For example, in Figure 5.24 a checker texture is mapped to a surface shader material as a spherical projection.. This scene is included on the CD as proj_persp.ma.Placing Placement Boxes
Trang 1appear That is, the upper edge of the texture is pinched into a single point, as is the
lower For example, in Figure 5.24 a checker texture is mapped to a surface shader
material as a spherical projection The top and bottom portion of the checker is
col-lapsed at the poles A similar problem occurs with a nurBs sphere; even though all
nurBs surfaces have four edges, two of the edges are collapsed into single points at
the sphere’s top and bottom pole
Figure 5.23 Planar projections mapped to various primitive surfaces This scene is included on the CD as proj_plane.ma
only for a Spherical projection type U Angle is functional only for Spherical and Cylindrical projections
Trang 2Figure 5.24 (Left) A Spherical projection with default settings is applied to a sphere (Right)
The Spherical projection’s U Angle is set to 360 and its V Angle is set to 180 This scene is included
on the CD as proj_spherical.ma
Ball places the texture inside a projection sphere The projection pinches the texture
at only one pole A real-world equivalent is a blanket draped over a ball with the ket’s four corners twisted together at one spot The pole is indicated by the diamond-shaped uV origin symbol on the projection icon (see Figure 5.25)
blan-Figure 5.25 (Left) A Ball projection is applied to a sphere (Middle) The Ball projection icon (Right) The test bitmap This scene is
included on the CD as proj_ball.ma
Cylindrical places the texture inside a cylinder The left and right edges of the texture
will meet if the projection’s u Angle is set to 360 degrees The cylindrical type creates two pinched poles at the top and bottom of the projection (see Figure 5.26)
Trang 3Cubic places a texture onto the six faces of a cube (see Figure 5.27).
Figure 5.27 A Cubic projection applied to a sphere This scene is included on the CD as proj_cubic.ma
Concentric randomly selects vertical slices from the texture and projects them in a
concentric pattern
TriPlanar projects the texture along three planes based on the surface normal of the
object that is affected
Perspective projects the texture from the view of a camera (see Figure 5.28) For this
to work, a camera must be selected from a drop-down list provided by the link To
camera attribute (found in the camera projection Attributes section of the
projec-tion utility’s Attribute editor tab) The projecprojec-tion icon will take the form of a camera
frustum but will not be aligned to the chosen camera in 3D space The frustum can
be “snapped” to the camera, however, by connecting the Translate, scale, and rotate
attributes of the camera’s transform node to the same attributes of the 3D placement
node connected to the projection utility node (For more information on custom
con-nections, see chapter 6.)
Trang 4Figure 5.28 A Perspective projection applied to a series of spheres This scene is included on the CD as proj_persp.ma.
Placing Placement Boxes and Projection Icons
The translation, scale, and rotation of a 3D placement utility’s placement box or jection icon affect the application of the texture mapped to it For 3D textures, i sug-gest the following tips for placing the placement box:
pro-i
• f a surface is already assigned to the material to which the 3D placement utility belongs, click the Fit To group BBox button in the 3D Texture placement Attri-butes section of the 3D placement utility’s Attribute editor tab This snaps the placement box to the bounding box of the surface
i
• f you need to translate, scale, or rotate the placement box, select the Texture icon in the Hypershade window you can also click the interactive placement button found in the 3D placement utility’s Attribute editor tab The interactive placement button selects the placement box and displays an interac-tive translate, rotate, and scale handle
place3d-u
are not accurate representations of the way in which the texture will render
This remains true if the placement box is scaled to fit the assigned surface Trial and error renders provide the best fine-tuning method in this situation
For 2D textures mapped with the As projection option, the following tips are suggested for placing the 3D placement utility’s projection icon:
T
editor tab is identical to the Fit To BBox button found in the projection utility’s Attribute editor tab you can use either button to snap the projection icon to the assigned object or assigned group’s bounding box
i
• f you need to translate, scale, or rotate the projection icon, select the Texture icon in the Hypershade window you can also click the interactive placement button found in the projection or 3D placement utility’s Attribute editor tab The interactive placement button selects the projection icon and dis-plays an interactive translate, rotate, and scale handle
Trang 5The projection icon created for projected 2D textures indicates the employed
uV orientation For example, a planar projection icon features a diamond-shaped
symbol at one corner (see Figure 5.29) This represents the 0, 0 origin in uV texture
space (For more information on uV texture space, see chapter 9.) using the origin
symbol as a reference, you can orient the icon and predict the resulting render For
example, if a planar projection icon is viewed from a front workspace view and the
origin symbol is at the bottom-left corner, V runs down to up and u runs left to right,
matching a texture’s icon in the Hypershade window
Figure 5.29
The UV origin symbol of a projection icon
spherical, cylindrical, Ball, Triplanar, and cubic projection icons also carry an origin symbol For Ball projections, the diamond shape represents the point where all
four corners of the texture converge Triplanar projections carry three origin symbols,
one at the corner of each plane each plane is identical to a planar projection cubic
projections carry six symbols, although three of them overlap at one corner
concen-tric projections carry no symbols since standard uV interpretation does not apply
For each and every example in this section, animation of the assigned surface can adversely affect the projection if either the surface or the projection icon is moved, the
surface picks up a different portion of the texture if the surface is larger than the
pro-jection icon or is not aligned to the icon, it receives a repeated portion of the texture
To avoid this problem, you can parent the 3D placement utility to the surface
How-ever, this will not prevent errors when a surface deforms Fortunately, the convert To
File Texture tool is available
Applying the Convert To File Texture Tool
The convert To File Texture tool allows you to convert projected 2D textures, as well
as 2D and 3D procedural textures, into permanent bitmaps To apply the tool, follow
these steps:
1. select a material that has a projected or procedural texture assigned to one or
more of its attributes shift+select the surface to which the material is assigned
2. choose edit > convert To File Texture (Maya software) > ❑ from the
Hyper-shade window menu The convert To File Texture options window opens (see Figure 5.30)
written out choose appropriate sizes and specify a File Format value Then click the convert And close button
Trang 6The Convert To File Texture Options window
For each projected 2D texture, procedural 2D texture, and procedural 3D ture mapped to the material, a bitmap is written to the following location with the following name:
tex-project_directory/texture_name-surface_name.format
At the same time, the original material is duplicated with the original shading network structure in place of the projected and procedural textures, however, File textures are provided with the new bitmaps preloaded The new material is automati-cally assigned to the surface When compared side by side, the converted bitmap sur-face is virtually identical to the original (see Figure 5.31) once the converted bitmaps are applied to the surface through the duplicated material, you can delete the original material Thereafter, you can animate or deform the surface; the textures will not slide
This offers the advantage of locking in any custom UV settings In addition, any bitmap mapped to a single channel attribute, such as Transparency or Diffuse, is converted to grayscale The original bitmaps are not harmed
Lambert material or if the surface is connected to more than one shading group In general, the default Lambert material should not be used in the texturing process You can delete connections to unneeded shading groups in the Hypershade window
Trang 7Surface with procedural textures Surface with converted bitmap textures
Figure 5.31 Procedurally mapped surface compared to surface with converted bitmaps This scene is included on the CD as
convert.ma
The convert To File Texture tool carries additional attributes for fine-tuning
Anti-Alias, if checked, anti-aliases the bitmap Background Mode controls the
back-ground color used in the conversion Fill Texture seams, when checked, extends the
color of any uV shell past the edge of the shell boundary; this prevents black lines
from forming at the boundaries when the surface is rendered Bake shading group
lighting, Bake shadows, and Bake Transparency, when checked, add their namesake
elements to the converted bitmap Double sided must be checked for Bake shadows to
function correctly uV range allows the custom selection of a non-0-to-1 range (it is
also possible to bake lighting information through the Transfer Maps window, which
is discussed in chapter 13.)
Chapter Tutorial: Creating Skin with Procedural Textures
in this tutorial, you will texture a character’s head using nothing more than 2D and
3D procedural textures (see Figure 5.32) Although custom bitmaps generally create
the highest level of realism, the proper use of procedural textures can save a
signifi-cant amount of time on any production
1. open head.ma from the chapter 5 scene folder on the cD This file contains a
stylized polygon head
area Assign the Blinn to the head open the Blinn’s Attribute editor tab change the color attribute to a flesh color of your choice change the Ambient color
to a dark red This will give the surface a subtle, skinlike glow in the shadows
The Ambient color slider should not be more than 1⁄8 of the slider length from the left side if the Ambient color is too strong, the surface will look washed out and flat
Trang 8Figure 5.32 A skin material created with 2D and 3D procedural textures.
3. To properly judge the results, create several lights Follow either the 2- or 3-point lighting techniques discussed in chapter 1 render a series of tests until the lighting is satisfactory
button and choose a Fractal texture from the create render node window
Double-click the place2dTexture1 icon in the work area, which opens its bute editor tab set repeat uV to 15, 15 and check stagger This reduces and randomizes the scale of the fractal pattern so that it can emulate pores
Attri-5. open the Blinn’s Attribute editor tab Adjust the eccentricity and specular roll off attributes correct values depending on the lighting of the scene The goal
is to create a strong specular highlight without losing the detail provided by the Fractal texture Be careful not to raise the eccentricity value too high; this will spread out the highlight and make the skin look dull
its Attribute editor tab reduce the Amplitude and raise the Threshold slightly
This reduces the amount of contrast in the fractal pattern and makes its effect subtler Tint the color gain attribute a pale blue This inserts a color other than red into the material and helps make the skin color more varied
Trang 9Map button choose a granite texture from the create render node window
in the work area, double-click the bump3d1 icon, which opens its Attribute editor tab change Bump Depth to 0.005 in a workspace view, select the 3D placement utility’s placement box and scale it down to 0.5, 0.5, 0.5 in x, y, Z
render a test The granite texture provides a subtle bumpiness/fuzziness to the parts of the skin that do not have specular highlights
Map button and choose a solid Fractal texture from the create render node window in the work area, double-click the solid Fractal icon (named solid-Fractal1), which opens its Attribute editor tab change the ratio value to 1 and the Frequency ratio value to 4 change color gain to a dark purple render a test frame The solid Fractal texture introduces variation within the basic skin color if the result is too bright or the color is not quite right, adjust the color gain and render additional tests
The skin material is complete! if you decide to apply this material to a character that moves or deforms, you can use the convert To File Texture tool to change the 3D
procedural textures into bitmaps if you get stuck with this tutorial, a finished version
is included as head_finished.ma in the chapter 5 scene folder on the cD
Trang 106
Trang 11Creating custom shading networks is a powerful way to texture and render with Maya You can connect hundreds of material, texture, geometry, light, and camera attributes through the Hypershade window for unique results In addition, you can apply specialized color utilities that can customize the hue, saturation, value, gamma, and contrast of any input and output
Chapter Contents
A quick review of the Hypershade window Multiple approaches for creating connections Tips for keeping the Hypershade organized Practical applications of each color utility6
Trang 12Mastering the Hypershade Window
the Hypershade window is the heir to the multilister domain although the ister window is a legacy tool from poweranimator, the Hypershade was created spe-cifically for maya everything that can be done in the multilister can be done in the Hypershade, but not vice versa you can access the Hypershade by choosing Window >
multil-rendering editors > Hypershade you can access the multilister by choosing Window >
rendering editors >multilister
Reviewing the Basics
the Hypershade window allows the connection of various maya nodes technically speaking, a node is a construct that holds specific information plus any actions asso-ciated with that information a node might be a curve, surface, material, texture, light, camera, joint, iK handle, and so on any box that appears in the Hypergraph
or Hypershade window is a node (For a differentiation between transform and shape nodes, see Chapter 7.) a node’s information is organized into specific attributes if an attribute can be animated, it is called a channel (and appears in the Channel Box) For example, the scale X of a sphere is a channel
you can connect attributes in an almost endless fashion a series of connected nodes is a node network if the network is designed for rendering, it’s called a shad-ing network any node connected to any other node is considered upstream or down-stream an upstream node is a node that outputs information a downstream node
is a node that receives or inputs information the node icons themselves will show if
an upstream or downstream connection exists if the bottom-left arrow is solid, the node is downstream of another node if the bottom-right arrow is solid, the node is upstream of another node if either arrow is hollow, a connection does not exist in the direction in which the hollow arrow points (see Figure 6.1)
Upstream node
Upstream connectiondoes not exist
Downstreamconnectionexists
Downstreamconnectionexists
Trang 13edit > duplicate > Without network from the Hypershade menu to copy entire
shad-ing networks, choose edit > duplicate > shading network.
you can export shading networks Choosing File > export selected network
saves the selected network, by itself, in a file with the .mb or .ma extension you can
then bring networks back into the maya scene by choosing File > import from the
Hypershade menu
to assign materials, mmB-drag them on top of geometry in a workspace view
alternatively, you can follow these steps:
to selection from the marking menu
Creating Custom Connections
you can create custom connections through the Connection editor (choose Window >
general editors > Connection editor) or the Hypershade window’s work area
descriptions of various approaches follow
Using the Connection Editor
the Connection editor is divided into two sections By default, the left side contains
outputs (upstream) and the right side contains inputs (downstream) a single node can
be displayed on each side to load a selected material, texture, surface, or any other
maya node, click the reload left or reload right button
to make a connection, simply select an attribute on the left and an attribute on the right once a connection is made, the names of the attributes become italicized a
number of attributes are grouped into sets of three, as represented by the plus sign (see
Figure 6.2) this grouping is a type of vector (see Chapter 8 for a discussion on
vec-tors.) it occurs most commonly with the Color attribute, which is composed of red,
green, and Blue channels, but it also applies to color-driven attributes such as
trans-parency and incandescence you can reveal the individual channels of any given vector
attribute by clicking the plus sign
Vector attribute
Vector attribute with channels visible Single attribute
Figure 6.2 Vector attributes and a single attribute in the Connection Editor
other attributes, such as translate or normal Camera, represent a spatial tor with X, y, and Z coordinates any vector attribute can be connected to any other
vec-vector attribute However, a vec-vector attribute cannot be connected to a single attribute
Trang 14Single channel of vector attribute to single attribute
Vector attribute to vector attribute
Figure 6.3 (Top) A vector attribute connected to second vector attribute (Bottom) The
single channel of a vector attribute connected to a single attribute
Color, the most common attribute, is predictably named Color on the input (downstream) side of a node However, it is named out Color on the output (upstream) side similarly, there is out glow Color, out alpha, and out transparency see the end of this section for a discussion of out alpha and out transparency
Employing Drag and Drop
dragging and dropping one node on top of another using the mmB automatically opens the Connect input of menu (see Figure 6.4) the default attribute (usually Color) of the output (upstream) node is automatically used for the connection the Connect input of menu makes no distinction between vector and single attributes if
a Connect input of menu selection is made that confuses the program, the tion editor automatically opens the attributes listed by the Connect input of menu
Connec-is incomplete (although they are the most common and often the most useful) to see the full list, choose other to open the Connection editor dragging and dropping one node on top of another using the mmB while pressing shift opens the Connection editor immediately
Figure 6.4
The Connect Input Of menu for
a Blinn material
Trang 15for both nodes is used For instance, the default input attribute of a Blinn
mate-rial is Color the default input attribute of a bump2d node is Bump Value if the two
nodes involved in the connection are not a standard pair, maya will not be able to
make a decision For example, dragging one texture on top of another texture with
the mmB and Ctrl forces maya to open the Connection editor
you can also mmB-drag nodes from the Hypershade window to the attribute editor an outlined box appears around any valid attribute when the mouse arrow
hovers over it (see Figure 6.5) releasing the mouse button over an attribute
automati-cally creates a connection in this case, it’s best to double-click the downstream node
first to open the node’s attribute editor tab, and then mmB-drag the upstream node
without having actually selected it of course, clicking the standard checkered map
button on an attribute editor tab opens the Create render node window and creates
a connection once a material, texture, or utility is selected
+
Figure 6.5
A node MMB-dragged to the Attribute Editor
The outlined box around the attribute signifies a potentially valid connection
Duplicating a Line
left mouse button (lmB)-clicking and -dragging an existing connection line creates
a brand-new ghost line if the ghost line is dropped onto another node, the Connect
input of menu opens if you click the original line behind the arrowhead, the ghost
line starts at the input (downstream) node if you click the original line ahead of the
arrowhead, the ghost line starts at the output (upstream) node the attribute for the
node from which the ghost line extends will be the same as the original connection
line (see Figure 6.6)
the output (upstream) attribute is displayed in the white label box to the left of the
mouse arrow, while the input (downstream) attribute is displayed in the white label
box to the right of the mouse arrow For example, when examining the connection in