V-Ray Environment Fog Overview


VRay_Environment_Fog is an atmospheric effect that allows the simulation of participating media like fog, atmospheric dust and so. Volumetric properties can be determined by 3d texture maps. The atmospheric effect can also be confined with geometry objects.

VRay_Environment_Fog can use either of two algorithms to calculate volumetric lighting. The first algorithm is a simple exponential sampling scheme, which is used when there are no texture maps specified. In this mode, VRay_Environment_Fog takes a number of random points inside the volume and calculates the volumetric lighting at those points. The second algorithm is a raymarching scheme, which is used when any of the volume properties are mapped with a texture. In that case, VRayEnvironmentFog traverses the fog volume in small steps, calculates the volume properties at each step and computes the volume lighting accordingly.

Common


Color  - defines the color of the fog when it is illuminated by light sources. You can also use a texture map to drive the fog color.

Example: Fog color

This example demonstrates the effect of the fog color. Note how color only changes the way the volume reacts to light, and not the volume transparency. In this example, the fog density is mapped with a checker texture. A Box gizmo is used to confine the fog volume.

In the following examples, the fog color has been mapped with a texture. World XYZ mapping type was used for the textures.


Gradient Ramp texture with Solid interpolation.


Noise texture with Turbulence type.

Emission  - controls the fog emission (self-illumination). You can use this parameter to substitute the ambient illumination inside the fog, instead of using GI.

Example: Fog emission

This example demonstrates the effect of the Fog emission parameter. The Fog color is gray so as to better show the effect of the emission. Note that since we also have GI enabled, the fog emission causes the volume to illuminate both itself and other objects around it. The fog density is mapped with a Checker texture. A Box gizmo is used to confine the fog volume.


Fog emission is black (no emission), 

Fog color is gray


Fog emission is dark blue

Fog color is gray


Fog emission is dark blueFog color is black 

(only the fog emission affects the image)

In the following examples, the Fog emission has been mapped with a texture. The Fog color is gray to better show the light scattering inside the volume, produced by the global illumination. The scene for the last image is available  here .


Fog emission is mapped with a

Gradient Ramp texture.


Fog emission is mapped with a red Noise 

texture with Turbulence type.

Emission Multiplier  - a multiplier for the  Emission parameter

Fog distance  - controls the fog density. Larger values make the fog more transparent, while smaller values make it more dense.

Example: Fog distance

This example demonstrates the effect of the Fog distance parameter. Note how larger values make the fog more transparent. A Box gizmo is used to confine the fog volume.

Fog distance is 4.0

Fog distance is 16.0

Fog distance is 64.0

In the following examples, the fog density has been mapped with a texture. World XYZ mapping type was used for the textures.

No texture

Checker texture

Regular Noise texture

Inverted turbulence Noise texture

Fog density - a multiplier for the  Fog distance parameter that allows a texture to be used for the density of the fog

Fog height  - if the fog is not contained within a volume, it is assumed to start from a certain Z-level height and continue downward indefinitely. This parameter determines the starting point along the Z-axis.

Example: Fog height

When there are no gizmo nodes connected to VRayEnvironmentFog, the volume occupies space downward from a certain height along the scene Z-axis, determined by the  Fog height  parameter. The following examples demonstrate this. Note that as the  Fog height  is increased, the scene becomes darker - this is because the sun is blocked by a larger amount of fog. This can be corrected by increasing the  Fog distance  parameter, and thus making the fog more transparent. Note also the sudden decrease of brightness when the camera is included inside the fog volume. For more info on gizmo nodes, see the Example below.

Fog distance = 40
Fog height
= 20

Fog distance = 40
Fog height
= 40

Fog distance = 40
Fog height
= 100

Fog distance = 40
Fog height
= 200

Fog distance = 200
Fog height
= 20

Fog distance = 200
Fog height
= 40

Fog distance = 200
Fog height
= 100

Fog distance = 200
Fog height
= 200

Subdivs  - this parameter determines the number of points inside the fog at which volumetric lighting is evaluated. Smaller values for this parameter render faster, but may produce noise in the image. Higher values render longer, but with less noise. It is only used when there are no texture maps specified, in which case the volume properties are the same everywhere.

GI


Scatter GI  - when on, the fog will also scatter global illumination. Note that this can be quite slow. In many cases, global illumination within the fog can be substituted with a simple emission term. When this option is on, the currently selected global illumination algorithm in the V-Ray settings will be used to accelerate GI inside the volume (e.g. the irradiance maplight cachephoton map or brute-force).

Scatter bounces  - when  Scatter GI  is enabled, this controls the number of GI bounces that will be calculated inside the fog.

Example: Scatter GI and Scatter bounces

This example demonstrates the effect of the Scatter GI and Scatter bounces parameters. Note how multiple scattering of light inside the volume greatly increases the realism of the image. The scene for the last image (for 3ds Max 2008) is available here.


GI is off in the V-Ray settings - the fog volume only shows direct lighting.


GI is onScatter GI is off - the fog does not scatter GI and so looks identical to the left image (it is lit with direct light only).


GI is onScatter GI is on,Scatter bounces is 1. Notice how the fog volume is affected by the skylight. The irradiance map was used for a primary GI engine.


GI is onScatter GI is on, Scatter bounces is 2. Irradiance map + brute force GI for secondary bounces.


GI is onScatter GI is on, Scatter bounces is 4. Irradiance map + brute force GI.

GI is onScatter GI is on, Scatter bounces is 8. Irradiance map + brute force GI.


GI is onScatter GI is on, Scatter bounces is 100. Irradiance map + Light cache for secondary bounces.

Raymarching


This sampler is used when any of the fog properties (color, density or emission) is mapped with a 3d texture. The sampler steps through the volume, evaluating volumetric textures and lighting, until it leaves the volume (if the fog is contained within a volume), or until the accumulated volume transparency falls below a certain cut-off threshold, or until a specified number of maximum steps is reached.

Simplify textures for GI  - When this option is checked V-Ray will use a simplified method for calculating the GI when rendering parts of the fog that are textured or are being faded out.

Step size  - determines the size of one step through the volume. Smaller steps produce more accurate results but are slower to render. In general, dense volumes require smaller step sizes than more transparent volumes. In practice, step sizes that are two to three times smaller than the Fog distance  parameter work well.

Max steps - specifies the maximum number of steps through the volume.

Texture samples  - determines the number of texture samples for each step through the volume. This allows to sample textures more accurately than the volumetric lighting. It is useful in cases where the textures vary much faster than the lighting itself (e.g. for detailed fractal textures).

Example: Sampling parameters (raymarcher with textures)

When any of the parameters (density, color or emission) is mapped with a texture, VRayEnvironmentFog uses a raymarching algorithm to compute the intersection of a ray with the volume.

The following examples demonstrate the effect of the  Step size  parameter. A Box gizmo is used to confine the volume, and the density is mapped with a Checker texture. Note how smaller values cause less noise and smoother shading of the volume. Note also that more dense volumes require smaller values of the  Step size parameter in order to produce a smooth result, compared to more transparent volumes. In general, values for the Step size  that are 2 to 3 times smaller than the Fog distance parameter work okay in most cases.

In the examples below, the  Fog distance  parameter is 5.0.

Step size is 1.0

Step size  is 2.5

Step size  is 5.0

Step size  is 10.0

In the examples below, the  Fog distance  is 20.0.

Step size  is 4.0

Step size  is 10.0

Step size  is 20.0

Step size  is 40.0

Cut off threshold - this parameter controls when the raymarcher will stop traversing the volume. If the accumulated volume transparency falls below this threshold, the volume will be considered opaque and tracing will be aborted. Higher values make the rendering faster but may introduce artifacts.

Fade Out


Fade out mode  - allows you to choose between two different modes of fade out.

Fade out radius  - allows you to set a radius for the fade out of the fog.

Per Object Fade Out Radius  - when this option is selected the fade out effect will be applied to each fog volume independently.

Ray Filter


Affect background  - enables or disables the tracing of background rays through the volumetric.

Affect reflection rays  - enables or disables the tracing of reflection rays through the volumetric.

Affect refraction rays  - enables or disables the tracing of refraction rays through the volumetric.

Affect shadow rays - enables or disables the tracing of shadow rays through the volumetric.

Affect GI rays  - enables or disables the tracing of GI rays through the volumetric.

Affect camera rays  - enables or disables the tracing of Camera rays through the volumetric.

Gizmos Tab


All objects in the scene  - a list of all scene objects that can be used as gizmos. A gizmo is a geometry object that will not be rendered directly, but instead will be used to "confine" within its volume the fog effect.

Gizmos  - specifies which gizmo objects will be used for the environment fog effect. If this list is empty, the fog will be applied to the entire volume of the scene.

Example: Gizmo nodes

When there are gizmos connected to VRayEnvironmentFog, then the volume is confined only inside the specified atmospheric gizmos and the Fog height parameter is ignored.

BoxGizmo

SphereGizmo

CylGizmo

Several gizmos


Several gizmos; the  Fog color  is mapped with a Gradient texture with ObjectXYZ mapping type.


Mesh used as a Gizmo


Gizmo falloff radius  = 4

Gizmo falloff mode  = Multiply by density


Gizmo falloff radius  = 4

Gizmo falloff mode  = Add density to falloff

Fade Out Radius


Fade out radius  - allows you to set a radius for the fade out of the selected environment fog gizmos

Set Fade out radius  - applies the specified value of  Fade out radius  to all selected objects from the  Gizmos list. Otherwise, each gizmo has its individual radius controlled via the "Fade Out Radius" local for the gizmo object property.

Lights Tab


Light Mode  - this option allows you to specify which lights will be considered when rendering the environment fog.

  • No lights - the lights in the scene will not affect the environment fog
  • Use all lights - all scene lights will have effect when rendering the environment fog
  • Use lights from list - all lights specified in the  lights  list affect the environment fog

lights  - a list of lights that can be picked to take part in the final rendering of the environment fog.

Notes


  • When using VRay_Environment_Fog with weak VRayLights, it may be necessary to turn down the  Cut-off threshold  parameter of the lights. The default value for this parameter works fine for surfaces, but for volumes, where a lot of weak light contributions are added together, it may produce a visible sharp boundary where the light calculations stop. 
  • You can use procedural textures to modify volume properties.
  • V-Ray does not have separate global illumination maps for volumetric rendering. Instead, all GI engines (the irradiance map, light cache, global/caustics photon maps) have been modified to support volumetric data.