Struct QuantizationSettings
Quantization settings.
Inherited Members
Namespace: Draco.Encode
Assembly: solution.dll
Syntax
public readonly struct QuantizationSettings
Constructors
QuantizationSettings(int)
Constructs quantization settings. Defaults are applied for normal, texture coordinate and color quantization.
Declaration
public QuantizationSettings(int positionQuantization)
Parameters
Type | Name | Description |
---|---|---|
int | positionQuantization | Initializes positionQuantization |
QuantizationSettings(int, int, int, int)
Constructs quantization settings.
Declaration
public QuantizationSettings(int positionQuantization, int normalQuantization, int texCoordQuantization, int colorQuantization)
Parameters
Type | Name | Description |
---|---|---|
int | positionQuantization | Initializes positionQuantization |
int | normalQuantization | Initializes normalQuantization |
int | texCoordQuantization | Initializes texCoordQuantization |
int | colorQuantization | Initializes colorQuantization |
Fields
Default
Default quantization settings, used whenever no settings are provided.
Declaration
public static readonly QuantizationSettings Default
Field Value
Type | Description |
---|---|
QuantizationSettings |
colorQuantization
Color quantization.
Declaration
public readonly int colorQuantization
Field Value
Type | Description |
---|---|
int |
maxQuantization
Maximum quantization bits.
Declaration
public const int maxQuantization = 30
Field Value
Type | Description |
---|---|
int |
minQuantization
Minimum quantization bits.
Declaration
public const int minQuantization = 1
Field Value
Type | Description |
---|---|
int |
normalQuantization
Normal quantization.
Declaration
public readonly int normalQuantization
Field Value
Type | Description |
---|---|
int |
positionQuantization
Vertex position quantization.
Declaration
public readonly int positionQuantization
Field Value
Type | Description |
---|---|
int |
texCoordQuantization
Texture coordinate quantization.
Declaration
public readonly int texCoordQuantization
Field Value
Type | Description |
---|---|
int |
Properties
IsValid
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
genericQuantization
Default quantization for generic attributes. Unused at the moment.
Declaration
public static int genericQuantization { get; }
Property Value
Type | Description |
---|---|
int |
Methods
FromWorldSize(Bounds, Vector3, float)
Constructs quantization settings. The position quantization value is based on the mesh's bounds, its scale in the world and the desired precision in world units. The rest will be default values.
Declaration
public static QuantizationSettings FromWorldSize(Bounds meshBounds, Vector3 worldScale, float precision)
Parameters
Type | Name | Description |
---|---|---|
Bounds | meshBounds | Size of the mesh |
Vector3 | worldScale | World scale of the object |
float | precision | Desired minimum precision in world units |
Returns
Type | Description |
---|---|
QuantizationSettings | Quantization settings |
FromWorldSize(Bounds, Vector3, float, int, int, int)
Constructs quantization settings. The position quantization value is based on the mesh's bounds, its scale in the world and the desired precision in world units.
Declaration
public static QuantizationSettings FromWorldSize(Bounds meshBounds, Vector3 worldScale, float precision, int normalQuantization, int texCoordQuantization, int colorQuantization)
Parameters
Type | Name | Description |
---|---|---|
Bounds | meshBounds | Size of the mesh |
Vector3 | worldScale | World scale of the object |
float | precision | Desired minimum precision in world units |
int | normalQuantization | Initializes normalQuantization |
int | texCoordQuantization | Initializes texCoordQuantization |
int | colorQuantization | Initializes colorQuantization |
Returns
Type | Description |
---|---|
QuantizationSettings | QuantizationSettings settings |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |