Ray Tracing variables default values/description questions.

Hi. I want to make for myself blueprint to manage ray tracing features and setting right by console variables and have full control of it.

[SPOILER]

[/SPOILER]

I created new empty UE4.23 preview 6 scene and checked all of variables default values in not modified scene. Here what I got.

[SPOILER]

r.RayTracing = 0

r.RayTracing.AmbientOcclusion = 1
r.RayTracing.AmbientOcclusion.EnableMaterials = 0
r.RayTracing.AmbientOcclusion.EnableTwoSidedGeometry = 0
r.RayTracing.AmbientOcclusion.SamplesPerPixel = -1

r.RayTracing.CacheShaderRecords = 1

r.RayTracing.DebugDisableTriangleCull = 0
r.RayTracing.DebugForceBuildMode = 0
r.RayTracing.DebugForceOpaque = 0

r.RayTracing.EnableMaterials = 1
r.RayTracing.ExcludeDecals = 0
r.RayTracing.ForceAllRayTracingEffects = -1

r.RayTracing.GlobalIllumination = -1
r.RayTracing.GlobalIllumination.Denoiser = 1
r.RayTracing.GlobalIllumination.DiffuseThreshold = 0.05
r.RayTracing.GlobalIllumination.EnableTwoSidedGeometry = 1
r.RayTracing.GlobalIllumination.EvalSkyLight = 0
r.RayTracing.GlobalIllumination.MaxBounces = -1
r.RayTracing.GlobalIllumination.MaxRayDistance = 999999988484154753734934528.0
r.RayTracing.GlobalIllumination.NextEventEstimationSamples = 2
r.RayTracing.GlobalIllumination.SamplesPerPixel = -1
r.RayTracing.GlobalIllumination.ScreenPercentage = 100.0
r.RayTracing.GlobalIllumination.UseRussianRoulette = 0

r.RayTracing.InstancedStaticMeshes = 1
r.RayTracing.InstancedStaticMeshes.CullClusterMaxRadiusMultiplier = 20
r.RayTracing.InstancedStaticMeshes.CullClusterRadius = 10000
r.RayTracing.InstancedStaticMeshes.Culling = 0
r.RayTracing.InstancedStaticMeshes.LowScaleCullRadius = 1000
r.RayTracing.InstancedStaticMeshes.LowScaleRadiusThreshold = 50
r.RayTracing.Landscape.DetectTextureStreaming = 1
r.RayTracing.Landscape.LODsUpdateEveryFrame = 0
r.RayTracing.NormalBias = 0.1

r.RayTracing.PSOCacheSize = 50

r.RayTracing.Reflections = -1
r.RayTracing.Reflections.DirectLighting = 1
r.RayTracing.Reflections.EmissiveAndIndirectLighting = 1
r.RayTracing.Reflections.HeightFog = 1
r.RayTracing.Reflections.MaxBounces = -1
r.RayTracing.Reflections.MaxRayDistance = -1.0
r.RayTracing.Reflections.MaxRoughness = -1.0
r.RayTracing.Reflections.MaxUnderCoatBounces = 0
r.RayTracing.Reflections.MinClearCoatLevel = 0.01
r.RayTracing.Reflections.MinRayDistance = -1.0
r.RayTracing.Reflections.ReflectionCaptures = 0
r.RayTracing.Reflections.SamplesPerPixel = -1
r.RayTracing.Reflections.ScreenPercentage = 100
r.RayTracing.Reflections.Shadows = -1
r.RayTracing.Reflections.SortMaterials = 0
r.RayTracing.Reflections.SortSize = 5
r.RayTracing.Reflections.SortTileSize = 64
r.RayTracing.Reflections.TestPathRoughness = 1

r.RayTracing.Shadows = 1
r.RayTracing.Shadow.MaxBatchSize = 8
r.RayTracing.Shadow.SamplesPerPixel = 1
r.RayTracing.Shadows.EnableMaterials = 1
r.RayTracing.Shadows.EnableTwoSidedGeometry = 1

r.RayTracing.SkyLight = -1
r.RayTracing.SkyLight.DecoupleSampleGeneration = 1
r.RayTracing.SkyLight.Denoiser = 1
r.RayTracing.SkyLight.EnableTwoSidedGeometry = 1
r.RayTracing.SkyLight.MaxRayDistance = 10000000.0
r.RayTracing.SkyLight.SamplesPerPixel = -1
r.RayTracing.SkyLight.Sampling.StopLevel = 0

r.RayTracing.StochasticRectLight = 0
r.RayTracing.StochasticRectLight.IsTextureImportanceSampling = 1
r.RayTracing.StochasticRectLight.SamplesPerPixel = -1

r.RayTracing.Translucency = 0
r.RayTracing.Translucency.DirectLighting = 1
r.RayTracing.Translucency.EmissiveAndIndirectLighting = 1
r.RayTracing.Translucency.HeightFog = 1
r.RayTracing.Translucency.MaxRayDistance = -1.0
r.RayTracing.Translucency.MaxRefractionRays = -1
r.RayTracing.Translucency.MaxRoughness = -1.0
r.RayTracing.Translucency.MinRayDistance = -1.0
r.RayTracing.Translucency.PrimaryRayBias = 0.00001
r.RayTracing.Translucency.Refraction = -1
r.RayTracing.Translucency.SamplesPerPixel = 1
r.RayTracing.Translucency.Shadows = -1

r.RayTracing.UseTextureLod = 0

ShowFlag.RayTracedDistanceFieldShadows = 2
ShowFlag.RayTracingDebug = 2

[/SPOILER]

Now I have number of questions - general, about default values, what exactly do some of variables. Since I can’t find answers just by google it I need some technical specialist answers. Or if this “Rendering” thread is not the right place for such questions maybe someone can redirect me to right place.

So lets go on with questions.

General questions.

[SPOILER]

  1. For variables like r.RayTracing.Translucency, r.RayTracing.SkyLight value is boolean 1 - 0? Some of variables have value 1 (enabled) some 0 (disabled) some -1. What mean this -1 if variable type is boolean so what mean “-”? Is it -1 because feature still not enabled somewhere in PostProcess?
  2. For Distance type variables -1.0 mean that value is unlimited ( “-” ) and variable type if float ( “.0” )
  3. For Max/MinBounces type variables = -1 mean that bounces number is unlimited or it because as I asked before for features which is not enabled bounces values =-1?

[/SPOILER]

Values and description questions.

[SPOILER]

  1. r.RayTracing.CacheShaderRecords = 1 What exactly do this cache record? Is it boolean 0 - 1 or some range of integer values variable ? What does different values?

02 r.RayTracing.ForceAllRayTracingEffects = -1 What exactly do this variable? Is it boolean 0 - 1 or some range of integer values variable ? What does different values?

  1. r.RayTracing.GlobalIllumination.DiffuseThreshold = 0.05 What exactly do this variable? Is it float between 0 - 1?

  2. r.RayTracing.GlobalIllumination.EvalSkyLight = 0 What exactly do this variable? Is it boolean 0 - 1 or some range of integer values variable ? What does different values?

  3. r.RayTracing.GlobalIllumination.MaxRayDistance = 999999988484154753734934528.0 Is such default value is OK?

  4. r.RayTracing.GlobalIllumination.NextEventEstimationSamples = 2 What exactly do this variable - cant see noticeable visual difference?

  5. r.RayTracing.InstancedStaticMeshes.CullClusterMaxRadiusMultiplier = 20, r.RayTracing.InstancedStaticMeshes.CullClusterRadius = 10000 , r.RayTracing.InstancedStaticMeshes.LowScaleCullRadius = 1000, r.RayTracing.InstancedStaticMeshes.LowScaleRadiusThreshold = 50 What exactly do this variables? Which values is better for performance?

  6. r.RayTracing.NormalBias = 0.1 What exactly do this variable? Is it float between 0 - 1? Is it affect performance?

  7. r.RayTracing.PSOCacheSize = 50 What exactly do this variable? Which values is better?

  8. r.RayTracing.Reflections.ReflectionCaptures = 0 What exactly do this variable? Reflection captures in ray traced scene.

  9. r.RayTracing.Reflections.SortMaterials = 0, r.RayTracing.Reflections.SortSize = 5, r.RayTracing.Reflections.SortTileSize = 64 What exactly do this variables? Which values is better?

  10. r.RayTracing.Reflections.TestPathRoughness = 1 What exactly do this variable? is it boolean 0 - 1?

  11. r.RayTracing.Shadow.MaxBatchSize = 8 What exactly do this variable? Which values is better?

  12. r.RayTracing.SkyLight.DecoupleSampleGeneration = 1 What exactly do this variable? is it boolean 0 - 1?

  13. r.RayTracing.SkyLight.Sampling.StopLevel = 0 What exactly do this variable? is it boolean 0 - 1 or some range of integer/float?

  14. r.RayTracing.StochasticRectLight.IsTextureImportanceSampling = 1 What exactly do this variable? is it boolean 0 - 1?

  15. r.RayTracing.Translucency.PrimaryRayBias = 0.00001 What exactly do this variable?

  16. r.RayTracing.UseTextureLod = 0 What exactly do this variable? is it boolean 0 - 1? Why by default its disabled?

  17. ShowFlag.RayTracingDebug = 2 Is it boolean 0 - 1 ( if yes why value =2) or some range of integer? How to use this debug? I tried to change values and nothing happened.

  18. r.RayTracing.DebugDisableTriangleCull = 0, r.RayTracing.DebugForceBuildMode = 0, r.RayTracing.DebugForceOpaque = 0 How to use this debugs and do I need to use it?

[/SPOILER]

Thanks for reading and any informative answers.

-1 means that it falls back to the value set in the Post Process Volume. By default, the PPV has control and to allow you to set whether translucency uses Raster or Ray Tracing. If you set it to 0 or 1, the value in the PPV is overridden and will not function.

It depends on the feature. Some have harder values set, like Sky Light. For others like reflections, it can be infinite while looking for the hit intersection. These values should be used as an optimization for those features when in use. For instance, reflections and translucency have a min and max distance value. This can be useful to tweak for what makes sense in your scenes or to find an average value that works well for your project that covers the majority of cases.

Not unlimited bounces. There are a hardcoded number of bounces set (pretty much a single bounce for everything that requires it (ie Reflections and Global Illumination). Like your first question, the -1 here just falls back to the value set for Number of Bounces in the PPV. if you set a value in the CVar, it overrides the PPV’s set bounces value.

==========================

for your other questions, I’m not going to go through each one but here are some ones I wanted to highlight that are new. Keep in mind that you can always type a “?” after the typed console variable to read its description. For example r.RayTracing.Reflections.ReflectionCaptures ? will give you a tooltip description for what it does.

-1 uses what has been set for the project by default, whether that’s the CVars or PPV settings. When set to 0, all Ray Tracing Effects in the project are disabled. When set to 1, all Ray Tracing effects are enabled, even ones you’ve not specifically enabled, such as Global Illumination or Translucency. This is useful for quick debugging purposes to measure the cost of Ray Tracing in your project.

This is a new fallback option for Ray Tracing to enable Reflection Captures to be used for the last bounce of Ray Tracing Reflections.

For example, you can have a single bounce of RT Reflection, then use a reflection capture for the second bounce, saving performance. If you use 2 bounces of RT Reflection, then the third bounce would be the reflection capture.