Multitexture Soft Shadows on Radeon®
|
| |

|
| |
Figure 1 - Soft shadow of vase
|
| |

|
| |
Figure 2 - Soft shadow texture
|
| |
The sample RadeonSoftShadow demonstrates how to use
multitexturing to generate soft shadows. The vase is drawn
several times into render target textures from the light
point-of-view in a dark gray silhouette over a black background.
The light position is displaced for each sample to simulate
a spherical light source. A shadow map texture is generated
by cumulatively subtracting each render target sample
from an initially all-white background. Overlapping silhouette
regions become progressively darker as samples are subtracted.
Regions with less overlap attain a lighter shade of gray,
thus forming a gradation of gray across the shadow. The
shadow map is projected onto the receiving surface using
automatic texture coordinates and a texture transformation
matrix. It is modulated onto the receiving surface with
multitexturing.
On the Radeon® two sample textures may be subtracted at
once using the three stage multitexture units. The two
samples are added together using the first and second
stage, and subtracted from the cumulative texture using
the third stage. Multiple samples may be subtracted by
applying this process recursively. Figure 1 shows the
projected shadow texture. Figure 2 shows the generated
shadow texture.
|
| |
- RadeonVaseSoftShadow Controls
-
- [SPACE] - Advance Frame-by-frame
- [ENTER] - stop advancing Frame-by-frame
- [ESC] - Quit
|
| |
| |
Downloads
|
| |
Note: The source code and media should be unzipped
into the following recommended directory structure to
ensure you can easily compile and run the executable.
Radeonxxxxxx.zip -> x:\atiddk\Direct3D\Radeonxxxxxx
media.zip -> x:\atiddk\media
RadeonSoftShadow.zip
media.zip
Back
to Samples Page
|
| |