r.Ortho.Debug.ForceOrthoWidth
r.Ortho.Debug.ForceOrthoWidth
#Overview
name: r.Ortho.Debug.ForceOrthoWidth
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Debug Force Ortho Width when creating a new camera actor
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Ortho.Debug.ForceOrthoWidth is to debug and force a specific orthographic width when creating a new camera actor in Unreal Engine 5. This setting variable is primarily used for the camera system, specifically for orthographic projection.
This setting variable is utilized by the Engine module, particularly in the camera stack types implementation. It’s part of the debug functionality for orthographic camera settings.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of DEFAULT_ORTHOWIDTH.
The associated variable CVarDebugForceCameraOrthoWidth directly interacts with r.Ortho.Debug.ForceOrthoWidth. They share the same value and purpose.
Developers must be aware that this variable is intended for debugging purposes. It forces a specific orthographic width when creating new camera actors, which can affect the visual output of the game or application. It’s important to note that this setting is render thread safe (ECVF_RenderThreadSafe).
Best practices when using this variable include:
- Use it only for debugging purposes, not in production code.
- Be aware that it affects all new camera actors created while this debug setting is active.
- Remember to reset or disable this debug setting when it’s no longer needed to avoid unintended effects on camera behavior.
Regarding the associated variable CVarDebugForceCameraOrthoWidth:
The purpose of CVarDebugForceCameraOrthoWidth is the same as r.Ortho.Debug.ForceOrthoWidth. It’s used to force a specific orthographic width for debugging camera settings.
This variable is used in the Engine module, specifically in the camera stack types implementation. It’s accessed in the FMinimalViewInfo::CalculateProjectionMatrixGivenViewRectangle function to set the OrthoWidth of the ViewInfo structure.
The value of CVarDebugForceCameraOrthoWidth is set when it’s declared as a TAutoConsoleVariable, with the same default value and description as r.Ortho.Debug.ForceOrthoWidth.
CVarDebugForceCameraOrthoWidth interacts directly with the ViewInfo structure, setting its OrthoWidth property. It’s used alongside other debug variables for orthographic camera settings.
Developers should be aware that this variable affects the calculation of projection matrices for orthographic cameras. It’s important to use this debug feature judiciously and remember to reset it when not needed.
Best practices for using CVarDebugForceCameraOrthoWidth include:
- Use it in conjunction with other orthographic camera debug settings for comprehensive testing.
- Be mindful of its impact on camera behavior and visual output when active.
- Consider using it in editor tools or debug builds rather than in shipping game code.
#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:68
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarDebugForceCameraOrthoWidth(
TEXT("r.Ortho.Debug.ForceOrthoWidth"),
DEFAULT_ORTHOWIDTH,
TEXT("Debug Force Ortho Width when creating a new camera actor"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<bool> CVarDebugForceUseOrthoAutoPlanes(
#Associated Variable and Callsites
This variable is associated with another variable named CVarDebugForceCameraOrthoWidth
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraStackTypes.cpp:67
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarDebugForceCameraOrthoWidth(
TEXT("r.Ortho.Debug.ForceOrthoWidth"),
DEFAULT_ORTHOWIDTH,
TEXT("Debug Force Ortho Width when creating a new camera actor"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraStackTypes.cpp:223
Scope (from outer to inner):
file
function void FMinimalViewInfo::CalculateProjectionMatrixGivenViewRectangle
Source code excerpt:
{
ViewInfo.ProjectionMode = ECameraProjectionMode::Orthographic;
ViewInfo.OrthoWidth = CVarDebugForceCameraOrthoWidth.GetValueOnAnyThread();
ViewInfo.bAutoCalculateOrthoPlanes = CVarDebugForceUseOrthoAutoPlanes.GetValueOnAnyThread();
ViewInfo.OrthoNearClipPlane = CVarDebugForceCameraOrthoNearPlane.GetValueOnAnyThread();
ViewInfo.OrthoFarClipPlane = CVarDebugForceCameraOrthoFarPlane.GetValueOnAnyThread();
}
#endif