|
By
Shawn Hargreaves
[Author's
Bio]
Gamasutra
August
13, 2003
|
Excerpted
From:
|
|
|
Features

Hemisphere Lighting With Radiosity Maps
Additional Considerations
This
form of lighting can easily be simplified, using cheaper versions
to implement shader LOD on distant objects. Most significantly,
the per-pixel radiosity lookups and sky color calculations can be
replaced by a single CPU texture lookup at the center of the object,
with the resulting sky and ground colors set as vertex shader constants,
the hemisphere tween evaluated per vertex, and no work at all required
in the pixel shader.
Doing single-texel CPU lookups into the radiosity map is extremely
fast, and this data can be useful in many places. For instance,
a particle system might do a ground color lookup when spawning a
new dust particle, to see if it should be in shadow and also so
it can be tinted to match the hue of its surroundings.
The
radiosity maps can easily become very large, but they are also highly
compressible. Large areas of the map will typically contain either
flat color or smooth gradients, so good results can be obtained
by splitting it into a grid of tiles and adjusting the resolution
of each tile according to how much detail it contains. At runtime,
a quick render to texture can expand the area around the camera
back out into a continuous full resolution map.
Because
the radiosity map is only a two dimensional image, there will obviously
be problems with environments that include multiple vertical levels.
Such cases can be handled by splitting the world into layers, with
a different radiosity map for each, but this lighting model is not
well suited to landscapes with a great deal of vertical complexity.
View
Animation
I
have provided a sequence of videos that show the technique in action.
These five videos (each approximately 7.5MB) show the same sequence
of events with various parts of the lighting model highlighted in
each clip. (Requires DivX player
to view.)
-
Radiosity.
-
Radiosity
plus dot3 sunlight.
- Specular
plus fresnel cubemap.
- Full
lighting model.
- Lighting
plus textures.
Color Plates
|
|
|
 |
 |
 |
Diffuse
(dot3) sunlight plus radiosity hemisphere lookup
|
With
the addition of specular and Fresnel contributions,
using a static cubemap holding an image of typical surroundings
|
|
References
Philip
Taylor (Microsoft Corporation) discusses hemisphere lighting: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndrive/html/directx11192001.asp
The
non-approximate version: Image Based Lighting, Cunjie Zhu, University
of Delaware: http://www.eecis.udel.edu/~czhu/IBL.pdf
This
lighting model is used in the game MotoGP 2, on PC and Xbox,
developed by Climax and published by THQ. MotoGP 1 used a
similar radiosity technique, but without the Fresnel term on the
environment cubemap.
______________________________________________________
|