Search Results for

    Show / Hide Table of Contents

    Class RenderView

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

    Inheritance
    System.Object
    RenderView
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public sealed class RenderView : ValueType

    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
    Field Value
    System.Single

    Flags

    The view flags.

    Declaration
    public ViewFlags Flags
    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
    Field Value
    System.Boolean

    IsOfflinePass

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

    Declaration
    public bool IsOfflinePass
    Field Value
    System.Boolean

    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
    Field Value
    System.Boolean

    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
    Field Value
    System.Boolean

    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
    Field Value
    Quality

    Mode

    The view mode.

    Declaration
    public ViewMode Mode
    Field Value
    ViewMode

    ModelLODBias

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

    Declaration
    public int ModelLODBias
    Field Value
    System.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
    Field Value
    System.Single

    ModelLODDistanceFactorSqrt

    Square of ModelLODDistanceFactor. Cached by rendering backend.

    Declaration
    public float ModelLODDistanceFactorSqrt
    Field Value
    System.Single

    Near

    The near plane.

    Declaration
    public float Near
    Field Value
    System.Single

    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
    Field Value
    Vector3

    Pass

    The draw passes mask for the current view rendering.

    Declaration
    public DrawPass Pass
    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

    ShadowModelLODBias

    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 int ShadowModelLODBias
    Field Value
    System.Int32

    ShadowModelLODDistanceFactor

    The model LOD distance scale factor. Default is 1. Applied to all the objects in the shadow maps render views. Higher values increase LODs quality. Can be used to improve shadows rendering performance or increase quality. [Deprecated on 26.10.2022, expires on 26.10.2024]

    Declaration
    public float ShadowModelLODDistanceFactor
    Field Value
    System.Single

    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
    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
    Field Value
    StaticFlags

    TaaFrameIndex

    Temporal Anti-Aliasing jitter frame index.

    Declaration
    public int TaaFrameIndex
    Field Value
    System.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(Camera)

    Copies render view data from the camera.

    Declaration
    public void CopyFrom(Camera camera)
    Parameters
    Camera camera

    The camera.

    CopyFrom(Camera, ref Viewport)

    Copies render view data from the camera.

    Declaration
    public void CopyFrom(Camera camera, ref Viewport viewport)
    Parameters
    Camera camera

    The camera.

    Viewport viewport

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

    GetWorldMatrix(ref Transform, out Matrix)

    Calculates the world matrix for the given transformation instance rendering.

    Declaration
    public void GetWorldMatrix(ref Transform transform, out Matrix world)
    Parameters
    Transform transform

    The object transformation.

    Matrix world

    The output matrix.

    Init()

    Initializes this view with default options.

    Declaration
    public void Init()

    SetProjector(Single, Single, Float3, Float3, Float3, Single)

    Set up view for projector rendering.

    Declaration
    public void SetProjector(float nearPlane, float farPlane, Float3 position, Float3 direction, Float3 up, float angle)
    Parameters
    System.Single nearPlane

    Near plane

    System.Single farPlane

    Far plane

    Float3 position

    Camera's position

    Float3 direction

    Camera's direction vector

    Float3 up

    Camera's up vector

    System.Single angle

    Camera's FOV angle (in degrees)

    SetUp(ref Matrix, ref Matrix)

    Initializes render view data.

    Declaration
    public void SetUp(ref Matrix view, ref Matrix projection)
    Parameters
    Matrix view

    The view.

    Matrix projection

    The projection.

    UpdateCachedData()

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

    Declaration
    public void UpdateCachedData()

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat