I believe there is an issue with PBR materials during GLB export/import

Please see the following playground.
I think there is an issue with the exporter/importer for glb and pbr materials.

https://www.babylonjs-playground.com/index.html#95MJI8#282

pinging @Drigax

Sorry, I don’t understand. Can you help explain what the issue is?

The exported material is different from the original. The two spheres should be identical?

They appear to be except that the reflection texture was not set. This isn’t really part of glTF, however, I’m not sure that this is an issue we can or want to address:

https://www.babylonjs-playground.com/index.html#95MJI8#284

Can you please frame your problem to be as detailed and specific as possible? Perhaps include some visual or text aids to define your expectations? I’m strugging to understand here. I’m a bit slow.

I can see we convert the applied reflectivity map into a blank diffuse + metal roughness, but is this not somewhat expected behavior?

Well I’m creating blocks (meshes) for my application and I’m saving them as glb files. I want some of them to have a reflection texture. My application has a catalog with many items, and the user will pick the ones they like and they will be downloaded and imported on the fly.

Example catalog:

I guess I need to save the reflection texture separate from the rest of the block and apply it after import?

Yes, you’ll have to apply the reflection texture after import, like how you did in your sample playground, unfortunately. We’re working on extensions to glTF that will allow for environment textures to be properly interpreted and applied on import, but implementation is still a ways off.

1 Like

Okay, thank you! Just one more clarification, in my playground I am applying the original texture, is there a way to get the reflection texture from the imported gltf resources, ie the BABYLON.AssetContainer?

Yes, you can use an imported texture as your reflection texture. You can search the scene textures by name after import if needed.

1 Like

That’s awesome! Thanks for your time and have a great day =]!