Graphics Programs Reference
In-Depth Information
inputs and outputs of a node and that allow nodes
to be connected by clicking and dragging a connec-
tion from the output socket of one node to the input
socket of another. Notice in Figure 12-27 that the
sockets we used to connect nodes all have match-
ing colors—green with green, yellow with yellow.
The colors need to match because different output
sockets pass different types of data and different
input sockets expect different kinds of data. Some
may require color information, some only a single
value. Others may require vector information, like
texture coordinates or normals.
Node sockets are color coded to clarify what a
node expects as input and what it creates as output:
I also set the color space of the Image Texture
to Non-Color Data from the drop-down menu in the
Image node to indicate that this node was not being
used as a color image, ensuring that Blender wouldn't
perform any gamma correction on this node.
Adjusting Inputs
To get the most out of my textures without having to
edit them in GIMP, I tweaked them using Blender's
nodes. For instance, to darken the diffuse colors
a little and make the reflections from the glossy
shader a little sharper, I added a Color Mix node,
setting its type to Multiply, its factor to 0.5, and its
second color input to black.
When this Color Mix node is dragged over the
connection between an Image Texture node and a
Shader node, Blender adds it to the chain automati-
cally. (The connection will be highlighted, and the
new node will be inserted when you drop it.) I did
this for the connection between the diffuse map and
the Diffuse BSDF shader to darken the texture slightly.
For the Glossy BSDF shader, in order to sharpen
up the reflections, I needed to reduce the values of
the input to the roughness shader. I accomplished
this by adding a Math node between my roughness
image Texture node and the roughness input of
the glossy shader. I set the operation of the node to
Multiply and set the second value of the node to 0.5.
This halved the values from the roughness image
before passing them to the Glossy Shader node so
that the overall roughness of the input to the shader
was halved, giving sharper, more glossy reflections.
For the shiny green areas of the mesh, I added
some variance in color based on the angle of the
surface to the camera. This gave the material a nice
iridescent look. I accomplished this by adding a
Geometry Input node ( shift ‑A 4 Input 4 Geometry)
to provide the surface normal as an input and a
Normal node to take the dot product of this input
with the view direction. I then used this dot product
output to modify the hue of my specular color map
with a Hue Saturation Value node. By using the dot
product output of the Normal node, I got a value
(rather than a vector) that varied with the surface
normal of the material. When this value was used
to affect the hue input of the Hue Saturation Value
node, the color of the material was subtly shifted
as the surface of the material tilted away from
the camera. You can see the node chain I used in
Figure 12-28. It's a somewhat complex setup, but
seeing it laid out and testing it for yourself should
help you make sense of it.
• Blue sockets are for vector data. They can
carry multiple values, such as UV coordinates
(two dimensional) or position data (three
dimensional).
• Green sockets are for shaders. They carry all
the information that determines how a material
interacts with light.
• Gray sockets are for value data. They carry a
single numerical value.
• Yellow sockets are for color data. They carry
RGBA values (red, green, blue, and alpha).
Certain types of sockets can be mixed and
matched. For example, value sockets can be used
as the input for color sockets, and Blender will sim-
ply treat the value data as a black-and-white image.
Color sockets can also be attached to value inputs,
and Blender will use the overall brightness of the
color as a value input. However, shader sockets are
more complex and can only be connected to other
shader sockets.
Roughness Map
In Chapter 11, I created a roughness map for the
Spider Bot. In Cycles, I can connect this map to
the roughness input for the Glossy BSDF node to
control how blurry or sharp the reflections from
the material should be. Dark areas will have sharp
reflections, while light areas will have blurry ones
(remember, this is the opposite of a hardness map).
To accomplish this, I added a new Image
Texture node, loaded in the roughness map, and
connected its output to the Glossy nodes roughness
input. As a result, bright areas of the texture had
blurrier highlights, and dark areas had sharp, glossy
highlights.
Search WWH ::




Custom Search