docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Decode

    The Decode class provides static methods for decoding/decompressing meshoptimizer compressed vertex and index buffers.

    Inheritance
    object
    Decode
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Meshoptimizer
    Assembly: Unity.Meshopt.Decompress.dll
    Syntax
    public static class Decode

    Methods

    DecodeGltfBuffer(NativeSlice<int>, NativeArray<byte>, int, int, NativeSlice<byte>, Mode, Filter)

    Creates a C# job that decompresses the provided source buffer into destination

    Declaration
    public static JobHandle DecodeGltfBuffer(NativeSlice<int> returnCode, NativeArray<byte> destination, int count, int size, NativeSlice<byte> source, Mode mode, Filter filter = Filter.None)
    Parameters
    Type Name Description
    NativeSlice<int> returnCode

    An array with a length of one. The job's return code will end up at index 0

    NativeArray<byte> destination

    Destination buffer where the source will be decompressed into

    int count

    Number of elements (vertices/indices) to decode

    int size

    Size of elements (vertex/index) in bytes

    NativeSlice<byte> source

    Source buffer

    Mode mode

    Compression mode

    Filter filter

    In case of Attributes mode, filter to be applied

    Returns
    Type Description
    JobHandle

    JobHandle for the created C# job

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown upon invalid mode/filter

    DecodeGltfBufferSync(NativeArray<byte>, int, int, NativeSlice<byte>, Mode, Filter)

    Synchronous variant of DecodeGltfBuffer(NativeSlice<int>, NativeArray<byte>, int, int, NativeSlice<byte>, Mode, Filter) (decodes on the current thread)

    Declaration
    public static int DecodeGltfBufferSync(NativeArray<byte> destination, int count, int size, NativeSlice<byte> source, Mode mode, Filter filter = Filter.None)
    Parameters
    Type Name Description
    NativeArray<byte> destination

    Destination buffer where the source will be decompressed into

    int count

    Number of elements (vertices/indices) to decode

    int size

    Size of elements (vertex/index) in bytes

    NativeSlice<byte> source

    Source buffer

    Mode mode

    Compression mode

    Filter filter

    In case of Attributes mode, filter to be applied

    Returns
    Type Description
    int

    Return code that is 0 in case of success

    In This Article
    • Methods
      • DecodeGltfBuffer(NativeSlice<int>, NativeArray<byte>, int, int, NativeSlice<byte>, Mode, Filter)
      • DecodeGltfBufferSync(NativeArray<byte>, int, int, NativeSlice<byte>, Mode, Filter)
    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)