r.RayTracing.Geometry.Cable.WPO
r.RayTracing.Geometry.Cable.WPO
#Overview
name: r.RayTracing.Geometry.Cable.WPO
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
World position offset evaluation for cable meshes with EvaluateWPO enabled in ray tracing effects.\n 0: Cable meshes with world position offset visible in ray tracing, WPO evaluation disabled.\n 1: Cable meshes with world position offset visible in ray tracing, WPO evaluation enabled (default).\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RayTracing.Geometry.Cable.WPO is to control the evaluation of World Position Offset (WPO) for cable meshes in ray tracing effects. This setting is specifically for the Cable Component system in Unreal Engine 5, which is part of the rendering and physics simulation subsystems.
This setting variable is used within the Cable Component plugin, which is part of the Unreal Engine’s runtime plugins. It directly affects how cable meshes are handled in ray tracing scenarios.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, meaning that by default, WPO evaluation is enabled for cable meshes in ray tracing.
The associated variable CVarRayTracingCableMeshesWPO interacts directly with r.RayTracing.Geometry.Cable.WPO. They share the same value and purpose.
Developers must be aware that:
- This variable affects the visual fidelity and performance of ray-traced cable meshes.
- It has two possible values: 0 (WPO evaluation disabled) and 1 (WPO evaluation enabled).
- Changing this value can impact the appearance of cable meshes in ray-traced scenes.
Best practices when using this variable include:
- Keep it enabled (value 1) for the most accurate visual representation of cable meshes in ray-traced scenes.
- Consider disabling it (value 0) if performance is a concern and the visual difference is negligible for your specific use case.
- Test your scenes with both settings to understand the visual and performance impact in your specific project.
Regarding the associated variable CVarRayTracingCableMeshesWPO:
The purpose of CVarRayTracingCableMeshesWPO is identical to r.RayTracing.Geometry.Cable.WPO. It’s the actual console variable that controls the WPO evaluation for cable meshes in ray tracing.
This variable is used in the Cable Component plugin, specifically in the CableComponent.cpp file. It’s used to determine whether to evaluate WPO for cable meshes in ray tracing contexts.
The value is set when the engine initializes the console variable system, with a default value of 1.
CVarRayTracingCableMeshesWPO interacts directly with other ray tracing and cable mesh-related variables, such as CVarRayTracingCableMeshesWPOCulling and CVarRayTracingCableMeshesWPOCullingRadius.
Developers should be aware that:
- This is the actual variable checked in the code to determine WPO evaluation behavior.
- It’s accessed using GetValueOnRenderThread(), indicating it’s used in render thread contexts.
Best practices include:
- Use this variable when you need to programmatically check or set the WPO evaluation state for cable meshes in ray tracing.
- Be cautious when modifying this value during runtime, as it can affect ongoing rendering processes.
- Consider the interaction with other related variables when adjusting this setting.
#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:23
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarRayTracingCableMeshesWPO(
TEXT("r.RayTracing.Geometry.Cable.WPO"),
1,
TEXT("World position offset evaluation for cable meshes with EvaluateWPO enabled in ray tracing effects.\n")
TEXT(" 0: Cable meshes with world position offset visible in ray tracing, WPO evaluation disabled.\n")
TEXT(" 1: Cable meshes with world position offset visible in ray tracing, WPO evaluation enabled (default).\n")
);
#Associated Variable and Callsites
This variable is associated with another variable named CVarRayTracingCableMeshesWPO
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/CableComponent/Source/CableComponent/Private/CableComponent.cpp:22
Scope: file
Source code excerpt:
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,
TEXT("World position offset evaluation for cable meshes with EvaluateWPO enabled in ray tracing effects.\n")
TEXT(" 0: Cable meshes with world position offset visible in ray tracing, WPO evaluation disabled.\n")
TEXT(" 1: Cable meshes with world position offset visible in ray tracing, WPO evaluation enabled (default).\n")
);
#Loc: <Workspace>/Engine/Plugins/Runtime/CableComponent/Source/CableComponent/Private/CableComponent.cpp:472
Scope (from outer to inner):
file
function virtual void GetDynamicRayTracingInstances
Source code excerpt:
}
bool bEvaluateWPO = bDynamicRayTracingGeometry && CVarRayTracingCableMeshesWPO.GetValueOnRenderThread() == 1;
if (bEvaluateWPO && CVarRayTracingCableMeshesWPOCulling.GetValueOnRenderThread() > 0)
{
const FVector ViewCenter = Context.ReferenceView->ViewMatrices.GetViewOrigin();
const FVector MeshCenter = GetBounds().Origin;
const float CullingRadius = CVarRayTracingCableMeshesWPOCullingRadius.GetValueOnRenderThread();