Faking Simple Volumetric Fog

| 2 Comments

redMistPlane.jpg

Here's an old school way of faking volumetric fog. I'm not sure who invented the idea, but we used to do it this way back in the Eighties.

noFogPlaneRGB.jpg

Set up a scene.

noFogZ16.jpg

Use a camera-based grad to fake a Z-depth render. Let gray represent distance from camera - the further, the brighter. Render in 16 bits.

FogPlaneRGB.jpg

Slam in a ground plane. This will represent the height of the top of your ground mist.

FogZ16.jpg

Render out another 16-bit Z-depth image with your elevated ground plane in place.

fogSubtraction.jpg

Subtract one 16-bit Z-depth image from the other. This will give you an image of fog ray traversal lengths - exactly as if you ray-marched through the volumteric fog.

processedMask.jpg

You can tweak the contrast if you wish.

fogLayerMask.jpg

Use this volumetric ray-marched mask as a key mix between your rendered scene and an image of pure fog color. (I chose pure red for my full fog image)

redMistPlane.jpg

Here are the results again. You can adjust fog density to taste by adjusting the density of the Z-depth difference mask.

This technique is pretty old-school. For it to work you have to stay out of the fog.

2 Comments

thanks for sharing that!

I'm glad you liked it!

Leave a comment

About this Entry

This page contains a single entry by published on May 6, 2006 12:34 PM.

Bright-for-Dark Photography was the previous entry in this blog.

Maya Double-Sided Shader is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.