1024_Particle_Cloud

franz's picture

Hiya, for some reason i just had to develop a custom particle cloud plugin, using vertex arrays. I thought i could share it with the community.

Here's a sample vid: http://www.vimeo.com/9781906

More info on my blog: http://1024d.wordpress.com/

A sample comp is included in the zip.

PreviewAttachmentSize
1024_Particles_Cloud.zip15.02 KB

gtoledo3's picture
Re: 1024_Particle_Cloud

Cool one Franz.

It's interesting how the image input winds up over the whole group of particles.

What kind of source images are you using there? Things that I've been trying considerably darken the particles. I tried video over the whole scene, and also a gaussian/billboard inside of a render in image, with a gamma control on the output... still pretty darn dark.

This reminds me of the image particles patch in a lot of ways, but different and also neat and unique.

Thanks again, this is great; I'm all about the particles, and having more twists on that is wonderful.

cybero's picture
Re: 1024_Particle_Cloud

That's really impressive, like the time-lining on the shake, repel and attract BTW.

Takes an image pretty well, but until I mixed up two of your patches with different image inputs and timeline references I had thought that on 10.6.2 it just didn't colour up without an image, or so it would have seemed.

Actually, although it took an opacity, my perception is that it doesn't actually read the colour value other than the opacity.

The Fade by Speed really does help with differentiating between one particle set and another, set one to fade and the other to not.

Lots of tweakability :-) .

PreviewAttachmentSize
_1024_Viz.qtz805.41 KB

gtoledo3's picture
Re: 1024_Particle_Cloud

Ok, new comment(s) :-)

I know this probably suited your purposes 100%, so take all this with a grain of salt, and knowing that I totally appreciate the free plugin!

-Ability to texture the particle would be a big plus.

-Blend modes would be great.

-Ability to set an input coordinate (x/y/z), that the particles would attract or repel against would be slick, because it would allow for some interesting cloud movement.

-If I could figure out how to effectively use that image input (this may be user error, or not quite "getting it"), I feel like taming the edges of the particle box with a gaussian or circle(s) would give a nice fade and make the whole particle scene look roundish. It looks like the image input might be doing some kind of subtract blend (?)

cybero's picture
Re: 1024_Particle_Cloud

You need to use Generic RGB and pray - seems to be a pit pot luck , all told. won't carry a colour setting on it's own - the visualizer I posted up will mean far less for not having an image input.

Preview .psd file type is good and size seems less important than colour range, although, in one experiment, I reduced both images that were working by 25 % and in that case only the red one's worked , even though the blue ones worked AOK before reducing in size.

& just discovered a blue Preview raster as .psd Generic RGB reduced size that works - whoopee

find attached the visualizer with the images used

PreviewAttachmentSize
Archive.zip810.95 KB

franz's picture
Re: 1024_Particle_Cloud

the source image input port is disabled. Pluging any image into it won't do anything. The port is here because i plan to use GL_POINT_SPRITES in the future, allowing for textured particles. Sorry if this was disturbing and needlessly took some of your time.

cybero's picture
Re: 1024_Particle_Cloud - it does do colours too :-)

Image port is disabled, but plugging in an image does do something .

Although it doesn't render the image presented, it does take some colour values from that image, whilst the Colour input allows for an input choice, but it does not render the input colour value.

Often as not, disabled usually means entirely unavailable too :-)

Certainly gives some indication for what might well become available later on in the plugins development.

Interesting idea, why does it remind me of something I saw elsewhere on the web recently ?

If you look at the two files I've previously uploaded, franz, you'll see that they are obtaining colour values from the input images embedded.

Just try unhooking the images and the particles produced will become white, at least that's the rendered result in my Viewer window.

Whatever, it's an interesting idea for a plugin.

PreviewAttachmentSize
1024_Particles_coloured.png
1024_Particles_coloured.png322.46 KB
1024_Particles_uncoloured.png
1024_Particles_uncoloured.png125.75 KB

cybero's picture
Re: 1024_Particle_Cloud - out of focus behaviour

Franz,

Is it intentional that the particle motions can literally cease and remain ceased if the Viewer window is out of focus [unselected although ostensibly rendering live] ?

cybero's picture
Re: 1024_Particle_Cloud

Maybe a bit too early for wishlisting but what about Mouse Input to steer the particles - Repelling, Attracting, etc ?

.lov.'s picture
Re: 1024_Particle_Cloud

Awesome! Color input is also disabled or its a bug?

franz's picture
Re: 1024_Particle_Cloud

mouse input is already functioning. see updated example.

PreviewAttachmentSize
_1024_Particles_Cloud_MOUSED.qtz20.87 KB

franz's picture
Re: 1024_Particle_Cloud - out of focus behaviour

there's a decay force apllied to all the particles. Not sure if that's what you re mentioning tho.

cybero's picture
Re: 1024_Particle_Cloud

OK so much for my being up to speed with that :-) -

BTW, figured out what this reminds me of, and that's a YouTube video post linked from quartzcomposer.dev by Mirek about an Objective-C plugin.

Have you found that the Image input does take the input image's colour information after a [rudimentary] fashion, Franz?

P.S - it doesn't like .png at all BTW.

P.P.S - it will iterate but doesn't need or suit more than 3 or 4 iterations , but will not accept colour information into Image input from a Generic RGB image like it would outside of an Iterator - see attached example.

PreviewAttachmentSize
_1024_Particles_Cloud_MOUSED iterated.qtz50.58 KB

cybero's picture
Re: 1024_Particle_Cloud - out of focus behaviour

Yeah, that's sounds about right, the particles pick up again, once that window has regained focus.

franz's picture
Re: 1024_Particle_Cloud / Corrected Version

Here's an updated version, with a clearer port description.

Color is now working. Blending mode should be set to Addition (GL_SRC_COLOR, GL_ONE) Few other controls, for your tweaking needs, such as particle speed decay.

PreviewAttachmentSize
1024_Particles_Cloud.zip22.1 KB

cybero's picture
Re: 1024_Particle_Cloud / Corrected Version

Just picked up on the update - works very nicely and both Image and Colour input are now of affect, although Image input is obviously kind of unsupported', it still adds additional colouration.

gtoledo3's picture
Re: 1024_Particle_Cloud / Corrected Version

Question...

Does this particle system have depth testing enabled by default, or?

.lov.'s picture
Re: 1024_Particle_Cloud / Corrected Version

what a nice update! Thanks for sharing :)

franz's picture
Re: 1024_Particle_Cloud / Corrected Version

i don't think so sorry. The plugin is just rendering the particles in their index order, no matter their actual position on the z axis, using ADDITIVE blending. Depth testing would require some calculations i guess. Any link on how to do this using openGL is welcome.

Meanwhile, here's a Quartz Crystal render using feedback and vade's v002 blur. - sorry about the compression artifacts -

And the corresponding QTZ, which also uses FSK'simplex plugin.

PreviewAttachmentSize
_1024_Particles_Cloud_FDB.qtz8.92 KB

smokris's picture
Re: 1024_Particle_Cloud / Corrected Version

franz wrote:
Depth testing would require some calculations i guess. Any link on how to do this using openGL is welcome.

The QCPatch API provides settings for this for free.. But unfortunately it's not exposed in the public QCPlugIn API. I just filed radr://7727982 to hopefully see this addressed eventually.

In the meantime you should be able to do something like this:

bool oldDepthTest = glIsEnabled(GL_DEPTH_TEST);
if(!oldDepthTest)
   glEnable(GL_DEPTH_TEST);
 
GLint oldDepthFunc;
glGetIntegerv(GL_DEPTH_FUNC,&oldDepthFunc);
if(oldDepthFunc!=GL_Less)
   glDepthFunc(GL_LESS);
 
...render...
 
if(oldDepthFunc!=GL_Less)
   glDepthFunc(oldDepthFunc);
if(!oldDepthTest)
   glDisable(GL_DEPTH_TEST);

cybero's picture
Re: 1024_Particle_Cloud / Corrected Version

Unfortunately the simplex noise plugin is giving me grief. - see post on that thread.

As a result, cannot see how this composition is meant to work, except in the video.

As I do know, however, the 1024 particles plugin does indeed work AOK for me on 10.6.2.

franz's picture
Re: 1024_Particle_Cloud / no simplex

Here's the comp without simplex, random instead.

franz's picture
Re: 1024_Particle_Cloud / Corrected Version

thanks smokris for the tip. will try that and report back.

cybero's picture
Re: 1024_Particle_Cloud / no simplex

cheers, that's very considerate of you, franz :-)

& now simplex updated & working with - well everything.