|
|
|
|
| |
Using the stencil buffer on the ATI
Rage128 and Rage128 Pro with Direct3D
|
The R128DX7Dissolve3D sample program shows how the stencil buffer may be used to dissolve from one real-time 3D scene into another using different dissolve patterns. Three different dissolve patterns are demonstrated: random noise, a tiled pattern, and a plasma image. Figure 1 shows R128DX7Dissolve3D doing a dissolve using the plasma pattern.
|
|
Figure 1
|
|
- R128DX7Dissolve3D works as follows:
-
- Fill the stencil buffer with the desired dissolve pattern.
- Set the stencil buffer to keep existing values on stencil pass.
- Dissolve sequence: loop from 0 to 255 in the desired step.
- At the start of each iteration, set the stencil reference to the loop counter.
- Set the stencil function to D3DCMP_LESS and draw the first scene.
- Set the stencil function to D3DCMP_GREATEREQUAL and draw the second scene.
- Swap the front and back buffers. NOTE: Do NOT clear the stencil buffer at the start of each new frame.
- R128DX7Dissolve3D Controls
-
- F1 - About
- F2 - Select Driver/Device/Mode
- [ALT]+[ENTER] - Toggle fullscreen/windowed
- [ENTER] - Toggle Go/Stop
- Space Bar - Single Step
- D - Initiate scene dissolve
- C - Cycle through dissolve patterns
- [ESC] - Quit
Downloads
DirectX 7 project file, source, executable, and support files
|
| |
 |
|
|
|