The model is changed to black if I hide scene environment

hideEvnironment | Babylon.js Playground

there is a 3d glb model, it can show normal if there is skyBox.

In one case, I want to hide the skyBox and show the html element below the canvas, show I use the code:

    button1.onPointerUpObservable.add(function() {
        currentSkybox.dispose();
        // hide scene environment, to show the html element below canvas
        scene.environmentIntensity  = 0;
        scene.clearColor = new BABYLON.Color4(0, 0, 0, 0);
    });

but now the model is change to black.

p.s. I try the village.glb, it’s ok.

Hello,

I had a look at your .glb file.
First of all : it’s very heavy, even Blender struggles to handle it ! (> 1M vertices on such little meshes is too much) You should definitely lighten it before importing in BJS


About your issue : it seems to come from the materials. They have a transmission set to 1.0, and IOR to 1.0, which is basically only about transparency (no diffuse). So the light have no effect on it, and also, that’s why the only way to see it is as an overlay above non black background (such as skybox)

Try to fix the materials before GLB export :slight_smile:

2 Likes

All objects from your asset file are refractive, only the skybox is not. Because we must render all non refractive objects to a specific texture to support refraction, when you remove the skybox, nothing is generated in this texture and you get a black texture as the refraction texture.

There’s nothing we can do about it, however I wonder why all your objects are refractive?

3 Likes

I see, thanks for your comments. I will feekback to the designer to modify the model. :slightly_smiling_face: