Game Development Reference
In-Depth Information
Cookies are gobos from the theatre world. What they do is provide a
textured light—a light with some shadow on it. Think of the shadow made
as light streams through a tree without a dense canopy of leaves. Cookies
can be handy to imply geometry that isn't there (think of plays that take
place in a forest lit with a “cookie” so the audience can see the shadows
of trees and leaves that are not actually present). For point lights, cookies
must be Cube Maps with alpha channels.
Shadows are beautiful but expensive in terms of resources. It takes a
good deal of horsepower to draw the shadows emitted by any light. Point
lights are especially expensive because they are essentially six spotlights
shooting out in each direction. This means drawing all these shadows
and draw calls in realtime can very quickly drag your game to a crawl.
Hard shadows are easier to draw than soft, but without some serious
baking, multiple-point lights with shadows will kill a frame rate. Note that
shadows drawn in realtime are available only with Unity Pro—although
they will be present in baked scenes when using the free Unity.
Halos can be thought of as glows.
Render mode is used for determining how critical a light is when Unity is
determining what to draw. For our level (and for most levels) Auto is a fine
setting.
Culling mask determines what this light illuminates. By default it
illuminates everything, but this can be restricted so a certain light only
lights certain objects. This actually comes in handy more often than
you'd think.
Lightmapping allows for the definition of whether this light is used in
the lightmapping process or not. It can be used in both lightmapping and
realtime of course, and in most situations a setting of Auto works fine.
Spotlight
Illumination emanates from a single point from a spotlight but emits out in
a cone shape just like a real spotlight. Figure 7.16 shows a spotlight and its
relevant handles. It still has a Range handle, but only one, and it indicates the
linear throw the light has. The new handles available here are the Spot Angle
Handles, which allow for the angle of the spot.
The Move and Rotate tools are very important for this tool. Rotating to find
the right spot to spotlight is the key to this tool.
Most of the notes for point lights apply to spotlights as well. A couple of
notable exceptions are (1) for a spotlight, cookies can be a single image with
an alpha channel, but it must have a black edge all the way around the image;
and (2) upon import, the Texture Import settings must have Border Mipmaps
activated, and the wrapping mode selected to Clamp.
Directional Light
Directional lights can be a little goofy to understand. Figure 7.17 shows the
scene with one directional light that is casting shadows. Remember that only
Unity Pro will cast realtime shadows, but shadows help illustrate what this
Search WWH ::




Custom Search