![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SceneView.h>
Inheritance diagram for FSceneView:Classes | |
| struct | FWaterInfoTextureRenderingParams |
Static Public Member Functions | |
| static ENGINE_API void | DeprojectScreenToWorld (const FVector2D &ScreenPos, const FIntRect &ViewRect, const FMatrix &InvViewMatrix, const FMatrix &InvProjMatrix, FVector &out_WorldOrigin, FVector &out_WorldDirection) |
| static ENGINE_API void | DeprojectScreenToWorld (const FVector2D &ScreenPos, const FIntRect &ViewRect, const FMatrix &InvViewProjMatrix, FVector &out_WorldOrigin, FVector &out_WorldDirection) |
| static ENGINE_API bool | ProjectWorldToScreen (const FVector &WorldPosition, const FIntRect &ViewRect, const FMatrix &ViewProjectionMatrix, FVector2D &out_ScreenPos, bool bShouldCalcOutsideViewPosition=false) |
| static ENGINE_API FVector4f | GetScreenPositionScaleBias (const FIntPoint &BufferSize, const FIntRect &ViewRect) |
Protected Attributes | |
| const FSceneView * | SnapshotOriginView = nullptr |
| FSceneViewStateInterface * | EyeAdaptationViewState = nullptr |
| TUniformBufferRef< FInstancedViewUniformShaderParameters > | InstancedViewUniformBuffer |
Friends | |
| class | FSceneRenderer |
| class | FViewSnapshotCache |
A projection from scene space into a 2D screen region.
| FSceneView::FSceneView | ( | const FSceneViewInitOptions & | InitOptions | ) |
Initialization constructor.
|
default |
These are only needed because of deprecated members being accessed in them
|
default |
|
virtualdefault |
Default destructor
|
inline |
| void FSceneView::ConfigureBufferVisualizationSettings | ( | ) |
Configure post process settings for the buffer visualization system
| void FSceneView::ConfigureVisualizeCalibrationSettings | ( | ) |
Configure post process settings for calibration material
Transforms a cursor location in render target pixel coordinates into the view's screen-space, taking into account the viewport rectangle.
Transforms a point from the view's screen-space into world coordinates multiplies X, Y, Z by W before transforming.
| void FSceneView::DeprojectFVector2D | ( | const FVector2D & | ScreenPos, |
| FVector & | out_WorldOrigin, | ||
| FVector & | out_WorldDirection | ||
| ) | const |
Transforms 2D screen coordinates into a 3D world-space origin and direction
| ScreenPos | - screen coordinates in pixels |
| out_WorldOrigin | (out) - world-space origin vector |
| out_WorldDirection | (out) - world-space direction vector |
|
static |
Transforms 2D screen coordinates into a 3D world-space origin and direction
| ScreenPos | - screen coordinates in pixels |
| ViewRect | - view rectangle |
| InvViewMatrix | - inverse view matrix |
| InvProjMatrix | - inverse projection matrix |
| out_WorldOrigin | (out) - world-space origin vector |
| out_WorldDirection | (out) - world-space direction vector |
|
static |
Overload to take a single combined view projection matrix.
| void FSceneView::EndFinalPostprocessSettings | ( | const FSceneViewInitOptions & | ViewInitOptions | ) |
applied global restrictions from show flags
|
inline |
| uint32 FSceneView::GetDistanceFieldTemporalSampleIndex | ( | ) | const |
returns the distance field temporal sample index or 0 if there is no view state
|
inline |
| FRDGPooledBuffer * FSceneView::GetEyeAdaptationBuffer | ( | ) | const |
Returns the eye adaptation buffer or null if it doesn't exist.
|
inline |
Get the feature level for this view (cached from the scene so this is not different per view)
| const FSceneView * FSceneView::GetInstancedSceneView | ( | ) | const |
Get the first secondary view associated with the primary view.
|
inline |
Returns uniform buffer that is used to access (first) instanced view's properties. Note: it is not the same as that view's ViewUniformBuffer, albeit it contains all relevant data from it.
| float FSceneView::GetLastAverageSceneLuminance | ( | ) | const |
Returns the average luminance or 0.0f if it doesn't exist.
Returns the eye adaptation luminance or 0.0f if it doesn't exist.
| float FSceneView::GetLastEyeAdaptationExposure | ( | ) | const |
Returns the eye adaptation exposure or 0.0f if it doesn't exist.
| uint32 FSceneView::GetOcclusionFrameCounter | ( | ) | const |
returns a the occlusion frame counter or MAX_uint32 if there is no view state
|
inline |
Returns the load action to use when overwriting all pixels of a target that you intend to read from. Takes into account the HMD hidden area mesh.
|
inline |
| const FSceneView * FSceneView::GetPrimarySceneView | ( | ) | const |
Get the primary view associated with the secondary view.
|
static |
| TArray< const FSceneView * > FSceneView::GetSecondaryViews | ( | ) | const |
Get all secondary views associated with the primary view.
| EShaderPlatform FSceneView::GetShaderPlatform | ( | ) | const |
Get the feature level for this view
| const FViewMatrices & FSceneView::GetShadowViewMatrices | ( | ) | const |
|
inline |
|
inline |
Instance factor for a stereo pass (normally 2 for ISR views, but see IStereoRendering::GetDesiredNumberOfViews()). Returns 1 for non-instanced stereo views or regular (split screen etc) views.
Returns the location used as the origin for LOD computations
| Index,0 | or 1, which LOD origin to return |
| float FSceneView::GetTemporalLODTransition | ( | ) | const |
Returns the blend factor between the last two LOD samples
|
inline |
| uint32 FSceneView::GetViewKey | ( | ) | const |
returns a unique key for the view state if one exists, otherwise returns zero
|
inline |
|
inline |
|
inline |
| bool FSceneView::HasValidEyeAdaptationBuffer | ( | ) | const |
Tells if the eye adaptation buffer exists without attempting to allocate it.
|
inline |
Checks whether this is the instanced view of a stereo pair. If the technique supports instanced rendering stereo and ISR is enabled, such views can be skipped.
| bool FSceneView::IsInstancedStereoPass | ( | ) | const |
True if the view should render as an instanced stereo pass
|
inline |
|
inline |
Checks whether this is the primary view of a stereo pair (important in instanced stereo rendering). Will also be true for any view that isn't stereo.
|
inline |
|
inline |
| void FSceneView::OverridePostProcessSettings | ( | const FPostProcessSettings & | Src, |
| float | Weight | ||
| ) |
custom layers can be combined with the existing settings
| Weight | usually 0..1 but outside range is clamped |
Transforms a point from pixel coordinates relative to the view's X,Y (left, top) into the view's screen-space.
Transforms a point from pixel coordinates relative to the view's X,Y (left, top) into the view's world-space.
Transforms a point from the view's world-space into the view's screen-space. Divides the resulting X, Y, Z by W before returning.
|
static |
Transforms 3D world-space origin into 2D screen coordinates
| WorldPosition | - the 3d world point to transform |
| ViewRect | - view rectangle |
| ViewProjectionMatrix | - combined view projection matrix |
| out_ScreenPos | (out) - screen coordinates in pixels |
| bShouldCalcOutsideViewPosition | - if enabled, calculates the out_ScreenPos if the WorldPosition is outside of ViewProjectionMatrix |
Transforms a point from the view's screen-space into pixel coordinates relative to the view's X,Y.
Transforms a point from the view's screen-space to world-space.
|
inline |
| void FSceneView::SetupAntiAliasingMethod | ( | ) |
| void FSceneView::SetupCommonViewUniformBufferParameters | ( | FViewUniformShaderParameters & | ViewUniformShaderParameters, |
| const FIntPoint & | InBufferSize, | ||
| int32 | NumMSAASamples, | ||
| const FIntRect & | InEffectiveViewRect, | ||
| const FViewMatrices & | InViewMatrices, | ||
| const FViewMatrices & | InPrevViewMatrices | ||
| ) | const |
Populates the uniform buffer prameters common to all scene view use cases View parameters should be set up in this method if they are required for the view to render properly. This is to avoid code duplication and uninitialized parameters in other places that create view uniform parameters (e.g Slate)
| void FSceneView::SetupViewRectUniformBufferParameters | ( | FViewUniformShaderParameters & | ViewUniformShaderParameters, |
| const FIntPoint & | InBufferSize, | ||
| const FIntRect & | InEffectiveViewRect, | ||
| const FViewMatrices & | InViewMatrices, | ||
| const FViewMatrices & | InPrevViewMatrice | ||
| ) | const |
Sets up the view rect parameters in the view's uniform shader parameters
Setup defaults and depending on view position (postprocess volumes)
| void FSceneView::UpdatePlanarReflectionViewMatrix | ( | const FSceneView & | SourceView, |
| const FMirrorMatrix & | MirrorMatrix | ||
| ) |
If we late update a view, we need to also late update any planar reflection views derived from it
| void FSceneView::UpdateViewMatrix | ( | ) |
Allow things like HMD displays to update the view matrix at the last minute, to minimize perceived latency
Transforms a point from the view's world-space into pixel coordinates relative to the view's X,Y (left, top).
Transforms a point from the view's world-space into pixel coordinates relative to the view's X,Y.
Transforms a point from world-space to the view's screen-space.
|
friend |
|
friend |
| FVector2f FSceneView::AmbientOcclusionOverrideParameter |
| EAntiAliasingMethod FSceneView::AntiAliasingMethod |
| UE::StereoRenderUtils::FStereoShaderAspects FSceneView::Aspects |
Stereo aspects of the shader pipeline based on this view's shader platform
| FTextureRHIRef FSceneView::AtmosphereInscatterTexture |
| FTextureRHIRef FSceneView::AtmosphereIrradianceTexture |
| FTextureRHIRef FSceneView::AtmosphereTransmittanceTexture |
Parameters for atmospheric fog.
| FLinearColor FSceneView::BackgroundColor |
| bool FSceneView::bAllowCrossGPUTransfer |
Allow cross GPU transfer for this view
Set to false to disable ray tracing on this view. Use IsRayTracingAllowedForView() function to test for ray tracing, not this bool.
| bool FSceneView::bAllowTemporalJitter |
| FVector FSceneView::BaseHmdLocation |
| FQuat FSceneView::BaseHmdOrientation |
| bool FSceneView::bCameraCut |
Whether we did a camera cut for this view this frame.
Whether to enable motion blur caused by camera movements
| bool FSceneView::bDisableDistanceBasedFadeTransitions |
Whether we should disable distance-based fade transitions for this frame (usually after a large camera movement.)
Enables a CoC offset whose offset value changes with pixel's scene depth
Whether this view should be excluded from extent history tracking.
| bool FSceneView::bEyeAdaptationAllViewPixels |
Whether to generate histogram eye adaptation from all view pixels, useful with a shared EyeAdaptationViewState. Pixels for views must form a contiguous rect.
| bool FSceneView::bForceCameraVisibilityReset |
True if we need to force the camera to discard previous frames occlusion. Necessary for overlapped tile rendering where we discard previous frame occlusion because the projection matrix changes.
| bool FSceneView::bForcePathTracerReset |
True if we should force the path tracer to reset its internal accumulation state
| bool FSceneView::bHasNearClippingPlane |
| bool FSceneView::bIsGameView |
True if this scene was created from a game world.
| bool FSceneView::bIsInstancedStereoEnabled |
True if instanced stereo is enabled.
| bool FSceneView::bIsLocked |
Whether this view was created from a locked viewpoint.
| bool FSceneView::bIsMobileMultiViewEnabled |
True if mobile multi-view is enabled.
| bool FSceneView::bIsMultiViewportEnabled |
True if multi-viewport instanced stereo rendering is enabled.
| bool FSceneView::bIsOfflineRender |
Whether this view is being used to render a high quality offline render
| bool FSceneView::bIsPlanarReflection |
Whether this view is being used to render a planar reflection.
| bool FSceneView::bIsReflectionCapture |
Whether this view is being used to render a reflection capture.
| bool FSceneView::bIsSceneCapture |
Whether this view is being used to render a scene capture.
| bool FSceneView::bIsSceneCaptureCube |
Whether the scene capture is a cube map (bIsSceneCapture will also be set).
| bool FSceneView::bIsSinglePassStereo |
True if any single-pass stereo mechanism is enabled (mobile multi view, instanced stereo multi-layer, or instanced stereo multi-viewport). Not related to the deprecated NVidia feature known as Single-Pass Stereo.
| bool FSceneView::bIsViewInfo |
For sanity checking casts that are assumed to be safe.
| bool FSceneView::bIsVirtualTexture |
Whether this view is being used to render a runtime virtual texture.
| bool FSceneView::bOverrideGPUMask |
Use custom GPUmask
| bool FSceneView::bRenderFirstInstanceOnly |
Whether this view should render the first instance only of any meshes using instancing.
| bool FSceneView::bRenderSceneTwoSided |
Whether to force two sided rendering for this view.
| bool FSceneView::bReverseCulling |
true if ViewMatrix.Determinant() is negative.
| bool FSceneView::bSceneCaptureUsesRayTracing |
Whether this view may use ray tracing, for views that are used to render a scene capture. Use IsRayTracingAllowedForView() to test for ray tracing, not this bool. Filled in based on the bUseRayTracingIfEnabled field in the scene capture component and r.RayTracing.SceneCaptures CVar (-1 == use value from component, 0 == disable globally, 1 == enable globally).
| bool FSceneView::bShouldBindInstancedViewUB |
True if we need to bind the instanced view uniform buffer parameters.
| bool FSceneView::bStaticSceneOnly |
Whether to only render static lights and objects.
This is used when capturing the scene for reflection captures, which aren't updated at runtime.
| bool FSceneView::bUseFieldOfViewForLOD |
| FIntRect FSceneView::CameraConstrainedViewRect |
Aspect ratio constrained view rect. In the editor, when attached to a camera actor and the camera black bar showflag is enabled, the normal viewrect remains as the full viewport, and the black bars are just simulated by drawing black bars. This member stores the effective constrained area within the bars.
Matrix overrides PrevViewToClip in the view uniform buffer. Used for replacing motion blur caused by the current camera movements with a custom transform.
| FLinearColor FSceneView::ColorScale |
Color scale multiplier used during post processing
| uint8 FSceneView::CullingFrustum |
| FVector FSceneView::CullingOrigin |
Monoscopic culling origin, same as the view matrix origin in case of non-stereo
| FName FSceneView::CurrentBufferVisualizationMode |
Current buffer visualization mode
| FName FSceneView::CurrentGPUSkinCacheVisualizationMode |
Current GPU Skin Cache visualization mode
| FName FSceneView::CurrentGroomVisualizationMode |
Current Groom visualization mode
| FName FSceneView::CurrentRayTracingDebugVisualizationMode |
Current ray tracing debug visualization mode
| FName FSceneView::CurrentVirtualShadowMapVisualizationMode |
Current Virtual Shadow Map visualization mode
| FName FSceneView::CurrentVirtualTextureVisualizationMode |
Current Virtual Texture visualization mode
| FName FSceneView::CurrentVisualizeCalibrationColorMaterialName |
Current visualize calibration color material name
| FName FSceneView::CurrentVisualizeCalibrationCustomMaterialName |
Current visualize calibration custom material name
| FName FSceneView::CurrentVisualizeCalibrationGrayscaleMaterialName |
Current visualize calibration grayscale material name
| FIntPoint FSceneView::CursorPos |
| class FCustomRenderPassBase* FSceneView::CustomRenderPass = nullptr |
| float FSceneView::DesiredFOV |
| FVector4f FSceneView::DiffuseOverrideParameter |
These can be used to override material parameters across the scene without recompiling shaders. The last component is how much to include of the material's value for that parameter, so 0 will completely remove the material's value.
| EDrawDynamicFlags::Type FSceneView::DrawDynamicFlags |
| FViewElementDrawer* FSceneView::Drawer |
An interaction which draws the view's interaction elements.
| FTextureRHIRef FSceneView::DynamicCocOffsetLUT |
Lookup table for the dynamic CoC offset
|
protected |
| const FSceneViewFamily* FSceneView::Family |
| const ERHIFeatureLevel::Type FSceneView::FeatureLevel |
Feature level for this scene
| FFinalPostProcessSettings FSceneView::FinalPostProcessSettings |
The final settings for the current viewer position (blended together from many volumes). Setup by the main thread, passed to the render thread and never touched again by the main thread.
| float FSceneView::FOV |
Actual field of view and that desired by the camera originally
| FPlane FSceneView::GlobalClippingPlane |
Global clipping plane being applied to the scene, or all 0's if disabled. This is used when rendering the planar reflection pass.
| FRHIGPUMask FSceneView::GPUMask |
The GPU nodes on which to render this view.
| TSet<FPrimitiveComponentId> FSceneView::HiddenPrimitives |
The primitives which are hidden for this view.
| float FSceneView::InFocusDistance = 0.0 |
When dynamic CoC offset is enabled, this is the distance from camera at which objects will be in perfect focus (when the CoC offset is maximum so that the final CoC is 0)
|
protected |
Instanced view uniform buffer held on the primary view.
| uint32 FSceneView::InstanceFactor = 1 |
When using mobile multi view fallback path we need to instance draw calls ourselves to cover both eyes instead of letting the drivers do it for us.
| FVector4f FSceneView::InvDeviceZToWorldZTransform |
| FShaderResourceViewRHIRef FSceneView::LandscapeIndirectionBuffer |
Landscape rendering related data
| FShaderResourceViewRHIRef FSceneView::LandscapePerComponentDataBuffer |
| FVector4f FSceneView::LensPrincipalPointOffsetScale |
In some cases, the principal point of the lens is not at the center of the screen, especially for overlapped tile rendering. So given a UV in [-1,1] viewport space, convert it to the [-1,1] viewport space of the lens using LensUV = LensPrincipalPointOffsetScale.xy ScreenUV * LensPrincipalPointOffsetScale.zw; This value is FVector4(0,0,1,1) unless overridden.
| float FSceneView::LODDistanceFactor |
Multiplier for cull distance on objects
| float FSceneView::MaterialTextureMipBias |
Mip bias to apply in material's samplers.
| int32 FSceneView::MaxShadowCascades |
Maximum number of shadow cascades to render with.
| float FSceneView::NearClippingDistance |
| FPlane FSceneView::NearClippingPlane |
| FVector4f FSceneView::NormalOverrideParameter |
| FVector FSceneView::OriginOffsetThisFrame |
World origin offset value. Non-zero only for a single frame when origin is rebased
| FLinearColor FSceneView::OverlayColor |
The frame index to override, useful for keeping determinism when rendering sequences.
If set, overrides the Output Frame Index. Useful for Halton-like offsets that should produce the same results in multi-sample accumulation when rendering sequences. If unset, renderer defaults to FrameIndex.
| int32 FSceneView::PathTracerSeedOffset |
Sets an offset to the seed the path tracer is using.
| int32 FSceneView::PlayerIndex |
Player index this view is associated with or INDEX_NONE.
| TOptional<FTransform> FSceneView::PreviousViewTransform |
| EPrimaryScreenPercentageMethod FSceneView::PrimaryScreenPercentageMethod |
| int32 FSceneView::PrimaryViewIndex |
For stereoscopic rendering, view family index of the primary view associated with this view
| FMatrix FSceneView::ProjectionMatrixUnadjustedForRHI |
| FVector2f FSceneView::RoughnessOverrideParameter |
| FSceneViewInitOptions FSceneView::SceneViewInitOptions |
| uint8 FSceneView::ShadowViewMatrices |
| TOptional<TSet<FPrimitiveComponentId> > FSceneView::ShowOnlyPrimitives |
The primitives which are visible for this view. If the array is not empty, all other primitives will be hidden.
|
protected |
Some views get cloned for certain renders, like shadows (see FViewInfo::CreateSnapshot()). If that's the case, this will point to the view this one originates from
| FVector4f FSceneView::SpecularOverrideParameter |
| FSceneViewStateInterface* FSceneView::State |
can be 0 (thumbnail rendering)
| EStereoscopicPass FSceneView::StereoPass |
For stereoscopic rendering, whether or not this is a full pass, or a left / right eye pass
| int32 FSceneView::StereoViewIndex |
For stereoscopic rendering, unique index identifying the view across view families
| FVector FSceneView::TranslucentSortAxis |
Sort axis for when TranslucentSortPolicy is SortAlongAxis
| TEnumAsByte<ETranslucentSortPolicy::Type> FSceneView::TranslucentSortPolicy |
Translucent sort mode
| FIntRect FSceneView::UnconstrainedViewRect |
| float FSceneView::UnderwaterDepth |
How far below the water surface this view is. -1 means the view is out of water.
| const FIntRect FSceneView::UnscaledViewRect |
| FSceneViewOwner FSceneView::ViewActor |
The actor which is being viewed from.
| FConvexVolume FSceneView::ViewFrustum |
| uint8 FSceneView::ViewLightingChannelMask = FViewLightingChannels::GetMaskDefault() |
View light masking support. Some systems assume the same mask setting for all views within a family, with potential artifacts if views use different masks.
| FVector FSceneView::ViewLocation |
Variables used to determine the view matrix
| FViewMatrices FSceneView::ViewMatrices |
| FRotator FSceneView::ViewRotation |
| TUniformBufferRef<FViewUniformShaderParameters> FSceneView::ViewUniformBuffer |
The uniform buffer for the view's parameters. This is only initialized in the rendering thread's copies of the FSceneView.
| FShaderResourceViewRHIRef FSceneView::WaterDataBuffer |
| FShaderResourceViewRHIRef FSceneView::WaterIndirectionBuffer |
Water rendering related data
| TArray<FWaterInfoTextureRenderingParams> FSceneView::WaterInfoTextureRenderingParams |
| int32 FSceneView::WaterInfoTextureViewIndex = INDEX_NONE |
Index of the water info texture slice corresponding to this view.
| EViewWaterIntersection FSceneView::WaterIntersection = EViewWaterIntersection::OutsideWater |
Whether the view intersects water.
| float FSceneView::WorldToMetersScale |