Question

I'm working with DirectX9 and now I'm having problems with the texture creation. I'm using the functions CreateTexture and LoadSurfaceFromMemory with D3DFMT_DXT1 compression, I checked the devices caps of my graphic card and D3DPTEXTURECAPS_POW2 and D3DPTEXTURECAPS_NONPOW2CONDITIONAL are off, I think this means that my graphic card have support of NON Power of Two Textures... I can use textures of any sizes. My problem is the most of the textures are working well (and their sizes aren't power of two), but in some cases don't work, like "1228 x 453", if I resize to "1228 x 452" the texture works well. What's going on?

Sorry for my English!. Thanks.

Was it helpful?

Solution

The BCn texture formats are block based. The blocks pack pixels into groups of 4x4 elements, so the texture dimension must be aligned on 4 for theses formats.

OTHER TIPS

Unfortunately, this is a graphics card issue. Even if the card claims support for non power of two textures, support is often buggy / limited.

You could pad the texture and use a subtexture, but the best approach is to build a texture atlas (in general you should be doing this anyway to conserve memory bandwidth)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top