r.HairStrands.Visibility.ComputeRaster.ContinuousLOD
r.HairStrands.Visibility.ComputeRaster.ContinuousLOD
#Overview
name: r.HairStrands.Visibility.ComputeRaster.ContinuousLOD
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable Continuos LOD when using compute rasterization. Experimental
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HairStrands.Visibility.ComputeRaster.ContinuousLOD is to enable Continuous Level of Detail (LOD) when using compute rasterization for hair strands visibility. This setting is part of the rendering system, specifically for hair rendering in Unreal Engine 5.
This setting variable is primarily used in the Renderer module, particularly in the HairStrands subsystem. It’s referenced in the HairStrandsInterface.cpp file, which suggests it’s an integral part of the hair rendering pipeline.
The value of this variable is set through a console variable (CVarHairStrandsVisibilityComputeRaster_ContinuousLOD) with a default value of 1 (enabled). It can be changed at runtime through console commands or configuration files.
This variable interacts with other hair-related settings. It’s used in conjunction with IsHairStrandContinuousDecimationReorderingEnabled() and IsHairVisibilityComputeRasterEnabled() to determine if the Continuous LOD feature for compute raster visibility should be active.
Developers should be aware that this feature is marked as experimental in the code comments. This means it might not be fully optimized or could potentially change in future engine versions. They should test thoroughly when enabling or disabling this feature to ensure it doesn’t negatively impact performance or visual quality.
Best practices when using this variable include:
- Only enable it if you’re using compute rasterization for hair visibility.
- Monitor performance impacts when enabling this feature, as it may affect rendering times.
- Use it in conjunction with other hair rendering settings for optimal results.
- Be prepared to adjust or disable it if you encounter any visual artifacts or performance issues.
Regarding the associated variable CVarHairStrandsVisibilityComputeRaster_ContinuousLOD:
This is the actual console variable that controls the r.HairStrands.Visibility.ComputeRaster.ContinuousLOD setting. It’s an integer variable, where a value greater than 0 enables the feature. It’s defined using TAutoConsoleVariable, which allows it to be changed at runtime.
The variable is used in the IsHairVisibilityComputeRasterContinuousLODEnabled() function to determine if the feature should be active. This function checks not only the value of CVarHairStrandsVisibilityComputeRaster_ContinuousLOD but also other related hair rendering settings.
Developers should use this console variable to toggle the Continuous LOD feature for compute raster visibility of hair strands. They can modify it through console commands or engine configuration files. When adjusting this variable, developers should be mindful of its interaction with other hair rendering settings and its potential impact on performance and visual quality.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsInterface.cpp:78
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHairStrandsVisibilityComputeRaster_ContinuousLOD(
TEXT("r.HairStrands.Visibility.ComputeRaster.ContinuousLOD"), 1,
TEXT("Enable Continuos LOD when using compute rasterization. Experimental"),
ECVF_RenderThreadSafe);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Import/export utils function for hair resources
void FRDGExternalBuffer::Release()
#Associated Variable and Callsites
This variable is associated with another variable named CVarHairStrandsVisibilityComputeRaster_ContinuousLOD
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsInterface.cpp:77
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarHairStrandsVisibilityComputeRaster_ContinuousLOD(
TEXT("r.HairStrands.Visibility.ComputeRaster.ContinuousLOD"), 1,
TEXT("Enable Continuos LOD when using compute rasterization. Experimental"),
ECVF_RenderThreadSafe);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Import/export utils function for hair resources
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsInterface.cpp:328
Scope (from outer to inner):
file
function bool IsHairVisibilityComputeRasterContinuousLODEnabled
Source code excerpt:
bool IsHairVisibilityComputeRasterContinuousLODEnabled()
{
return IsHairStrandContinuousDecimationReorderingEnabled() && IsHairVisibilityComputeRasterEnabled() && (CVarHairStrandsVisibilityComputeRaster_ContinuousLOD.GetValueOnAnyThread() > 0);
}
uint32 FHairGroupPublicData::GetActiveStrandsPointCount(bool bPrevious) const
{
return bPrevious ? ContinuousLODPreviousPointCount : ContinuousLODPointCount;
}