Sign in to follow this  
REspawn

Generate MipMaps and access them

Recommended Posts

Hi, I have a texture created with mipmaps, I want to be able to access the individual levels, when I use the D3DUSAGE_AUTOGENMIPMAP its not possible to access anything above level 0. My question is: Is it possible to access these levels via some other function other than GetSurfaceLevel? or Is there an easy way to scale the first surface level on a texture created without the D3DUSAGE_AUTOGENMIPMAP so I can create the chain myself? Thanks

Share this post


Link to post
Share on other sites
What do the Debug Runtimes say? So long as you use the D3DUSAGE_AUTOGENMIPMAP flag, the other mip levels should be generated, so you should be able to lock them just fine.

You could also just use IDirect3DBaseTexture9::GenerateMipSubLevels(), but specifying the D3DUSAGE_AUTOGENMIPMAP flag just calls that function internally anyway.

Share this post


Link to post
Share on other sites
The DirectX SDK page about Auto Generated MipMaps says that "Sublevel generation from this point on is completely transparent to the application. Only the top texture level is accessible to the application; the texture sublevels are not accessible since they will be created only when needed by the driver." The function IDirect3DBaseTexture9::GenerateMipSubLevels() is a hint to the driver that this would be a good time to generate the levels. If you are loading from a file or resource D3DX can generate the Mip levels for you.

Share this post


Link to post
Share on other sites
Roboticus makes a good point.

FYI: In the utility source for DxTex (texture viewer) in the SDK, when viewing a mipmap level, even Microsoft generates a new texture to display and accesses the original mipmapped texture only to get a surface description.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this