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.
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
- Enable Volumetric Fog on the Fog Setup Tab
If you forget this step you will not get any fog.
- Use the Path Tracer Engine
We have added some warnings if you try to render with Fog enabled, but not the Path Tracer Engine.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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.
This is the same scene, rendered for 1,000 passes without a smoothness filter. The extra passes definitely create a smoother, more complete image.
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:
- 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
- For this image, we set:
- Scattering: 40%
- Absorption: 5%
- Scatter Direction: 0.15
- Lighting channels were 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.
One of the other nice features for a nighttime scene like this was the use of Lighting Channels . 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”
- 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 lighting channels to lower sky intensity - to emphasize the sun streaks.
- Set scattering to 40% and then raise or lower if needed
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.