We've found the definition of hack and guesswork, all in one place :D
Still though, I do have to say good job jahrain; regardless of elegance, you did make it work and that puts you in the 90th percentile.
Nick
Printable View
No, I just find it amusing that he only recently realized that it would require no post-processing? I thought that was your entire plan in going from gbxmodel --> render_model, because you couldn't calculate binormals, tangents, centroids, etc. All of a sudden you're saying something about JMS and that leading to your scrambled bipeds...? I smell a cover-up.
Yes it was my plan but as I mensioned, but it was all under heavy assumption that I could do it without having to process the vertex and triangle data. I have only recently confirmed that my assumption was correct. Those first couple pics I posted was from just directly from a modified h1 .jms file that had nothing but vertecies and the indices in it due to me not completely mapping out the .gbxmodel structure yet. I realized the reasons it was scrambled is because it did require those degens as I mentioned earlier which where created by post processing with tool.
Theres no cover up, I'm trying to be honest and open about this, I don't know why you would think otherwise. I'm trying to explain what all I did and how I did it so that I could get better feedback, and perhaps someone might do a better job at it than I can instead of what, say what some others would do which would be just show off pics and keep all the information of how to do it to himself for the purpose of fame and glory.
If you hadn't mapped out the gbxmodel tag yet you could have asked me. Obviously I know the format very well as I've had to parse every byte of it and know what it corresponded to.
Well, I wasn't sure you or anyone else would be willing to help me. Besides, I like the fun of mapping out a model file structure. But maybe you could help by correcting any mistakes I might have made in this.Code:Key:
int16S: 16 bit integer byte swapped
float32S: 32 bit floating point byte swapped
longS: 32 bit long integer byte swapped
byte: 8 bit byte
string32: 32 byte length string
0x : relative offset in bytes
gbxModel struct
main size = 296
0x236 = markerCount longS
0x248 = nodeCount longS
0x260 = regionCount longS
0x272 = geometryCount longS
0x284 = shaderCount longS
markersBlock
size = 64
0x0 = nameString string32
0x32 = magicIdentifier int16S
0x52 = markerInstanceCount longS
markerInstanceBlock
size = 32
0x0 = regionIndex byte
0x1 = permutationIndex byte
0x2 = nodeIndex byte
0x4 = positionX float32S
0x8 = positionY float32S
0x12 = positionZ float32S
0x16 = rotationI float32S
0x20 = rotationJ float32S
0x24 = rotationK float32S
0x28 = ratationW float32S
nodeBlock
size = 156
0x0 nameString string32
0x32 = nextSiblingNodeIndex int16S
0x34 = firstChildNodeIndex int16S
0x36 = parentNodeIndex int16S
0x40 = positionX float32S
0x44 = positionY float32S
0x48 = positionZ float32S
0x52 = rotationI float32S
0x56 = rotationJ float32S
0x60 = rotationK float32S
0x64 = rotationW float32S
0x68 = nodeDistance float32S
regionBlock
size = 76
0x0 = nameString string32
0x64 = permutationCount longS
permutationsBlock
size = 88
0x0 = nameString string32
0x64 = superLowGeometryIndex int16S
0x66 = lowGeometryIndex int16S
0x68 = mediumGeometryIndex int16S
0x70 = highGeometryIndex int16S
0x72 = superHighGeometryIndex int16S
0x76 = markersCount longS
markersBlock
size = 80
0x0 = markerName string32
0x32 = nodeIndex int16S
0x36 = rotationI float32S
0x40 = rotationJ float32S
0x44 = rotationK float32S
0x48 = rotationW float32S
0x52 = positionX float32S
0x56 = positionY float32S
0x60 = positionZ float32S
geometriesBlock
size = 48
0x36 = partsCount longS
partsBlock
size = 132
0x4 = shaderIndex int16S
0x20 = centroidX float32S
0x24 = centroidY float32S
0x28 = centroidZ float32S
0x32 = vertexCount longS
0x44 = compressedVertexCount longS
0x56 = triangleCount longS
uncompressedVerteciesBlock
size = 68
0x0 = positionX float32S
0x4 = positionY float32S
0x8 = positionZ float32S
0x12 = normalI float32S
0x16 = normalJ float32S
0x20 = normalK float32S
0x24 = biNormalI float32S
0x28 = biNormalJ float32S
0x32 = biNormalk float32S
0x36 = tangentI float32S
0x40 = tangentJ float32S
0x44 = tangentK float32S
0x48 = texCoordX float32S
0x52 = texCoordY float32S
0x56 = node0Index int16S
0x58 = node1Index int16S
0x60 = node0weight float32S
0x64 = node1weight float32S
compressedVertexBlock
size = 32
triangleBlock
size = 6
0x0 = indexA int16S
0x2 = indexB int16S
0x4 = indexC int16S
shaderBlock
size = 32
0x10 = shaderTagRegSize
shaderTagRefsBlock
Post the render_model one as well for fun.
ZOMG UPDATE!!!11one
First of all, The project has been renamed to GBXModel Upgrader. Because that is precisely what it does. It will upgrade your .gbxmodel tags to h2's .render_model tags. Heres a screen shot of the current working GUI.
http://i193.photobucket.com/albums/z...0/UIsample.jpg
It was quickly thrown together, and I may polish it off a bit before release. Still a few more geometry options I need to add in, such as the option to support compressed model, setting specific tag flags and such.
I fixed most of the geometry problems, except the flipping faces problem still has me befuddled. Right now my work around is to just set each shader to be double sided and the problem goes away. Until then, I have added the option to flip each face for each individual geometry part. Also shaders, markers and node blocks are now fully supported and transfer just about flawlessly. UVWs are all correct, vertex weighting is correct, (for bipeds), and so on.
Right now, the current build has the ability for you to create custom scenery, skyboxes crates, weapons, bipeds, vehicles etc that all use the same collision, animations and physics models of existing tags. I haven't fully tested all of these yet, since I'm limited with guerrilla atm but I'm quite certain that the upgraded models should work pretty flawlessly ingame.
compared with the original tag:
http://i193.photobucket.com/albums/z...omparison2.jpg
And heres a model that went ingame smoothly with shaders and texture applied.
http://i193.photobucket.com/albums/z...5-21-03-58.jpg
http://i193.photobucket.com/albums/z...5-22-25-06.jpg
http://i193.photobucket.com/albums/z...5-21-21-25.jpg
Yes thats my sexy custom biped I modeled about a year ago. Its been a fine test subject. Right now, its just a piece of scenery however.
Still just a few things to polish up and a few bugs to fix before I make my first release.
Oh shi. The best model I've seen in halo 2. :woot: