Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

 

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.

 

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

 

 

 

srcTexture.LevelCount is 1. I tried calling

 

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

 

 

but no effect either.

 

Does anyone know what the problem is, am I using the GenerateMipSubLevels incorrectly?

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...