In this recipe, we will make a snowy mountain landscape by reusing existing shaders—the Rock_procedural
and the
Snow materials
. We will improve these materials by grouping them and exposing the useful values. Then we will create a new group node that will work as a stencil to depict snow in a more customizable and natural way on the rocks as shown in the following screenshot:
The snowy mountain landscape as it appears in the final rendering
As usual, let's start with the preparation of the scene. In this case, we start with an almost ready blend file:
9931OS_05_RockSnow_start.blend
file, where there is a scene with a placed Camera—a simply modeled Mountain object and a Plane set as Emitter.2
for both View and Render.1
for both View and Render.1.00
. Go back to the Displace modifier and set the Strength to -0.200
.0.50
. Back in the Displace modifier panel, set the Strength to -0.050
.0.040
.0.650
, Lacunarity to 2.000
, Octaves to 0.500
, Offset to 0.250
, Basis to Voronoi F1, and Size to 2.00
. Back in the Displace modifier panel, set the Strength to 0.300
.2.000
, and Size to 3.30
. Back in the Displace modifier panel, set the Strength to 0.100
as shown in the following screenshot:The mountain object obtained using different settings—without and with the several modifiers
1.200
.0.250
. Add a Light Path node (press Shift + A and navigate to Input | Light Path). Connect the Is Camera Ray output to the Fac input socket of the Mix Shader node.texture
folder and load the WinterForest_Env.hdr
image (it's a free, high-dynamic-range image downloaded from the sIBL Archive at http://www.hdrlabs.com/sibl/archive.html, and licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License).19°
as shown in the following screenshot:The World network setting
1.00
. Set the Samples to 10
for Preview and 25
for Render. Under the Light Paths subpanel, disable both the Reflective Caustics and Refractive Caustics items and set the Filter Glossy to 1.00
.We are going to create the scene and materials by dividing the process into four stages:
So, let's start with the first stage.
Let's append the required (and previously made) materials, and group them for convenience:
9931OS_03_snow.blend
file, append the Snow_01
material, and for now, assign it to the Mountain object.Bump_Strength
. Repeat this step for the Distance socket and rename it as Bump_Distance
.Snow_Color
. Drag the Color input of the Glossy BSDF shader node and connect it to the same Snow_Color socket.Transl_Color
.Snow_02
and check the fake user option. Click on the Bump_Strength slider and type 1.500
as shown in the following screenshot:Making a node group of the appended snow material
9931OS_03_Rock_procedurals.blend
file, append the Rock_proc01
material. Go to the Material datablock button on the Node Editor toolbar and assign it to the Mountain object.0.000
for all the three axes.1.000
. Press Shift + D to duplicate it, and do this three times. Connect the Value outputs of each of the four Multiply-Math nodes to the Scale input sockets of the four Noise Texture nodes inside the BUMP frame.10.000
for Noise Texture01, 15.000
for Noise Texture02, 37.500
for Noise Texture03, and 112.500
for Noise Texture04.1.000
) of each of the four Multiply-Math nodes.Rock_Scale
as shown in the following screenshot:Adding Math nodes to tweak the exposed scale values of the textures for the procedural rock material
Mix03
again, and paste it between the RGB Curves node and the Diffuse BSDF shader. Set the Blend Type to Color and connect its output to the Color input socket of the Glossy BSDF shader.Mix04
and paste it between the RGB Curves and the Mix03 nodes. Set its Blend Type to Multiply and the Color2 to pure black. Then select both the Mix03 and Mix04 nodes and parent them to the COLOR frame as shown in the following screenshot:Adding color variations to the rock material
Rock_Color
.Rock_Darkness
. Move the Vector socket on the Group Input node to the bottom of the list.0.500
and the position of the white color stop to 0.545
as shown in the following screenshot:Creating a Color output in the node group to be used later to detail the stencil effect
Bump_Strength
and Bump_Distance
, respectively. Move the Vector socket to the bottom. Press Tab to exit Edit Mode.Rock_proc_02
, and enable the fake user. Set the Rock_Color values for R 0.078
, G to 0.067
, and B to 0.056
; the Rock_Scale to 0.600
; and the Rock_Darkness to 0.469
as shown in the following screenshot:The overall view of the procedural rock node group in Edit Mode
Now we can start to build the real shader by mixing the procedural rock and snow materials:
Rock_Snow
in the Node Editor toolbar.Starting to build the snowy rock mountain material
At this point, both the materials are assigned to the Mountain object, but if you render the preview now, they will appear on the whole mesh surface as a mixture of rock and snow. We must build a separator to establish where the surface will show only the rock and where it will show only the snow:
Mapping01
, Mapping02
, Gradient Texture01
, Gradient Texture02
, and ColorRamp01
. Connect the Normal output of the Geometry node to the Vector input socket of the Mapping01 node and the Position output to the Mapping02 node. Then connect the Mapping01 node to the Gradient Texture01 node and the Mapping02 node to the Gradient Texture02 node.-0.210
and the Rotation value of Y as 90°
. In the Mapping02 node, set only the Rotation value of Y as 90°
.0.000
and label it as Add01
. Then connect the Color outputs of both the Gradient Texture nodes to the Color1 and to the Color2 input sockets.0.600
position. Add a new color stop, set the color to pure black, and move it to the 0.700
position. Then move the position of the white color stop to 0.800
.SLOPE
as shown in the following screenshot:The SLOPE frame
Mapping03
and change the Location value of X to -0.600
.4.600
. Set the Voronoi Texture node's Coloring to Cell and the Scale to 28.700
. Set the Musgrave Texture node's type to Ridged Multifractal, the Scale to 3.500
, Detail to 16.000
, Dimension to 0.900
, Lacunarity to 0.600
, Offset to 0.500
, and Gain to 5.000
.Burn03
.Burn04
, and set its Fac value to 1.000
. Connect the Color output of the Burn03 node to the Color1 input socket of the Burn04 node. Then connect the Fac output of the Musgrave Texture node to its Color2 input socket.ColorRamp02
, and paste it between the Burn03 and the Burn04 nodes. Set Interpolation to Ease and move the white color marker to the 0.487
position.DENSITY
as shown in the following screenshot:The DENSITY frame
1.000
. Connect the Color output of the Burn02 node inside the SLOPE frame to the Color1 input socket. Then connect the Color output of the last Burn04 node inside the DENSITY frame to the Color2 input socket.ColorRamp04
, and paste it between the Soft Light and the Group Output nodes. Set Interpolation to Ease, the black color stop to the 0.500
position, and the white color stop to the 0.600
position.Snow_amount
.Separator
as shown in the following screenshot:The outputs of the SLOPE and DENSITY frames added inside the Separator node group
0.724
.1.000
and connect the Color output to the Fac input socket of the Mix Shader node.The final step we can do to improve our material is to append the Fog_underwater node group, from the 9931OS_05_underwater_final.blend
file located in Nodetree. Rename this node Atmos_persp
and paste it just before the Material Output node. Then press Tab to open the group by entering Edit Mode. Set the Multiply node value to 0.010
and the color values of the Emission shader for R to 0.078
, G to 0.133
, and B to 0.250
as shown in the following screenshot:
The overall network and the atmospheric perspective node group added at the end of the shader. Note the Color output of the Rock material added to the output of the Separator to work as stencil or blending factor.
Now let's see how this material actually works, by dividing the creation's process into three parts:
Snow
material and made a group, exposing the required properties and changing the way the bump works. In other words, we deleted the output to the Displacement input of the Material Output node and implemented a per shader bump.This doesn't really make a big difference in the final rendering. Just be aware that a bump piped in the Displacement socket can react to Ambient Occlusion (which we didn't use in the scene, by the way), but this is not true with the per shader bump.
Rock_procedural
material and made a group of it as well. Again, all the necessary values were exposed, and although we kept the material unaltered in this scene, the group could now be easily reused for different kinds of rock in other projects or on different objects.We added a Math node set to Multiply for every texture Scale value that needed to be driven by one single exposed input. The first Value of the Math node, set to the original scale value, gets multiplied by the driven second Value, thus increasing or decreasing (for values smaller than 1.000
) the final scale value.
Separator
, a node group outputting gray-scale values that are connected to the Fac input of the Mix Shader node, which works as a stencil map, separating the two different materials on the mesh surface accordingly to black and white values. The two gradient textures in the SLOPE frame, mapped on the position and the normals of the mesh and then blended together by the Burn nodes, make the snow material (the white color value of the stencil map) appear more on the mesh's faces that have more a horizontal trend than a vertical one. Thanks to the Add01 node, mixing the gradients driven by the exposed input Snow_amount and influencing the gradient of the ColorRamp01 node, it's also possible to set the quantity of snow (the white color in the stencil) on the whole object. The mixed textures in the DENSITY frame make the separation line between black and white more frayed and realistic, and so also the Color output of the Separator group that is added to a Color output of the Rock shader just before being connected to the Fac input of the Mix Shader. Have a look at the following screenshot:The only mask and the Rendered versions of three different values of the Snow_amount slider
In the preceding set of screenshots, you can see the different effects of the 0.000
, 0.700
, and 1.000
values of the Snow_amount slider. The black-and-white mask works as a separator between the rock and the snow materials.