Creating a fake volume light material

In this recipe, we will create a material to fake the typical effect of a cone of light visible when passing through the dust suspended in the air, or falling from the sky on a cloudy day (the so-called God's rays) different from the real volumetric effect described in the There's more section of the Using Cycles volume materials recipe. This is a fake—just a mesh and not a real light to be used for the scene. Therefore, a matching Lamp must be set for the real lighting, as shown in the already made blend file.

Creating a fake volume light material

The fake volume cone of light as it appears in the final rendering

Start Blender and open the 9931OS_09_volumelight_start.blend file, where there is a scene set with a ground Plane, a Cube, the volumetric cone mesh (volume_light), a spot mesh object (spot_mesh), and an effective Spot lamp parented to the volume_light. The Spot lamp cone follows the shape of the volume_light, and its purpose is to light the Cube leaning on the ground Plane.

The volume light objects also have a brief animation of 98 frames. To see it, move the Time Cursor inside the Timeline window; to point the cone of light to the Cube, go to frame 81.

Let's go ahead with creating the light cone material:

  1. Select the volume_light object and click on the New button in the Node Editor window toolbar, or in the Material window under the main Properties panel to the right. Rename the material as volume_light.
  2. In the Material window, switch the Diffuse BSDF shader node with a Mix Shader node. Label it as Mix Shader1.
  3. In the first Shader slot of the Mix Shader1 node, select a new Mix Shader node. Label it as Mix Shader2. In the second Shader slot, select a Transparent BSDF shader node.
  4. Go to the Mix Shader2 node, and in the first Shader slot, select a Mix Shader node again (Mix Shader3). Connect the output of the Transparent BSDF node to the second Shader slot of the Mix Shader2 node.
  5. Go to the Mix Shader3 node, and in the first Shader slot, select one more Mix Shader node (label it Mix Shader4). Connect the output of the Transparent BSDF node to the second Shader slot.
  6. Go to the Mix Shader4 node, and in the first Shader slot, select one Emission node. Connect the output of the Transparent BSDF node to the second Shader slot of the Mix Shader4 node.
  7. Set the color values of the Emission node for R to 0.769, G to 0.800, and B to 0.592. Then set the Fac value of Mix Shader4 to 0.800.
  8. Add a Layer Weight node (press Shift + A and navigate to Input | Layer Weight) and connect its Facing output to the Fac input socket of the Mix Shader3 node. Set the Blend value to 0.900.
  9. Add a ColorRamp node (press Shift + A and navigate to Converter | ColorRamp) and connect its color output to the Fac input socket of the Mix Shader2 node. Set the Interpolation to B-Spline and move the black color stop to position 0. Then move the white color stop to the extreme left.
  10. Add a Value node (press Shift + A and navigate to Input | Value), label it as Intensity, and connect it to the Fac input socket of the Mix Shader1 node. Set the value to 0.400.
    How to do it...

    The entire material network

  11. Save the file as 9931OS_09_volumelight_final.blend.

The effect of light blending with the night is obtained by the various factors of blending of the Mix Shader nodes that cause the mixing of the Emission shader with the Transparent shader. The purpose of connecting the Value node to the Fac input of the Mix Shader1 node is to establish the intensity of the fake volumetric light. A value of 1.000 turns it off completely (be careful not to go beyond 1.000, otherwise the cone mesh will show up as a dark silhouette). On the contrary, values towards 0.000 (or even negative values) make it appear more and more intense.

Be careful with this simulation because being a mesh emitting light, it can produce strange and unrealistic effects if not carefully planned. Suppose you go to frame 62 and start the rendering. Then you will see that the volumetric cone mesh is intersecting the Cube even in those areas where a real light would create shadows.

Since Cycles has been added to Blender, many artists have posted screenshots and tests for almost every possible kind of material. Especially on the Blender Artists forum, you will find a plethora of data and will discover different (and often better) ways to create the same materials that you have seen in this Cookbook.

Now it's up to you to create new, amazing materials and renderings that no one can avoid staring at. Blend on!