Class DracoEncoder
Provides Draco encoding capabilities.
Inherited Members
Namespace: Draco.Encode
Assembly: solution.dll
Syntax
public static class DracoEncoder
Methods
EncodeMesh(Mesh)
Applies Draco compression to a given mesh and returns the encoded result (one per sub-mesh)
Declaration
public static Task<EncodeResult[]> EncodeMesh(Mesh unityMesh)
Parameters
Type | Name | Description |
---|---|---|
Mesh | unityMesh | Input mesh |
Returns
Type | Description |
---|---|
Task<EncodeResult[]> | Encoded data (one per sub-mesh) |
EncodeMesh(Mesh, QuantizationSettings, SpeedSettings)
Applies Draco compression to a given mesh and returns the encoded result (one per sub-mesh)
Declaration
public static Task<EncodeResult[]> EncodeMesh(Mesh unityMesh, QuantizationSettings quantization, SpeedSettings speed)
Parameters
Type | Name | Description |
---|---|---|
Mesh | unityMesh | Input mesh |
QuantizationSettings | quantization | Quantization settings |
SpeedSettings | speed | Encode/decode speed settings |
Returns
Type | Description |
---|---|
Task<EncodeResult[]> | Encoded data (one per sub-mesh) |
EncodeMesh(Mesh, int, int, int, int, int, int, int)
Applies Draco compression to a given mesh and returns the encoded result (one per sub-mesh) The quantization parameters help to find a balance between encoded size and quality / precision.
Declaration
[Obsolete("Use EncodeMesh(Mesh,QuantizationSettings,SpeedSettings) instead")]
public static Task<EncodeResult[]> EncodeMesh(Mesh unityMesh, int encodingSpeed = 0, int decodingSpeed = 4, int positionQuantization = 14, int normalQuantization = 10, int texCoordQuantization = 12, int colorQuantization = 8, int genericQuantization = 12)
Parameters
Type | Name | Description |
---|---|---|
Mesh | unityMesh | Input mesh |
int | encodingSpeed | Encoding speed level. 0 means slow and small. 10 is fastest. |
int | decodingSpeed | Decoding speed level. 0 means slow and small. 10 is fastest. |
int | positionQuantization | Vertex position quantization |
int | normalQuantization | Normal quantization |
int | texCoordQuantization | Texture coordinate quantization |
int | colorQuantization | Color quantization |
int | genericQuantization | Generic quantization (e.g. blend weights and indices). unused at the moment |
Returns
Type | Description |
---|---|
Task<EncodeResult[]> | Encoded data (one per sub-mesh) |
See Also
EncodeMesh(Mesh, MeshData)
Applies Draco compression to a given mesh/meshData and returns the encoded result (one per sub-mesh). The user is responsible for acquiring the readable MeshData and disposing it.
Declaration
public static Task<EncodeResult[]> EncodeMesh(Mesh mesh, Mesh.MeshData meshData)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | Input mesh |
Mesh.MeshData | meshData | Previously acquired readable mesh data |
Returns
Type | Description |
---|---|
Task<EncodeResult[]> | Encoded data (one per sub-mesh) |
EncodeMesh(Mesh, MeshData, QuantizationSettings, SpeedSettings)
Applies Draco compression to a given mesh/meshData and returns the encoded result (one per sub-mesh). The user is responsible for acquiring the readable MeshData and disposing it.
Declaration
public static Task<EncodeResult[]> EncodeMesh(Mesh mesh, Mesh.MeshData meshData, QuantizationSettings quantization, SpeedSettings speed)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | Input mesh |
Mesh.MeshData | meshData | Previously acquired readable mesh data |
QuantizationSettings | quantization | Quantization settings |
SpeedSettings | speed | Encode/decode speed settings |
Returns
Type | Description |
---|---|
Task<EncodeResult[]> | Encoded data (one per sub-mesh) |
EncodeMesh(Mesh, MeshData, int, int, int, int, int, int, int)
Applies Draco compression to a given mesh/meshData and returns the encoded result (one per sub-mesh) The user is responsible for acquiring the readable MeshData and disposing it. The quantization parameters help to find a balance between encoded size and quality / precision.
Declaration
[Obsolete("Use EncodeMesh(Mesh,Mesh.MeshData,QuantizationSettings,SpeedSettings) instead")]
public static Task<EncodeResult[]> EncodeMesh(Mesh mesh, Mesh.MeshData meshData, int encodingSpeed = 0, int decodingSpeed = 4, int positionQuantization = 14, int normalQuantization = 10, int texCoordQuantization = 12, int colorQuantization = 8, int genericQuantization = 12)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | Input mesh |
Mesh.MeshData | meshData | Previously acquired readable mesh data |
int | encodingSpeed | Encoding speed level. 0 means slow and small. 10 is fastest. |
int | decodingSpeed | Decoding speed level. 0 means slow and small. 10 is fastest. |
int | positionQuantization | Vertex position quantization |
int | normalQuantization | Normal quantization |
int | texCoordQuantization | Texture coordinate quantization |
int | colorQuantization | Color quantization |
int | genericQuantization | Generic quantization (e.g. blend weights and indices). unused at the moment |
Returns
Type | Description |
---|---|
Task<EncodeResult[]> | Encoded data (one per sub-mesh) |
See Also
EncodeMesh(Mesh, MeshData, Vector3, float, int, int, int, int, int, int)
Applies Draco compression to a given mesh/meshData and returns the encoded result (one per sub-mesh) The user is responsible for acquiring the readable MeshData and disposing it. The quality and quantization parameters are calculated from the mesh's bounds, its worldScale and desired precision. The quantization parameters help to find a balance between compressed size and quality / precision.
Declaration
[Obsolete("Use EncodeMesh(Mesh,Mesh.MeshData,QuantizationSettings,SpeedSettings) instead")]
public static Task<EncodeResult[]> EncodeMesh(Mesh mesh, Mesh.MeshData meshData, Vector3 worldScale, float precision = 0.001, int encodingSpeed = 0, int decodingSpeed = 4, int normalQuantization = 10, int texCoordQuantization = 12, int colorQuantization = 8, int genericQuantization = 12)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | Input mesh |
Mesh.MeshData | meshData | Previously acquired readable mesh data |
Vector3 | worldScale | Local-to-world scale this mesh is present in the scene |
float | precision | Desired minimum precision in world units |
int | encodingSpeed | Encoding speed level. 0 means slow and small. 10 is fastest. |
int | decodingSpeed | Decoding speed level. 0 means slow and small. 10 is fastest. |
int | normalQuantization | Normal quantization |
int | texCoordQuantization | Texture coordinate quantization |
int | colorQuantization | Color quantization |
int | genericQuantization | Generic quantization (e.g. blend weights and indices). unused at the moment |
Returns
Type | Description |
---|---|
Task<EncodeResult[]> | Encoded data (one per sub-mesh) |
See Also
EncodeMesh(Mesh, Vector3, float, int, int, int, int, int, int)
Applies Draco compression to a given mesh and returns the encoded result (one per sub-mesh) The quality and quantization parameters are calculated from the mesh's bounds, its worldScale and desired precision. The quantization parameters help to find a balance between compressed size and quality / precision.
Declaration
[Obsolete("Use EncodeMesh(Mesh,QuantizationSettings,SpeedSettings) instead")]
public static Task<EncodeResult[]> EncodeMesh(Mesh unityMesh, Vector3 worldScale, float precision = 0.001, int encodingSpeed = 0, int decodingSpeed = 4, int normalQuantization = 10, int texCoordQuantization = 12, int colorQuantization = 8, int genericQuantization = 12)
Parameters
Type | Name | Description |
---|---|---|
Mesh | unityMesh | Input mesh |
Vector3 | worldScale | Local-to-world scale this mesh is present in the scene |
float | precision | Desired minimum precision in world units |
int | encodingSpeed | Encoding speed level. 0 means slow and small. 10 is fastest. |
int | decodingSpeed | Decoding speed level. 0 means slow and small. 10 is fastest. |
int | normalQuantization | Normal quantization |
int | texCoordQuantization | Texture coordinate quantization |
int | colorQuantization | Color quantization |
int | genericQuantization | Generic quantization (e.g. blend weights and indices). unused at the moment |
Returns
Type | Description |
---|---|
Task<EncodeResult[]> | Encoded data (one per sub-mesh) |