r.VolumetricCloud.EmptySpaceSkipping.SampleCorners
r.VolumetricCloud.EmptySpaceSkipping.SampleCorners
#Overview
name: r.VolumetricCloud.EmptySpaceSkipping.SampleCorners
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0 means center samples only, >0 means corner are also sampled.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VolumetricCloud.EmptySpaceSkipping.SampleCorners is to control the sampling method for empty space skipping in volumetric cloud rendering. It determines whether to use only center samples or include corner samples as well.
This setting variable is primarily used in the rendering system, specifically for volumetric cloud rendering. It is part of the Unreal Engine’s renderer module, as evidenced by its location in the VolumetricCloudRendering.cpp file.
The value of this variable is set through a console variable (CVarVolumetricCloudEmptySpaceSkippingSampleCorners) with a default value of 1. It can be changed at runtime using console commands or through game settings.
The associated variable CVarVolumetricCloudEmptySpaceSkippingSampleCorners interacts directly with r.VolumetricCloud.EmptySpaceSkipping.SampleCorners. They share the same value and purpose.
Developers must be aware that:
- A value of 0 means only center samples are used.
- Any value greater than 0 means corner samples are also included.
- This setting can affect rendering performance and quality.
Best practices when using this variable include:
- Consider the performance impact of enabling corner sampling (values > 0) in performance-critical scenarios.
- Use this in conjunction with other volumetric cloud rendering settings for optimal results.
- Test different values to find the best balance between rendering quality and performance for your specific use case.
Regarding the associated variable CVarVolumetricCloudEmptySpaceSkippingSampleCorners:
- It is a TAutoConsoleVariable
type, allowing runtime modification. - It is used directly in the RenderVolumetricCloudsInternal function to determine the sampling method.
- The value is retrieved using GetValueOnRenderThread(), ensuring thread-safe access.
- It influences the permutation vector for the FRenderVolumetricCloudEmptySpaceSkippingCS shader, potentially affecting shader compilation and selection.
Developers should be cautious when modifying this variable, as it can have direct impacts on shader permutations and rendering performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:222
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarVolumetricCloudEmptySpaceSkippingSampleCorners(
TEXT("r.VolumetricCloud.EmptySpaceSkipping.SampleCorners"), 1,
TEXT("0 means center samples only, >0 means corner are also sampled."),
ECVF_RenderThreadSafe | ECVF_Scalability);
//////////////////////////////////////////////////////////////////////////
#Associated Variable and Callsites
This variable is associated with another variable named CVarVolumetricCloudEmptySpaceSkippingSampleCorners
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:221
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarVolumetricCloudEmptySpaceSkippingSampleCorners(
TEXT("r.VolumetricCloud.EmptySpaceSkipping.SampleCorners"), 1,
TEXT("0 means center samples only, >0 means corner are also sampled."),
ECVF_RenderThreadSafe | ECVF_Scalability);
//////////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:2333
Scope (from outer to inner):
file
function void FSceneRenderer::RenderVolumetricCloudsInternal
Source code excerpt:
MaterialRenderProxy = MaterialRenderProxy ? MaterialRenderProxy : CloudVolumeMaterialProxy;
const bool bSampleCorners = CVarVolumetricCloudEmptySpaceSkippingSampleCorners.GetValueOnRenderThread() > 0;
typename FRenderVolumetricCloudEmptySpaceSkippingCS::FPermutationDomain PermutationVector;
PermutationVector.Set<typename FRenderVolumetricCloudEmptySpaceSkippingCS::FCloudEmptySpaceSkippingDebug>(bCloudEmptySpaceSkippingDebug);
PermutationVector.Set<typename FRenderVolumetricCloudEmptySpaceSkippingCS::FCloudEmptySpaceSkippingSampleCorners>(bSampleCorners);
TShaderRef<FRenderVolumetricCloudEmptySpaceSkippingCS> ComputeShader = MaterialResource->GetShader<FRenderVolumetricCloudEmptySpaceSkippingCS>(&FLocalVertexFactory::StaticType, PermutationVector, false);