NewBye question

I have a question about exporting a glb from Sandbox.

I am able to open a OBJ in sandbox.
I can add a texture (loaded from my local drive) to the “default material” assigned to it, but unfortuanetely, when exporting my scene as “Glb” the glb file is generated but with no texture.

How can I embed this file to the GLB?
Many Thanks

Hi and welcome to the Babylon community!

I think you’ll need to add the texture through code @sebavan is that right?

It should export it at least for the basics like diffuse emissive and such :frowning: @bghgary could confirm but it looks like a bug to me ?

Hi,

In fact the easier way I’ve found to make it, is to export first the scene in sandbox format, next import it (textures are embedded) and next export as GLB…

Many thanks

Cordialement

Jean-Michel LE GOFF | Responsable Recherches Numériques | Louis Vuitton Malletier |+33664405492

Hi @jmlg10 good to see you on the forums!

Do you have a sample obj you can share that has this problem? That will help us repro it faster.

@bghgary I used the default playground, applied a texture to the default material and exported if that helps ?

Wait, so the obj has nothing to do with it?

Ok, yeah, sorry I misunderstood. I will take a look as soon as I can.

1 Like

Finally got a chance to look at this.

Here is the fix: Export glTF with default material when unspecified by bghgary · Pull Request #12230 · BabylonJS/Babylon.js · GitHub

Generally speaking, you should avoid using the default material when exporting to glTF unless you are also replacing it with a PBR material. By default, the scene’s default material is a standard material which will be quite lossy when converted to glTF which requires PBR materials.

1 Like

Many Thanks,

I’m understanding the point about PBR material, but in order to get a rapid preview, this fix is very convenient.

Thanks again.

Another very cool feature could be to upload a zip archive containing the Obj, mtl and texture file… instead of thh obj and next assign the texture to the default material…

but this is probably another story…

You can create a Feature Request for that! :smiley: