{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method LoadFromBytes | KTX for Unity | 3.2.2
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method LoadFromBytes

    LoadFromBytes(NativeSlice<byte>, bool, uint, uint, uint, bool)

    Loads a KTX or Basis Universal texture from a buffer

    Declaration
    public Task<TextureResult> LoadFromBytes(NativeSlice<byte> data, bool linear = false, uint layer = 0, uint faceSlice = 0, uint mipLevel = 0, bool mipChain = true)
    Parameters
    Type Name Description
    NativeSlice<byte> data

    Native buffer that holds the ktx/basis file

    bool linear

    Depicts if texture is sampled in linear or sRGB gamma color space.

    uint layer

    Texture array layer to import

    uint faceSlice

    Cubemap face or 3D/volume texture slice to import.

    uint mipLevel

    Lowest mipmap level to import (where 0 is the highest resolution). Lower mipmap levels (of higher resolution) are being discarded. Useful to limit texture resolution.

    bool mipChain

    If true, a mipmap chain (if present) is imported.

    Returns
    Type Description
    Task<TextureResult>

    A TextureResult that contains an ErrorCode, the resulting texture and its orientation.

    LoadFromBytes(NativeSlice<byte>, GraphicsFormat, uint, uint, uint, bool)

    Loads a KTX or Basis Universal texture from a buffer

    Declaration
    public Task<TextureResult> LoadFromBytes(NativeSlice<byte> data, GraphicsFormat targetFormat, uint layer = 0, uint faceSlice = 0, uint mipLevel = 0, bool mipChain = true)
    Parameters
    Type Name Description
    NativeSlice<byte> data

    Native buffer that holds the ktx/basis file

    GraphicsFormat targetFormat

    Desired texture format

    uint layer

    Texture array layer to import

    uint faceSlice

    Cubemap face or 3D/volume texture slice to import.

    uint mipLevel

    Lowest mipmap level to import (where 0 is the highest resolution). Lower mipmap levels (of higher resolution) are being discarded. Useful to limit texture resolution.

    bool mipChain

    If true, a mipmap chain (if present) is imported.

    Returns
    Type Description
    Task<TextureResult>

    A TextureResult that contains an ErrorCode, the resulting texture and its orientation.

    In This Article
    Back to top
    Copyright © 2023 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)