r.Ortho.Debug.ForceAllCamerasToOrtho
r.Ortho.Debug.ForceAllCamerasToOrtho
#Overview
name: r.Ortho.Debug.ForceAllCamerasToOrtho
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Debug Force all cameras in the scene to use Orthographic views
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Ortho.Debug.ForceAllCamerasToOrtho is to force all cameras in the scene to use orthographic views for debugging purposes. This setting variable is part of the camera and rendering system in Unreal Engine 5.
This setting variable is primarily used by the Engine module, specifically within the camera stack implementation. It’s referenced in the CameraStackTypes.cpp file, which suggests it’s an integral part of the camera system.
The value of this variable is set as a console variable (CVar) using TAutoConsoleVariable. It’s initialized with a default value of false, meaning it’s not enabled by default.
The associated variable CVarDebugForceAllCamerasToOrtho directly interacts with r.Ortho.Debug.ForceAllCamerasToOrtho. They share the same value and are essentially the same variable, with CVarDebugForceAllCamerasToOrtho being the C++ representation of the console variable.
Developers must be aware that this variable is only available in non-shipping builds (as indicated by the #if !(UE_BUILD_SHIPPING) preprocessor directive). It’s intended for debugging purposes and should not be relied upon in production code.
When using this variable, developers should consider the following best practices:
- Use it only for debugging camera-related issues.
- Remember to disable it before creating a shipping build.
- Be aware that enabling this variable will affect all cameras in the scene, which might interfere with other debugging efforts.
Regarding the associated variable CVarDebugForceAllCamerasToOrtho:
Its purpose is to provide a C++ accessible way to check and modify the r.Ortho.Debug.ForceAllCamerasToOrtho setting.
It’s used within the Engine module, specifically in the camera stack implementation to modify camera behavior for debugging.
The value is set when the console variable is initialized, and it can be accessed or modified using the GetValueOnAnyThread() method.
It interacts directly with r.Ortho.Debug.ForceAllCamerasToOrtho, as they represent the same setting.
Developers should be aware that this variable is only available in non-shipping builds and is intended for debugging purposes.
Best practices for using CVarDebugForceAllCamerasToOrtho include:
- Use GetValueOnAnyThread() to safely access its value from any thread.
- Consider potential performance implications when frequently checking this value in performance-critical code paths.
- Use it in conjunction with other debug camera settings for comprehensive camera debugging.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraStackTypes.cpp:60
Scope: file
Source code excerpt:
#if !(UE_BUILD_SHIPPING)
static TAutoConsoleVariable<bool> CVarDebugForceAllCamerasToOrtho(
TEXT("r.Ortho.Debug.ForceAllCamerasToOrtho"),
false,
TEXT("Debug Force all cameras in the scene to use Orthographic views"),
ECVF_RenderThreadSafe
);
#Associated Variable and Callsites
This variable is associated with another variable named CVarDebugForceAllCamerasToOrtho
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraStackTypes.cpp:59
Scope: file
Source code excerpt:
#if !(UE_BUILD_SHIPPING)
static TAutoConsoleVariable<bool> CVarDebugForceAllCamerasToOrtho(
TEXT("r.Ortho.Debug.ForceAllCamerasToOrtho"),
false,
TEXT("Debug Force all cameras in the scene to use Orthographic views"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraStackTypes.cpp:220
Scope (from outer to inner):
file
function void FMinimalViewInfo::CalculateProjectionMatrixGivenViewRectangle
Source code excerpt:
{
#if !(UE_BUILD_SHIPPING)
if (CVarDebugForceAllCamerasToOrtho.GetValueOnAnyThread())
{
ViewInfo.ProjectionMode = ECameraProjectionMode::Orthographic;
ViewInfo.OrthoWidth = CVarDebugForceCameraOrthoWidth.GetValueOnAnyThread();
ViewInfo.bAutoCalculateOrthoPlanes = CVarDebugForceUseOrthoAutoPlanes.GetValueOnAnyThread();
ViewInfo.OrthoNearClipPlane = CVarDebugForceCameraOrthoNearPlane.GetValueOnAnyThread();
ViewInfo.OrthoFarClipPlane = CVarDebugForceCameraOrthoFarPlane.GetValueOnAnyThread();