CryBlend icon indicating copy to clipboard operation
CryBlend copied to clipboard

Material files generated are somewhat buggy

Open marc40000 opened this issue 9 years ago • 2 comments

Hi !

When I Export something with cryblend it creates an .mlt file and .cgf file and a .dds file just fine. I can open that in sandbox and it Looks correct.

However, if I don't open it in sandbox but instead after exporting trying to just call LoadGeometry() on a newly created entity, I see nothing.

If I load the exact same geom in the Sandbox, I can see it. Also, if I modify the material a tiny bit so the sandbox has to rewrite it, I can afterwards load the geom with the material successfully from c++ as well. It's enough to Switch the diffuse texture to another one and back to the original to do this.

Camparing the .mtl files from before the sandbox save and afterwards, there are additional Parameters in the .mtl that got added by sandbox. I also tried adding those myself without opening Sandbox after exporting with cryblend and that also makes the geoms work when loaded from c++. So it's just the generated .mtl files from cryblend that are missing some Parameters.

I'ld see cryblend adding those Parameters directly so I can just Export from blender use the created files directly in my game without having to do another step in between that adds those parameters.

marc40000 avatar Jul 02 '16 10:07 marc40000

Could you specify which parameters are added to the mtl files by Sandbox respectively what you added manually?

roidanton avatar Jul 02 '16 11:07 roidanton

I don't know which Parameter is responsible for it to make it work. But here is the file before sandbox modified it:

<Material MtlFlags="256">
 <SubMaterials>
  <Material Name="ceiling" MtlFlags="128" SurfaceType="" Diffuse="0.3,0.3,0.3" Specular="0,0,0" Emissive="0,0,0" Shininess="0" Opacity="1">
   <Textures>
    <Texture Map="Diffuse" File="Assets\blend\ceiling\ceiling.dds"/>
   </Textures>
  </Material>
 </SubMaterials>
</Material>

and this si the file after Sandbox modified it:

<Material MtlFlags="524544" vertModifType="0">
 <SubMaterials>
  <Material Name="ceiling" MtlFlags="524416" Shader="Illum" GenMask="20000000" StringGenMask="%SUBSURFACE_SCATTERING" SurfaceType="" MatTemplate="" Diffuse="0.30000001,0.30000001,0.30000001" Specular="0,0,0" Opacity="1" vertModifType="0" LayerAct="1">
   <Textures>
    <Texture Map="Diffuse" File="./ceiling.dds"/>
   </Textures>
   <PublicParams EmittanceMapGamma="1" SSSIndex="0"/>
  </Material>
 </SubMaterials>
 <PublicParams EmittanceMapGamma="1" SSSIndex="0"/>
</Material>

marc40000 avatar Jul 02 '16 16:07 marc40000