|
This sample application demonstrates
hardware accelerated mip map generation in DirectX 9
for both 2D textures and cube maps. Several different
texture formats are demonstrated, and the user can cycle
among them using the up/down arrows.
Each frame, this application renders a spinning teapot
into the current renderable texture (all six faces in
the case of a cube map). The application then
uses the texture's GenerateMipSubLevels() method to cause the mip map levels
to be generated by the hardware.
In 2D texture mode, the application draws two spinning
quadrilateral primitives, while spheres are drawn in
the cube map mode. In both modes, the primitive
on the left is drawn with the dynamically updating mip
map, while the primitive on the right is drawn with
a reference texture which is the same size as the dynamic
texture. This reference texture contains mip levels
of varying colors to illustrate the transition between
mip levels. Trilinear filtering can be toggled
with the [T] key. Switch between 2D and cube maps
with the [M] key.
|