Skip to content

EXT_mesh_gpu_instancing should support quantized quaternions #1818

@zeux

Description

@zeux

EXT_mesh_gpu_instancing was just merged in #1691 but it specifies quaternions as FLOAT_VEC4:

For "rotation" the values are quaternion FLOAT_VEC4's in the order (x, y, z, w), where w is the scalar.

This is problematic for transmission size reasons. There's a substantial difference in size between a floating-point vec4 quaternion (16 bytes) and signed-normalized 16-bit quaternion (8 bytes). In the basic case I'd expect a typical instance stream to contain 12-byte positions and 16-byte rotations right now (assuming no scaling) which adds up to 28 bytes, vs 20 bytes for signed-normalized representation.

Additionally using #1702 the quantized quaternions can be compressed further with more efficiency compared to non-quantized quaternions.

gltfpack currently only implements quantized storage. Babylon.JS already supports quantized inputs, Three.JS can trivially do so as discussed on the issue.

I'd like to ask that the spec be amended to change the rotation requirements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions