Game Development Reference
In-Depth Information
top section of the Build Editor and select the face with your mouse cursor. This will highlight the edges of the
face and give you a crosshair target in the middle of it that is useful for centering the texture you are applying.
Now, select your whole object and bring up the Texture tab in the Build editor, but rather than using the
menu to iddle with Transparency, Glow, or any of those goodies just yet, let's create a lighting effect that
does not stress the server too much or require that we make any special textures.
Take a few minutes to decide how the lighting will be set up in your scene. In Figure 6.13, there is a stone
arch in need of some texturing. Let's suppose that for the most part the sun or the moon will light this scene.
On the underside of the arch, rather than take the default white base color in the Texture (diffuse section of
the Texture tab), why not take that down to a 60% or 50% gray color? In the example shown in Figure 6.13,
bringing down the base material color to a gray on the undersides and off sides of the arch creates the
sense of overall lighting without adding immovable baked shadow textures to the structure. If you do this
consistently all over your build, you can create a sense of light and shadow without making any special
shadow-based textures.
Now that you have tried a little base material shifting to add some lighting, let us proceed with a quick
tour around the rest of the Texture tab menu (Figure 6.14).
The Transparency spinner obviously allows you to make the prim or object translucent or even invisible
by changing the alpha value on your texture. Be aware that by using this, the server will change a 24-bit
texture into a 32-bit one to accommodate an alpha effect, and that change could cause alpha sorting glitches
or lickering in your scene where two layers of transparent objects overlap. There is little you can do about
this except to plan carefully when you build to avoid overlaps of alpha-based textures and to use them as
judiciously as possible. Also, be aware that when you turn on Transparency, bump mapping and shininess
are deactivated on the object.
Glow and Brightness were added to the texture options in Second Life in 2009. This vertex shader will
cause a minor performance hit, but most graphics cards these days would barely notice. When activated, the
surface is rendered to show a radiating light from the edges and faces. It is effective for ire and radioactive
fuel effects, although the glow itself will not cast light on the scene or create any shadows. The Shininess
and Bumpiness modiiers contain the legacy settings, and are still one of the simplest ways to put some life
into your textures. For even iner, more realistic effects, it is worth your time to experiment with specular and
normal maps to take advantage of the newer options in these modiiers.
Mapping comes in two basic categories: default and planar. Each type of prim has its own default mapping
format, called UV mapping, which determines how a texture is wrapped around or mapped onto the form.
The U represents the horizontal direction of the texture image, and the V represents the vertical direction of
a texture image. Look at Figure 6.15 to see how each of the primitives will take on a texture map and how
they orient the UV coordinates.
The planar mapping does what its name says; it will make your texture align itself to the plane of a box or
prism. This can be used to help correct the distortion you will see on the sides of a tapered box or prism as
shown in Figure 6.4, and the arch base prims of Figure 6.13. Please note that the planar mapping of a texture
will affect the tiling as it changes from repeats per face to repeats per meter. This can easily be set back to
the appropriate size with the spinners on the lower part of the menu if you so desire.
Tiling the texture you have made on the surface of a prim or object is a bit of a ine art in itself (Figure 6.16).
When you build something, the irst place to check is at the top of the Build menu and make sure that the
stretch texture box is checked on. When you rez a prim, its default texture mapping setting is one repeat both
horizontally  ( U ) and vertically ( V ), and the default size of the object (usually a box) should be 0.5 meters
to the side. At this point, you can decide to utilize a little math and take advantage of the built-in stretch
textures option. Suppose you wanted to make a tile loor that was 10 meters square. You could make a huge
Search WWH ::




Custom Search