Shadow Problems

Hey all,

I’m trying to implement shadows in 3089.

I started using DirectionalLightShadowRenderer, which worked great until I tried using other post-processors (like FXAA). Then, shadows would render over everything, even shadows that should be hidden behind other objects.

I switched to DirectionalLightShadowFilter, and it fixed that problem. However, DirectionalLightShadowFilter seems to ignore “receive” settings – everything receives shadows, even if I set the shadow mode to “Off” or just “Cast”.

Are these limitations based on how the shadows are calculated and rendered? Any suggestions on how to fix this? :expressionless:

Thank you!

@phr00t said: Hey all,

I’m trying to implement shadows in 3089.

I started using DirectionalLightShadowRenderer, which worked great until I tried using other post-processors (like FXAA). Then, shadows would render over everything, even shadows that should be hidden behind other objects.

I switched to DirectionalLightShadowFilter, and it fixed that problem. However, DirectionalLightShadowFilter seems to ignore “receive” settings – everything receives shadows, even if I set the shadow mode to “Off” or just “Cast”.

Are these limitations based on how the shadows are calculated and rendered? Any suggestions on how to fix this? :expressionless:

Thank you!


Yes the filter renders shadows to everything that write depth and ignores the shadow hint . That’s the draw back of the technique, but it’s a lot faster than the renderer.

The problem you’re talking about with the renderer sounds like you placed the shadowRenderer after the FilterPostProcessor in the processor stack.
Invert that order and it should work.

Thank you nehon. Yes, inverting the order at which I put the processors on the stack fixed the issue. I detach the shadow renderer at night, so it is a bit cumbersome making sure it is added back in order…

I need to use the ShadowRenderer since I need to use the shadow hints…

Oh, here is how things are looking :slight_smile:


that’s nice!