r.Water.WaterMesh.GPUQuadTree.JitterSampleFootprint
r.Water.WaterMesh.GPUQuadTree.JitterSampleFootprint
#Overview
name: r.Water.WaterMesh.GPUQuadTree.JitterSampleFootprint
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Pixel footprint of the jitter sample pattern. Values greater than 1.0 can cause the water mesh to raster into neighboring pixels not normally covered by the mesh. Default: 1.5, Min 0.0
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Water.WaterMesh.GPUQuadTree.JitterSampleFootprint is to control the pixel footprint of the jitter sample pattern in the water mesh rendering system of Unreal Engine 5. This setting is specifically used in the water rendering subsystem, which is part of the experimental Water plugin.
This setting variable is primarily used in the Water plugin, specifically in the WaterMeshSceneProxy component. It’s part of the GPU QuadTree rendering system for water meshes, which is likely used to optimize the rendering of large water bodies.
The value of this variable is set as a console variable with a default value of 1.5f. It can be modified at runtime through the console or programmatically.
This variable interacts closely with other water mesh rendering settings, such as CVarWaterMeshGPUQuadTreeMultiSampling, CVarWaterMeshGPUQuadTreeNumJitterSamples, and CVarWaterMeshGPUQuadTreeConservativeRasterization. It’s used in conjunction with these variables to configure the water mesh rendering parameters.
Developers must be aware that values greater than 1.0 for this variable can cause the water mesh to raster into neighboring pixels not normally covered by the mesh. This could potentially affect the visual quality and performance of water rendering.
Best practices when using this variable include:
- Carefully adjusting the value to balance between visual quality and performance.
- Testing different values to find the optimal setting for your specific water rendering needs.
- Considering the interaction with other water mesh rendering settings.
- Being cautious when setting values above 1.0, as it may affect neighboring pixels.
Regarding the associated variable CVarWaterMeshGPUQuadTreeJitterSampleFootprint:
This is the actual console variable that stores and provides access to the r.Water.WaterMesh.GPUQuadTree.JitterSampleFootprint setting. It’s defined using TAutoConsoleVariable, which allows it to be changed at runtime.
The purpose of this variable is the same as r.Water.WaterMesh.GPUQuadTree.JitterSampleFootprint - to control the pixel footprint of the jitter sample pattern in water mesh rendering.
It’s used in the BuildGPUQuadTree function of the FWaterMeshSceneProxy class to set the JitterSampleFootprint parameter for the GPU QuadTree initialization.
When working with this variable, developers should:
- Access its value using the GetValueOnRenderThread() method to ensure thread-safety.
- Consider clamping or validating the value before use, as demonstrated in the BuildGPUQuadTree function.
- Be aware that changes to this variable will affect the water rendering in real-time, which can be useful for fine-tuning but should be used carefully in production environments.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterMeshSceneProxy.cpp:55
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarWaterMeshGPUQuadTreeJitterSampleFootprint(
TEXT("r.Water.WaterMesh.GPUQuadTree.JitterSampleFootprint"), 1.5f,
TEXT("Pixel footprint of the jitter sample pattern. Values greater than 1.0 can cause the water mesh to raster into neighboring pixels not normally covered by the mesh. Default: 1.5, Min 0.0"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarWaterMeshGPUQuadTreeConservativeRasterization(
TEXT("r.Water.WaterMesh.GPUQuadTree.ConservativeRasterization"), 0,
TEXT("Enables software conservative rasterization for rasterizing water body meshes into the water quadtree. Disables jittered draws. Default: 0"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarWaterMeshGPUQuadTreeJitterSampleFootprint
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterMeshSceneProxy.cpp:54
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarWaterMeshGPUQuadTreeJitterSampleFootprint(
TEXT("r.Water.WaterMesh.GPUQuadTree.JitterSampleFootprint"), 1.5f,
TEXT("Pixel footprint of the jitter sample pattern. Values greater than 1.0 can cause the water mesh to raster into neighboring pixels not normally covered by the mesh. Default: 1.5, Min 0.0"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarWaterMeshGPUQuadTreeConservativeRasterization(
TEXT("r.Water.WaterMesh.GPUQuadTree.ConservativeRasterization"), 0,
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterMeshSceneProxy.cpp:1247
Scope (from outer to inner):
file
function void FWaterMeshSceneProxy::BuildGPUQuadTree
Source code excerpt:
Params.NumMSAASamples = FMath::Clamp(CVarWaterMeshGPUQuadTreeMultiSampling.GetValueOnRenderThread(), 1, 8);
Params.NumJitterSamples = FMath::Clamp(CVarWaterMeshGPUQuadTreeNumJitterSamples.GetValueOnRenderThread(), 1, 16);
Params.JitterSampleFootprint = FMath::Max(CVarWaterMeshGPUQuadTreeJitterSampleFootprint.GetValueOnRenderThread(), 0.0f);
Params.CaptureDepthRange = WaterQuadTreeDepthRange;
Params.bUseMSAAJitterPattern = CVarWaterMeshGPUQuadTreeJitterPattern.GetValueOnRenderThread() == 1;
Params.bUseConservativeRasterization = bAllDrawsAreConservativeRasterCompatible && CVarWaterMeshGPUQuadTreeConservativeRasterization.GetValueOnRenderThread() != 0;
QuadTreeGPU.Init(GraphBuilder, Params, Draws);
}