r.VT.RVT.MipColors
r.VT.RVT.MipColors
#Overview
name: r.VT.RVT.MipColors
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Render mip colors to RVT BaseColor.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VT.RVT.MipColors is to control the rendering of mip colors in the Runtime Virtual Texture (RVT) BaseColor. This setting variable is part of Unreal Engine’s virtual texturing system, which is a critical component of the rendering pipeline.
This setting variable is primarily used by the Runtime Virtual Texture subsystem within the Renderer module of Unreal Engine. Based on the callsites, it’s clear that this variable is utilized in the runtime virtual texture rendering process.
The value of this variable is set through a console variable (CVar) system. It’s initialized as a TAutoConsoleVariable with a default value of false, meaning that by default, mip colors are not rendered to the RVT BaseColor.
The associated variable CVarVTMipColors directly interacts with r.VT.RVT.MipColors. They share the same value and purpose. CVarVTMipColors is used to access the value of r.VT.RVT.MipColors within the C++ code.
Developers must be aware that enabling this variable will affect the visual output of runtime virtual textures. When enabled, it will render mip colors to the RVT BaseColor, which can be useful for debugging or achieving specific visual effects.
Best practices when using this variable include:
- Use it primarily for debugging purposes to visualize mip levels in runtime virtual textures.
- Be cautious about enabling it in production builds, as it may affect performance and visual quality.
- Consider the impact on other rendering systems that rely on the RVT BaseColor when this option is enabled.
Regarding the associated variable CVarVTMipColors:
- Its purpose is to provide a programmatic way to access and modify the r.VT.RVT.MipColors setting within the C++ code.
- It’s used in the RuntimeVirtualTexture namespace, specifically in the RenderPage function.
- The value is retrieved using GetValueOnRenderThread(), indicating that it’s safe to access from the render thread.
- When enabled, it affects the RuntimeVirtualTextureDebugParams of the view’s uniform shader parameters, setting it to the result of GetMipLevelColor(vLevel).
- Developers should be aware that changes to CVarVTMipColors will directly impact the rendering of runtime virtual textures and should be used judiciously.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/RuntimeVirtualTextureRender.cpp:27
Scope (from outer to inner):
file
namespace RuntimeVirtualTexture
Source code excerpt:
{
static TAutoConsoleVariable<bool> CVarVTMipColors(
TEXT("r.VT.RVT.MipColors"),
false,
TEXT("Render mip colors to RVT BaseColor."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarVTHighQualityPerPixelHeight(
TEXT("r.VT.RVT.HighQualityPerPixelHeight"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarVTMipColors
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/RuntimeVirtualTextureRender.cpp:26
Scope (from outer to inner):
file
namespace RuntimeVirtualTexture
Source code excerpt:
namespace RuntimeVirtualTexture
{
static TAutoConsoleVariable<bool> CVarVTMipColors(
TEXT("r.VT.RVT.MipColors"),
false,
TEXT("Render mip colors to RVT BaseColor."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarVTHighQualityPerPixelHeight(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/RuntimeVirtualTextureRender.cpp:1447
Scope (from outer to inner):
file
function void RenderPage
Source code excerpt:
View->CachedViewUniformShaderParameters->RuntimeVirtualTextureMipLevel = MipLevelParameter;
View->CachedViewUniformShaderParameters->RuntimeVirtualTexturePackHeight = FVector2f(WorldHeightPackParameter); // LWC_TODO: Precision loss
View->CachedViewUniformShaderParameters->RuntimeVirtualTextureDebugParams = CVarVTMipColors.GetValueOnRenderThread() ? GetMipLevelColor(vLevel) : FixedColor;
View->ViewUniformBuffer = TUniformBufferRef<FViewUniformShaderParameters>::CreateUniformBufferImmediate(*View->CachedViewUniformShaderParameters, UniformBuffer_SingleFrame);
// Build graph
FRenderGraphSetup::FInitDesc GraphSetupDesc(Scene->GetFeatureLevel(), MaterialType, TextureSize);
GraphSetupDesc.OutputFormat0 = OutputTexture0 != nullptr ? OutputTexture0->GetFormat() : PF_Unknown;
GraphSetupDesc.OutputTargets.Add(OutputTarget0);