// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors
// SPDX-License-Identifier: Apache-2.0
#if DRACO_IS_INSTALLED
using Draco.Encode;
#endif
namespace GLTFast.Export
{
///
/// Settings for Draco mesh compression
///
public class DracoExportSettings
{
// TODO: Look into world-space size and precision based quantization
// public float positionalPrecision = 0.001f;
/// Encoding speed level. 0 means slow and small. 10 is fastest.
public int encodingSpeed = 0;
/// Decoding speed level. 0 means slow and small. 10 is fastest.
public int decodingSpeed = 4;
/// Positional quantization.
public int positionQuantization = 14;
/// Normal quantization.
public int normalQuantization = 10;
/// Texture coordinate quantization.
public int texCoordQuantization = 12;
/// Color quantization.
public int colorQuantization = 8;
#if DRACO_IS_INSTALLED
public static implicit operator QuantizationSettings(DracoExportSettings s) => new QuantizationSettings(
s.positionQuantization,
s.normalQuantization,
s.texCoordQuantization,
s.colorQuantization
);
public static implicit operator SpeedSettings(DracoExportSettings s) => new SpeedSettings(
s.encodingSpeed,
s.decodingSpeed
);
#endif
}
}