Exported GLB/GLTF renders with blown out lighting?

If I export this scene (https://www.babylonjs-playground.com/#2CU0P1#44) as GLB or GLTF, and then load it up in the GLTF viewer, or the babylon sandbox, everything is bright white. If I toggled the wrench beside the Albedo texture it does seem to show up properly. If i crank emissive down on the texture in the debugger, it pretty much resembles the original scene.

Any idea what’s going on here? I thought it was maybe similar to Material replaced with "debugMaterial" after GLB-Export via Sandbox - #4 by cloud but doesn’t quite seem to be the case.

@bghgary might have an idea :slight_smile:

I think you already found the problem. :slight_smile:

The emissive values are overriding the texture when exported. This is normal for PBR materials, but apparently it doesn’t do the same for standard materials which is used in this PG. I’m also not sure how setting diffuseTexture instead of emissiveTexture works with emissiveColor.

The exporter converts the emissive color directly from standard material to PBR material which is wrong in this case. Feel free to file a GitHub issue on this.

Other thoughts: It’s not typically a good idea to use standard materials when exporting to glTF as glTF only supports PBR materials. The code seems to be trying to set roughness and metallic which don’t exist on the standard material. The exporter tries to convert standard materials to PBR materials, but there are probably many cases that it will not handle well. Is it supposed to be a PBR material?

Ah yes, thank you, this is exactly what was happening. I was trying to simplify the PBR material to a standard material to get that working before switching back to PBR.

1 Like