r.RayTracing.Debug.InstanceOverlap.Scale

r.RayTracing.Debug.InstanceOverlap.Scale

#Overview

name: r.RayTracing.Debug.InstanceOverlap.Scale

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.RayTracing.Debug.InstanceOverlap.Scale is to provide a scaling factor for the instance traversal heat map visualization in ray tracing debug mode. This variable is primarily used in the rendering system, specifically for ray tracing debugging.

This setting variable is relied upon by the Unreal Engine’s Renderer module, particularly in the ray tracing debug subsystem. It’s used in the RayTracingDebug.cpp file, which is part of the ray tracing debugging functionality.

The value of this variable is set as a console variable with a default value of 16.0f. It can be modified at runtime through the console or configuration files.

The associated variable CVarRayTracingDebugInstanceOverlapScale directly interacts with r.RayTracing.Debug.InstanceOverlap.Scale. They share the same value and purpose.

Developers must be aware that this variable affects the visualization of the instance traversal heat map. A higher value will make the heat map more pronounced, while a lower value will make it more subtle. This can be crucial when debugging ray tracing performance and behavior.

Best practices when using this variable include:

  1. Adjusting it to get a clear visualization of instance overlap without overwhelming other visual elements.
  2. Using it in conjunction with other ray tracing debug tools for a comprehensive understanding of the ray tracing process.
  3. Resetting it to the default value (16.0f) when not actively debugging to ensure normal visualization behavior.

Regarding the associated variable CVarRayTracingDebugInstanceOverlapScale:

The purpose of CVarRayTracingDebugInstanceOverlapScale is identical to r.RayTracing.Debug.InstanceOverlap.Scale. It’s the internal representation of the console variable in the C++ code.

This variable is used in the Renderer module, specifically in the ray tracing debug functionality. It’s defined and used in the RayTracingDebug.cpp file.

The value of CVarRayTracingDebugInstanceOverlapScale is set when the console variable r.RayTracing.Debug.InstanceOverlap.Scale is set. It’s retrieved in the code using the GetValueOnRenderThread() method.

CVarRayTracingDebugInstanceOverlapScale directly interacts with r.RayTracing.Debug.InstanceOverlap.Scale, as they represent the same setting.

Developers should be aware that this is the actual variable used in the C++ code to access the console variable’s value. Any changes to r.RayTracing.Debug.InstanceOverlap.Scale will be reflected in this variable.

Best practices include using CVarRayTracingDebugInstanceOverlapScale.GetValueOnRenderThread() to safely access the current value of the setting in render thread code.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RayTracing/RayTracingDebug.cpp:66

Scope: file

Source code excerpt:


static TAutoConsoleVariable<float> CVarRayTracingDebugInstanceOverlapScale(
	TEXT("r.RayTracing.Debug.InstanceOverlap.Scale"),
	16.0f,
	TEXT("Scaling factor for instance traversal heat map visualization. (default = 16)\n")
);

static TAutoConsoleVariable<float> CVarRayTracingDebugInstanceOverlapBoundingBoxScale(
	TEXT("r.RayTracing.Debug.InstanceOverlap.BoundingBoxScale"),

#Associated Variable and Callsites

This variable is associated with another variable named CVarRayTracingDebugInstanceOverlapScale. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RayTracing/RayTracingDebug.cpp:65

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<float> CVarRayTracingDebugInstanceOverlapScale(
	TEXT("r.RayTracing.Debug.InstanceOverlap.Scale"),
	16.0f,
	TEXT("Scaling factor for instance traversal heat map visualization. (default = 16)\n")
);

static TAutoConsoleVariable<float> CVarRayTracingDebugInstanceOverlapBoundingBoxScale(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RayTracing/RayTracingDebug.cpp:1267

Scope (from outer to inner):

file
function     static void DrawInstanceOverlap

Source code excerpt:


		PassParameters->InstanceOverlap = GraphBuilder.CreateSRV(InstanceOverlapTexture);
		PassParameters->HeatmapScale = CVarRayTracingDebugInstanceOverlapScale.GetValueOnRenderThread();

		TShaderMapRef<FRayTracingDebugBlendInstanceOverlapPS> PixelShader(View.ShaderMap);

		FPixelShaderUtils::AddFullscreenPass(
			GraphBuilder,
			View.ShaderMap,