Auto Mip Map Generation on the Radeon®
|
| |

|
| |
Figure 1 - One full 90 degree spin of the "Blt
Spin" algorithm
|
| |
The RadeonAutoMipGen sample uses SGIS_generate_mipmap
to demonstrate automatic mip map generation in OpenGL®.
A procedural texture is created by the app and is copied
to texture memory using glTexSubImage2D at which time
the entire Mip chain is recomputed automatically.
The Blt (Block Transfer) Spin algorithm was inspired by
a screen saver in the XScreenSavers
package. The Basic idea is that an image is divided into
quadrants then each quadrant slides to it's clockwise
quadrant neighbor. Then the alorithm recurses (dividing
each quadrant into 4 quadrants... etc) until your quadrant
size is a single texel. This will result in your original
image rotated 90 degrees. The actual demo continues to
spin the image over and over, the animation shown here
on the web page only shows a single 90 degree rotation
(one complete cycle through the algorithm). Each time
the image is updated it is copied to texture memory using
glTexSubImage2D and because auto mip mapping is enabled
the entire mip chain is recreated (you can zoom out the
quad to verify that it's working).
|
| |
- RadeonAutoMipGen Controls:
-
- F - Advance one frame (when Animation is toggled
off)
- UP/DOWN ARROW - Zoom In/Out
- RIGHT + MOUSE - Zoom In/Out
- SPACE - Toggle Animation (use F to flip through
frames)
- ESC - Quit
|
| |
Downloads
|
| |
RadeonAutoMipGen.zip
Back
to Samples Page
|
| |