Search Results for

    Show / Hide Table of Contents

    Class RenderTools

    Set of utilities for rendering.

    Inheritance
    RenderTools
    Assembly: FlaxEngine.dll
    File: Engine/Graphics/RenderTools.h
    Syntax
    public class RenderTools

    Constructors

    DEPRECATED("Use CalculateTangentFrame with unpacked Float3/Float4.")

    Declaration
    public DEPRECATED("Use CalculateTangentFrame with unpacked Float3/Float4.") static void CalculateTangentFrame(FloatR10G10B10A2& resultNormal
    Parameters
    "Use CalculateTangentFrame with unpacked Float3/Float4." RenderTools_DEPRECATED__Use_CalculateTangentFrame_with_unpacked_Float3_Float4___

    DEPRECATED("Use ComputeModelLOD instead.")

    Computes the skinned model LOD index to use during rendering. [Deprecated in v1.12]

    Declaration
    public DEPRECATED("Use ComputeModelLOD instead.") static int32 ComputeSkinnedModelLOD(const SkinnedModel* model
    Parameters
    "Use ComputeModelLOD instead." RenderTools_DEPRECATED__Use_ComputeModelLOD_instead___

    DEPRECATED("Use GetShaderProfileFeatures instead") static bool CanSupportTessellation(ShaderProfile profile)

    Check if the given shader profile supports the tessellation. Runtime can reject tessellation support but it defines if given shader profile CAN support tessellation. [Deprecated in v1.12]

    Declaration
    public DEPRECATED("Use GetShaderProfileFeatures instead") static bool CanSupportTessellation(ShaderProfile profile)
    Parameters
    "Use GetShaderProfileFeatures instead" RenderTools_DEPRECATED__Use_GetShaderProfileFeatures_instead__

    Fields

    DepthBoundMaxBackground

    Declaration
    public static constexpr float DepthBoundMaxBackground = 1.0f - 0.0000001f
    Field Value
    constexpr float

    normal

    Declaration
    public FloatR10G10B10A2 Float3 normal
    Field Value
    FloatR10G10B10A2 Float3

    origin

    Declaration
    public Float3 origin
    Field Value
    Float3

    radius

    Declaration
    public Float3 float radius
    Field Value
    Float3 float

    renderContext

    Declaration
    public Float3 float RenderContext renderContext
    Field Value
    Float3 float RenderContext

    resultTangent

    Declaration
    public FloatR10G10B10A2 resultTangent
    Field Value
    FloatR10G10B10A2

    tangent

    Declaration
    public FloatR10G10B10A2 Float3 Float3 tangent
    Field Value
    FloatR10G10B10A2 Float3 Float3

    Methods

    CalcSubresourceIndex(uint32 mipSlice, int32 arraySlice, int32 mipLevels)

    Declaration
    public static int32 CalcSubresourceIndex(uint32 mipSlice, int32 arraySlice, int32 mipLevels)
    Parameters
    uint32 mipSlice

    int32 arraySlice

    int32 mipLevels

    Returns
    int32

    CalculateTangentFrame(Float3& resultNormal, Float4& resultTangent, const Float3& normal)

    Declaration
    public static void CalculateTangentFrame(Float3& resultNormal, Float4& resultTangent, const Float3& normal)
    Parameters
    Float3 resultNormal

    Float4 resultTangent

    Float3 normal

    CalculateTangentFrame(Float3& resultNormal, Float4& resultTangent, const Float3& normal, const Float3& tangent)

    Declaration
    public static void CalculateTangentFrame(Float3& resultNormal, Float4& resultTangent, const Float3& normal, const Float3& tangent)
    Parameters
    Float3 resultNormal

    Float4 resultTangent

    Float3 normal

    Float3 tangent

    CalculateTextureMemoryUsage(PixelFormat format, int32 width, int32 height, int32 depth, int32 mipLevels)

    Declaration
    public static uint64 CalculateTextureMemoryUsage(PixelFormat format, int32 width, int32 height, int32 depth, int32 mipLevels)
    Parameters
    PixelFormat format

    int32 width

    int32 height

    int32 depth

    int32 mipLevels

    Returns
    uint64

    CalculateTextureMemoryUsage(PixelFormat format, int32 width, int32 height, int32 mipLevels)

    Declaration
    public static uint64 CalculateTextureMemoryUsage(PixelFormat format, int32 width, int32 height, int32 mipLevels)
    Parameters
    PixelFormat format

    int32 width

    int32 height

    int32 mipLevels

    Returns
    uint64

    ComputeBoundsScreenRadiusSquared(const Float3& origin, const float radius, const RenderView& view)

    Computes the bounds screen radius squared.

    Declaration
    public static float ComputeBoundsScreenRadiusSquared(const Float3& origin, const float radius, const RenderView& view)
    Parameters
    Float3 origin

    The bounds origin.

    float radius

    The bounds radius.

    RenderView view

    The render view.

    Returns
    float

    The squared radius.

    ComputeBoundsScreenRadiusSquared(const Float3& origin, float radius, const Float3& viewOrigin, const Matrix& projectionMatrix)

    Computes the bounds screen radius squared.

    Declaration
    public static float ComputeBoundsScreenRadiusSquared(const Float3& origin, float radius, const Float3& viewOrigin, const Matrix& projectionMatrix)
    Parameters
    Float3 origin

    The bounds origin.

    float radius

    The bounds radius.

    Float3 viewOrigin

    The render view position.

    Matrix projectionMatrix

    The render view projection matrix.

    Returns
    float

    The squared radius.

    ComputeBoxModelDrawMatrix(const RenderView& view, const OrientedBoundingBox& box, Matrix& resultWorld, bool& resultIsViewInside)

    Declaration
    public static void ComputeBoxModelDrawMatrix(const RenderView& view, const OrientedBoundingBox& box, Matrix& resultWorld, bool& resultIsViewInside)
    Parameters
    RenderView view

    OrientedBoundingBox box

    Matrix resultWorld

    bool resultIsViewInside

    ComputeCascadeUpdateFrequency(int32 cascadeIndex, int32 cascadeCount, int32& updateFrequency, int32& updatePhrase, int32 updateMaxCountPerFrame=1)

    Declaration
    public static void ComputeCascadeUpdateFrequency(int32 cascadeIndex, int32 cascadeCount, int32& updateFrequency, int32& updatePhrase, int32 updateMaxCountPerFrame=1)
    Parameters
    int32 cascadeIndex

    int32 cascadeCount

    int32 updateFrequency

    int32 updatePhrase

    int32 updateMaxCountPerFrame

    ComputeDistanceSortKey(float distance)

    Computes the sorting key for depth value (quantized) Reference: http://aras-p.info/blog/2014/01/16/rough-sorting-by-depth/

    Declaration
    public static uint32 ComputeDistanceSortKey(float distance)
    Parameters
    float distance

    Returns
    uint32

    ComputeModelLOD(const Model* model, const Float3& origin, float radius, const RenderContext& renderContext)

    Computes the model LOD index to use during rendering.

    Declaration
    public static int32 ComputeModelLOD(const Model* model, const Float3& origin, float radius, const RenderContext& renderContext)
    Parameters
    Model model

    The model.

    Float3 origin

    The bounds origin.

    float radius

    The bounds radius.

    RenderContext renderContext

    The rendering context.

    Returns
    int32

    The zero-based LOD index. Returns -1 if model should not be rendered.

    ComputeModelLOD(const SkinnedModel* model, const Float3& origin, float radius, const RenderContext& renderContext)

    Computes the model LOD index to use during rendering.

    Declaration
    public static int32 ComputeModelLOD(const SkinnedModel* model, const Float3& origin, float radius, const RenderContext& renderContext)
    Parameters
    SkinnedModel model

    The model.

    Float3 origin

    The bounds origin.

    float radius

    The bounds radius.

    RenderContext renderContext

    The rendering context.

    Returns
    int32

    The zero-based LOD index. Returns -1 if model should not be rendered.

    ComputePitch(PixelFormat format, int32 width, int32 height, uint32& rowPitch, uint32& slicePitch)

    Computes the image row pitch in bytes, and the slice pitch (size in bytes of the image) based on format, width, and height.

    Declaration
    public static void ComputePitch(PixelFormat format, int32 width, int32 height, uint32& rowPitch, uint32& slicePitch)
    Parameters
    PixelFormat format

    The pixel format of the surface.

    int32 width

    The surface width.

    int32 height

    The surface height.

    uint32 rowPitch

    The number of bytes in a scanline of pixels in the image. A standard pitch is 'byte' aligned and therefore it is equal to bytes-per-pixel * width-of-image. For block-compressed (BC) formats, this is the number of bytes in a row of blocks (which covers up to 4 scanlines at once). The rowPitch can be larger than the number of valid pixels in the image due to alignment padding.

    uint32 slicePitch

    For volume (3D) textures, slicePitch is the number of bytes in each depth slice. For 1D and 2D images, this is simply the total size of the image including any alignment padding.

    ComputeSphereModelDrawMatrix(const RenderView& view, const Float3& position, float radius, Matrix& resultWorld, bool& resultIsViewInside)

    Declaration
    public static void ComputeSphereModelDrawMatrix(const RenderView& view, const Float3& position, float radius, Matrix& resultWorld, bool& resultIsViewInside)
    Parameters
    RenderView view

    Float3 position

    float radius

    Matrix resultWorld

    bool resultIsViewInside

    ComputeTemporalTime()

    Declaration
    public static float ComputeTemporalTime()
    Returns
    float

    GetColorQuantizationError(PixelFormat format)

    Declaration
    public static Float3 GetColorQuantizationError(PixelFormat format)
    Parameters
    PixelFormat format

    Returns
    Float3

    GetDepthBounds(const RenderView& view, const BoundingBox& bounds)

    Declaration
    public static Float2 GetDepthBounds(const RenderView& view, const BoundingBox& bounds)
    Parameters
    RenderView view

    BoundingBox bounds

    Returns
    Float2

    GetDepthBounds(const RenderView& view, const BoundingSphere& bounds)

    Declaration
    public static Float2 GetDepthBounds(const RenderView& view, const BoundingSphere& bounds)
    Parameters
    RenderView view

    BoundingSphere bounds

    Returns
    Float2

    GetDepthBounds(const RenderView& view, const Float3& nearPoint, const Float3& farPoint)

    Declaration
    public static Float2 GetDepthBounds(const RenderView& view, const Float3& nearPoint, const Float3& farPoint)
    Parameters
    RenderView view

    Float3 nearPoint

    Float3 farPoint

    Returns
    Float2

    GetDepthBounds(const RenderView& view, const Float3& point, bool near)

    Declaration
    public static float GetDepthBounds(const RenderView& view, const Float3& point, bool near)
    Parameters
    RenderView view

    Float3 point

    bool near

    Returns
    float

    GetDepthBounds(const RenderView& view, const OrientedBoundingBox& bounds)

    Declaration
    public static Float2 GetDepthBounds(const RenderView& view, const OrientedBoundingBox& bounds)
    Parameters
    RenderView view

    OrientedBoundingBox bounds

    Returns
    Float2

    GetDepthBounds(const RenderView& view, const Span<Float3>& points)

    Declaration
    public static Float2 GetDepthBounds(const RenderView& view, const Span<Float3>& points)
    Parameters
    RenderView view

    Span<Float3> points

    Returns
    Float2

    GetDepthBounds(const RenderView& view, float viewDistance, bool near)

    Declaration
    public static float GetDepthBounds(const RenderView& view, float viewDistance, bool near)
    Parameters
    RenderView view

    float viewDistance

    bool near

    Returns
    float

    GetFeatureLevel(ShaderProfile profile)

    Computes the feature level for the given shader profile.

    Declaration
    public static FeatureLevel GetFeatureLevel(ShaderProfile profile)
    Parameters
    ShaderProfile profile

    The shader profile.

    Returns
    FeatureLevel

    The feature level matching the given shader profile.

    GetResolution(int32 base, ResolutionMode mode)

    Declaration
    public static int32 GetResolution(int32 base, ResolutionMode mode)
    Parameters
    int32 base

    ResolutionMode mode

    Returns
    int32

    Type Parameters
    typename ResolutionMode

    GetShaderProfileFeatures(ShaderProfile profile)

    Gets the features for the given shader profile. Runtime device might not support all of them.

    Declaration
    public static ShaderProfileFeatures GetShaderProfileFeatures(ShaderProfile profile)
    Parameters
    ShaderProfile profile

    The shader profile.

    Returns
    ShaderProfileFeatures

    The feature flags for the given shader profile.

    GetWorldDeterminantSign(const Matrix& worldMatrix)

    Declaration
    public static float GetWorldDeterminantSign(const Matrix& worldMatrix)
    Parameters
    Matrix worldMatrix

    Returns
    float

    ShouldUpdateCascade(int32 frameIndex, int32 cascadeIndex, int32 cascadeCount, int32 updateMaxCountPerFrame=1, bool updateForce=false)

    Declaration
    public static bool ShouldUpdateCascade(int32 frameIndex, int32 cascadeIndex, int32 cascadeCount, int32 updateMaxCountPerFrame=1, bool updateForce=false)
    Parameters
    int32 frameIndex

    int32 cascadeIndex

    int32 cascadeCount

    int32 updateMaxCountPerFrame

    bool updateForce

    Returns
    bool

    TemporalHalton(int32 index, int32 base)

    Declaration
    public static float TemporalHalton(int32 index, int32 base)
    Parameters
    int32 index

    int32 base

    Returns
    float

    UpdateModelLODTransition(byte& lodTransition)

    Declaration
    public static void UpdateModelLODTransition(byte& lodTransition)
    Parameters
    byte lodTransition

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