r.RayTracing.Shadows.Lights.Point

r.RayTracing.Shadows.Lights.Point

#Overview

name: r.RayTracing.Shadows.Lights.Point

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.Shadows.Lights.Point is to enable or disable ray tracing shadows for point lights in Unreal Engine 5’s rendering system.

This setting variable is primarily used by the rendering subsystem of Unreal Engine 5, specifically in the light rendering module. It’s part of the ray tracing feature set for shadow rendering.

The value of this variable is set through the console variable system (CVarRayTracingShadowsPointLight). It’s initialized with a default value of 1, meaning ray tracing shadows for point lights are enabled by default.

The associated variable CVarRayTracingShadowsPointLight directly interacts with r.RayTracing.Shadows.Lights.Point. They share the same value and purpose.

Developers must be aware that this variable affects the rendering performance and visual quality of shadows cast by point lights. Enabling ray traced shadows for point lights can significantly impact performance, especially in scenes with many point lights.

Best practices when using this variable include:

  1. Consider the performance implications of enabling ray traced shadows for point lights.
  2. Use it in conjunction with other ray tracing settings for consistent visual quality.
  3. Test thoroughly in various lighting scenarios to ensure desired results.

Regarding the associated variable CVarRayTracingShadowsPointLight:

The purpose of CVarRayTracingShadowsPointLight is to provide programmatic access to the r.RayTracing.Shadows.Lights.Point setting within the C++ codebase.

This variable is used in the renderer subsystem, specifically in the light rendering module. It’s accessed in the ShouldRenderRayTracingShadowsForLightType function to determine if ray traced shadows should be rendered for point lights.

The value of CVarRayTracingShadowsPointLight is set when r.RayTracing.Shadows.Lights.Point is modified, as they are directly linked.

Developers should be aware that modifying CVarRayTracingShadowsPointLight directly in code will affect the r.RayTracing.Shadows.Lights.Point setting and vice versa.

Best practices for using CVarRayTracingShadowsPointLight include:

  1. Use GetValueOnRenderThread() when accessing its value to ensure thread safety.
  2. Consider the performance implications when enabling or disabling this feature dynamically during runtime.
  3. Coordinate its usage with other ray tracing settings for consistent behavior and performance.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightRendering.cpp:116

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarRayTracingShadowsPointLight(
	TEXT("r.RayTracing.Shadows.Lights.Point"),
	1,
	TEXT("Enables ray tracing shadows for point lights (default = 1)"),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarRayTracingShadowsSpotLight(
	TEXT("r.RayTracing.Shadows.Lights.Spot"),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightRendering.cpp:115

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarRayTracingShadowsPointLight(
	TEXT("r.RayTracing.Shadows.Lights.Point"),
	1,
	TEXT("Enables ray tracing shadows for point lights (default = 1)"),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarRayTracingShadowsSpotLight(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightRendering.cpp:200

Scope (from outer to inner):

file
function     static bool ShouldRenderRayTracingShadowsForLightType

Source code excerpt:

		return !!CVarRayTracingShadowsDirectionalLight.GetValueOnRenderThread();
	case LightType_Point:
		return !!CVarRayTracingShadowsPointLight.GetValueOnRenderThread();
	case LightType_Spot:
		return !!CVarRayTracingShadowsSpotLight.GetValueOnRenderThread();
	case LightType_Rect:
		return !!CVarRayTracingShadowsRectLight.GetValueOnRenderThread();
	default:
		return true;