In all the recipes we have seen so far, Cycles used the Surface input socket and (very rarely) the Displacement input socket for the bump effects of the Material Output node to make the renderings. Assigning colors or textures to the surface of an object clearly means that interaction between a ray of light and an object happens only at the surface level of the object, and until this surface doesn't show what should be inside, that's OK. The surface attribute is enough for a realistic rendering.
Things get more complex when there is a need to show what's inside an object, for example, water inside a glass container, smoke and clouds in a thick atmosphere, and so on.
Usually, these are effects that require the use of the volume attribute more than the surface attribute to be effectively rendered.
So, in the first recipes of this chapter, we are going to see the use of the Volume input socket of the Material Output node. Rather than covering a specific material, this recipe is more of a "tour" to show the possibilities related to the Volume shader assigned to a mesh object. Have a look at the following screenshot:
Start Blender and open the 9931OS_09_start.blend
file, with the usual Suzanne object leaning on a Plane, a mesh-light Emitter, and the Camera.
50
and for Render to 100
. Switch Pattern from Sobol to Correlated Multy-Jitter.0.25
. The default value is 0.10
. Increasing this will make the rendering of volumes less accurate but faster, and lowering it will result in the opposite.First, let's see the Volume applied to our usual Suzanne mesh primitive by performing the following steps:
10.000
, either in the node interface in the Node Editor window, or in the slot under the Volume subpanel in the main Properties panel. Suzanne's volume looks more solid, as shown in the middle of the preceding screenshot.1.000
and change the Color values of the Volume Scatter node for R to 1.000
, G to 0.000
, and B to 0.000
(a red color). The Suzanne object now appears as complementary colored smoke (on the right side of the preceding screenshot) because light is scattered (note that the shadow on the Plane gets the same color).1.440
and the Roughness value to 0.100
.0.800
for the Color of the Volume Scatter node.10.000
, set Operation to Multiply, and connect its output to the Density input socket of the Volume Scatter node as shown in the following screenshot:0.195
and the white color stop to position 0.100
as shown in the following screenshot:11.500
, and reconnect the Glass BSDF shader node output to the Surface input socket of the Material Output node. Change the Color values of the Volume Scatter node for R to 1.000
, G to 0.000
, and B to 0.000
as shown in the following screenshot:Bubbles
and save the file by naming it 9931OS_09_volume.blend
. Have a look at the following screenshot:So, for the previous material named Bubbles
, we used the Volume Scatter node. What about the Volume Absorption node?
Bubbles
material, and click on the X icon button to delink the datablock. Then click on the New button.10.000
and set the Color values for R to 1.000
, G to 0.000
, and B to 0.000
. Have a look at the following screenshot:0.100
, set Operation to Less Than, and connect its output to the first Value input socket of the second Math node. Set the second Value to 12.800
and the Operation to Multiply.algae
. Here is a screenshot for your reference:3.500
, change the Color of the Volume Absorption node for R 0.045
, G 0.800
, and B 0.113
, and connect the output of the Glass BSDF shader node to the Surface input socket of the Material Output node. Set the IOR value to 1.440
and the Roughness value to 0.100
as shown in the following screenshot:algae
material, and then click on the 2 icon (Display number of users for this data) to create a duplicate of the material, named algae.001
.emitting_volume
and substitute the Volume Absorption node with an Emission node (press Shift + A and go to | Shader | Emission). Connect the output of the Multiply-Math node to the Color input socket, and set the Strength value to 0.050
.emitting_volume
material and save the file.In this tour recipe, we saw the three shaders used for the volumetric attribute of a material in Cycles, that is, the Volume Scatter, Volume Absorption, and Emission shaders (we have already seen the Emission shader the previous chapters, and it is commonly used in Lamps and mesh-lights).
The Volume Scatter and Absorption shaders do exactly what their names say, as we saw in the examples. If we give them a color other than black, gray, or white, the Volume Scatter shader returns a complementary hue, while the Volume Absorption shader returns the same hue we set up.
About the Density value, remember that the higher the value, the more particles inside the volume. This allows for simulation of very light and rarefied vapors or very dense clouds of smoke, where the material looks almost solid.
A Volume can be associated not only with objects but also with the World. This allows for several effects, for example, mist, or the famous God's rays. They are obtained by simply scattering light in the air of a Spot lamp.
The setup is really simple and intuitive: a Volume Scatter node connected to the Volume input socket of the World Output node. Have a look at the following screenshot:
The Density value of the Volume Scatter node in this case is set very low (0.010) to allow the light of the Spot lamp to shine through.
Open the 9931OS_09_volume_ambient.blend
file to have a look.
13.59.106.174