Skip to content

Support for more component types in metadata textures #13129

@mzschwartz5

Description

@mzschwartz5

Current state:

For the structural metadata extension, texels can encode metadata via property textures. Currently, the only supported metadata property type is UINT8. A texture can encode a (fixed-size) array of uints (interpreted in the shader as ivecN), or normalized uints (interpreted as floats), but it cannot use multiple channels to represent higher-precision numbers.

Desired state:

Represent higher precision ints and floats (up to 32 bits - using all 4 channels of each texel), as well as bools and smaller fixed-size arrays of higher precision (e.g. ivec2 with half-precision). Strings and dynamic arrays will not be supported still.

The underlying texture will still be RGB(A)8 format, but the data from each channel will be bit-shifted to form a higher precision format.

Some misc. notes:

  • The structural metadata spec states:

For unsigned integer component types, values are normalized between [0.0, 1.0]. For signed integer component types, values are normalized between [-1.0, 1.0]

Currently, since we only support the UINT8 component type, we only consider the first case here. We'll need to also consider normalized signed integer types going forward.

  • webgl 1 does not support uint types in glsl

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