Closed Soreepeong closed 5 months ago
I think you're right about the MeshSubset.MatId
. :( I'm looking at some new Ivo files from Star citizen, and it's not the index but rather a hex 0x3F519404
. Argh! I need to check the material file and see if that value is stored anywhere.
Oh weird. The classic cryengine files have the matId
property which seems to line up to the index.
With the Ivo SC files, there is a property I have named materialId
that seems to be the index. Or at least an index. It seems to be the order of the submeshes, but whether that matches with the order in the mtl file... I'm not sure.
edit: hahaha, I must have run into this before. The submesh chunk for Ivo reads the first property into MatId
. It's just my 010 template that has them backwards. MatId seems to be the index of the material in the mtl file.
MaterialTextures
.GenMask
needs to be referred to, in order to fit game textures into the textures that glTF expects. I thought this might be useful for collada texture exports too.BaseGltfRenderer._materialMap
will keep track of materials added to glTF.I still have no confidence on whether
MeshSubset.MatId
is an index insideSubMaterials
node inside a material XML file; the code is written under that assumption, and it seems to work.