A naive workaround would be adding up the missing permutation COMPACT_CULLED_SHADOW_OBJECTS to the shader struct FLumenSceneDirectLightingTraceDistanceFieldShadowsCS, but this makes the Lumen scene lighting start flickering. So I suspect that Lumen scene offscreen shadow tracing may not handle the case where compacting culled object is off at all?
Steps to Reproduce
[Image Removed]
Steps to reproduce:
- Make sure Lumen is on and there is at least a directional light in the scene. Turn off the Lumen hardware raytracing.
- Turns Lumen detail tracing on (whether by ProjectSettings or by CVar r.Lumen.TraceMeshSDFs). And make sure r.Lumen.TraceMeshSDFs.Allow is also true by scalability settings.
- Set r.DFShadowCompactCulledObject to 0.
Then the crash happens. The order of step 2 and 3 can be swapped.
Hi,
Adding the missing permutation to the Lumen shader merely allows the shader code to be compiled correctly. This does not guarantee that you will get the intended output, as you still need to ensure that you bind the correct data to your ShadowTileStartOffset SRV. Doing this will require additional code changes, which I would suggest against, since you will likely run into further problems. Why do you want to turn off distance field shadow compaction? This should be an optimization that will boost your performance rather than hurt it.
We compared the performance between the compaction on/off and it turned out no difference, so we considered to turn it off to save the cost of a pass dispatch. Now I guess we have to leave it on. Thanks for the help.
If it does not impact your performance, leave on the compaction pass. I will close the ticket for now, but if you need more help, please feel free to reach out again.