Jump to content

  • Log In with Google      Sign In   
  • Create Account

Non power of two texture in DirectX


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 viper110110   Members   -  Reputation: 705

Like
1Likes
Like

Posted 06 November 2012 - 07:39 PM

I am trying to load textures in the same way as the rastertek tutorials do it, but when I get to the font tutorial, the texture for the font won't load. After some thorough detective work, I determined that it was because one of the texture dimensions was not a power of two. How can I get directx to load any texture regardless of size?

Edit: Just figured out that he uses a power of two texture for the font and posted a different texture on his website (with a bad size). Regardless, I would still like to know how to handle non-power-of-two textures

Edited by viper110110, 06 November 2012 - 07:41 PM.


Sponsor:

#2 Hodgman   Moderators   -  Reputation: 32008

Like
0Likes
Like

Posted 06 November 2012 - 08:30 PM

Which version of Direct3D are you using?

#3 viper110110   Members   -  Reputation: 705

Like
0Likes
Like

Posted 06 November 2012 - 08:36 PM

Direct3D 10 but with D3D11 installed on windows 8 and the new windows sdk

Edited by viper110110, 06 November 2012 - 08:38 PM.


#4 Hodgman   Moderators   -  Reputation: 32008

Like
2Likes
Like

Posted 06 November 2012 - 09:32 PM

In D3D9 you have to check the 'CAPS' to see if the GPU supports non-power-of-2 (NPOT) textures or not... but D3D10 instead mandates that all D3D10 GPUs must support NPOT textures, so you shouldn't have to tread POT/NPOT textures differently at all.

What kind of errors are you getting with your NPOT texture?

#5 viper110110   Members   -  Reputation: 705

Like
0Likes
Like

Posted 08 November 2012 - 06:27 PM

E_INVALIDARG is the return value of CreateDDSTextureFromFile

I tested this by changing one of my regular textures to 307x256

EDIT: upon further digging, I have found that the function call to CreateD3DResources in DDSTextureLoader.cpp is returning this value

Edited by viper110110, 08 November 2012 - 06:30 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS