Shadow rendering glitch when changing light angle

Ah, that helps! As does your diagnosis that FilterManager is causing the problem! :slight_smile:

Okay, first of all, a solution:

Set the priority of the shadow-casting light to a negative value.

But of course, and as indeed shown by the program you posted, you’ve tried that, and it doesn’t work. I confirm as much.

So set it to an even more negative value! XD;

(Specifically, I tried with the somewhat-ridiculous value of “-1000000”.)

On my end, this causes the problem to go away!

To speculate, what I think is happening is that FilterManager, naturally, wants to render the scene before the final rendering is done, in order that said final rendering be done with a current view of the scene.

To this end, I imagine that it’s somewhere setting the priority of the scene-rendering to a negative value.

As a result, if the priority of the shadow-casting light isn’t set to a sufficiently negative value, it still ends up having a higher priority than the scene, and so its shadow-buffer is still rendered after the scene, and thus we still get a one-frame delay in shadow-rendering!

3 Likes