News for hackers. Stuff that matters.
Re:Show HN: Exophysics – WebGL2 particle simulator by expenses2 on Monday December 07, 2020 @12:06PM (#25334087)
I thought that WebGL2 didn't have compute shaders. How are you doing this without them?
Re:Show HN: Exophysics – WebGL2 particle simulator by hut0 on Monday December 07, 2020 @02:57PM (#25336493)
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.

Re:Show HN: Exophysics – WebGL2 particle simulator by pjmlp on Monday December 07, 2020 @02:09PM (#25335850)
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.