Directional Light in Lumen Scene Appears to End ~21km From Origin

The directional lighting’s influence in the Lumen scene appears to end at approximately 21km from the origin. I can’t find any exposed settings that would affect this so it seems like a bug, as directional lights are supposed to be unbounded and indeed the direct surface lighting from the light is not affected by distance from the origin.

You can reproduce this by:

  1. Creating a new project with Lumen enabled
  2. Create a new level with a basic lighting setup (directional light, skylight, etc…)
  3. Create a cube or other mesh and move it to X: 2097680.0, Y: 0, Z: 0
  4. Note that the Lumen scene view shows that only half of the object is being lit.

Steps to Reproduce

Hey Brett

Can you try r.LumenScene.GlobalSDF.ClipmapExtent, r.LumenScene.ViewDistance, and/or PPV -> Lumen Global Illumination -> Max Trace Distance?

Ahh I see. I asked the dev to look at the code and you are correct. The Surface Cache stores lighting on cards placed on mesh surfaces, and those cards are addressed and lit in absolute world space which is hard coded to 2²¹cm which explains your 21km cutoff. This is measured from origin not from camera.

You have a couple of options, beyond changing the Lighting Mode like you found, that were recommended.

You can try World Partition. Surface cache quality is camera-relative, but its addressing precision is origin-relative. Use World Partition with origin rebasing so the active region stays close to 0,0,0. If your playable space is offset 21km out, rebase it back toward origin.

Or you can dive into LumenSceneRendering.cpp and attempt to edit the constant. But that is largely untested so ymmv.

Hi, I’ve tried all three of these and they have no effect on the problem.

I poked around some more and changing the ray lighting mode from “Surface Cache” to any of the hit lighting options causes the problem to disappear, so it looks like the issue lies somewhere in the surface cache?

It doesn’t look like the repro project attached when I created the issue, so I’m attaching it again for you to have.

LumenLimit.zip(11.3 KB)

Ok, thanks. World partition with rebasing is the most likely solution we’ll choose, though I’ll go take a look at the code as well.