When objects are placed behind/beneath a masked landscape and r.Lumen.HardwareRayTracing.SurfaceCacheAlphaMasking is enabled, the direct light evaluation is incorrect.
Setting Context.bAcceptFirstHitAndEndSearch to false in LumenSceneDirectLightingHardwareRayTracing.usf:318 fixes the issue.
From what I’ve found this happens because sometimes the raytracing ends up evaluating the landscapes anyhit shader first, then aborting the trace. This leads to a retrace from the hit location on the landscape, which in turn causes the incorrect lighting. Note that this probably only needs to be disabled when r.Lumen.HardwareRayTracing.SurfaceCacheAlphaMasking is enabled.
thanks for reporting this issue and sharing a fix. Unfortunately I was unable to open the repro project as it shows a message that Level.umap appears to be an asset file.
Would it be possible to repackage the repro project again (or provide more detailed repro steps)? Can you also tell me what engine version you are using?
thanks for the new repro scene, I could replicate the issue and tried both your fixes. I confirmed that setting r.RayTracing.Geometry.Landscape.VertexMask to 1 fixes the issue in 5.6 (the CVar was introduced with this commit), but setting Context.bAcceptFirstHitAndEndSearch to false in LumenSceneDirectLightingHardwareRayTracing.usf and recompiling the shader did not make a difference for me in 5.5 or 5.6 (I remade the scene in 5.5). Can you please confirm that this fix works for both engine versions?
It works on both engine versions for me. Did you set the one on line 318 to false? There are two in the file, one is on line 206, which is for the stochastic path, and the other one is on line 318, for the non stochastic path.