r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias
r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias
#Overview
name: r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Determines MIP bias for sparse voxel generation (Default = 3)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias is to determine the MIP (Mipmap) bias for sparse voxel generation in heterogeneous volumes rendering. This setting variable is primarily used in the rendering system, specifically for the heterogeneous volumes feature in Unreal Engine 5.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, as evidenced by its location in the HeterogeneousVolumes.cpp file within the Renderer’s private directory.
The value of this variable is set as a console variable with a default value of 3. It can be modified at runtime through the console or programmatically.
This variable interacts with its associated variable CVarHeterogeneousVolumesSparseVoxelGenerationMipBias. They share the same value and purpose.
Developers must be aware that this variable affects the level of detail in sparse voxel generation. A higher value will result in using lower resolution mipmaps, which can improve performance at the cost of visual quality. Conversely, a lower value will use higher resolution mipmaps, potentially increasing visual quality but at a higher performance cost.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project, balancing between performance and visual quality.
- Testing different values to find the optimal setting for your specific use case.
- Considering the target hardware capabilities when setting this value.
- Using it in conjunction with other heterogeneous volumes settings for best results.
Regarding the associated variable CVarHeterogeneousVolumesSparseVoxelGenerationMipBias:
- Its purpose is the same as r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias.
- It is used in the Renderer module, specifically in the heterogeneous volumes feature.
- Its value is set through the console variable system and can be accessed on the render thread.
- It interacts directly with r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias, sharing the same value.
- Developers should be aware that this is the actual variable used in the code to retrieve the mip bias value.
- Best practices include using this variable when you need to access the mip bias value in C++ code, particularly on the render thread.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:155
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesSparseVoxelGenerationMipBias(
TEXT("r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias"),
3,
TEXT("Determines MIP bias for sparse voxel generation (Default = 3)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesSparseVoxelPerTileCulling(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesSparseVoxelGenerationMipBias
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:154
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesSparseVoxelGenerationMipBias(
TEXT("r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias"),
3,
TEXT("Determines MIP bias for sparse voxel generation (Default = 3)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:420
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function uint32 GetSparseVoxelMipBias
Source code excerpt:
{
// TODO: Clamp based on texture dimension..
return FMath::Clamp(CVarHeterogeneousVolumesSparseVoxelGenerationMipBias.GetValueOnRenderThread(), 0, 10);
}
int32 GetDebugMode()
{
return CVarHeterogeneousVolumesDebug.GetValueOnRenderThread();
}