257
Chapter 9
Light Fog, Fluids, and
Another Look at Materials
W
    take another look at materials. We will tile a texture to cover a large
area, experiment with a few dierent ways to make glass, render with the mental
ray renderer, and make a material look like a light source. Along the way, we will slip in a
light eect called fog and we will use a uid particle eect.
FIXING A TILED TEXTURE WITH OVERLAYS
A common task when creating 3D models is prepping a le texture that looks great on its
own but needs to be repeated in order to cover a large area. Most of the time you cannot
simply enlarge the texture. Even if you have a photo-enlarging application that will allow
you to add pixels so that the image does not become pixelated as you enlarge it, it is usually
true that there is some natural granularity of the texture that needs to be preserved when
applying it to your model. If you have a brick wall, you do not want a twenty-foot expanse
of it covered with a single giant brick; what you need to do is take the texture you have on
hand and tile it.
We are going to look at the key problem of concealing what are oen obvious borders
between the individual tiles. With a brick wall, one way to do this is to use interlocking
sections of brick texture. is makes the job of tiling it very easy. Later, we will look at the
tougher problem of tiling a texture that does not have this interlocking property. Once
a texture has been prepped to be tiled without the edges of the tiles showing, we call it a
“seamless” texture.
If you do need a photo-enlarging application, a good product for enlarging images with-
out having to stretch the pixels is the onOne Perfect suite. It works as a stand-alone applica-
tion and as a Photoshop/Aperture/Lightroom plug-in.
258 3D Animation for the Raw Beginner Using Maya
Experimenting with Textures
Right now, we will look at a simple way to make those
seams between tiles less obvious. e goal is to get the
tiled texture to a point where the seams will not be
easily visible from whatever perspective and distance,
and under whatever lighting we plan to render it.
Adding Noise to the Tiling Lines
Remember our cactus texture? e tiled version of it is
shown in Figure9.1. We can clearly see the horizontal
lines in it, because they cut against the grain of the tex-
ture. What we want to do is soen those lines. One way
to do this is to use another texture to add some noise
to that tiled grain. We will do some experimentation to
see just what sort of texture, if added as a layer to our
tiled cactus texture, will get the job done.
Consider Figures9.2 and 9.3, these are the rust tex-
tures we looked at earlier. Now look at Figures9.4 and
9.5, these are organic textures, both of bushes. All four
of these textures oer a more irregular grain.
First, though, we need to decide just how to add this
layer to the tiled cactus texture. What we will use is a
“saturation” layer. Saturation refers to the brightness of
colors. Another way to look at it is that low saturation
tends to wash out a color. High saturation means the
color is more vibrant. Our goal will be to use the colors
of the new texture layer to inuence the colors of the
FIGURE 9.1 Original cactus patches.
FIGURE 9.2 Rusty metal 1. FIGURE 9.3 Rusty metal 2.
Light Fog, Fluids, and Another Look at Materials 259
tiled cactus texture. Our hope is that the irregular color pattern of the saturation layer will
conceal the sharp boundaries we see between the separate tiles in Figure9.1.
Figures9.6, 9.7, 9.8, and 9.9 show us the settings for each saturation layer. Figures9.10,
9.11, 9.12, and 9.13 (see Color Insert for these gures) give us the one-to-one comparisons
between the original tiled texture and the tiled texture with each of the four saturation
layers added. All four of them do indeed improve the appearance of our tiled texture. e
rst two, the ones with the rust layers, are probably too patchy, with obvious dark and
light areas. e rst bush has too much yellow in it. But the fourth one is pretty good. We
can use that on the cactus and the lines between the tiles will not be so obvious.
Two Final Notes on Tiling
Even if the borders between tiles are eradicated, the tiling can still be detected if the texture
has signicantly varying color patterns inside each tile. If you look carefully at the brick
wall behind our cabana, you will see the pattern repeating.
And a place to go for nice textures is www.subtlepatterns.com.
FIGURE 9.4 (See p. CI-9 of Color Insert) Bush
texture number 1.
FIGURE 9.5 (See p. CI-9 of Color Insert) Bush
texture number 2.
FIGURE 9.6 Rusty metal 1 settings. FIGURE 9.7 Rusty metal 2 settings.
260 3D Animation for the Raw Beginner Using Maya
FIGURE 9.9 Bush 2 settings.
FIGURE 9.10 (See p. CI-9 of Color Insert)
Rusty metal 1—compare.
FIGURE 9.8 Bush 1 settings.
FIGURE 9.11 (See p. CI-9 of Color Insert)
Rusty metal 2—compare.
FIGURE 9.12 (See p. CI-9 of Color Insert)
Bush 1—compare.
FIGURE 9.13 (See p. CI-9 of Color Insert)
Bush 2compare.
Light Fog, Fluids, and Another Look at Materials 261
MAKING A SEAMLESS TEXTURE WITH MAYA PAINT
We will look at one interesting alternative to doctoring a texture to make it tile seamlessly:
using the painting canvas in Maya to create a texture from scratch.
Painting a Seamless Tiled Texture
By going to Windows (on the Main Menu) and then choosing Paint Eects, you will reveal
the Maya painting canvas. On the Canvas window, you can select Canvas and then choose
New Image. A window will pop up that will allow you to give your image a name, choose
a background color, and select an image size.
In the middle of the top menu on the canvas window, Figure9.14, are two icons that
need to be selected so that the texture we are making will wrap in both dimensions. ey
are white icons with blue paint strokes on them. ere are red arrows on the top of the
x-wrap icon and on the le side of the y-wrap icon.
Next you paint your texture image, while making sure you use both the top/bottom
wrapping and the le/right wrapping. You will have to play around with it. You should
paint strokes that go o the canvas in both dimensions.
When you save your image, it will end up in:
Documents → Maya → projects → sourceimages
Creating and Tiling a File Texture
Go to the Hypershade and create a le texture; make sure it is a Normal (not Projection)
texture. Use the painting you just made and saved in sourceimages as the le for this tex-
ture. Go to the attributes of the le texture and select the place2dTexture1 tab. (is should
be the default name for the rst texture you create in your scene.) Set the two Repeat UV
numbers to 3 and 3. (Or whatever nonzero numbers you want.)
Notice that because the paint tool will continue a line that goes o the Canvas by
drawing it on the other side of the image, the creator of the image in Figure9.15 did not
have to manually line up the four lines that go o the Canvas in both directions. Our
wrapable texture looks like Figure9.16 on a polygon plane.
FIGURE 9.14 Mayas canvas.
FIGURE 9.15 A seamless texture.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.175.182