Shadow Light Max Distance Bug

I cant say what exact version this crept in, but if you specify a shadowLight.shadowMaxZ value, the shadow does NOT render at all. Any value. But if it is left undefined it renders fine but you can no longer set the desired max shadow distance for your real time shadows.

Its hard to reproduce on the playground. Because of the architecture of the playground its hard to create a shader generator within the default createScene. You get an error talking about the scene has to be created first. Probably would be better to pass the scene object in the ShadowGenerator constructor just like any other babylon entity that required the scene.

But none the less. Any value on shadowLight.shadowMaxZ causes shadow to not render

You know the deal…I need a PG to track and fix the issue

No sure to understand that.

Nonetheless, I did a random search for shadowMaxZ and it seems to work there:

Hmmm… Seems odd… I used to load values like 150 in this property as shadow max shadow distance… But when i use values like 150… I see no shadows… but if i use much higher values like your example: 5000 it works fine.

I thought shadowMinZ and shadowMaxZ were for limit your shadows… Even better for performance.

So in Unity i normal do a min = 0.2 and max = 150 for my shadows… I a thought that worked before. That is what i been using for a while now.

So what is the Unity Value for shadowMaxZ… How would i limit to 150 units

Shit @Deltakosh … My bad… Im a dumb ass sometime… The playground error… I was trying a shadow on Hemispheric Light instead of Directional Light…

But i still need to know how i would limit shadows… They Way unity does it is my QualitySettings… Low quality uses like 40 meters and high quality uses like 150 meters for max shadow distance.

They are used to help improving the projection precision. The closer the better

To limit shadows, we just use the renderList. Feel free to add / remove objects based on your own logic