docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CreateOrResizeRenderTexture

    CreateOrResizeRenderTexture(ref RenderTexture, int, int, int, bool, RenderTextureFormat, RenderTextureReadWrite, string)

    Creates a new texture if the given texture is null or the wrong size.

    Declaration
    public static void CreateOrResizeRenderTexture(ref RenderTexture texture, int width, int height, int depth, bool enableReadWrite, RenderTextureFormat format, RenderTextureReadWrite colorSpace, string name = "")
    Parameters
    Type Name Description
    RenderTexture texture

    Reference to the texture.

    int width

    Requested width.

    int height

    Requested height

    int depth

    Requested depth.

    bool enableReadWrite

    Enable random read writes on this texture.

    RenderTextureFormat format

    Format of the texture.

    RenderTextureReadWrite colorSpace

    Color space used for the texture.

    string name

    Optional name for the texture. Default: "".

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