Hacker News new | past | comments | ask | show | jobs | submit login

I thought that WebGL2 didn't have compute shaders. How are you doing this without them?



I 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#) 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/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.


You 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.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: