Exporting 3D file(.glb) containing stencil buffers and HDR file

Hey folks,

I need to export sharable 3D file, may be .glb file using babylon.js which contains all required things to make the rendering same as browser like complete scene, camera, lights, stencil buffers, HDR, PBR Materials etc.

I am trying to export from inspector tool, but exported .glb file doesn’t show masked area(stencil buffers), HDR in glTF Viewer.
Is this possible or limitation of babylon.js? I am missing out anything here conceptually?

Also, if it is possible, I want to export it via code, not inspector panel, is it doable?

Thanks a lot in advance!

Hello @Itsdefault , how are you doing?

Yes, Babylon.js has an API you can call to programmatically export your scene into a glb. Here is the documentation for it:

glTF Exporter | Babylon.js Documentation

Regarding your particular scene, can you provide a playground that shows a scene with similar features? My guess is that if a feature is supported in GLTF you will probably be able to export it using the Babylon.js exporter. I’m not sure how glTF handles stencil buffers though.

glTF does not support stencil buffer.