How disable black backlight face

Hello, I am wondering if I can disable the backlight face color. For example, I created a simple cube below:

const scene = new BABYLON.Scene(engine);

const camera = new BABYLON.ArcRotateCamera("camera1", 1, 1, 4, new BABYLON.Vector3(0, 0, 0), scene);
camera.setTarget(BABYLON.Vector3.Zero());
camera.attachControl(canvas, true);

const light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);

const box = BABYLON.MeshBuilder.CreateBox("box", {}, scene);

You can see from the cube that it has six faces. One of them is white, the other is black, and the rest of them are all gray. And what I want is to set all the faces the same (white color).

If not, in my project, it will produce a weird effect:

So if it’s possible in Babylon to make them the same color? Thanks!

You can set groundColor of hemisphericLight to White:

light.groundColor = new BABYLON.Color3.White();

PG:

3 Likes

Thanks. BTW, do other light types like PointLight have the similar property that I can set? I tried switch it to the PointLight, but it misses the groundColor property.

No, but you can create StandardMaterial with white emissiveColor and apply on your mesh.

PG:

Edit: It would also be possible to use MaterialPlugin, to set shadow color.

Docs:

Example of Evgeni_Popov:

1 Like