Closed sessamekesh closed 11 months ago
I'm also happy to make a PR for these, with just a touch of guidance from the Draco team 🙂
There is a more granular API already. See ExpertEncoder
where you can set quantization setting for a specific attribute index (not attribute type). That should be sufficient for your requirments.
I'd love to be able to set quantization per-attribute for generic attributes, especially skeletal animation parameters bone_idx and bone_weight.
Background
I currently use a handful of custom
GeometryAttribute::GENERIC
attributes, and have been happy enough to use default quantization settings for all of them - compression rate is not a major pain point for me.Some of my models get quite large though, even with Draco compression, and I'd love the ability to tweak the quantization level for custom properties.
Proposal 1: Add an
Encoder::SetIndividualAttributeQuantization(GeometryAttribute::Type, int attribute_idx, int quantization_bits)
methodThe three most common
GENERIC
attributes I use:A cursory internet search suggests that my use cases of vertex tangents and skeleton bindings are both pretty common use cases for
GeometryAttribute::GENERIC
.I favor this approach, since it fits the common use cases and is extensible to uncommon ones as well.
Proposal 2: Add
BONE_INDEX
andBONE_WEIGHT
attribute typesSkeletal animation for 3D assets is a common enough use case to justify a special distinction. There isn't a lot of insanely fancy compression to be had here, but BONE_INDEX data can usually fit in 4-6 bits, and I suspect BONE_WEIGHT data can be fairly aggressively quantized as it's often a normal 4D vector.