Search Results for

    Show / Hide Table of Contents

    Struct RenderView

    Rendering view description that defines how to render the objects (camera placement, rendering properties, etc.).

    Assembly: FlaxEngine.dll
    File: Engine/Graphics/RenderView.h
    Syntax
    public struct RenderView

    Constructors

    DEPRECATED()

    The model LOD bias. Default is 0. Applied to all the objects in the shadow maps render views. Can be used to improve shadows rendering performance or increase quality. [Deprecated on 26.10.2022, expires on 26.10.2024]

    Declaration
    public virtual DEPRECATED() int32 ShadowModelLODBias = 0

    RenderView(const RenderView& other)

    Declaration
    public RenderView(const RenderView& other) = default
    Parameters
    RenderView other

    RenderView(RenderView&& other)

    Declaration
    public RenderView(RenderView&& other) = default
    Parameters
    RenderView other

    Fields

    CullingFrustum

    The view frustum used for culling (can be different than Frustum in some cases e.g. cascaded shadow map rendering).

    Declaration
    public BoundingFrustum CullingFrustum
    Field Value
    BoundingFrustum

    Direction

    The direction of the view.

    Declaration
    public Float3 Direction
    Field Value
    Float3

    Far

    The far plane.

    Declaration
    public float Far = 10000.0f
    Field Value
    float

    Flags

    The view flags.

    Declaration
    public ViewFlags Flags = ViewFlags::DefaultGame
    Field Value
    ViewFlags

    Frustum

    The view frustum.

    Declaration
    public BoundingFrustum Frustum
    Field Value
    BoundingFrustum

    IP

    The inverted projection matrix.

    Declaration
    public Matrix IP
    Field Value
    Matrix

    IsCullingDisabled

    Flag used by custom passes to skip any object culling when drawing.

    Declaration
    public bool IsCullingDisabled = false
    Field Value
    bool

    IsOfflinePass

    Flag used by static, offline rendering passes (eg. reflections rendering, lightmap rendering etc.)

    Declaration
    public bool IsOfflinePass = false
    Field Value
    bool

    IsSingleFrame

    Flag used by single-frame rendering passes (eg. thumbnail rendering, model view caching) to reject LOD transitions animations and other temporal draw effects.

    Declaration
    public bool IsSingleFrame = false
    Field Value
    bool

    IsTaaResolved

    True if TAA has been resolved when rendering view and frame doesn't contain jitter anymore. Rendering geometry after this point should not use jitter anymore (eg. editor gizmos or custom geometry as overlay).

    Declaration
    public bool IsTaaResolved = false
    Field Value
    bool

    IV

    The inverted view matrix.

    Declaration
    public Matrix IV
    Field Value
    Matrix

    IVP

    The inverted projection view matrix.

    Declaration
    public Matrix IVP
    Field Value
    Matrix

    MainScreenSize

    The main viewport screen size packed (x - width, y - height, zw - inv width, w - inv height).

    Declaration
    public Float4 MainScreenSize
    Field Value
    Float4

    MainViewProjection

    The main viewport view * projection matrix.

    Declaration
    public Matrix MainViewProjection
    Field Value
    Matrix

    MaxShadowsQuality

    Maximum allowed shadows quality for this view

    Declaration
    public Quality MaxShadowsQuality = Quality::Ultra
    Field Value
    Quality

    Mode

    The view mode.

    Declaration
    public ViewMode Mode = ViewMode::Default
    Field Value
    ViewMode

    ModelLODBias

    The model LOD bias. Default is 0. Applied to all the objects in the render view.

    Declaration
    public int32 ModelLODBias = 0
    Field Value
    int32

    ModelLODDistanceFactor

    The model LOD distance scale factor. Default is 1. Applied to all the objects in the render view. Higher values increase LODs quality.

    Declaration
    public float ModelLODDistanceFactor = 1.0f
    Field Value
    float

    ModelLODDistanceFactorSqrt

    Square of ModelLODDistanceFactor. Cached by rendering backend.

    Declaration
    public float ModelLODDistanceFactorSqrt
    Field Value
    float

    Near

    The near plane.

    Declaration
    public float Near = 0.1f
    Field Value
    float

    NonJitteredProjection

    The projection matrix with no camera offset (no jittering). For many temporal image effects, the camera that is currently rendering needs to be slightly offset from the default projection (that is, the camera is ‘jittered’). If you use motion vectors and camera jittering together, use this property to keep the motion vectors stable between frames.

    Declaration
    public Matrix NonJitteredProjection
    Field Value
    Matrix

    Origin

    The position of the view origin (in world-units). Used for camera-relative rendering to achieve large worlds support with keeping 32-bit precision for coordinates in scene rendering.

    Declaration
    public Vector3 Origin = Vector3::Zero
    Field Value
    Vector3

    Pass

    The draw passes mask for the current view rendering.

    Declaration
    public DrawPass Pass = DrawPass::None
    Field Value
    DrawPass

    Position

    The position of the view (relative to the origin).

    Declaration
    public Float3 Position
    Field Value
    Float3

    PrevOrigin

    The previous frame rendering view origin.

    Declaration
    public Vector3 PrevOrigin
    Field Value
    Vector3

    PrevProjection

    The previous frame projection matrix.

    Declaration
    public Matrix PrevProjection
    Field Value
    Matrix

    PrevView

    The previous frame view matrix.

    Declaration
    public Matrix PrevView
    Field Value
    Matrix

    PrevViewProjection

    The previous frame view * projection matrix.

    Declaration
    public Matrix PrevViewProjection
    Field Value
    Matrix

    Projection

    The projection matrix.

    Declaration
    public Matrix Projection
    Field Value
    Matrix

    RenderLayersMask

    The rendering mask for layers. Used to exclude objects from rendering.

    Declaration
    public LayersMask RenderLayersMask
    Field Value
    LayersMask

    ScreenSize

    The screen size packed (x - width, y - height, zw - inv width, w - inv height). Cached before rendering.

    Declaration
    public Float4 ScreenSize
    Field Value
    Float4

    StaticFlagsCompare

    The static flags mask comparision rhs. Allows to draw objects that don't pass the static flags mask. Objects are checked with the following formula: (ObjectStaticFlags and StaticFlagsMask) == StaticFlagsMaskCompare.

    Declaration
    public StaticFlags StaticFlagsCompare = StaticFlags::None
    Field Value
    StaticFlags

    StaticFlagsMask

    The static flags mask used to hide objects that don't have a given static flags. Eg. use StaticFlags::Lightmap to render only objects that can use lightmap.

    Declaration
    public StaticFlags StaticFlagsMask = StaticFlags::None
    Field Value
    StaticFlags

    TaaFrameIndex

    Temporal Anti-Aliasing jitter frame index.

    Declaration
    public int32 TaaFrameIndex = 0
    Field Value
    int32

    TemporalAAJitter

    The temporal AA jitter packed (xy - this frame jitter, zw - previous frame jitter). Cached before rendering. Zero if TAA is disabled. The value added to projection matrix (in clip space).

    Declaration
    public Float4 TemporalAAJitter
    Field Value
    Float4

    View

    The view matrix.

    Declaration
    public Matrix View
    Field Value
    Matrix

    ViewInfo

    The view information vector with packed components to reconstruct linear depth and view position from the hardware depth buffer. Cached before rendering.

    Declaration
    public Float4 ViewInfo
    Field Value
    Float4

    WorldPosition

    The global position of the view (Origin+Position).

    Declaration
    public Vector3 WorldPosition
    Field Value
    Vector3

    Methods

    CopyFrom(const Camera* camera, const Viewport* viewport=nullptr)

    Copies view data from camera to the view.

    Declaration
    public void CopyFrom(const Camera* camera, const Viewport* viewport=nullptr)
    Parameters
    Camera camera

    The camera to copy its data.

    Viewport viewport

    The custom viewport to use for view/projection matrices override.

    GetShadowsDrawPassMask(ShadowsCastingMode shadowsMode)

    Declaration
    public DrawPass GetShadowsDrawPassMask(ShadowsCastingMode shadowsMode) const
    Parameters
    ShadowsCastingMode shadowsMode

    Returns
    DrawPass

    GetWorldMatrix(const Transform& transform, Matrix& world)

    Declaration
    public void GetWorldMatrix(const Transform& transform, Matrix& world) const
    Parameters
    Transform transform

    Matrix world

    GetWorldMatrix(Double4x4& world)

    Declaration
    public void GetWorldMatrix(Double4x4& world) const
    Parameters
    Double4x4 world

    GetWorldMatrix(Matrix& world)

    Declaration
    public void GetWorldMatrix(Matrix& world) const
    Parameters
    Matrix world

    Returns
    void

    IsOrthographicProjection()

    Determines whether view is orthographic projection or perspective.

    Declaration
    public bool IsOrthographicProjection() const
    Returns
    bool

    IsPerspectiveProjection()

    Determines whether view is perspective projection or orthographic.

    Declaration
    public bool IsPerspectiveProjection() const
    Returns
    bool

    operator=(const RenderView& other)

    Declaration
    public RenderView operator=(const RenderView& other) = default
    Parameters
    RenderView other

    Returns
    RenderView

    Prepare(RenderContext& renderContext)

    Prepares view for rendering a scene. Called before rendering so other parts can reuse calculated value.

    Declaration
    public void Prepare(RenderContext& renderContext)
    Parameters
    RenderContext renderContext

    The rendering context.

    PrepareCache(const RenderContext& renderContext, float width, float height, const Float2& temporalAAJitter, const RenderView* mainView=nullptr)

    Prepares the cached data.

    Declaration
    public void PrepareCache(const RenderContext& renderContext, float width, float height, const Float2& temporalAAJitter, const RenderView* mainView=nullptr)
    Parameters
    RenderContext renderContext

    The rendering context.

    float width

    The rendering width.

    float height

    The rendering height.

    Float2 temporalAAJitter

    The temporal jitter for this frame.

    RenderView mainView

    The main rendering viewport. Use null if it's top level view; pass pointer to main view for sub-passes like shadow depths.

    RenderView()

    Declaration
    public PRAGMA_DISABLE_DEPRECATION_WARNINGS RenderView() = default
    Returns
    PRAGMA_DISABLE_DEPRECATION_WARNINGS

    SetFace(int32 faceIndex)

    Setups view for given face of the cube rendering.

    Declaration
    public void SetFace(int32 faceIndex)
    Parameters
    int32 faceIndex

    Face index(0-5)

    SetProjector(float nearPlane, float farPlane, const Float3& position, const Float3& direction, const Float3& up, float angle)

    Setups view for cube rendering.

    Declaration
    public void SetProjector(float nearPlane, float farPlane, const Float3& position, const Float3& direction, const Float3& up, float angle)
    Parameters
    float nearPlane

    Near plane

    float farPlane

    Far plane

    Float3 position

    Camera's position

    Float3 direction

    Camera's direction vector

    Float3 up

    Camera's up vector

    float angle

    Camera's FOV angle (in degrees)

    SetUp(const Matrix& view, const Matrix& projection)

    Declaration
    public void SetUp(const Matrix& view, const Matrix& projection)
    Parameters
    Matrix view

    Matrix projection

    SetUp(const Matrix& viewProjection)

    Declaration
    public void SetUp(const Matrix& viewProjection)
    Parameters
    Matrix viewProjection

    SetUpCube(float nearPlane, float farPlane, const Float3& position)

    Setups view for cube rendering.

    Declaration
    public void SetUpCube(float nearPlane, float farPlane, const Float3& position)
    Parameters
    float nearPlane

    Near plane

    float farPlane

    Far plane

    Float3 position

    Camera's position

    UpdateCachedData()

    Updates the cached data for the view (inverse matrices, etc.).

    Declaration
    public PRAGMA_ENABLE_DEPRECATION_WARNINGS void UpdateCachedData()
    Returns
    PRAGMA_ENABLE_DEPRECATION_WARNINGS void

    ViewProjection()

    Declaration
    public Matrix ViewProjection() const
    Returns
    Matrix

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat