Emulating fog with quartz

Veiss's picture

Hello, I was wondering if someone could point me in the right direction or show me some examples of ways to create fog in quartz as I'm still kind of young with quartz knowledge. I'm envisioning fog that slowly moves around, and i want to have audio control the hue of it. I did notice the fog macro patch, but i haven't really got it to do much. I just have this idea in my head of what i want, but don't quite know how to get there. Hopefully someone can help, and i can learn something too. Thanks!

cybero's picture
Re: Emulating fog with quartz

The Fog patch doesn't do anything much like you want it to.

GLSL shading perhaps , after a fashion.

OpenCL - 10.6 dependent of course - possible, after a fashion [ and a wing and a prayer].

toneburst's picture
Re: Emulating fog with quartz

Depends what you mean by 'fog'. In 3D graphics, the term 'fog' usually just means an effect whereby the colours in a scene are altered as a function of depth, usually fading to a fog colour as they get further away from the view plane. I think what you're thinking of is more a kind of volumetric smoke effect. It's a bit more complicated, and quite difficult to do convincingly in realtime, I suspect.

a|x

dust's picture
Re: Emulating fog with quartz

you might want to try and download the opencl zip from apples developer site it has a file called wind tunnel which you could tweak to look some decent fog or smoke but its taxing on your system. you could try with the a particle patch as well. it won't be volumetric but you can fake some foq and water with it.

gtoledo3's picture
Re: Emulating fog with quartz

I'm attaching an example of a way to have a pseudo volumetric fog in quartz composer.

However, I would do something way more stylized than this attachment if I was making a visualizer. I don't think that it's quite as simple as making audio control hue that would make something look attractive, in my opinion. It's in the fine points of refining the source image (in lieu of this standard particle generator I'm using), that would make it potentially look cool.

In contrast to other comments, I would advise that using OpenCL would be largely pointless, unless you wanted some kind of actual simulation of physics, and even then, I would tend to use some other particle engine, like kineme particles. OpenCL=not ready for primetime. It's promising, but even the Apple OpenCL particle system examples that have been referred to aren't stable. The "fog" is also totally "2D" in the example with the car/wind tunnel; again, that example is more of a display of physics.

PreviewAttachmentSize
pseudo volumetric fog_gt.qtz16.56 KB

cybero's picture
Re: Emulating fog with quartz

Nice use of a Particle System to create a 'fog'.

I'd been looking into GLSL, but had initially been doing so on 10.6.

However, having had enough of that distro's capriciousness in the face of GLSL & OpenCL I've decided to stick to the far more reliable and productive Leopard.

Got some good effects by layering a second particle system, tinkering with the colours and employing some Fog and Lighting patches and using GL Scale and Look at.

gtoledo3's picture
Re: Emulating fog with quartz

As far as the particle system goes, it's almost a place holder... I feel like it's the iteration and queue that gives much of the effect. One could take a texture image, use some clever CI warping, and probably get something pretty foggy, just using that in place of the particle system. It just depends on what the desired type of "fog" is. If I wanted whisps or something, I would likely go an entirely different route.

This is a kind of setup for making a glsl fog in 2D.... this doesn't use a texture/image input, it just uses lighting+vertex distortion with GLSL to create the "texture". It can be useful in some ways that the other setup might not be. There are so many ways that this could be approached that it's hard to point to one ultimate path. Kineme texture patches and the particle tools could be pretty useful for this type of thing as well.

PreviewAttachmentSize
GLSL 2D Fog_gt.qtz7.43 KB

cybero's picture
Re: Emulating fog with quartz

Been tinkering around with your old faithful example and trying out some of the other standard 3D Labs and nVidia [ their ears must be burning ] GLSL shaders, and finding even that level of GPU / CPU to be so provocative of freeze ups in 10.6.1, I have just given up on that OS, for at least 48 hours.

Been much more productive as a result.

This GLSL Fog works very well as a backdrop , of course GLSL grids can make layering objects a trifle tricky IMETD [nigh impossible :-)], that's why I like the Particle System better, more easily configurable.

Veiss's picture
Re: Emulating fog with quartz

Thanks for the examples. I've made some modifications to get closer to what i was looking for and hooked up a joystick and audio. Any way to make it look a little more smokey?