3 ms·
I thought that WebGL2 didn't have compute shaders. How are you doing this without them?
by expenses2 6y ago
I thought that WebGL2 didn't have compute shaders. How are you doing this without them?
- pjmlp 6y agoYou can fake it by misusing textures. Actually there is a compute shaders extension, but it is only available in certain drivers configurations in Firefox. Chrome only plans to support WebGPU.
- hut0 6y agoI use transform feedback, which allows vertex shaders to send data back to the application. You could do this with textures as well, as described by pjmlp. I did this in an earlier version (https://github.com/hut/cellmade# https://github.com/hut/cellmade#) but it just felt SO WRONG. I was very happy that I found out about transform feedback to be able to do it more cleanly. https://developer.mozilla.org/en-US/docs/Web/API/WebGLTransformFeedback https://developer.mozilla.org/en-US/docs/Web/API/WebGLTransf... > The WebGLTransformFeedback interface is part of the WebGL 2 API and enables transform feedback, which is the process of capturing primitives generated by vertex processing. It allows to preserve the post-transform rendering state of an object and resubmit this data multiple times.