-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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/data textures in WebGL2 and WebGPU #5921
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive PR - thanks for all the effort on this! 🙏 LGTM, but deferring to @mvaligursky for final approval before we can merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR, but I left a bunch of comments / fixes / suggestions before this can be merged.
Just to add here - I'd love to have an engine example here showing the use of some of these. Any thoughts on this @liamdon ? |
Thank you for all the comments @mvaligursky! I'll address the issues above. Regarding the engine example: yes, I thought about doing this but wanted to make sure you were OK with the idea before investing time in an example. I'll add an example to this PR, but likely over the weekend. |
Co-authored-by: Martin Valigursky <59932779+mvaligursky@users.noreply.github.com>
@mvaligursky addressed all your comments above - I really appreciate the rounds of review on this, the PR is much better now! Want to make sure you saw my note on |
I'm not sure you added the note. Perhaps it'd be the best to add a comment in the code to explain. |
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Sorry for the flurry of edits/suggestions. We generally try to keep JSDoc comments to 100 columns.... |
@willeastcott No problem! Do you use a formatter or IDE extension that flags those for you, or just eyeballing? |
Just eyeballed it. 😄 |
in VisualStudio code, you can add a ruler to draw a line at column 100. Go to settings, search for rulers, Edit .. and add something like this
|
Awesome, just enabled that. There's always a new VSCode feature to discover! I realized that my earlier replies/comments to you were not submitted @mvaligursky, I did not toggle on the Github review mode 🤦♂️ Let me know if I missed anything else, otherwise I think we are good to go! |
The only remaining issue for me is to change the pixel format Single letter type is something I'm already using for uniform types. Naming compatibility with WebGL naming is not very relevant in our API. |
Done - was not a strong opinion against that from me, but I wanted to present the 'WebGL' reasoning in case it was important. We are now using a single character for all the type suffixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic PR @liamdon , thanks for the contribution!
Add support for many of the signed/unsigned integer formats supported by WebGL 2.
Integer textures are very useful for emulating compute shaders in WebGL using data textures, voxel rendering and more.
With that said, new formats do require a few lines of repetitive definition code - 573 net lines here. I won't be offended if you decide that the potential use-cases are too niche to justify the added weight.
Happy Holidays!
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.
Example:
CleanShot.2024-01-15.at.08.47.45_1_2.mp4