engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 所有成员列表
FSceneView类 参考

A projection from scene space into a 2D screen region. 更多...

#include <SceneView.h>

Public 成员函数

void ConfigureBufferVisualizationSettings ()
 Configure post process settings for the buffer visualization system
 
void ConfigureVisualizeCalibrationSettings ()
 Configure post process settings for calibration material
 
FVector Deproject (const FPlane &ScreenPoint) const
 Transforms a point from the view's screen-space into world coordinates multiplies X, Y, Z by W before transforming.
 
void DeprojectFVector2D (const FVector2D &ScreenPos, FVector &out_WorldOrigin, FVector &out_WorldDirection) const
 Transforms 2D screen coordinates into a 3D world-space origin and direction 更多...
 
void EndFinalPostprocessSettings (const FSceneViewInitOptions &ViewInitOptions)
 applied global restrictions from show flags
 
 FSceneView (const FSceneViewInitOptions &InitOptions)
 Initialization constructor.
 
const FExposureBufferData * GetEyeAdaptationBuffer () const
 Returns the eye adaptation buffer (mobile) or null if it doesn't exist.
 
IPooledRenderTarget * GetEyeAdaptationTexture () const
 Returns the eye adaptation texture (SM5+ only) or null if it doesn't exist.
 
ERHIFeatureLevel::Type GetFeatureLevel () const
 Get the feature level for this view (cached from the scene so this is not different per view)
 
uint32 GetOcclusionFrameCounter () const
 returns a the occlusion frame counter or MAX_uint32 if there is no view state
 
EShaderPlatform GetShaderPlatform () const
 Get the feature level for this view
 
FVector GetTemporalLODOrigin (int32 Index, bool bUseLaggedLODTransition=true) const
 Returns the location used as the origin for LOD computations 更多...
 
float GetTemporalLODTransition () const
 Returns the blend factor between the last two LOD samples
 
uint32 GetViewKey () const
 returns a unique key for the view state if one exists, otherwise returns zero
 
bool HasValidEyeAdaptationTexture () const
 Tells if the eye adaptation texture / buffer exists without attempting to allocate it.
 
bool IsInstancedStereoPass () const
 True if the view should render as an instanced stereo pass
 
bool IsPerspectiveProjection () const
 
void OverridePostProcessSettings (const FPostProcessSettings &Src, float Weight)
 custom layers can be combined with the existing settings 更多...
 
FVector4 PixelToScreen (float X, float Y, float Z) const
 Transforms a point from pixel coordinates relative to the view's X,Y (left, top) into the view's screen-space.
 
FVector4 PixelToWorld (float X, float Y, float Z) const
 Transforms a point from pixel coordinates relative to the view's X,Y (left, top) into the view's world-space.
 
FPlane Project (const FVector &WorldPoint) const
 Transforms a point from the view's world-space into the view's screen-space. 更多...
 
bool ScreenToPixel (const FVector4 &ScreenPoint, FVector2D &OutPixelLocation) const
 Transforms a point from the view's screen-space into pixel coordinates relative to the view's X,Y.
 
FVector ScreenToWorld (const FVector4 &ScreenPoint) const
 Transforms a point from the view's screen-space to world-space.
 
void 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. 更多...
 
void 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
 
void StartFinalPostprocessSettings (FVector InViewLocation)
 Setup defaults and depending on view position (postprocess volumes)
 
void 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 UpdateViewMatrix ()
 Allow things like HMD displays to update the view matrix at the last minute, to minimize perceived latency
 
bool WorldToPixel (const FVector &WorldPoint, FVector2D &OutPixelLocation) const
 Transforms a point from the view's world-space into pixel coordinates relative to the view's X,Y (left, top).
 
FVector4 WorldToScreen (const FVector &WorldPoint) const
 Transforms a point from world-space to the view's screen-space.
 

静态 Public 成员函数

static void DeprojectScreenToWorld (const FVector2D &ScreenPos, const FIntRect &ViewRect, const FMatrix &InvViewMatrix, const FMatrix &InvProjMatrix, FVector &out_WorldOrigin, FVector &out_WorldDirection)
 Transforms 2D screen coordinates into a 3D world-space origin and direction 更多...
 
static void DeprojectScreenToWorld (const FVector2D &ScreenPos, const FIntRect &ViewRect, const FMatrix &InvViewProjMatrix, FVector &out_WorldOrigin, FVector &out_WorldDirection)
 Overload to take a single combined view projection matrix.
 
static bool ProjectWorldToScreen (const FVector &WorldPosition, const FIntRect &ViewRect, const FMatrix &ViewProjectionMatrix, FVector2D &out_ScreenPos)
 Transforms 3D world-space origin into 2D screen coordinates 更多...
 

Public 属性

FTextureRHIRef AtmosphereTransmittanceTexture
 Parameters for atmospheric fog.
 
bool bAllowCrossGPUTransfer
 Allow cross GPU transfer for this view
 
bool bCameraCut
 Whether we did a camera cut for this view this frame.
 
bool bForceCameraVisibilityReset
 True if we need to force the camera to discard previous frames occlusion. 更多...
 
bool bIsGameView
 True if this scene was created from a game world.
 
bool bIsInstancedStereoEnabled
 True if instanced stereo is enabled.
 
bool bIsLocked
 Whether this view was created from a locked viewpoint.
 
bool bIsMobileMultiViewEnabled
 True if mobile multi-view is enabled.
 
bool bIsMultiViewEnabled
 True if multi-view is enabled.
 
bool bIsOfflineRender
 Whether this view is being used to render a high quality offline render
 
bool bIsPlanarReflection
 Whether this view is being used to render a planar reflection.
 
bool bIsReflectionCapture
 Whether this view is being used to render a reflection capture.
 
bool bIsSceneCapture
 Whether this view is being used to render a scene capture.
 
bool bIsViewInfo
 For sanity checking casts that are assumed to be safe.
 
bool bIsVirtualTexture
 Whether this view is being used to render a runtime virtual texture.
 
bool bOverrideGPUMask
 Use custom GPUmask
 
bool bRenderFirstInstanceOnly
 Whether this view should render the first instance only of any meshes using instancing.
 
bool bRenderSceneTwoSided
 Whether to force two sided rendering for this view.
 
bool bReverseCulling
 true if ViewMatrix.Determinant() is negative.
 
bool bSceneCaptureUsesRayTracing
 Whether this view uses ray tracing, for views that are used to render a scene capture.
 
bool bShouldBindInstancedViewUB
 True if we need to bind the instanced view uniform buffer parameters.
 
bool bStaticSceneOnly
 Whether to only render static lights and objects. 更多...
 
FIntRect CameraConstrainedViewRect
 Aspect ratio constrained view rect. 更多...
 
FLinearColor ColorScale
 Color scale multiplier used during post processing
 
FName CurrentBufferVisualizationMode
 Current buffer visualization mode
 
FName CurrentVisualizeCalibrationColorMaterialName
 Current visualize calibration color material name
 
FName CurrentVisualizeCalibrationCustomMaterialName
 Current visualize calibration custom material name
 
FName CurrentVisualizeCalibrationGrayscaleMaterialName
 Current visualize calibration grayscale material name
 
FVector4 DiffuseOverrideParameter
 These can be used to override material parameters across the scene without recompiling shaders. 更多...
 
FViewElementDrawer * Drawer
 An interaction which draws the view's interaction elements.
 
const ERHIFeatureLevel::Type FeatureLevel
 Feature level for this scene
 
FFinalPostProcessSettings FinalPostProcessSettings
 The final settings for the current viewer position (blended together from many volumes). 更多...
 
FForwardLightingViewResources * ForwardLightingResources
 Points to the view state's resources if a view state exists.
 
float FOV
 Actual field of view and that desired by the camera originally
 
FPlane GlobalClippingPlane
 Global clipping plane being applied to the scene, or all 0's if disabled. 更多...
 
FRHIGPUMask GPUMask
 The GPU nodes on which to render this view.
 
TSet< FPrimitiveComponentId > HiddenPrimitives
 The primitives which are hidden for this view.
 
FVector4 LensPrincipalPointOffsetScale
 In some cases, the principal point of the lens is not at the center of the screen, especially for overlapped tile rendering. 更多...
 
float LODDistanceFactor
 Multiplier for cull distance on objects
 
float MaterialTextureMipBias
 Mip bias to apply in material's samplers.
 
int32 MaxShadowCascades
 Maximum number of shadow cascades to render with.
 
TUniformBufferRef< FMobileDirectionalLightShaderParameters > MobileDirectionalLightUniformBuffers [NUM_LIGHTING_CHANNELS+1]
 Mobile Directional Lighting uniform buffers, one for each lighting channel The first is used for primitives with no lighting channels set. 更多...
 
FVector OriginOffsetThisFrame
 World origin offset value. 更多...
 
TOptional< uint32 > OverrideFrameIndexValue
 The frame index to override, useful for keeping determinism when rendering sequences.
 
int32 PlayerIndex
 Player index this view is associated with or INDEX_NONE.
 
TOptional< TSet< FPrimitiveComponentId > > ShowOnlyPrimitives
 The primitives which are visible for this view. 更多...
 
FSceneViewStateInterface * State
 can be 0 (thumbnail rendering)
 
float StereoIPD
 Half of the view's stereo IPD (- for lhs, + for rhs)
 
EStereoscopicPass StereoPass
 For stereoscopic rendering, whether or not this is a full pass, or a left / right eye pass
 
FVector TranslucentSortAxis
 Sort axis for when TranslucentSortPolicy is SortAlongAxis
 
TEnumAsByte< ETranslucentSortPolicy::Type > TranslucentSortPolicy
 Translucent sort mode
 
float UnderwaterDepth
 How far below the water surface this view is. 更多...
 
const AActor * ViewActor
 The actor which is being viewed from.
 
FVector ViewLocation
 Variables used to determine the view matrix
 
TUniformBufferRef< FViewUniformShaderParameters > ViewUniformBuffer
 The uniform buffer for the view's parameters. 更多...
 
FShaderResourceViewRHIRef WaterIndirectionBuffer
 Water rendering related data
 

详细描述

A projection from scene space into a 2D screen region.

成员函数说明

◆ DeprojectFVector2D()

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

◆ DeprojectScreenToWorld()

static void FSceneView::DeprojectScreenToWorld ( const FVector2D &  ScreenPos,
const FIntRect &  ViewRect,
const FMatrix &  InvViewMatrix,
const FMatrix &  InvProjMatrix,
FVector &  out_WorldOrigin,
FVector &  out_WorldDirection 
)
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

◆ GetTemporalLODOrigin()

FVector FSceneView::GetTemporalLODOrigin ( int32  Index,
bool  bUseLaggedLODTransition = true 
) const

Returns the location used as the origin for LOD computations

参数
Index,0or 1, which LOD origin to return
返回
LOD origin

◆ IsPerspectiveProjection()

bool FSceneView::IsPerspectiveProjection ( ) const
inline
返回
true:perspective, false:orthographic

◆ OverridePostProcessSettings()

void FSceneView::OverridePostProcessSettings ( const FPostProcessSettings &  Src,
float  Weight 
)

custom layers can be combined with the existing settings

参数
Weightusually 0..1 but outside range is clamped

◆ Project()

FPlane FSceneView::Project ( const FVector &  WorldPoint) const

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.

◆ ProjectWorldToScreen()

static bool FSceneView::ProjectWorldToScreen ( const FVector &  WorldPosition,
const FIntRect &  ViewRect,
const FMatrix &  ViewProjectionMatrix,
FVector2D &  out_ScreenPos 
)
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

◆ SetupCommonViewUniformBufferParameters()

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)

类成员变量说明

◆ bForceCameraVisibilityReset

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.

◆ bStaticSceneOnly

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.

◆ CameraConstrainedViewRect

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.

◆ DiffuseOverrideParameter

FVector4 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.

◆ FinalPostProcessSettings

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.

◆ GlobalClippingPlane

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.

◆ LensPrincipalPointOffsetScale

FVector4 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.

◆ MobileDirectionalLightUniformBuffers

TUniformBufferRef<FMobileDirectionalLightShaderParameters> FSceneView::MobileDirectionalLightUniformBuffers[NUM_LIGHTING_CHANNELS+1]

Mobile Directional Lighting uniform buffers, one for each lighting channel The first is used for primitives with no lighting channels set.

Only initialized in the rendering thread's copies of the FSceneView.

◆ OriginOffsetThisFrame

FVector FSceneView::OriginOffsetThisFrame

World origin offset value.

Non-zero only for a single frame when origin is rebased

◆ ShowOnlyPrimitives

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.

◆ UnderwaterDepth

float FSceneView::UnderwaterDepth

How far below the water surface this view is.

-1 means the view is out of water.

◆ ViewUniformBuffer

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.


该类的文档由以下文件生成: