Problem with Shadow Generator and Point Light

I attach a Point Light to my player Mesh and it produce shadows to the walls.
Works fine when the player is at more than “1” of distance to the wall, but when it’s close to the wall the shadow is not casted properly.

I make this test scene to show the problem:
https://www.babylonjs-playground.com/#1GUOCF#42

Hope can help me, thanks :slight_smile:

I found at the inspector that setting the option of Point Light “Shadows near plane” to “0.1” solves the problem. But i can’t found how to set it on the code.

image

It’s the option of light “shadowMinZ”.
Just solved, lol.

Solved playground: https://www.babylonjs-playground.com/#1GUOCF#45

2 Likes