The brilliance of the light hits the ground

Hello

As seen in the photos the light hits my floor too much. How can I prevent this? I can’t share a playground with you because I don’t get the same error in Playgrounds, I’m sorry.

Can you help?

image

You can use

light.excludedMeshes = [yourMesh]

It will stop the light from affecting the mesh altogether.
Alternatively, you can reduce the intensity of light, and change its position

Try to add this on your material which displays the plan.

mat.ambientColor = BABYLON.Color3.Black();
mat.emissiveColor = BABYLON.Color3.Black();
mat.specularColor = BABYLON.Color3.Black();

This should solve your problem without modifying your light

3 Likes

Actually, it should do the same as in the PG (unless there is something wrong or unless you changed the position of the light, ground or camera angle).
There are a number of other parameters you can work on a light to avoid this direct light issue (that eventually depends on the angle of the light and camera).
You can angle your light so that it will not hit with such a direct angle.
You can also set a ‘range’ to your light to limit the distance of casting the light (i.e. you can lower the intensity a lot and set a longer range or the other way round).
In essence you should displace your light and direction a little from the axis.
Else, adding a 2 or 3-points light (with lesser intensity for each, since light only adds to light :wink: can also help getting a better lighting.

Edit: And then of course, just saw @Dad72 comment above, you can also modify how the light will impact your material. Lots to say about lights :wink: but one thing that worries me is when you say “i do not get the same in the PG”. Could you double check that and confirm you are doing just exactly the same? Thx,

I would recommend to use an unlit material in your case, for instance create a pbr material, set unlit to true and place your texture in the albedoTexture channel.

        mesh.material.ambientColor = BABYLON.Color3.Black();
        mesh.material.emissiveColor = BABYLON.Color3.Black();
        mesh.material.specularColor = BABYLON.Color3.Black();

Thanks, it really worked when I used it that way.

1 Like