Basic Parameters

Fog Color (map) – 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.

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

Emission Multiplier (map) – 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.

Fog Density (map) – a multiplier for the Fog distance channel that allows a texture to be used for the density of the fog

Opacity Mode – When enabled, the density will be treated as opacity.

Subdivision determines the number of points inside the fog at which volumetric lighting is evaluated. Smaller values for this channel  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.

Use Height – determines whether or not the height should be taken into account.

Height – determines height value.

Advanced Parameters

Solid Mode – when enabled, this will disable randomisation when sampling and take one sample at 0.5 density

Jitter – when enabled, this adds a random offset when starting sampling

Deep Output – toggles the deep image output.Note that enabling this option will force ray marching even for simple volumetrics, which can cause slower rendering.

IOR – the 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 will not change direction.

Fade Out

Fade Out Mode – controls the edge fade out effect for the edges of the volume and gives a choice between Add density to falloff and Multiply by density this is controlled by the Fade Out Radius

Fade Out Radius – controls the fade out effect for the edges of the volume.

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 map, light cache, photon 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.

Raymarching

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 sampling of 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)

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

Ray Filter

Affect Reflections – enables the tracing of reflection rays through the volumetric.

Affect Refractions – enables the tracing of refraction rays through the volumetric.

Affect Shadows – enables the tracing of shadow rays through the volumetric.

Affect GI – enables the tracing of GI rays through the volumetric

Affect Camera – enables or disables the tracing of Camera rays through the volumetric

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.

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 color 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 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 blueFog 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.

Fog emission is mapped with a Gradient Ramp texture.

Fog emission is mapped with a Gradient Ramp texture.

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

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

[KGVID poster=”http://vrayforc4d.net/docs/wp-content/uploads/2015/05/clouds_combined_small_thumb42.jpg” width=”300″ height=”304″]http://vrayforc4d.net/docs/wp-content/uploads/2015/03/clouds_combined_small.mp4[/KGVID]

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.

[KGVID poster=”http://vrayforc4d.net/docs/wp-content/uploads/2015/05/cfd_combined_small_thumb2.jpg” width=”640″ height=”432″]http://vrayforc4d.net/docs/wp-content/uploads/2015/03/cfd_combined_small.mp4[/KGVID]

Scatter GI is off

[KGVID width=”640″ height=”240″]http://vrayforc4d.net/docs/wp-content/uploads/2015/03/cfd_wind_combined.mp4[/KGVID]

Scatter GI is on;

Scatter bounces is 100

Fog height

When there are no gizmo nodes connected to V-Ray Environment Fog, 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

Sampling parameters (without textures)

When no textures are used, V-Ray Environment Fog uses a simple sampling algorithm where samples are distributed according to the volume density. The only quality parameter for this sampler is the Subdivs parameter.

Subdivs is 1

Subdivs is 8

Subdivs is 16

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

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 1Step size is 4.0 – note the noise.

Texture samples is 4Step size is 4.0 – much better result, with only minor increase in render time.

Texture samples is 1Step 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.

Gizmo nodes

When there are gizmos connected to V-Ray Environment Fog, 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

Volumetric caustics

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

Caustics are offAffect shadows for the sphere material is off.

Caustics are offAffect 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. 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 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).

The light has 100 Caustics subdivs (10,000 caustics photons are shot).

The light has 500 Caustics subdivs (250,000 caustics photons are shot). Note the broken caustics beam – this is not because there are not enough caustics photons, but because we don’t have enough samples for the fog itself.

The light has 500 Caustics subdivs again, but the fogSubdivs parameter is set to 32. Note the improved sampling of the caustics beam.