Multitexture Light Glare on Radeon®
|
|
|
 |
|
|
Figure 1 - Light glare using multitexturing
|
|
|
The sample RadeonLightGlare demonstrates a post-processing technique for creating blurry glare around emmisive scene objects. It creates this effect dynamically using multitexturing and render target textures.
The first step in this technique is to render emissive scene objects into a render target texture. The texture is then downsampled into a series of progressively smaller render target textures, each half the width and height of its predecessor. As they are downsampled, the textures are bilinear filtered to establish the base bluriness. As downsampling introduces inherent aliasing artifacts, the textures need to be antialiased to soften or smudge the bluriness. For each texture, multiple samples are generated by drawing it slightly jittered into secondary render target textures of matching size. The samples are accumulated by adding them in weighted proportions through a combination of multitexturing and alpha blending. The Radeon® can combine four samples in a single pass using its three texture stage units and the alpha blending unit. This process can be used recursively to accumulate more samples. The RadeonLightGlare sample downsamples into 128x128, 64x64, 32x32, and 16x16 textures. Figure 2, Figure 3, Figure 4, and Figure 5 show the blurred textures used in this sample.
|
|
|

|

|
Figure 2 - 128x128 blur texture
|
Figure 2 - 64x64 blur texture
| |
|

|

|
Figure 3 - 32x32 blur texture
|
Figure 4 - 16x16 blur texture
|
|
|
|
The anitaliased images are added together in weighted proportions, also using multitexturing, to create a composite glare texture. Figure 6 shows the composite texture. Finally, the texture is blended over the scene in a post-processing pass. Figure 1 shows the final image.
|
|
|

|
|
|
Figure 6 - Composite glare texture
|
|
|
- RadeonLightGlare Controls
-
- G - Enable/Disable glare
- H - High intensity glare
- M - Medium intensity glare
- L - Low intensity glare
- 0 - View 128x128 blur texture
- 1 - View 64x64 blur texture
- 2 - View 32x32 blur texture
- 3 - View 16x16 blur texture
- C - View composite blur texture
- [SPACE] - Advance Frame-by-frame
- [ENTER] - stop advancing Frame-by-frame
- [LEFT] - Rotate camera left
- [RIGHT] - Rotate camera right
- [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
RadeonLightGlare.zip
media.zip
Back to Samples Page
|
|
|