OptionalcolorsPer-vertex colors: 4 bytes (RGBA) per vertex, encoded as a normalized COLOR attribute. Each value must be an integer 0..255.
OptionalcompressionHow hard the encoder squeezes: an integer 0..10, defaulting to 5.
Higher levels encode slower into fewer bytes (the encode/decode speeds
run at 10 - level); 0 is the fastest encode.
OptionalencoderA ready draco3d encoder module, as createEncoderModule resolves. When
omitted, one is created from the draco3d package and shared across
calls. Pass one in to reuse a module (or to supply the .wasm in an
environment the default lookup cannot reach, like a bundled Worker).
OptionalnormalsPer-vertex normals: 3 numbers per vertex, encoded as the NORMAL
attribute. Must match positions in length.
OptionalpreserveKeep the decoded faces (and vertices) in input order via sequential
encoding. Defaults to false: the edgebreaker reorders faces while
compressing better. Either way the same triangles decode.
OptionalquantizationPer-attribute quantization bits (each an integer 1..30).
OptionaluvsTexture coordinates: 2 finite numbers per vertex.
OptionalwasmThe encoder .wasm bytes, forwarded to createEncoderModule when the
shared module is created. Bundlers cannot always locate draco3d's own
.wasm next to its glue (Vite workers, inlined builds): fetch the
encoder asset (a ?url import of draco3d/draco_encoder.wasm) and pass
its bytes here. Ignored when encoderModule is given.
Options of encodeDraco: the encoder settings plus the extra attributes.