Live data from Hacker News

WebGL: 80,000 particles

minimal.be

31–40 of 85 posts

Re: WebGL: 80,000 particles

#32
post #6

Is 80000 particles the limit? With Flash you could render +300000 particles years ago: http://www.unitzeroone.com/labs/alchemyPushingPixels/

Probably not. The author of this WebGL app is updating the particles on the CPU which probably explains the low particle count.

Now-a-days it's pretty much standard to use two floating-point off screen textures to store, update, and draw the particles completely on the GPU. This way, you can get 1M+ particles easy.

Re: WebGL: 80,000 particles

#35
It's actually 30,000 particles, not 80,000. See the source: "numLines = 30000".

If you set a breakpoint at that line (28), then you can edit the variable in the console to whatever you want. You can make it smaller without setting the breakpoint, but any higher results in a "attempt to access out of range vertices" error.

I can get it to ~40,000 on my iMac's 6970m 2GB without noticeable slowdown (this is w/ Chrome 20 dev.)

Re: WebGL: 80,000 particles

#36
post #6

Is 80000 particles the limit? With Flash you could render +300000 particles years ago: http://www.unitzeroone.com/labs/alchemyPushingPixels/

While looking pretty, the demo actually is fairly unoptimized. Each draw loop the vertex buffer is rewritten after iterating over and updating each particle's velocity.

Preserving state directly on the GPU makes it so you can get up into the millions of particles (depending on the videocard of course): http://mikecann.co.uk/projects/HaxeWebGLParticles/

Re: WebGL: 80,000 particles

#38
post #6

Is 80000 particles the limit? With Flash you could render +300000 particles years ago: http://www.unitzeroone.com/labs/alchemyPushingPixels/

That demo gets about 19 fps on my machine, whereas the WebGL demo appears to be getting close to 60, so that seems to be scaling pretty similarly. Also keep in mind that the demo you linked to uses Alchemy, which is C/C++ compiled to AVM2, so for WebGL to be getting roughly equivalent performance is pretty damned impressive.

Actually the 'math' was done using alchemy, the shader was pixelbender http://www.adobe.com/devnet/pixelbender.html However the example was flash then (3 years ago) vs webgl now. This is flash now; a version with 1.4 million particles using the new molehill http://www.simppa.fi/blog/1_point_4_million_particles/

Re: WebGL: 80,000 particles

#40
post #37

It looks very impressive. I'd love to see some kind of game using particles like that, something like Osmos: http://www.youtube.com/watch?v=pso6UBicLWU

Spheres of Chaos... Mmmm. http://www.spheresofchaos.com/

That would be a great game to port to the web.
Post reply on HN