Game Development Reference
In-Depth Information
Offset is a valuable tool as well, especially with textures that have an alpha channel and may have had
the image placed just a little too close to the edges. Primarily, the Texture Offset will slide your texture
along the horizontal ( U ) or vertical ( V ) axis. If you turn on Select Face while doing the offset, you will see
the center of the texture moving back and forth when you run the spinners. It is always wise to make sure
that any texture with a transparent background, like a tree or bush, does not go all the way to the edge of
the image. It is best to leave a 4- to 6-pixel gap at the edge so you are not iddling too much with Offset
modiication of the texture on your form.
6.8 SPECIALIZED TEXTURES: ANIMATED, TRANSPARENCY,
AND BAKED LIGHTING WITH AMBIENT OCCLUSION
In the next 3 sections you will explore some of the more exotic forms of texture creation: animated textures,
textures with transparency, and textures that have the lighting in the scene added on their surfaces (baking)
with ambient occlusion.
6.8.1 T exTures WiTh a nimaTion
At times, you may want to create objects that have moving surfaces, things like water, spinning targets, lap-
ping wings, or whatever captures your imagination. There are several ways to produce these effects by the
use of simple scripts and special textures. The most basic way to animate a texture is to use a script to move
it around on the face of a prim. If you animate the offset, then the texture appears to slide across the surface,
just as water lows down a channel. Animate the rotation and you can have a spinning wheel image. If the
scale is animated, you can make a surface appear to “breathe” or inlate.
If you want a cycling animated effect, perhaps a crackling ire, then a series of lame images when played
in sequence can create a realistic effect. The initial texture is laid out in a speciic grid so that the animate
texture script can ind that section of the texture and project each image in sequence. Figure 6.17 illustrates
a texture that creates lapping dragonly wings. Each “frame” has the wings in a slightly different position,
and that creates the illusion of rapidly beating wings as the images are lashed on the surface of the prim as
rapidly as possible.
As you start to dive into animated texture creation and want to get scripts that create animated textures,
pay a visit to Robin Sojourner's Texture Learning Exhibits on Living Tree Island in Second Life.
6.8.2 T exTures WiTh T ransparenCy : T Wo m eThods for C reaTing T hem
At some point in your virtual building career, you will need to make a texture that has transparency on it.
You may need to make a frosty window for your gingerbread house or a leafy branch for the new tree you
are building. There are several methods for creating these types of textures, and two of the most useful
ways are by using a 24-bit PNG ile (easy; good for beginners) or making a TGA 32-bit ile (less easy; good
for advanced graphics users). Torley Linden has a useful tutorial about the PNG method (http://youtu.be/
ekLIgpRHSq4) [6].
In textures that have varying levels of transparency, like a frosted window or a dragonly wing, you may
need to utilize the alpha channel of a 32-bit Targa ile. For more information on creating these kinds of
transparencies, check out Robin Woods's excellent tutorial (http://www.robinwood.com/Catalog/Technical/
SL-Tuts/SLPages/WhiteHalo.html).
Search WWH ::




Custom Search