Game Development Reference
In-Depth Information
To ensure an object is affected by the lights in a scene, it must have a Material class
that supports it. For most game objects, the default choice is the Lighting material. It sup-
ports a variety of lighting types from per pixel to lightmaps and vertex lighting. The latter
two are optional but have their uses.
A lightmap is essentially an extra texture where lighting has been pre-rendered. Its resolu-
tion can rarely match real-time lighting, but from another perspective, it is very fast since
lighting doesn't have to be calculated at runtime; also, it can be used for static scenes.
Normally, lighting is calculated on a per-pixel basis. This means that for each pixel visible
on the screen, the processor has to calculate how it is affected by the available light
sources. It is fairly expensive and even more so with many light sources, but it produces a
more realistic result. Vertex lighting instead means that lighting is calculated for each ver-
tex on a model. For low poly models, this is much faster although not as detailed. The
quality will suffer noticeably when it is near the object, but it can give good enough res-
ults for objects some distance away.
Search WWH ::




Custom Search