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

Support for Integer vertex attributes on WebGL2 #5816

Merged
merged 1 commit into from Nov 10, 2023

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Nov 10, 2023

Fixes #3930

  • Int/uint attributes are now supported - which makes them available in shader as int/uint numbers, instead of as floats.
  • This is also used on Splats, WebGL2 uses integer splat IDs to match WebGPU. Only WebGL1 uses floats.

New API

  • VertexFormat.description[].asInt - true to interpret as int attribute, false as float (default)

example:

        const vertexFormat = new VertexFormat(device, [
            { semantic: SEMANTIC_ATTR13, components: 1, type: TYPE_UINT32, asInt: true }
        ]);

@mvaligursky mvaligursky merged commit a72b99e into main Nov 10, 2023
7 checks passed
@mvaligursky mvaligursky deleted the mv-int-attributes-gl2 branch November 10, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support integer formats of vertex attributes
2 participants