Jump to content
  • Advertisement
Sign in to follow this  
Quat

mipmap dimensions

This topic is 3890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Do mipmap dimensions still need to be powers of 2 (or was that just in old times?) I loaded an image (not of power of 2 dimensions) using D3DX10CreateShaderResourceViewFromFile and it worked, but I am wondering if the function resized it to powers of 2 internally.

Share this post


Link to post
Share on other sites
Advertisement
Mipmaps never needed to be pow2 unless the top level surface was pow2.

width' = max(width/2,1);
height' = max(height/2,1);

You can pass a width and height of 'D3DX_DEFAULT_NONPOW2' to D3DXCreateTextureFrom*Ex to make a non-pow2 texture. This will work on nearly every card that works in DX9, but there will be limitations on many cards (see the caps entry on nonpow2conditional). If you just pass D3DX_DEFAULT, it will make a pow2 texture. If you pass D3DX_FILTER_NONE as the filter to the create call, the texture won't be stretched, it just won't fill the entire surface. Each of the 3 cases has valid uses.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!