This page provides information about the Environment Fog Effects node in V-Ray for Blender.


Overview


V-Ray Environment Fog is an atmospheric effect that allows the simulation of participating media like fog, atmospheric dust, and so forth. 3D texture maps can determine volumetric properties.

V-Ray 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, the V-Ray 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, V-Ray Environment Fog traverses the fog volume in small steps, calculates the volume properties at each step, and computes the volume lighting accordingly. This node can only be applied to the scene as a whole; if you would like to confine the fog effect to a container, you need to use the Volume Fog Effects node.


UI Path: ||V-Ray Node Editor|| > World > Add > Effects > Environment Fog


See the Environment Fog tutorial for an example workflow.



Node Input Sockets


Gizmos – Allows objects from the scene to be connected as the fog container. Connecting nodes to this port adds them to the Gizmo Objects list.

Lights – Allows lights to be connected. Connected lights are included in the Light List

Fog Color (input socket) – Allows a color node to determine the color of the fog.

Fog Density (input socket) – Allows an integer-outputting node to determine the Fog Density parameter.

Emission Color (input socket) – Allows a node to control the Emission Color.

Emission Multiplier (input socket) – Allows an integer-outputting node to control the Emission Multiplier.

Fog Transparency (input socket) – Allows a node to control the Fog Transparency.


Properties


You can find the parameters of this node either in the Node menu in the V-Ray Node Editor or in the World Properties tab.


Enabled – Enables or disables the Environment Fog.

Fog Color – Defines the color of the fog when light sources illuminate it. You can also use a texture map to drive the fog color. See the example.

Phase Function – Controls how the light scatters inside the fog. The default value of 0.0 scatters the light uniformly in all directions. Positive values make the light scatter mostly forward. Negative values result in light scattering backward. Phase Function values very close to 1.0 or -1.0 are not recommended as they produce very directional scattering. See the example.

Fog Distance – Controls the fog density in centimeters, i.e., the distance that light travels inside the fog. Larger values make the fog more transparent, while smaller values make it more dense. See the example.

Use Height – When enabled, the Height property is taken into account.

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. The units are centimeters. See the examples.

Fog Density – A multiplier for the Fog Distance parameter that allows a texture to be used for the density of the fog.

Emission ColorControls the fog emission (self-illumination). This parameter can substitute the ambient illumination inside the fog instead of using GI. See the example.

Emission Multiplier – Multiplies the Emission Color parameter.

Fog Transparency – Controls the transparency of the fog volume at a thickness given by the Fog Distance parameter. Brighter colors make the fog more transparent. See the example.

IORIndex 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.

Deep Output – Toggles writing deep data to the file. Note that enabling this option forces ray marching even for simple volumetrics, which can cause slower rendering.



Parameters' location





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. A sphere, shaped like the V-Ray logo, has been used to confine the fog volume by setting it as the Gizmo Object. The opacity of the sphere's material has been set to be completely transparent by changing its Opacity to a black color. This means the surface material has no contribution to the shading of the sphere, only the V-Ray Environment Fog.

For the last 2 images, the Fog Color has been mapped with a texture.


Fog Color = green

Gradient Ramp texture with Constant interpolation.
The fog density is mapped with a Checker texture.


Click on the images to view them in full size


Noise texture set to Turbulence type



  



Example: Phase Function

This example uses backlighting, and the Scatter GI is turned on with 1 bounce. As you can see, negative values scatter the light backward, and positive values scatter the light forward.



Phase Function = -0.75

Phase Function = 0

Phase Function = 0.75




Example: Fog Distance


This example demonstrates the effect of the Fog Distance parameter. Note how larger values make the fog more transparent. A sphere, shaped like the V-Ray logo, has been used to confine the fog volume by setting it as the Gizmo Object. The opacity of the sphere's material has been set to be complately transparent by changing its Opacity to a black color. This means the surface material has no contribution to the shading of the sphere, only the V-Ray Environment Fog.


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



Fog Distance = 0.5
No texture in the fog density


Click on the images to view them in full size


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

 



Example: Fog Transparency


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


Fog Transparency = HSV (0, 0, 0.18)



Fog Transparency = HSV (0.619, 0.49, 0.568)


Click on the images to view them in full size


Fog Transparency = HSV (0.094, 0.321, 0.486)




Example: Emission Color

  

This example demonstrates the effect of the Emission Color parameter. The Fog Color is gray so as to better show the effect of the emission. Note that since we also have Scatter 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 like the V-Ray logo, has been used to confine the fog volume by setting it as the Gizmo Object. The opacity of the sphere's material has been set to be completely transparent by changing its Opacity to a black color. This means the surface material has no contribution to the shading of the sphere, only the V-Ray Environment Fog.

In the last two renders, the Emission has been mapped with a texture. The Fog Color is gray to also better show the light scattering inside the volume, produced by the global illumination.



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


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


Click on the images to view them in full size



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


 


 

Example: Height


When there are no geometries selected in the Gizmo Objects list of the V-Ray Environment Fog, the volume occupies space downward from a certain height along the scene's up-axis, determined by the Height parameter, when Use Height is enabled. The following examples demonstrate this. Note that as the 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. 

Compare the images above and below to see how increasing the Fog Distance affects the visibility in the scene.


Fog Distance = 50
Height = 10

Fog Distance = 50
Height = 15

Fog Distance = 50
Height = 50

Fog Distance = 200
Height = 10

Fog Distance = 200
Height = 15


Click on the images to view them in full size


Fog Distance = 200
Height = 50


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 accelerates GI inside the volume (e.g., the light cache or brute force). See the example.

Scatter Bounces –  When Scatter GI is enabled, this option controls the number of GI bounces 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.



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


GI is enabled in the V-Ray Render Settings, Scatter GI is off.
The fog does not scatter GI and so looks identical to the previous image (it is lit with direct light only).


Click on the images to view them in full size.



GI is enabled, Scatter GI is on, Scatter Bounces = 1
Notice how the fog is affected by the skylight. Brute Force was used for the primary GI engine.


Ray Filter



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

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

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

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

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

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

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



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), until the accumulated volume transparency falls below a certain cut-off threshold, or until a specified number of maximum steps is reached.

Simplify Texture for GI – When this option is enabled, V-Ray uses a simplified method for calculating the GI when rendering parts of the fog that are textured or are faded out.

Step Size – Determines the size of one step through the volume in centimeters. 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 samples 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). See the example.

Cutoff Threshold – Controls when the ray marcher 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. This parameter is not available when the render engine is set to GPU.




Example: Texture Samples with Raymarching


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, thus saving render time.


Texture Samples = 1, Step Size = 4.0

Texture Samples = 4, Step Size = 4.0


Click on the images to view them in full size


Texture Samples = 1, Step Size = 1.0


Fade Out



Fade Out Mode – Allows you to choose between two different modes of fade-out: Multiply by density or Add density to fallout.

Fade Out Radius – Allows you to set 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.


Gizmo Objects



Object List – Creates a list of objects and collections to be considered in the Environment fog. The fog is contained within these objects. Use the Remove button to remove items from the list. 


Light Set



Lights Mode – Specifies which lights are considered when rendering the environment fog. It is used when certain lights affect specific objects in the scene while another group of lights is affecting the environment fog.

No lights – The lights in the scene do not affect the environment fog.
Use per-gizmo lights (default) – The lights attached to the environment fog set are ignored. Only the lights affecting the shape where the fog resides are used.
Override per-gizmo lights – Only the lights affecting the environment fog set are considered.
Intersect with per-gizmo lights – Only lights affecting both the shape and the environment fog set are considered.
Add to per-gizmo lights – Both lights affecting the shape and the environment fog set are considered.

Light List – Creates a list of light objects and collections to be considered in one of the Lights Mode in the Environment fog.


A light that is a child of the Environment fog is considered in the default Light mode (Use Per-gizmo lights) and is ignored.




Was this helpful?