Snow.qtz Javascript Fix and Particle Count Mod

gtoledo3's picture

When looking at a recent post by yanomano about array size, I realized that the Snow.qtz example from the Apple Developer Examples "OpenCL" download suffered from a very similar code setup to set the particle positions.

I have changed that so that when the particle count is reduced, that the structure reduces correctly.

Also, I have noted that when the qtz is initialized, that it runs a bit "oddly" until particle count is reset. This amounts to the distribution of particles not being as even looking, and performance being a bit more uneven. I'm not sure if this has always been the case with this composition, but I've added a small portion to the setup to create a pulse at startup that quickly adds and subtracts a particle on startup, and any time that particle count is changed thereafter. This smooths performance on my system.

Snow_with Javscript and Count Mod_gt.qtz46.18 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cybero's picture
Re: Snow.qtz Javascript Fix and Particle Count Mod

Cheers, much more interesting than the World Cup.