docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method EncodeTexture

    EncodeTexture(Texture2D, ImageFormat, bool, Material)

    Encodes the export texture

    Declaration
    protected static byte[] EncodeTexture(Texture2D texture, ImageFormat format, bool hasAlpha = true, Material blitMaterial = null)
    Parameters
    Type Name Description
    Texture2D texture

    Main texture to encode

    ImageFormat format

    Image format

    bool hasAlpha

    True if the texture has an alpha channel

    Material blitMaterial

    Custom blit material

    Returns
    Type Description
    byte[]

    Encoded texture data

    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)