Bug: Dynamic shadow fade distance varies by resolution

So, Dynamic Shadows from Movable Shadow-Casting Point Or Spot Lights.

Sometimes you’re making a game with a lot of shadow casting dynamic lights. The shadow casting part of this is expensive, so you want to fade the shadows out at high distances.

Luckily, that is supported:

Unreal is already fading out the shadows, just at a really high distance. So you lower that distance, and your shadows fade out at 20 meters or whatever. Huge perf boon!

But hold up! You specified that distance in pixels! As in, “this light will start to fade out once it only takes up 512 pixels on the screen, and finish fading out when it takes up 128”. That’s no good! You’re going to get wildly inconsistent results depending on screen resolution! The higher your screen resolution, the greater the distance at which you’ll still be rendering dynamic shadows! The lower, the nearer! At 4K, you might be rendering shadows from every dynamic light in the level! At 640x480, you might be rendering none at all!

That’s what’s happening right now.

Here’s a test scene, using:
r.Shadow.FadeResolution 512
r.Shadow.MinResolution 256
r.Shadow.TexelsPerPixel 0.5
r.Shadow.RadiusThreshold 0.03

Rendered at:

1407x957: http://i.imgur.com/ktiV3eK.png
2x that: http://i.imgur.com/IBHmHMF.png
3x that: http://i.imgur.com/iK0Wv6L.png
4x that: http://i.imgur.com/sb8xIA3.png

Notice how the higher I crank my screen resolution, the greater the distance at which I’m drawing shadows. This probably isn’t good or useful for anybody. It makes it pretty difficult to tweak lighting performance, unless I figure out my own values from the viewport res and set them via console command every tick.

Probably change it so that FadeResolution and MinResolution are values between 0 and 1 mapped to the current viewport res?

Here’s a twitter thread including a video.