docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method ReAllocateIfNeeded

    ReAllocateIfNeeded(ref RTHandle, in RenderTextureDescriptor, FilterMode, TextureWrapMode, bool, int, float, string)

    Re-allocate fixed-size RTHandle if it is not allocated or doesn't match the descriptor

    Declaration
    public static bool ReAllocateIfNeeded(ref RTHandle handle, in RenderTextureDescriptor descriptor, FilterMode filterMode = FilterMode.Point, TextureWrapMode wrapMode = TextureWrapMode.Repeat, bool isShadowMap = false, int anisoLevel = 1, float mipMapBias = 0, string name = "")
    Parameters
    Type Name Description
    RTHandle handle

    RTHandle to check (can be null)

    RenderTextureDescriptor descriptor

    Descriptor for the RTHandle to match

    FilterMode filterMode

    Filtering mode of the RTHandle.

    TextureWrapMode wrapMode

    Addressing mode of the RTHandle.

    bool isShadowMap

    Set to true if the depth buffer should be used as a shadow map.

    int anisoLevel

    Anisotropic filtering level.

    float mipMapBias

    Bias applied to mipmaps during filtering.

    string name

    Name of the RTHandle.

    Returns
    Type Description
    bool

    ReAllocateIfNeeded(ref RTHandle, Vector2, in RenderTextureDescriptor, FilterMode, TextureWrapMode, bool, int, float, string)

    Re-allocate dynamically resized RTHandle if it is not allocated or doesn't match the descriptor

    Declaration
    public static bool ReAllocateIfNeeded(ref RTHandle handle, Vector2 scaleFactor, in RenderTextureDescriptor descriptor, FilterMode filterMode = FilterMode.Point, TextureWrapMode wrapMode = TextureWrapMode.Repeat, bool isShadowMap = false, int anisoLevel = 1, float mipMapBias = 0, string name = "")
    Parameters
    Type Name Description
    RTHandle handle

    RTHandle to check (can be null)

    Vector2 scaleFactor

    Constant scale for the RTHandle size computation.

    RenderTextureDescriptor descriptor

    Descriptor for the RTHandle to match

    FilterMode filterMode

    Filtering mode of the RTHandle.

    TextureWrapMode wrapMode

    Addressing mode of the RTHandle.

    bool isShadowMap

    Set to true if the depth buffer should be used as a shadow map.

    int anisoLevel

    Anisotropic filtering level.

    float mipMapBias

    Bias applied to mipmaps during filtering.

    string name

    Name of the RTHandle.

    Returns
    Type Description
    bool

    If the RTHandle should be re-allocated

    ReAllocateIfNeeded(ref RTHandle, ScaleFunc, in RenderTextureDescriptor, FilterMode, TextureWrapMode, bool, int, float, string)

    Re-allocate dynamically resized RTHandle if it is not allocated or doesn't match the descriptor

    Declaration
    public static bool ReAllocateIfNeeded(ref RTHandle handle, ScaleFunc scaleFunc, in RenderTextureDescriptor descriptor, FilterMode filterMode = FilterMode.Point, TextureWrapMode wrapMode = TextureWrapMode.Repeat, bool isShadowMap = false, int anisoLevel = 1, float mipMapBias = 0, string name = "")
    Parameters
    Type Name Description
    RTHandle handle

    RTHandle to check (can be null)

    ScaleFunc scaleFunc

    Function used for the RTHandle size computation.

    RenderTextureDescriptor descriptor

    Descriptor for the RTHandle to match

    FilterMode filterMode

    Filtering mode of the RTHandle.

    TextureWrapMode wrapMode

    Addressing mode of the RTHandle.

    bool isShadowMap

    Set to true if the depth buffer should be used as a shadow map.

    int anisoLevel

    Anisotropic filtering level.

    float mipMapBias

    Bias applied to mipmaps during filtering.

    string name

    Name of the RTHandle.

    Returns
    Type Description
    bool

    If an allocation was done

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)