Graphics Programs Reference
In-Depth Information
12. Add a new
ColorRamp
node, connect the
Lighten
node output to its
Fac
input, and then move the white marker at the middle of the slider and the
black one at a quarter to the right.
13. Add a new
Mix
node, set the
Blend Type
to
Subtract
and the
Fac
value
to
1.00
, and then connect the
ColorRamp
color output to the
Color1
in-
put and the output of the first
Subtract
node to the
Color2
input socket.
14. Add an
RGB to BW
node (press
Shift
+
A
and go to
Convertor
|
RGB to
BW
), a
Bump
node (press
Shift
+
A
and go to
Vector
|
Bump
) and a
Dif-
fuse BSDF
shader (press
Shift
+
A
and go to
Shader
|
Diffuse BSDF
).
15. Connect the last
Subtract
node output to the
RGB to BW
node, the out-
put of this one to the
Height
input of the
Bump
node and the
Normal
output to the
Normal
input of the
Diffuse
shader. Set the
Bump
node's
Strength
value to
0.010
, as shown in the following screenshot:
16. Select all these nodes and press
Crtl
+
G
, confirm on
New
, and rename
the group as
Foam
.
17. Drag the
Color
output of the last
Subtract
node on the right-hand side
of the group box to expose it. Do the same with the
BSDF
output of the
Diffuse
shader and press
Tab
to close the group.
Third - creating the stencil material for the foam location
What we now need is a way to limit the presence of the foam only to the upper parts
of the waves:
1. Add a
Gradient
texture node (press
Shift
+
A
and go to
Texture
|
Gradi-
ent Texture
) and a
Voronoi
texture node (press
Shift
+
A
|
Texture
|
Voronoi Texture
), select them and press
Shift
+
D
to duplicate them.
2. Set both the
Gradient
node's types to
Easing
, the
Scale
value of the first
Voronoi
node to
250.000
, and of the second to
50.000
.
3. Add three
Mapping
nodes (press
Shift
+
A
and go to
Vector
|
Mapping
,
then press
Shift
+
D
).