Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXT_accessor_additional_types #2395

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions extensions/2.0/Vendor/EXT_accessor_additional_types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# EXT\_accessor\_additional\_types

## Contributors

- Sean, [@spnda](https://github.com/spnda)

## Status

Draft

## Dependencies

Written against the glTF 2.0 spec.

## Overview

Similarly to the `KHR_mesh_quantization` extension, this extension offers additional accessor data types for use-cases where the traditional values either offer too much precision, and are therefore wasting memory, or offer too little precision.

This extension expands the list of component types to additionally support 16-bit half-precision floats, which are commonly used for UV texture coordinates, and for larger data types, such as 64-bit double precision floats, and 64-bit integers.

This extension adds an exhaustive list of all currently supportable types, so that other extensions can make use of them for different use-cases. Additionally, this extension also allows 16-bit half-precision floats as an additional type for UV texture coordinates, as they are commonly used to optimise memory usage, since they often have next to no effect on quality, and is supported by most modern GPUs and graphics APIs.

Assets that make use of this extension must mark it as required, as it cannot be optional, since there is no method of switching component types based on supported extensions.

## Extending Accessor Data Types

When the `EXT_accessor_additional_types` extension is supported, the following **extra** accessor data types are allowed for usage in accessors in addition to the types defined in [Section 3.6.2.2](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#accessor-data-types).

|componentType|Data type|Signed|Bits|
|-------------|---------|------|----|
|5124|signed int|Signed, two’s complement|32|
|5130|double|Signed|64|
|5131|half float|Signed|16|
|5135|unsigned long|Unsigned|64|
Copy link
Contributor

@aaronfranke aaronfranke Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about 5134 / 0x140E, for signed long? It seems odd to have signed and unsigned versions of 8-bit, 16-bit, and 32-bit integers, but only have unsigned 64-bit integers. The value 0x140E is defined in OpenGL (line 3202) and in LWJGL.


The new floating point accessor data types must use IEEE754 double-precision format (binary64) and half-precision format (binary16), respectively.

## Extending Mesh Attributes

When `EXT_accessor_additional_types` extension is supported, the following **extra** types are allowed for storing mesh attributes in addition to the types defined in [Section 3.7.2.1](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#meshes-overview).

|Name|Accessor Type(s)|Component Type(s)|
|----|----------------|-----------------|
|`TEXCOORD_n`|VEC2|_half float_|

## Extending Morph Target Attributes

When `EXT_accessor_additional_types` extension is supported, the following **extra** types are allowed for storing morph target attributes in addition to the types defined in [Section 3.7.2.2](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#morph-targets).

|Name|Accessor Type(s)|Component Type(s)|
|----|----------------|-----------------|
|`TEXCOORD_n`|VEC2|_half float_|