|
|
|
|
| |
Using the stencil buffer on the ATI
Rage128 and Rage128 Pro with Direct3D
|
The R128DX7Reflect sample program shows how the stencil buffer may be used to restrict rendering within a bounded area. This may be used to mask out specific regions for rendering, for example when drawing reflecting objects such as mirrors or marble floors. Figure 1 shows R128DX7Reflect in action.
|
|
Figure 1
|
|
- R128DX7Reflect works as follows:
-
- Draw every original object other than the reflective
surface normally.
- Put the shape of the reflective surface into
the stencil buffer, but not on to the z-buffer
or draw buffer.
- Reflect all the original objects in the plane
of the reflective surface, and draw them wherever
the stencil buffer is non-zero.
- Alpha-blend the reflective surface additively
on to the draw buffer.
- R128DX7Reflect Controls
-
- F1 - About
- F2 - Select Driver/Device/Mode
- [ALT]+[ENTER] - Toggle fullscreen/windowed
- [ENTER] - Toggle Go/Stop
- Space Bar - Single Step
- Up/Down Arrows - Move camera up/down
- Left/Right Arrows - Rotate scene left/right
- S - Toggle use of stencil
- [ESC] - Quit
Downloads
DirectX 7 project file, source, executable, and support files
|
| |
 |
|
|
|