Volumetric Fog

Volumetric fog allows the atmosphere surrounding your model to participate in the lighting calculation. Effects such as “sun streaks” or “light beams” can be accurately modeled using this effect. Tips on achieving both of these specific phenomena are discussed below.

Nighttime fog scene - see Nighttime Fog Tips below. (It took about 1,000 passes for this rendering to converge and smooth out.)
Chick Inn Model courtesy of MuseumMaker - See: Sketching Ypsi


FAQ - Why can't I see any fog

When we first used fog, we didn't see any either. We have fixed, or added warnings, for many of the thing we ran into. But this list may help.

Most of these items are discussed later in the Volumetric Fog Article


  1. Enable Volumetric Fog on the Fog Setup Tab
    If you forget this step you will not get any fog.

  2. Use the Path Tracer Engine
    We have added some warnings if you try to render with Fog enabled, but not the Path Tracer Engine.

  3. Don't use Section Planes
    There is currently a bug where Fog does not work when viewed through a section plane. You will need to hide or delete geometry instead if you want to see through walls, etc. until we get this fixed.

  4. Wait long enough so that the lights creating the fog appear
    The default is for only 1/3 of the lights to appear in each pass, so wait 6 to 10 passes before you give up on the fog.

  5. Make sure Scattering is set properly
    Scattering is the amoun that light is scattered by the fog. If you don't see any fog, set it to 50%. You can raise or lower it later once you are able to see the fog.

  6. Don't set values too high - If Scattering or Absorption is too high, then you may just get a dark rendering with no light passing through.

  7. Check the Fog Boundary
    For my first rendering I did not set the fog boundary. Since then we have added some default boundaries - such as the model boundary.

  8. Make sure the fog boundary does not intersect any other faces.
    We have made the default boundary 5% larger than the model. If you set your own boundary, make sure there are not any coplanar faces in th model which intersect the boundary.

To enable volumetric fog

  • Volumetric fog requires the Path Tracer , it is not available in the standard engine.
  • On the Lights Tab , click the Enable box in the Fog group.
  • After you enable fog a box will appear in your model. This box controls the extent of the fog. It can be stretched using grip points, scaled, rotated, and moved.

Path Tracer Engine

Volumetric Fog requires the nXt Path Tracer engine.

This engine can create special effects like fog, but does so at the expense of a more complex and time-consuming calculation. The Path Tracer begins by displaying a very grainy or “noisy” image which gradually refines and becomes smooth. This process is known as convergence. Some scenes will converge very quickly, others will take many hours.

After just a few passes, the image appears quite noisy, but may be sufficient to determine if the scene is set up properly. I will usually take 100's 0r 1,000's of passes to get a good final image. Each pass is faster than with the Packet Mode Engine, but it will still usually take longer to get a useable result with the Patch Tracer.

10 passes - early on the rendering has a lot of unresolved pixels. The final image is beginning to take shape but will need many more passes before it is complete.
250 passes - you can see how this is going to work, and stop the rendering if you want to make changes. But it will probably take about 1,000 passes to get a good image with fog.
1000 passes - after about 1,000 passes the scene has converged fairly well.


Smoothness Filters

Use of the smoothness filters, included in IRender nXt, can also help resolve the image.

This two images are spot lights in haze, after 250 passes.

The one the left is the images as rendered, the one on the right has a 3x3 Gaussian Smoothness filter applied.


The smoothness helps converge the pixels, and the slight blurriness it adds is acceptable in a foggy scene.

250 passes - original image
250 passes with Gaussian 3x3 Smoothness filter applied.


This is the same scene, rendered for 1,000 passes without a smoothness filter. The extra passes definitely create a smoother, more complete image.

1000 passes - no filters


Fog Boundary

The Fog calculations require a boundary to determine where to apply the fog effect.

A radio button is supplied for two simple cases - setting the boundary to the database extrema, and setting the boundary to the extrema plus camera.

In this lighthouse example, the database extrema do not work well - because the database itself was so small:

Boundary set to database extrema (plus 10%) after 50 passes. This does not achieve the effect desired.
Face added to SketchUp to define new model extrema for fog.
Boundary set to database extrema - with added area to define the fog boundary.


Settings

Fog tab.jpg
  • Enable Volumetric Fog - remember to also select the Path Tracer Engine.
  • Fog Color - The Color Swatch allows you to change the scattering color, normally set to white.
  • Scattering - controls the probability of the light encountering a particle in the fog boundary. Higher numbers produce denser fogs. The default of 20% is adequate for many uses.
  • Absorption - is the probability of light being absorbed in the fog boundary. Higher numbers produce darker fogs. This is normally left at 0%.
  • Scattering Direction - controls how the light is scattered. Values > 0 produce forward scattering. Values < 0 produce backward scattering, similar to reflection. The default of 0.2 produces a pattern which resembles water droplets suspended in air.


Tips for various conditions

Nighttime Fog

Chick-inn-3459-450.jpg

  • For this image, we set:
  • Scattering: 40%
  • Absorption: 5%
  • Scatter Direction: 0.15
  • the Light Balancer was used to adjust the intensity of the street light and signs while renderings.
  • The sign on top of the building and the sign at the right were illuminated as lights (using Object Properties or Materil Illumination)
  • The other signs were illuminated using self-glow.
CI-lighting.jpg

Light Balancer

One of the other nice features for a nighttime scene like this was the use of the Light Balancer . I was able to assign separate channels to groups of lights, and then balance them while rendering and after the rendering was complete. This is much easier than having to change the intensity of the lights and re-render to see the effect.


Exterior 'Sun Streaks'

Exterior Volumetric Fog


  • Create a multi-channel rendering and place the sun on one channel and the sky on another.
  • Using the Channels dialog box, turn the sky down to 0.2. (The particles in the air will act as your “sky”. The standard sky model is not accurate when representing very “low” skies.)
  • Change the sun direction so your model is lit from behind. Sun streaks will usually only be visible in the dark areas of your model. Add trees or other shade producing objects.

Interior Light through Window

  • Use the Light Balancer to lower sky intensity - to emphasize the sun streaks.
  • Set scattering to 40% and then raise or lower if needed
Stained Glass example


Interior "Light Beams"

  • This effect often requires a long time to properly resolve. It may be impractical for some scenes.
  • Use low density fog. Set Scattering to 20% as a start.
  • Use focused lighting, such as spot lights with narrow cones.
Interior Volumetric Fog


See also

IRender nXt