Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material files generated are somewhat buggy #220

Open
marc40000 opened this issue Jul 2, 2016 · 2 comments
Open

Material files generated are somewhat buggy #220

marc40000 opened this issue Jul 2, 2016 · 2 comments
Labels
Milestone

Comments

@marc40000
Copy link

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.

@roidanton
Copy link
Contributor

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

@marc40000
Copy link
Author

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>

@dwhite5914 dwhite5914 added the Bug label Aug 16, 2016
@dwhite5914 dwhite5914 added this to the 5.30 milestone Aug 16, 2016
@dwhite5914 dwhite5914 changed the title Material Files generated are somewhat buggy Material files generated are somewhat buggy Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants