Auto Generating Mip Maps

skip

Newcomer
Joined
Jul 7, 2005
Messages
1
I am simply trying to load in a texture and have the mip maps be auto generated or force the generation of the mip maps through Texture.GenerateMipSubLevels(). I am getting very strange results.

This bit of code generates multiple levels.

Code:
Texture srcTexture = new Texture(Device, 256, 256, 0, 0, Format.X8R8G8B8, Pool.Managed);

srcTexture.LevelCount = 9 at this point, so it did create multiple surfaces.

Changing the Usage only creates one level.

Code:
Texture srcTexture = new Texture(Device, 256, 256, 0, Usage.AutoGenerateMipMap, Format.X8R8G8B8, Pool.Managed);



srcTexture.LevelCount is 1. I tried calling

Code:
srcTexture.AutoGenerateFilterType = TextureFilter.Linear;
srcTexture.GenerateMipSubLevels()


but no effect either.

Does anyone know what the problem is, am I using the GenerateMipSubLevels incorrectly?
 
An application can discover support for automatic generation of mipmaps in a particular format by calling Manager.CheckDeviceFormat with Usage.AutoGenerateMipMap. If Manager.CheckDeviceFormat returns false, the Texture constructor succeeds, but returns a single-level texture.


Documentation is cool.
 
Back
Top