Jump to content
  • Advertisement
Sign in to follow this  
Caesar

loading textures of size other than 2^x

This topic is 5091 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

Hello, I'd like to load a texture that is of size 800x600 (I don't mind it being enlarged - but not resized when loading). The problem is that the space it would eat on disk is too high (I'd like to load jpg files, photos (RLE in BMP wouldn't be much use I suppose). Any hints? (D3DXCreateTextureFromFileEx with appropriate dimensions only makes the func resize the image) thanks

Share this post


Link to post
Share on other sites
Advertisement
Caesar, you clearly know more than me already but I thought I may as well drop this out there. Isn't it supposed to be a bad idea to use textures larger than 512x512?

Share this post


Link to post
Share on other sites
Use the D3DXCreateTextureFromFileEx with a filter of D3DX_FILTER_NONE. The images will end up as 1024x1024 but only the topleft 800x600 will contain image data. As long as you don't intend to use wrapping UVs, you're all set. To use, either set the UVs which would normally be 1.0 to to 800/1024.0, and 600/1024.0

Share this post


Link to post
Share on other sites
Keith: why do you think so (I'm going to use it as a sprite/background, not a texture indeed). If you still think it's a bad idea, why do you think so?

Namethatnobodyelsetook: thanks a lot, thaht's exactly it :)

Share this post


Link to post
Share on other sites
Caesar,

As I said you most-likely know more than me on this subject. I just ran dxcap and checked

DirectX Graphics Adapters
->MyCard
--->D3D Device Types
----->HAL
-------->Caps

And on this machine, MaxTextureHeight and MaxTextureWidth is only 256! I've heard that you want to try to keep your textures under 512x512 so that you can be sure to support older cards. But it seems, this card wouldnt even support that. Granted its an old graphics card but..

(Referecne supports upto 4096x4096)
Keith

Share this post


Link to post
Share on other sites
nVidia seems to support up to 4096, while ATI supports up to 2048 (newer ATI or nVidia might be even more). I think the RagePro (1998) supported 1024x1024, though I remember having some issues when trying to actually use that, and we used 512x512. It really depends on what your minimum spec machine is.

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!