1193D Modeling, 2D Graphics, and Data Visualization
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 ddling too much with Offset
modication of the texture on your form.
6.8 SPECIALIZED TEXTURES: ANIMATED, TRANSPARENCY,
ANDBAKED 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 TexTures WiTh animaTion
At times, you may want to create objects that have moving surfaces, things like water, spinning targets, ap-
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 ows 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 inate.
If you want a cycling animated effect, perhaps a crackling re, then a series of ame images when played
in sequence can create a realistic effect. The initial texture is laid out in a specic grid so that the animate
texture script can nd that section of the texture and project each image in sequence. Figure6.17 illustrates
a texture that creates apping dragony wings. Each “frame” has the wings in a slightly different position,
and that creates the illusion of rapidly beating wings as the images are ashed 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 TexTures WiTh TransparenCy: TWo meThods for CreaTing Them
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 le (easy; good for beginners) or making a TGA 32-bit le (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 dragony wing, you may
need to utilize the alpha channel of a 32-bit Targa le. 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).