Sign in to follow this  

loading textures of size other than 2^x

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

This topic is 4811 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this