Creating a GLB file with a black background

Hi there,
i´m working on a project where i need to create more then 150 single GLB files…
I´m working with 3D max 2021
Using the babylon exporter the glb file that come out looks fine…
But…I need it on a black background…the exported glb file has always awhite background…
no matter what settings for background colour…Environment etc etc are.

Even when i load it into any GLB editor to change that it always stays white

I need the GLB files for usage in a "shopify " shop page…

Anyone has an idea how to solve that problem



scene.clearColor = new BABYLON.Color3.Black()

You tried this?

You have skybox? Transparent canvas? It’s hard to say without seeing it in action. If you could setup the playground, or share the GLB file it would be helpful.

You might have an extra geometry in your model could you share it ?

Hi nagalo,

since i´m not into programming it a bit hard to understand…
I did try that setting several ways…in teh tree.js editor and also doing that setting in zhe babylon.js viewer.

I´m not sure though wether these “programms” save these setting when exporting ( saving) the glb file again…so if not…in what “progarmm” can i do this setting and it will be saved when saving as a glb file again…

The thing with the skybox…i tried it with or without…no visible difference…

There is no way to export it from 3dmax with a black background…there are setting for the skybox in the exporter…but somehow nothing happens

where can i upload the glb file for yu to have a look at it?



any shared location would work :slight_smile: @PatrickRyan might also provide insight on it.

Here´s the link to the GLB File


The model does not have a background, I am totally not sure of your issue

Could you share how you use it ???

ok…in what way do i need a background when exporting out of max?

a mesh background…or just an environment setting?

when i put in a 3d background and a camera the default camera positions outside of all of the 3D data…
which is not what i want

I am not sure to understand what you are trying to achieve anymore. At first I thought you wanted to get rid of the white background, but the model you shared does not have one so it should be all good ?

no…i want the background to be black…when i load it in “shopify” its all white…

i ´m trying to achieve this for days now…

my customer wants 150 GLB files of his products on a black background…

these GLB files are to be shown in shopify…

next to that i´m building him a 3D viewer to be started as an external link from within shopify

the glb files should look about the same as in the GLTF based viewer…
I use Verge3d to create all the interactivity

so the issue is…how to get a glb file with a black background

the 3d viewer takes a bit to load…its work in progress…and lots of textures etc to be loaded…
at teh moment it works best with chrome…and a graphic card with lets say at least 8GB

Why not using babylon for the viewer ? and you could set the background via code.

Otherwise you would need to create a cube far enough but not to far where the face are facing inward with a black unlit material, and a camera in the box. Also you need to make sure the viewer supports unlit and camera extension.

i did try it in the babylon viewer…but somehow i seem to be doing something wrong…

when i export it as a glb again…it still has no black background…

if you could tell me where to do what setting in the viewer…that would be great

Babylon.js Playground is this what you had in mind?

1 Like

ok…i did try that as well…but since i´m not into programming at all…i did have real problems working with
that progarmm…i didn´t even get my glb file loaded …

I am having hard time understanding how are you showing your model in shopify?

It seems that it’s not connected to the GLB file itself, as GLB file loads fine in babylon environment. Any screenshots, links?

The link you sent, there is black background there. Have you created that, or is that something else?

i tried it with the babylon viewer…there are settings for the background as well but i´m not sure wether
these settings are saved when exporting the glb file again…it looked the same as before

So the viewer is not going to save the bg color when you export as a glb file again. You can save the playground scene to snippet server for example that will save that. :slight_smile: