docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BasisUniversalTexture

    Loads a Basis Universal texture from the StreamingAssets folder, a URL, or a buffer.

    Inheritance
    object
    TextureBase
    BasisUniversalTexture
    Inherited Members
    TextureBase.LoadFromStreamingAssets(string, bool, uint, uint, uint, bool)
    TextureBase.LoadFromStreamingAssets(string, GraphicsFormat, uint, uint, uint, bool)
    TextureBase.LoadFromUrl(string, bool, uint, uint, uint, bool)
    TextureBase.LoadFromUrl(string, GraphicsFormat, uint, uint, uint, bool)
    TextureBase.LoadFromBytes(NativeSlice<byte>, bool, uint, uint, uint, bool)
    TextureBase.LoadFromBytes(NativeSlice<byte>, GraphicsFormat, uint, uint, uint, bool)
    TextureBase.GetStreamingAssetsUrl(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: KtxUnity
    Assembly: Ktx.dll
    Syntax
    public class BasisUniversalTexture : TextureBase

    Methods

    Dispose()

    Releases all resources. Part of the low-level API that provides finer control over the loading process.

    Declaration
    public override void Dispose()
    Overrides
    TextureBase.Dispose()
    See Also
    Open(NativeSlice<byte>)
    LoadTexture2D(bool, uint, uint, uint, bool)
    LoadTexture2D(GraphicsFormat, uint, uint, uint, bool)
    Dispose()

    LoadTexture2D(bool, uint, uint, uint, bool)

    Creates a Texture2D from the previously opened texture. Transcodes or decodes the texture into a GPU compatible format (if required) and uploads it to GPU memory. Part of the low-level API that provides finer control over the loading process.

    Declaration
    public override Task<TextureResult> LoadTexture2D(bool linear = false, uint layer = 0, uint faceSlice = 0, uint mipLevel = 0, bool mipChain = true)
    Parameters
    Type Name Description
    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.

    Overrides
    TextureBase.LoadTexture2D(bool, uint, uint, uint, bool)
    See Also
    Open(NativeSlice<byte>)
    Dispose()

    LoadTexture2D(GraphicsFormat, uint, uint, uint, bool)

    Creates a Texture2D from the previously opened texture. Transcodes or decodes the texture into a desired GPU compatible format (if required) and uploads it to GPU memory. Part of the low-level API that provides finer control over the loading process.

    Declaration
    public override Task<TextureResult> LoadTexture2D(GraphicsFormat targetFormat, uint layer = 0, uint faceSlice = 0, uint mipLevel = 0, bool mipChain = true)
    Parameters
    Type Name Description
    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.

    Overrides
    TextureBase.LoadTexture2D(GraphicsFormat, uint, uint, uint, bool)
    See Also
    Open(NativeSlice<byte>)
    Dispose()

    Open(NativeSlice<byte>)

    Loads a texture from memory. Part of the low-level API that provides finer control over the loading process.

    Declaration
    public override ErrorCode Open(NativeSlice<byte> data)
    Parameters
    Type Name Description
    NativeSlice<byte> data

    Input texture data

    Returns
    Type Description
    ErrorCode

    Success if loading was successful or an error specific code otherwise.

    Overrides
    TextureBase.Open(NativeSlice<byte>)
    See Also
    LoadTexture2D(bool, uint, uint, uint, bool)
    LoadTexture2D(GraphicsFormat, uint, uint, uint, bool)
    Dispose()
    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)