According to the licensee, this problem is caused by a variable inconsistency in Cvar.

The cause seems to be the difference between the CVar reference when generating RayTracingSceneRHI and the CVar reference when drawing shadows.
RayTracingSceneRHI generation is done with the DispatchRayTracingWorldUpdates function in DeferredShadingRenderer.cpp.
At this time, the AnyRayTracingPassEnabled function is used to check whether the Ray Tracing technique is effective.
Among them, CVar of "r.RayTracing.Shadows" is acquired, but this is FConsoleVariableRef of RenderThreadSafe. When you get a value from this class with GetInt, you get the MainValue.

However, what you check when drawing shadows is the ShouldRenderRayTracingShadows function in LightRendering.cpp.
Here we are checking the GRayTracingShadows variable, which will be RefValue. Since it is a RenderThreadSafe CVar, there may be situations where MainValue and RefValue are different values depending on the timing.

We haven't seen a crash, but it's likely to happen with a similar implementation, Ray Tracing Stochastic Rect Light.

The following Ray Tracing function is disabled in the attached project.

r.RayTracing.AmbientOcclusion = "0"
r.RayTracing.SkyLight = "0"
r.RayTracing.InstancedStaticMeshes = "0"
r.RayTracing.GlobalIllumination = "0"
r.RayTracing.EnableMaterials = "0"
r.RayTracing.Landscape = "0"
r.RayTracing.LightingMissShader = "0"
r.RayTracing.Niagara.Meshes = "0"
r.RayTracing.Reflections = "0"
r.RayTracing.SceneCaptures = "0"
r.RayTracing.SkyLight = "0"
r.RayTracing.StochasticRectLight = "0"
r.RayTracing.Translucency = "0"


Steps to Reproduce
  1. Open attached project
    This project is set to disable some ray tracing features.
    [Link Removed]
  1. Play the game and press the numbers 1 and 2 to enable and disable Raytracing shadows and cause a crash.
    [Link Removed]
    [Link Removed]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-99707 in the post.

Login to Vote

ComponentUE - Graphics Features - Lumen
Affects Versions4.25
Target Fix4.26
Fix Commit14326472
Release Commit14326472
CreatedSep 16, 2020
ResolvedSep 16, 2020
UpdatedSep 19, 2021