UnityGLTF icon indicating copy to clipboard operation
UnityGLTF copied to clipboard

Exporter doesn't support base color textures

Open peoplepilot opened this issue 5 years ago • 2 comments

Am I missing something? Seems like a lot of more advanced functionality is supported...

peoplepilot avatar Sep 09 '20 05:09 peoplepilot

It seems that for the exporter to work with colors and textures you need to have a shader that is supported by the library on the object you want to export.

Some of these compatible shader are included in the project. It seems you may also use the Standard Unity Shader.

That's a pretty undocumented behavior, the exporter should allow working with any shader, or at least warn the user, even though it might skip some properties upon export...

ponahoum avatar Feb 16 '21 17:02 ponahoum

Yes, thanks.

In the end I hacked the GLTFSceneExporter.cs ExportMaterial function and added the below code after the IsPBRMetallicRoughness test:

else if (materialObj.HasProperty("_MainTex")) { material.PbrMetallicRoughness = ExportPBRMetallicRoughness(materialObj); }

which is working well enough for my purposes...

peoplepilot avatar Feb 16 '21 22:02 peoplepilot

Please update to the latest version and open a new issue if the problem persists. Thanks!

robertdorn83 avatar Feb 09 '24 09:02 robertdorn83