July 26, 2018
In this tutorial we’ll see together how to create the fog as volumetric effect with Corona Renderer.

Software: Corona Renderer 2.0

Corona Renderer 2 lets you simulate even more advanced volumetric effects than the previous versions. In this tutorial I’ll show you how to quickly create some fog with the help of procedural textures to vary the density and to control the height dynamically.

This method is perfect to limit the effect close to some areas of the image. In the image of the car I wanted to simulate some low haze rising from the asphalt. The first step is to create a geometry that will delimit the fog, in this case a simple box.

Scene_setup
Scene Setup

It’s crucial never to put the camera inside the box volume, otherwise the effect won’t work due to a limit of the render engine. Assign a Corona Volume Material to the box.

Corona Volume
Corona Volume

In order to achieve a clear haze you have to set a color of 220 RGB for Absorption Color and Scattering color. A pure white color (255 RGB) in the Absorption Color will make the haze disappear. This property is important and I’ll show you later how you can take advantage of it.

To control the density of the effect you have to adjust the Absorption Distance. The lower the value, the thicker the fog will be.

Absorption distance
Absorption distance

To improve the effect we need to control the height dynamically by simulating a gradient effect.

With the Corona Distance Texmap the material can recognize an object that will be the base and starting point of the haze and tweak its height.

Material_00

Remember to change the Volume Mapping mode to “Inside Volume” when you put a texture in the Absorption color.

Volume mapping
Volume mapping

You can control the quality and computation speed of the texture inside the volume with the Step Size parameter. Higher values will lead to faster rendering but with a lower quality for the fog. There’s not a perfect value: some test must be done to find the best balanced setting. For this example I used a value of 100cm: it was quite fast and produced good results.

In the Corona Distance Texmap you have to define the object that will be recognized as the base. Add the plane of the road into the “Distance from” area.

Material_01_b

To create the fading effect of the fog close to the ground you have to put two different colors in Color Near and Color Far settings. Color Near 220 RGB, Color Far 255 RGB. With these settings the fog will fade upwards.

To tweak the height there is the Distance Far value.

Example of Distance Far
Example of Distance Far

The result is still not satisfying because the haze is too uniform.

To introduce some variations in the density and height, it’s possible to use procedural textures: a Smoke map was used in this image. A Noise map works well too. The purpose is to create color variations that will substitute the single color value of the Color Near in the Corona Distance Texmap. This will lead to density variations; in correspondence with a pure white color in the Smoke Map, some holes will appear in the fog.

Smoke map
Smoke map

To better tweak the Smoke Map I added an Output node to change the contrast using the Curve editor. As you can see from the screenshot, I made sure that there were large areas of pure white to “pierce” the fog and I raised the value of blacks to prevent the visible mist from being too dark.

Material_02_b

This is the result obtained:

100 Distance CRdistFar 1000 Smoke
100 Distance CRdistFar 1000 Smoke

Still not perfect. I want to randomize also the height of the fog using the same Smoke Map. Simply connect the Smoke Map to the Distance Scale Texmap value. The colors of the texture will act as a black and white mask for the Distance Far.

Distance Scale
Distance Scale

This is the final effect:

100 Distance CRdistFar 1000 Smoke Scale
100 Distance CRdistFar 1000 Smoke Scale

Following this method I simulated the low fog for the DeLorean image, tweaking dynamically the height and producing a more realistic effect than a simple uniform mist.

DMC Fog and dirt
DMC Fog and dirt

From this backstage image you can see that the fog is localized only close to the ground and above all it isn’t uniform in terms of density.

DMC Backstage
DMC Backstage

Have fun with Corona Renderer!

Giona

Enhance your knowledge on Corona Renderer, join us at SOA Academy! The Masterclass and the advanced course are waiting for you!

Share this