Game Development Reference
In-Depth Information
8.5.2 s haders and T exTures and h oW T hey m aKe m aTerials
Now, if you remember that the color on the surface of an object occurs because it holds on to all the other
wavelengths and only lets you see the color wavelength of the material, you are beginning to understand how
shaders work. This kind of selective speciicity extends to all manner of surface properties in a virtual world,
and by controlling them you can affect the quality of “perceived” light in a scene. Imagine the difference in a
sphere that looks like blue felt versus a sphere that looks like blue glass. Because of the soft surface on a felt
sphere, you may not actually be able to see a highlight on the surface, and the lighting would seem general and
diffuse, as if from an overhead luorescent panel. On the glass sphere, you may see very bright highlights on
the surface, showing you the positions of all the lights around it. These extreme examples are to make the point
that the choices you make in the properties of the surfaces on your objects in a virtual environment are a vital
part of the lighting design. In virtual environments, all of the 3D surfaces are covered with materials or shaders.
Just so you have a clear understanding of the terms and there is no confusion between the term shader
and the related terms of texture and material , let's look at the differences in meanings for this terminology.
8.5.2.1 Deining Shaders, Textures, and Materials in Second Life and OpenSim
1. A shader deines the look of a surface of an object. Shaders make up the underlying surface of a
material without color or just a basic color tint. They have little “character” other than how shiny,
transparent, or smooth they make the surface of a prim or object look.
2. Textures can be added to the shaders to make a surface take on more detailed characteristics such
as wood grain, mineral lecks, or animal skin coloring.
3. Materials are the combination of textures and shaders and can be stored on prims in Second Life or
OpenSim as shown in Figure 8.3. The menu for creating them is found under the Texture tab of the
Build/Edit menu.
Beautiful models covered with “baked” or prelit textures are almost indistinguishable from models lit
with real-time light. The limitation to this process is that your shadows are static and especially noticeable if
you have any moving lights or a sun/moon cycle. A walk down the street on a sunny day will show you how
highlights move across the surfaces as you change your point of view and how shadows move in response to
changes in the lighting in the environment.
8.6 ENVIRONMENTAL MENUS AND SHADERS IN SECOND LIFE AND OPENSIM
Shaders in Second Life and OpenSim are inluenced by the Graphics settings controlled by Firestorm. The
environmental settings you see in the Avatar/Preferences/Graphics menu when you have the quality set
as medium or higher include shaders such as Lighting/Shadows and Ambient Occlusion. These Advanced
Lighting shaders greatly affect the look of the materials in the world, as you can see in the lower panel of
Figure  8.3, and they are in turn affected by the WindLight settings of the entire environment. In  Second
Life and OpenSim, after you have applied shaders such as transparency, glow, shininess, and bump textures
to an object, you can then universally affect the appearance of your water, land, sky, and all the objects
on it with the choice of different overall settings in the Avatar/Preferences/Graphics menu and in the
World/Environment/Editor/Environment settings menu.
Compare the two menus so that you understand how they differ and overlap in functioning. In Figure 8.4,
you can see the Advanced Lighting and Shader controls under the Avatar/Preferences/Graphics tab. Below
it is the World/Environmental Editor/Environmental Settings menu, where you can customize your sky and
water environments and the overall lighting of the scene.
Search WWH ::




Custom Search