© Square Enix © Goodbye Kansas


Table of Contents

This page provides information on the V-Ray EnvironmentFog node.


Overview


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

V-Ray EnvironmentFog 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, V-Ray 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, V-Ray traverses the fog volume in small steps, calculates the volume properties at each step, and computes the volume lighting accordingly.



Parameters


Enabled – Enables or disables the V-Ray Fog.

Treat Density as Opacity – When enabled, treats density as opacity.

Color – Defines the color of the fog when it is illuminated by light sources. For more information, see the Color example below.

Color Multiplier – Specifies a multiplier for the fog color.

Phase Function – Controls the phase function used for the anisotropic volumetric scattering computation.

Emission (color) – Controls the fog emission (self-illumination). You can use this parameter to substitute the ambient illumination inside the fog, instead of using GI. For more information, see the Emission example below.

Emission Multiplier – Specifies a multiplier for the fog emission.

Distance – Controls the fog density by specifying the distance between fog particles. Larger values make the fog more transparent, while smaller values make it more dense. For more information, see the Fog Distance example below. 

Density – Specifies a multiplier for the Distance parameter.

Transparency – Controls the color of the volumetric shadows and the tint for the objects seen through the fog. Brighter colors make the fog more transparent, while darker colors make it more dense at a distance given by the Distance parameter. See the Transparency example below.

Height – Determines the starting point for the fog along the Z-axis. For more information, see the Fog Height example below.

Index of Refraction – Index of Refraction for the volume, which describes the way light bends when crossing the material surface. A value of 1.0 means the light does not change direction.

Light Mode – Specifies which lights are considered when rendering the environment fog. It is used when you have certain lights affecting just specific objects in the scene while another group of lights is affecting the environment fog. For more information, see the Volumetric Caustics example below.

No Lights – The lights in the scene do not affect the environment fog.
All Lights – All lights in the scene affect the environment fog.
Selected Lights – Only the selected lights in the Lights field affect the environment fog.

Lights – Allows the selection of lights when the Light Mode is set to Override Shape Lights, the Intersect with Shape Lights, or the Add to Shape Lights.


Hou20_VRay6.2_Fog_Main


Global Illumination


Scatter GI – When enabled, the fog also scatters 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 enabled, the currently selected global illumination algorithm in the V-Ray settings is used to accelerate GI inside the volume (e.g. the light cache, or brute-force). For more information, see the Scatter GI and Scatter Bounces example and the Importance of GI example below.

Scatter Bounces – When Scatter GI is enabled, this controls the number of GI bounces that are calculated inside the fog.


Hou20_VRay6.2_Fog_GI


Raymarching


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 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. Higher values sample textures more accurately than the volumetric lighting. This setting is useful in cases where the textures vary much more than the lighting itself (e.g. for detailed fractal textures). For more information, see the Texture Samples example below.

Cutoff Threshold – Controls when the raymarcher stops traversing the volume. If the accumulated volume transparency falls below this threshold, the volume is considered opaque and tracing is aborted. Higher values make the rendering faster but may introduce artifacts. 

Deep Output – Enables depth data output using deep images for use in deep compositing applications.


Hou20_VRay6.2_Fog_Raymarching


Fadeout


Fade Out Mode – Specifies between two different modes of fading out the fog:

Multiply by Density – Multiplies by the fog density.
Subtract (Add Density to Falloff) – Subtracts the density from the falloff.

Fade Out Radius – Specifies a radius for the fade out of the fog.

Per Object Fade Out Radius – When enabled, the fade out effect is applied to each fog volume independently.


Hou20_VRay6.2_Fog_Fadeout


Options


Affect Background Rays – Enables or disables the tracing of background rays through the volumetric. When disabled, the background is not obscured by the fog.

Affect Alpha – Enables or disables the tracing of Alpha rays through the volumetric.

Affect Reflections Rays – Enables or disables the tracing of reflection rays through the volumetric.

Affect Refractions Rays – Enables or disables the tracing of refraction rays through the volumetric.

Affect Shadows 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.


Hou20_VRay6.2_Fog_Options





Example: 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. A sphere shaped as the V-Ray logo has been used to confine the fog volume with the VRayEnvironmentFog set as the Volume material in the shading group of the sphere.

For the last 2 images, the fog Color has been mapped with a texture. World XYZ mapping type was used for the textures.



fog color = white

fog color = green

A Gradient Ramp texture with Solid interpolation.
The fog density is mapped with a checker texture.

A Noise texture with Turbulence type

Move the slider to see the example renders.




 



Example: 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 sphere shaped as the V-Ray logo has been used to confine the fog volume.

In the last two renders, 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.




Fog Emission is black (no emission),
Fog Color is gray


Fog Emission is dark blue,
Fog Color is gray


Fog Emission is dark blue, Fog Color is black
(only the fog emission affects the image)


Fog Emission is mapped with a Gradient Ramp texture
Fog Color is gray


Fog Emission is mapped with a red Noise texture with Turbulence type
Fog Color is gray

Move the slider to see the example renders.




 



Example: Distance


This example demonstrates the effect of the fog Distance parameter. Note how larger values make the fog more transparent. A sphere shaped as the V-Ray logo has been used to confine the fog volume.



Fog Distance is 0.1
Fog Density is mapped with a noise texture

Fog Distance is 0.5
Fog Density is mapped with a noise texture

Fog Distance is 2.5
Fog Density is mapped with a noise texture

Fog Distance is 0.5
No texture in the fog Density

Fog Distance is 0.5
Fog Density is mapped with a checker texture

Move the slider to see the example renders.







Examples: Fog Transparency


This example demonstrates the effect of fog Transparency parameter. Note how the objects inside the fog are tinted and the transparency of the fog is affected, while the fog Distance parameter remains unchanged.



Fog transparency = default HSV (0, 0, 46)

Fog transparency = HSV (0, 0, 96)

Fog transparency =  HSV (0, 0, 146)

Fog transparency = HSV (158, 125, 145)

Fog transparency = HSV (24, 82, 124)

Move the slider to see the example renders.




 



Example: Height


When there are no geometry 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.


Fog Distance = 0
Fog Height = 0

Fog Distance = 50
Fog Height = 10

Fog Distance = 50
Fog Height = 15

Fog Distance = 50
Fog Height = 20

Fog Distance = 50
Fog Height = 50

Move the slider to see the example renders.

Fog Distance = 0
Fog Height = 0

Fog Distance = 200
Fog Height = 10

Fog Distance = 200
Fog Height = 15

Fog Distance = 200
Fog Height = 20

Fog Distance = 200
Fog Height = 50

Move the slider to see the example renders.








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. 



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

GI is on, Scatter 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 on, Scatter GI is on, Scatter Bounces is 1.
Notice how the fog volume is affected by the skylight. Brute Force was used for the primary GI engine.

GI is on, Scatter GI is on, Scatter Bounces is 2.
Brute Force + Light Cache GI for secondary bounces

GI is on, Scatter GI is on, Scatter Bounces is 4.
Brute Force + Light Cache GI

GI is on, Scatter GI is on, Scatter Bounces is 8.
Brute Force + Light Cache GI

GI is on, Scatter GI is on, Scatter Bounces is 100.
Brute Force + Light Cache GI

Move the slider to see the example renders.







Example: Importance of GI


GI scattering is especially important when creating cloud-like volumes. For example, compare the following two images, done with and without GI scattering.




Global illumination is off


Global illumination is on (irradiance map + light cache) with Scatter GI on and Scatter Bounces set to 100




The following example shows GI scattering inside a smoke volume. The volumetric textures (density and emission) for this example are provided from a fluid dynamics simulation in the form of 3D textures. Irradiance map and the light cache are used for both sequences. Note how GI scattering causes the smoke to be naturally illuminated by the fire in the second row of images. 

















Example: Texture Samples with Ray Marching


The following example demonstrates the effect of the Texture Samples parameter. This parameter allows for more accurate sampling of textures with rapid changes, without the need to increase the Step Size parameter, and thus saving render time.


Texture Samples is 1, Step Size is 4.0

Note the noise.

Texture Samples is 4, Step Size is 4.0

Much better result, with only minor increase in render time.

Texture Samples is 1, Step Size is 1.0

In practice, the texture is sampled with the same rate as with the image on the left, but render time is greatly increased, since lighting is also sampled at a greater rate.

Move the slider to see the example renders.






Example: Volumetric Caustics


This example demonstrates volumetric caustics and colored shadows with different settings.



 Caustics are off, Affect Shadows for the sphere material is off

 Caustics are off, Affect Shadows for the sphere material is on

Caustics are on

 Caustics are on, and the fog Density is mapped with a Smoke texture



The quality of the volumetric caustics depends on the sampling of the volume fog, on the V-Ray caustics settings, and the caustics settings for the light. In the first two images below, all parameters are same with the exception of the caustics subdivs for the light (||Light|| > Advanced properties rollout > Caustics Subdivs). Note how the more photons are shot, the more defined the caustics are. In this example, we also have the caustics Max Density parameter set to 0.3 (||V-Ray Shelf|| > ROP Parm > Renderer tab > Caustics tab) in order to limit the photon density in the caustics map. This saves memory and makes the rendering faster, although it will limit the spatial resolution of the caustics (in our case, to 0.3 scene units).

Compare the two examples where the light has 1000 Caustics Subdivs (500,000 caustics photons are shot) and 200 Caustics Subdivs (20,000 caustics photons are shot)
Note the broken caustics beam in the example with 1000 Caustics Subdivs - this is not because there are not enough caustics photons, but because we don't have enough samples for the fog itself.



200
1000