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.
> 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.
https://www.youtube.com/watch?v=makaJpLvbow <- this one is pretty awesome too. A very simple rule and quite the complex behavior. Though I'd recommend watching it at 175% speed, muted, and perhaps with the 1812 Overture as the background music.
It's a pity that Safari is a little slow to implement WebGL2. Your message on chrome though sounds like a legit bug, since normally, Exophysics reduces the number of particles to match the hardware/browser capabilities, and here they're exceeded. Will investigate.
True, but that law was established to discourage any research in that domain, reducing the overall occurences of sentience-incidents and the resulting messy philosophical questions.
Hey people, I built this particle simulator in ~500 lines of self-contained HTML/JS/WebGL2.
It's designed to encourage creativity and exploration. You can just download one of those universes and open up the HTML file in a text editor to tweak the physical laws and constants. Then open it up in your browser to see the result immediately.
I had a lot of fun exploring the beautiful emergent behaviors that arise from those simple rules, give it a try too! There's plenty of documentation and you don't need to be a programming wizard. :)
https://exophysics.net/
It's more simple, and more about physics than biology, but the emergent phenomena are pretty interesting nevertheless. This universe comes the closest to a life simulation: https://exophysics.net/exhibit/mordial.html [based on the Primordial Particle System, https://www.youtube.com/watch?v=makaJpLvbow]