Volume Fog - How does it work? (101)

User avatar
SirEdric
Fusionator
Posts: 2405
Joined: 10 years ago
Real name: Eric Westphal
Been thanked: 6 times
Contact:

Volume Fog - How does it work? (101)

#1

Unread post by SirEdric »

So what's that VolumeFog all about?
Well...in most cases it's about getting one's head round *how* the thing actually works,
*what* it does to generate those mysterious volumes,
and *how* we could utilize that knowledge to ... well ... generate cool looking, fast rendering volumetric effects.

The Basics of VlF
So here we go with the most simple VlF setup possible.
A 3D Scene with a Camera and an 'invisible' Sphere that encompasses the entire scene.
That Sphere is of utter importance when it comes to VlF since it provides data for XYZ or WorldPosition to the VlF.
Make sure to bring the Opacity down and uncheck the 'Ignore Transparent Pixels' option.
VlF000_TransparentPixels0.jpg
VlF001_TransparentPixels.jpg
Also make sure that the Render3D outputs WPP and....voila! The result is ...meh... a soft cube.
VlF000_Result.jpg
VolFog_WSL_Setup001.comp

Build a Volume
So how is this stupid volume created anyways?
Think of the VlF like it's taking an image and putting it into space multiple times one behind the other.
Since the default 'image' is just a white plane, putting many white planes behind one another results in a cube.
Let's spice this up a bit.
We'll add a Text+ and since it's meant to become a 'volumetric texture', let's keep it's size at somewhat like 256x256.
Type something like '1' into the Text and make sure the Number fills the entire image.
Connect the Text+ to the VlF ... and ... interesting ... the fog now looks like an extruded version of the number 1!
VlF001_Number.jpg
VolFog_WSL_Setup002.comp
Pump up theVolume
Righto...time to play.
Add a Timecode modifier to the Text+, set it to frames only, and in the VlF set the z-slices to 16.
VlF003_tc.jpg
VolFog_WSL_Setup003.comp
So now, for any of those slices the VlF takes a different image (generated by the Text+'s Timecode).
Still doesn't look like a fancy cloud, but it explains the concept.
You might notice the 'First Slice Time' slider is set to a static value of 1.
So if you play back your comp, the shape of the fog won't change.
Let's get a bit more fancy and put a simple expression in there: time
VolFog_WSL_Setup004.comp
Play back and ... whooo! ... the blurry numbers seem to move through the fog! Creepy!

Now replace the Text+ with a FastNoise of the same size and some SeetheRate.
VolFog_WSL_Setup005.comp
Congratulations!
You just built your first jet-stream-like-volumetric thingy(ish).
But how to make actual volumes (like from particles or the like) into a volumetric fog?
Well ... that's for the next part of this topic...:-)

Added in 4 minutes 22 seconds:
Spoiler
Really? Well...we will end up with something like this. Or not. Who knows...:-)
VolFog_WSL_Setup100.comp
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 7924
Joined: 10 years ago
Location: Vancouver, Canada
Mood:
Has thanked: 78 times
Been thanked: 72 times
Contact:

Re: Volume Fog - How does it work? (101)

#2

Unread post by SecondMan »

Excellent, excellent topic @SirEdric, thanks for taking it on!

VolumeFog is such an understated tool in Fusion. It's the sleeper car of compositing and a dear old friend of mine :)

And my oh my, I may have stumbled on a Fu16 bug because of it... Specifically in VolFog_WSL_Setup002.comp:

Fu9:

Image

Fu16:

Image

Need to dig a little further but it's bedtime now :)

andromeda_girl

Re: Volume Fog - How does it work? (101)

#3

Unread post by andromeda_girl »

Vfog is one of my faves to play with over the years. wish we had way more hardcore tutorials on it :)

Captain LeBuck
Fusioneer
Posts: 91
Joined: 10 years ago

Re: Volume Fog - How does it work? (101)

#4

Unread post by Captain LeBuck »

Aye, my favorite tool as well. Indeed the volume fog tool seems to change slightly with almost every version of Fusion. Although I love it it needs to catch up with modern tools. When doing some serious VF works, heavy memory consumption and loads of Fusion restarts are inevitable.

Robert Zeltsch, creator of the volumeFog tool apparently had the idea for the volume fog tool on the toilet :)

User avatar
SirEdric
Fusionator
Posts: 2405
Joined: 10 years ago
Real name: Eric Westphal
Been thanked: 6 times
Contact:

Re: Volume Fog - How does it work? (101)

#5

Unread post by SirEdric »

So here we go with Part 2.
Let's have some fun with the concepts we just learned.

Reset the VlF's shape parameters and create a FastNoise.
This time we're a bit more adventurous and go for a 1024x1024 size.
Make the gradient radial, play around with the settings, stretch your Fog in Z, and add a few more samples.
VlF101_Shape.png
VlF101_Tunnel.jpg
VolFog_WSL_Setup101.comp
Whoo-hee! We're flying through an endless tunnel of fog! (name the show...:-))

Wanna go even more fancy? Add a Shake to the FN Gradient's Start.
VlF102_Tunnel.jpg
VolFog_WSL_Setup102.comp
And now? Now we go for the icing on the cake. Light.
Add a PointLight to your 3D Scene, position it somewhere in negative Z (but still inside that invisible sphere!),
give it some color, some intensity, and falloff.
Go to the VlF's Light tab and enable Light.
VlF103_Light.png
Whoosh!
VlF103_Tunnel.jpg
VolFog_WSL_Setup103.comp
Now go and play a bit with that setup, while I prepare breakfast...:-)

Added in 49 minutes 54 seconds:
PS:
For bonus points modify your Camera3D's X and Y offset with another Shake...:-)
You do not have the required permissions to view the files attached to this post.

User avatar
SirEdric
Fusionator
Posts: 2405
Joined: 10 years ago
Real name: Eric Westphal
Been thanked: 6 times
Contact:

Re: Volume Fog - How does it work? (101)

#6

Unread post by SirEdric »

And here's a different setup.
All based on the same priciples. So have a look and analyze what's going on there.
VlF201_Sky.jpg
VolFog_WSL_Setup201.comp
You do not have the required permissions to view the files attached to this post.

User avatar
SirEdric
Fusionator
Posts: 2405
Joined: 10 years ago
Real name: Eric Westphal
Been thanked: 6 times
Contact:

Re: Volume Fog - How does it work? (101)

#7

Unread post by SirEdric »

Another slice?
So far we used FastNoise to create those slices we need for a nice looking volume.
But what if we had something like a ParticleSystem that we want to make into a VolumetricFog?

[warning: Time is running short, so there will be lots of text and not so many explanations ahaed!]

Well ... you might have guessed ... we need to carve our ParticleSystem into nice slices.
There are a few caveats there and a bit of abstract thinking envolved as well, but here we go.

What we need to do is to move our Camera3D through that ParticleSystem.
The number of frames it takes to travel through is determined by the number of z-slices.
So with 16 z-slices you want your camera to travel through the Particles System over a period of 16 frames.
Obviously this could be done manually, but when you change the z-slices in the VlF, you'll have to manually update the animation as well.
So in the example I used an Expression on the Camera's z-position: Start-((Range/(VolumeFog1.ZSlices/2))*(time%VolumeFog1.ZSlices))
Not as intimidating as it looks. It basically says 'Travel from a defined start point to a defined endpoint over a period of time determined by the z-slices'.

You want to adjust your Camera's start and end point so that it starts right at the biggest extent of your ParticlesSystem and ends right after it has cut through the last bunch of particles. In other words make sure that there's something rendered on each of those 16 frames.

In order to only show a certain portion of the ParticleSystem one could use the Camera's own near and far clip controls.
And of course adjust those so that the clipped portion, or slice thickness, equals roughly 1/16 (or 1/ZSlices).
However, Clip does what the name implies. It hardclips everything, which might result in nasty flickering.
So I used two Softclip Tools, one for the near, the other for the far range and added a bit of falloff.
Again, these have some expressions to make the entire process more intuitive.
I have to dive into that at a later point in time.
(Time's really runnig short...need another weekend for this...:-))

So far so good for a static ParticleSystem. But what if want a dynamically moving System into a Volume?
Did I mention abstract thinking? I guess I did.
So in this example we use a Time3D to freeze the System for 16 frames while the camera slices through it,
(and the VlF consumes those 16 images to make them into volumetric slices),
then advance one frame in terms of the animation of the ParticleSystem, freeze that again, have the camera travel through it,
rinse, repeat,...
Of course the Time3D is connected to the number of slices as well via a simple Expression: math.ceil(time/VolumeFog1.ZSlices)

Did I mention caveats? I think I did.
Imagine a 100 frame particle explosion you want to make into a volume.
With 16 slices on each frame you need to render 1600 sliced-frames.
Meaning, when your comp's GlobalEnd is set to 1000, the comp will fail after rendering 62 frames.
Weird. But that's how it is with this setup.
There are other ways (as always in Fusion) and I hope to get the time to explain those as well.
(After adding more examples to this one....sigh...:-))

Conclusion
To bring Volumes from other 3D packages into Fusion, you need to slice them up and make those slices into an image sequence
(from which the VlF consumes a certain number of frames for each volumetric frame) or into a sequence of sprite sheets,
or, or, or,.....

Hopefully this thread did shed some light on the endless possibilities there are with VlF and showed a couple ways on how to get there.

Cheerio.

Eric.
You do not have the required permissions to view the files attached to this post.

User avatar
French_Fry
Fusionista
Posts: 372
Joined: 10 years ago
Location: Nashville, TN
Contact:

Re: Volume Fog - How does it work? (101)

#8

Unread post by French_Fry »

Very very cool Eric!
I remember going through those videos you setup back in Fu6.4. The VolFog is really awesome, but I also found it to be very technical. It was fine at the time, as it was new and exploratory, but seeing how awesome it could be I always wished it could have been developed more to make it more artist-friendly. If a little more could have been done under the hood, that tool would have taken off.
Someone explained to me one day the math to get animated fog in there using the fractal noise node, and it took me a while to wrap my head around it. I couldn't set it back up today.... If an artist wants fog, there's a good chance he might want it animated also. I just wished there was a 2.0 version of it that was artist-friendly, and not just TD friendly. :) Maybe one day... :) Thanks for the refresher course!

User avatar
SirEdric
Fusionator
Posts: 2405
Joined: 10 years ago
Real name: Eric Westphal
Been thanked: 6 times
Contact:

Re: Volume Fog - How does it work? (101)

#9

Unread post by SirEdric »

I think where VlF really shines is when you get beauty renders out of some 3D Software, together with a WPP.
Then Displace an imageplane with that WPP and use *that* to add fog to your scene....:-)

User avatar
bowserlm
Fusionista
Posts: 350
Joined: 6 years ago

Re: Volume Fog - How does it work? (101)

#10

Unread post by bowserlm »

Curious to see an example of that setup. With animated fog ;)

I know those Anonymous shots were accomplished this way - which is still some of the best demonstrations of what Fusion can do.

I've just never see any examples since that were on that level.

andromeda_girl

Re: Volume Fog - How does it work? (101)

#11

Unread post by andromeda_girl »

While I would prefer to see Fusion import Houdini VDBs instead of using the slices, this methodology still works brilliantly.
I have yet to see a setup with Houdini volume-slices doing its thing with animated volumes from an image sequence of those slice-maps, and I would be interested to see an example of these.
Robert's example demonstrates this, however he utilized custom tools with unique slice-map exports from Houdini that the video does not get into in detail, and as those tools were custom it is not something the Fu community can play with --unless he feels generous and it lands on Reactor ;)

Regarding VDB importing, a colleague is testing VDB import into nuke however it has to be used in Eddy, which is just terribly expensive at 2500USD/per seat and still requires the heavy render times [nuke's GPU capabilities are still ghetto at best]
So AFAIAC Fusion's Vfog solution is still a more efficient workflow, even without direct VDB import capability.

Hopefully in the next day or so I can have testing in play at work for a proof of concept, there has been a lot of grumbling about making the fx pipeline more efficient and this is where Fusion can shine a light on things vs a pricey comp alternative that doesn't provide faster throughput.

User avatar
SirEdric
Fusionator
Posts: 2405
Joined: 10 years ago
Real name: Eric Westphal
Been thanked: 6 times
Contact:

Re: Volume Fog - How does it work? (101)

#12

Unread post by SirEdric »

andromeda_girl wrote: 5 years agoI have yet to see a setup with Houdini volume-slices doing its thing with animated volumes from an image sequence of those slice-maps, and I would be interested to see an example of these.
If anyone can supply a sequence of Houdini-Sliced Volumes, I'm all in.
Unfortunately my only experience with Houdini so far is that I learned how to double-click the Icon to start it....:-)

User avatar
ISOTRON
Fusioneer
Posts: 181
Joined: 10 years ago
Location: Germany, Munich
Contact:

Re: Volume Fog - How does it work? (101)

#13

Unread post by ISOTRON »

to play with....
mostly the value "assymetrie" on negative value, make your lights visible as spots in the fog. and u can play by mixing them like magic :)
->clickme
LightVolFogNegAsym_[0212-0253].gif
LightVolfogNegAsym.comp
LightFogAsyme.JPG
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 7924
Joined: 10 years ago
Location: Vancouver, Canada
Mood:
Has thanked: 78 times
Been thanked: 72 times
Contact:

Re: Volume Fog - How does it work? (101)

#14

Unread post by SecondMan »

That's a great little tip, thank you! :)

User avatar
Movalex
Sir Requestalot
Posts: 407
Joined: 7 years ago
Real name: Alexey Bogomolov
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Volume Fog - How does it work? (101)

#15

Unread post by Movalex »

For some reason this does not work in Fusion 16... Are there any changes to how VolumeFog works in v16?