UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMinimalViewInfo Struct Reference

#include <CameraTypes.h>

Public Member Functions

 FMinimalViewInfo ()
 
ENGINE_API bool Equals (const FMinimalViewInfo &OtherInfo) const
 
ENGINE_API void BlendViewInfo (FMinimalViewInfo &OtherInfo, float OtherWeight)
 
ENGINE_API void ApplyBlendWeight (const float &Weight)
 
ENGINE_API void AddWeightedViewInfo (const FMinimalViewInfo &OtherView, const float &Weight)
 
ENGINE_API FMatrix CalculateProjectionMatrix () const
 
float GetFinalPerspectiveNearClipPlane () const
 
ENGINE_API bool AutoCalculateOrthoPlanes (FSceneViewProjectionData &InOutProjectionData)
 
void SetCameraToViewTarget (const FVector ActorLocation)
 
ENGINE_API FVector TransformWorldToFirstPerson (const FVector &WorldPosition, bool bIgnoreFirstPersonScale) const
 
ENGINE_API float CalculateFirstPersonFOVCorrectionFactor () const
 
ENGINE_API void ApplyOverscan (float InOverscan, bool bScaleResolutionWithOverscan=false, bool bCropOverscan=false)
 
ENGINE_API void ApplyAsymmetricOverscan (const FVector4f &InAsymmetricOverscan, bool bScaleResolutionWithOverscan=false, bool bCropOverscan=false)
 
float GetOverscan () const
 
ENGINE_API void ClearOverscan ()
 

Static Public Member Functions

static ENGINE_API void CalculateProjectionMatrixGivenView (FMinimalViewInfo &ViewInfo, TEnumAsByte< enum EAspectRatioAxisConstraint > AspectRatioAxisConstraint, class FViewport *Viewport, struct FSceneViewProjectionData &InOutProjectionData)
 
static ENGINE_API void CalculateProjectionMatrixGivenViewRectangle (FMinimalViewInfo &ViewInfo, TEnumAsByte< enum EAspectRatioAxisConstraint > AspectRatioAxisConstraint, const FIntRect &ConstrainedViewRectangle, FSceneViewProjectionData &InOutProjectionData)
 

Public Attributes

FVector Location
 
FRotator Rotation
 
float FOV
 
float DesiredFOV
 
float FirstPersonFOV
 
float FirstPersonScale
 
float OrthoWidth
 
bool bAutoCalculateOrthoPlanes
 
float AutoPlaneShift
 
bool bUpdateOrthoPlanes
 
bool bUseCameraHeightAsViewTarget
 
float OrthoNearClipPlane
 
float OrthoFarClipPlane
 
float PerspectiveNearClipPlane
 
float AspectRatio
 
TOptional< EAspectRatioAxisConstraintAspectRatioAxisConstraint
 
uint32 bConstrainAspectRatio:1
 
uint32 bUseFirstPersonParameters: 1
 
uint32 bUseFieldOfViewForLOD:1
 
TEnumAsByte< ECameraProjectionMode::TypeProjectionMode
 
float PostProcessBlendWeight
 
struct FPostProcessSettings PostProcessSettings
 
FVector2D OffCenterProjectionOffset
 
TOptional< FTransformPreviousViewTransform
 
float OverscanResolutionFraction
 
float CropFraction
 
FVector4f AsymmetricCropFraction
 

Constructor & Destructor Documentation

◆ FMinimalViewInfo()

FMinimalViewInfo::FMinimalViewInfo ( )
inline

Member Function Documentation

◆ AddWeightedViewInfo()

void FMinimalViewInfo::AddWeightedViewInfo ( const FMinimalViewInfo OtherView,
const float Weight 
)

Combines this view with another one which will be weighted. Equals to this += OtherView * Weight.

◆ ApplyAsymmetricOverscan()

void FMinimalViewInfo::ApplyAsymmetricOverscan ( const FVector4f InAsymmetricOverscan,
bool  bScaleResolutionWithOverscan = false,
bool  bCropOverscan = false 
)

Experimental: Apply asymmetric overscan to the view info, which scales the field of view, ortho width, aspect ratio, and off-center projection to simulate expanding the view frustum asymmetrically.

Parameters
InAsymmetricOverscan- The amount of asymmetric overscan to apply, from 0.0 meaning no overscan to 1.0 meaning 100% overscan. By convention, X is the left overscan, Y is the right overscan, Z is the top overscan, and W is the bottom overscan.
bScaleResolutionWithOverscan- Indicates that the view's resolution should be scaled with the amount of overscan, so that the original frustum remains the same resolution
bCropOverscan- Indicates that the view should be cropped during the final post process pass to remove the overscanned pixels

◆ ApplyBlendWeight()

void FMinimalViewInfo::ApplyBlendWeight ( const float Weight)

Applies weighting to this view, in order to be blended with another one. Equals to this *= Weight.

◆ ApplyOverscan()

void FMinimalViewInfo::ApplyOverscan ( float  InOverscan,
bool  bScaleResolutionWithOverscan = false,
bool  bCropOverscan = false 
)

Apply overscan to the view info, which scales the field of view and ortho width to simulate expanding the view frustum.

Parameters
InOverscan- The amount of overscan to apply, from 0.0 meaning no overscan to 1.0 meaning 100% overscan
bScaleResolutionWithOverscan- Indicates that the view's resolution should be scaled with the amount of overscan, so that the original frustum remains the same resolution
bCropOverscan- Indicates that the view should be cropped during the final post process pass to remove the overscanned pixels

◆ AutoCalculateOrthoPlanes()

bool FMinimalViewInfo::AutoCalculateOrthoPlanes ( FSceneViewProjectionData InOutProjectionData)

Automatically calculates the Near/Far plane values for an Ortho camera

The CosAngle is the cosine of the angle between the ViewForward and camera down. Forcing the absolute value for this means that Up/Down is 1.0f and Forward (90 degrees) is 0. We use this to scale the Near Plane, and the far plane if 16 bit scaling is disabled.

We still max out at UE_OLD_WORLD_MAX or Max32FP, but we scale the FarPlane depending on ratio of the pixel size to the world unit size. Details below, but the reasoning is, we can't visibly see smaller than a pixel, so the passes that need 16bit buffers such as HZB have their plane distances scaled automatically depending on this ratio.

Default path if the 16bit scaling depth is disabled or not usable. Note: this path does not scale for 16 bit buffers, it only calculates Near/Far plane min/max automatically

The camera arm length is adjusted depending on the CosAngle as the horizontal view typically has a significantly larger plane range, so it becomes irrelevant, whereas it is necessary to account for in a top down view. Note: a small scene camera arm length will become irrelevant for a large ortho width.

The NearPlane calculation is a scaled OrthoHeight depending on the camera angle, which maxes out at 45 degrees by default as this captures the entire scene for the majority of angles. r.Ortho.AutoPlanes.ShiftPlanes should be used to account for views outside of this.

The FarPlane is the required depth precision interpretation for the UnitPerPixelRatio. We clamp this to remove the Near plane difference, and also max out at the previously set maximum FPValue. This setup should help for possible future implementations where we can increase the depth range (i.e. LWC + double float depth buffers).

◆ BlendViewInfo()

void FMinimalViewInfo::BlendViewInfo ( FMinimalViewInfo OtherInfo,
float  OtherWeight 
)

◆ CalculateFirstPersonFOVCorrectionFactor()

float FMinimalViewInfo::CalculateFirstPersonFOVCorrectionFactor ( ) const

Correction factor to apply to the first person transform used on primitives tagged as "IsFirstPerson" to achieve a first person specific field of view. It is computed as tan(SceneFOVRadians * 0.5) / tan(FirstPersonFOVRadians * 0.5).

◆ CalculateProjectionMatrix()

FMatrix FMinimalViewInfo::CalculateProjectionMatrix ( ) const

Calculates the projection matrix using this view info's aspect ratio (regardless of bConstrainAspectRatio)

◆ CalculateProjectionMatrixGivenView()

void FMinimalViewInfo::CalculateProjectionMatrixGivenView ( FMinimalViewInfo ViewInfo,
TEnumAsByte< enum EAspectRatioAxisConstraint AspectRatioAxisConstraint,
class FViewport Viewport,
struct FSceneViewProjectionData InOutProjectionData 
)
static

Calculates the projection matrix (and potentially a constrained view rectangle) given a FMinimalViewInfo and partially configured projection data (must have the view rect already set)

◆ CalculateProjectionMatrixGivenViewRectangle()

void FMinimalViewInfo::CalculateProjectionMatrixGivenViewRectangle ( FMinimalViewInfo ViewInfo,
TEnumAsByte< enum EAspectRatioAxisConstraint AspectRatioAxisConstraint,
const FIntRect ConstrainedViewRectangle,
FSceneViewProjectionData InOutProjectionData 
)
static

Calculates the projection matrix (and potentially a constrained view rectangle) given a FMinimalViewInfo and partially configured projection data (must have the view rect already set). ConstrainedViewRectangle is only used if the ViewInfo.bConstrainAspectRatio is set.

◆ ClearOverscan()

void FMinimalViewInfo::ClearOverscan ( )

Removes all overscan (uniform and asymmetric) from the view info.

◆ Equals()

bool FMinimalViewInfo::Equals ( const FMinimalViewInfo OtherInfo) const

◆ GetFinalPerspectiveNearClipPlane()

float FMinimalViewInfo::GetFinalPerspectiveNearClipPlane ( ) const
inline

The near plane distance of the perspective view (in world units). Returns the value of PerspectiveNearClipPlane if positive, and GNearClippingPlane otherwise

◆ GetOverscan()

float FMinimalViewInfo::GetOverscan ( ) const
inline

Gets the total amount of overscan that has been applied to the view's frustum, with 0.0 meaning no overscan and 1.0 meaning 100% overscan

◆ SetCameraToViewTarget()

void FMinimalViewInfo::SetCameraToViewTarget ( const FVector  ActorLocation)
inline

Sets the camera distance from view target for AutoCalculateOrthoPlanes

◆ TransformWorldToFirstPerson()

FVector FMinimalViewInfo::TransformWorldToFirstPerson ( const FVector WorldPosition,
bool  bIgnoreFirstPersonScale 
) const

Transforms a world space location into "first person space". This function mirrors the morphing that is applied to first person primitives when they are rendered on the GPU, so it can be used for spawning objects (e.g. projectiles or ejected shell casings) relative to the morphed first person geometry on screen. Setting bIgnoreFirstPersonScale to true only applies the field of view morphing and is useful for cases where a full size projectile is spawned in front of the first person weapon. By ignoring the first person scale for the spawn location, the spawned full-size projectile will be spawned a bit further away from the camera, but its on-screen size will look correct.

Member Data Documentation

◆ AspectRatio

float FMinimalViewInfo::AspectRatio

◆ AspectRatioAxisConstraint

TOptional<EAspectRatioAxisConstraint> FMinimalViewInfo::AspectRatioAxisConstraint

◆ AsymmetricCropFraction

FVector4f FMinimalViewInfo::AsymmetricCropFraction

Experimental: The fraction for each edge between 0.0 and 1.0 of the view to crop to during the final post process upscale, with 1.0 meaning no crop. By convention, X is the left edge, Y is the right edge, Z is the top edge, and W is the bottom edge. Stacks with uniform CropFraction.

◆ AutoPlaneShift

float FMinimalViewInfo::AutoPlaneShift

Manually adjusts the planes of this camera, maintaining the distance between them. Positive moves out to the farplane, negative towards the near plane

◆ bAutoCalculateOrthoPlanes

bool FMinimalViewInfo::bAutoCalculateOrthoPlanes

Option for the Ortho camera to automatically calculated the near/far plane

◆ bConstrainAspectRatio

uint32 FMinimalViewInfo::bConstrainAspectRatio

◆ bUpdateOrthoPlanes

bool FMinimalViewInfo::bUpdateOrthoPlanes

Adjusts the near/far planes and the view origin of the current camera automatically to avoid clipping and light artefacting

◆ bUseCameraHeightAsViewTarget

bool FMinimalViewInfo::bUseCameraHeightAsViewTarget

If UpdateOrthoPlanes is enabled, this setting will use the cameras current height to compensate the distance to the general view (as a pseudo distance to view target when one isn't present)

◆ bUseFieldOfViewForLOD

uint32 FMinimalViewInfo::bUseFieldOfViewForLOD

◆ bUseFirstPersonParameters

uint32 FMinimalViewInfo::bUseFirstPersonParameters

◆ CropFraction

float FMinimalViewInfo::CropFraction

The fraction between 0.0 and 1.0 of the view to crop to during the final post process upscale, with 1.0 meaning no crop

◆ DesiredFOV

float FMinimalViewInfo::DesiredFOV

The originally desired horizontal field of view before any adjustments to account for different aspect ratios

◆ FirstPersonFOV

float FMinimalViewInfo::FirstPersonFOV

The horizontal field of view (in degrees) used for primitives tagged as "IsFirstPerson".

◆ FirstPersonScale

float FMinimalViewInfo::FirstPersonScale

The scale to apply to primitives tagged as "IsFirstPerson". This is used to scale down primitives towards the camera such that they are small enough not to intersect with the scene.

◆ FOV

float FMinimalViewInfo::FOV

The horizontal field of view (in degrees) in perspective mode (ignored in orthographic mode).

◆ Location

FVector FMinimalViewInfo::Location

Location

◆ OffCenterProjectionOffset

FVector2D FMinimalViewInfo::OffCenterProjectionOffset

Off-axis / off-center projection offset as proportion of screen dimensions

◆ OrthoFarClipPlane

float FMinimalViewInfo::OrthoFarClipPlane

The far plane distance of the orthographic view (in world units)

◆ OrthoNearClipPlane

float FMinimalViewInfo::OrthoNearClipPlane

The near plane distance of the orthographic view (in world units)

◆ OrthoWidth

float FMinimalViewInfo::OrthoWidth

The desired width (in world units) of the orthographic view (ignored in Perspective mode)

◆ OverscanResolutionFraction

float FMinimalViewInfo::OverscanResolutionFraction

Resolution fraction that scales with the amount of overscan added to the view

◆ PerspectiveNearClipPlane

float FMinimalViewInfo::PerspectiveNearClipPlane

The near plane distance of the perspective view (in world units). Set to a negative value to use the default global value of GNearClippingPlane

◆ PostProcessBlendWeight

float FMinimalViewInfo::PostProcessBlendWeight

Indicates if PostProcessSettings should be applied.

◆ PostProcessSettings

struct FPostProcessSettings FMinimalViewInfo::PostProcessSettings

Post-process settings to use if PostProcessBlendWeight is non-zero.

◆ PreviousViewTransform

TOptional<FTransform> FMinimalViewInfo::PreviousViewTransform

Optional transform to be considered as this view's previous transform

◆ ProjectionMode

TEnumAsByte<ECameraProjectionMode::Type> FMinimalViewInfo::ProjectionMode

◆ Rotation

FRotator FMinimalViewInfo::Rotation

Rotation


The documentation for this struct was generated from the following files: