Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texture Loading Problem

Started by HandCraftedRadio Apr 4, 2008 at 4:38 PM 1 replies 1.2k views
Original Post
HandCraftedRadio
HandCraftedRadio
Is there anyway to set a texture's dimensions so they do not scale to a power of 2? Right now I am using the D3DX_DEFAULT_NONPOW2 flag to do this when creating the texture but apparently this does not work with all cards. It is making the textures all distortorted on cards that don't support it. Is there any way around this?
Sc4Freak
Sc4Freak
If a card doesn't support it, there's not much you can do.

If you're using the texture as a texture for a 3D mesh, the extra size shouldn't really matter. If you're doing it in 2D, I can see how it can be a problem.

When writing 2D programs, I dealt with this problem by manually resizing the texture up to the nearest power of 2. But rather than stretch the image, I just filled the extra pixels with black. I then used alpha blend or alpha testing to remove the extra black pixels.
HandCraftedRadio
HandCraftedRadio
Yeah, I will do that in my future games. The thing is, i only became aware of this after I completed the game so it is going to be hard to go through all the images and resize them. If I manually set the size of each image I load, would that work the same? Instead of using D3DX_DEFAULT_NONPOW2 for the sizes I just fill in the sizes manually?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.