2

I try to develop a board game with BABYLON.js I have a board and an ArcRotateCamera.
My light is an HemisphericLight

When I draw Lines on my board I would like that these line have all the same aspect. Now when I move the camera, the light have an effect on these lines and some of them disappear by changing color too close to the background color.

How i can define that my line doesn't are affected by the light ?

Spols
  • 21
  • 3

2 Answers2

4

If there is no material attached to them, create a new StandardMaterial and assign it (mesh.material = new BABYLON.StandardMaterial('mat', scene);).

Once those meshes have a material, you can simply set material.disableLighting to true.

Raanan W
  • 1,295
  • 7
  • 19
2

Apart from the method mentioned of excluding it from the lights (for which you can also use light.excludedMeshes.push(mesh);) you can try removing the glare which makes a material look metallic and too shiny. Depending on what you want, one or the other will work better.

This is how you remove the glare:

light.specular = new BABYLON.Color3(0,0,0);
DPM
  • 1,960
  • 3
  • 26
  • 49