r.RayTracing.Geometry.Cable

r.RayTracing.Geometry.Cable

#Overview

name: r.RayTracing.Geometry.Cable

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.RayTracing.Geometry.Cable is to control the inclusion of Cable meshes in ray tracing effects within Unreal Engine 5. This setting variable is specifically related to the rendering system, particularly the ray tracing functionality.

This setting variable is primarily used in the Cable Component plugin, which is part of the Unreal Engine runtime. Based on the Callsites section, we can see that it’s referenced in the CableComponent.cpp file, which is located in the CableComponent plugin.

The value of this variable is set using a console variable (CVar) system. It’s initialized with a default value of 1, meaning cable meshes are enabled in ray tracing by default.

The associated variable CVarRayTracingCableMeshes interacts directly with r.RayTracing.Geometry.Cable. They share the same value and purpose.

Developers must be aware that this variable affects the performance and visual quality of ray tracing in scenes that include cable meshes. Enabling this feature (value = 1) will include cable meshes in ray tracing calculations, potentially improving visual fidelity but at the cost of increased computational load.

Best practices when using this variable include:

  1. Consider the performance impact of including cable meshes in ray tracing, especially in scenes with many cable components.
  2. Use it in conjunction with other ray tracing settings for optimal results.
  3. Test the visual and performance differences with the setting enabled and disabled to make informed decisions.

Regarding the associated variable CVarRayTracingCableMeshes:

The purpose of CVarRayTracingCableMeshes is identical to r.RayTracing.Geometry.Cable. It’s an internal representation of the console variable used within the C++ code.

This variable is used in the Cable Component plugin, specifically in the rendering logic for cable meshes.

The value of CVarRayTracingCableMeshes is set by the console variable system and can be accessed at runtime using GetValueOnRenderThread().

It interacts directly with ray tracing functionality, determining whether cable meshes should be included in ray tracing calculations.

Developers should be aware that this variable is used in render thread operations and should be accessed accordingly.

Best practices include using this variable for render-thread specific logic and ensuring thread-safe access when necessary.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/CableComponent/Source/CableComponent/Private/CableComponent.cpp:18

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarRayTracingCableMeshes(
	TEXT("r.RayTracing.Geometry.Cable"),
	1,
	TEXT("Include Cable meshes in ray tracing effects (default = 1 (cable meshes enabled in ray tracing))"));

static TAutoConsoleVariable<int32> CVarRayTracingCableMeshesWPO(
	TEXT("r.RayTracing.Geometry.Cable.WPO"),
	1,

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/CableComponent/Source/CableComponent/Private/CableComponent.cpp:17

Scope: file

Source code excerpt:

DEFINE_RENDER_COMMAND_PIPE(Cable, ERenderCommandPipeFlags::None);

static TAutoConsoleVariable<int32> CVarRayTracingCableMeshes(
	TEXT("r.RayTracing.Geometry.Cable"),
	1,
	TEXT("Include Cable meshes in ray tracing effects (default = 1 (cable meshes enabled in ray tracing))"));

static TAutoConsoleVariable<int32> CVarRayTracingCableMeshesWPO(
	TEXT("r.RayTracing.Geometry.Cable.WPO"),

#Loc: <Workspace>/Engine/Plugins/Runtime/CableComponent/Source/CableComponent/Private/CableComponent.cpp:298

Scope (from outer to inner):

file
function     class FCableSceneProxy final : public FPrimitiveSceneProxy { public: SIZE_T GetTypeHash
class        class FCableSceneProxy final : public FPrimitiveSceneProxy
function     void SetDynamicData_RenderThread

Source code excerpt:


#if RHI_RAYTRACING
			if (bSupportRayTracing && CVarRayTracingCableMeshes.GetValueOnRenderThread() != 0)
			{
				FRayTracingGeometry& RayTracingGeometry = StaticRayTracingGeometry;
				if (RayTracingGeometry.IsValid())
				{
					RayTracingGeometry.ReleaseResource();
					UpdateRayTracingGeometry_RenderingThread(RayTracingGeometry, RHICmdList);

#Loc: <Workspace>/Engine/Plugins/Runtime/CableComponent/Source/CableComponent/Private/CableComponent.cpp:460

Scope (from outer to inner):

file
function     virtual void GetDynamicRayTracingInstances

Source code excerpt:

	virtual void GetDynamicRayTracingInstances(FRayTracingMaterialGatheringContext& Context, TArray<FRayTracingInstance>& OutRayTracingInstances) override
	{
		if (CVarRayTracingCableMeshes.GetValueOnRenderThread() == 0)
		{
			return;
		}

		if (!ensureMsgf(IsRayTracingRelevant(),
			TEXT("GetDynamicRayTracingInstances() is only expected to be called for scene proxies that are compatible with ray tracing. ")