Add support for Texture Buffer Objects (TBOs)
Increasing access
This would allow for more complex shaders which require more data while still making it possible to run them in realistic amounts of time. It would also help to introduce p5.js users to GPU based computing, which would be a great step forward for helping to develop the WebGL knowledge of beginners. For instance, high resolution voxel terrain which could use the increased amount of data transferring that TBOs allow for.
Most appropriate sub-area of p5.js?
- [ ] Accessibility
- [ ] Color
- [ ] Core/Environment/Rendering
- [ ] Data
- [ ] DOM
- [ ] Events
- [ ] Image
- [ ] IO
- [ ] Math
- [ ] Typography
- [ ] Utilities
- [X] WebGL
- [ ] Build process
- [ ] Unit testing
- [ ] Internationalization
- [ ] Friendly errors
- [ ] Other (specify if possible)
Feature request details
Create an official function that acts similarly to setUniform(), but offers more control over TBO specifics (e.g. texture type).
Similar to https://github.com/processing/p5.js/issues/7309
Hey I'm interested in working on this. The idea of adding more control over texture buffer objects seems really useful, especially for projects that need to handle larger datasets in shaders. I've been looking at how we could extend the current setUniform() functionality to give users more control over texture types and formats. Would love to help implement this - has anyone already started working on it? @davepagurek can you please guide on this I was thinking about an implementation with
gl.texBuffer(gl.TEXTURE_BUFFER, options.format, buffer);
const location = gl.getUniformLocation(program, name);
gl.uniform1i(location, options.textureUnit);
Hello @RandomGamingDev and maintainers,
I am interested in contributing to the Texture Buffer Objects (TBOs) support feature. I understand this is an advanced task requiring low-level WebGL and potentially large architectural decisions.
Before starting any implementation, I would like to get guidance on the API design. Specifically:
-
Level of Abstraction: Should the function primarily wrap
gl.texBufferdirectly (as suggested by @RandomGamingDev) to cater to power users, or should it integrate with p5.js's existing texture object model? -
Implementation Branch: Given the magnitude of this WebGL feature, should the PR target the stable
mainbranch or the ongoingdev-2.0branch?
I am prepared to research the existing WebGL context and draft a design proposal for review. Could you assign this to me for initial investigation and design planning?