mipmap dimensions

Started by
0 comments, last by Namethatnobodyelsetook 16 years, 4 months ago
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.
-----Quat
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.

This topic is closed to new replies.

Advertisement