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

WebGLRenderer: Add support for integer attributes with WebGL2. #19019

Merged
merged 1 commit into from
Apr 2, 2020

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Apr 2, 2020

WebGL 2 supports integer vertex attributes. However, it only works when vertexAttribIPointer is used. More details in the WebGL 2 specification, 5.31 "VertexAttrib function must match shader attribute type" . Also see this discussion.

To be clear:

  • Int32BufferAttribute is mapped to GLSL int.
  • Uint32BufferAttribute is mapped to GLSL uint.

The actual feature request comes from the forum.

@mrdoob
Copy link
Owner

mrdoob commented Apr 2, 2020

Nice!

@mrdoob mrdoob added this to the r116 milestone Apr 2, 2020
@mrdoob mrdoob merged commit d60217b into mrdoob:dev Apr 2, 2020
@mrdoob
Copy link
Owner

mrdoob commented Apr 2, 2020

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Apr 3, 2020

Should we do a webgl2 example for this?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Apr 3, 2020

Should we do a webgl2 example for this?

Still thinking about a demo that's not going to be too complex but still representative. Suggestion are welcome^^.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Apr 3, 2020

I'Ve prepared an example here: #19024 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants