Jump to content
  • Advertisement
Sign in to follow this  
homer_3

Image size limits?

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

I'm working on a game and it has a large background image (4000x2500). I got a warning in MSVS stating that some graphics cards can't support images that large. I don't intend to display the entire image at once, instead the camera will pan around to allow the user to view sections of the image at a time. Would said graphics cards still have a problem with this? I don't have any old hardware to try running my game on, so I can't really test this out for myself.

Share this post


Link to post
Share on other sites
Advertisement
If you were using OpenGL you could use:
int MaxTextureSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &MaxTextureSize);

And you will get the maximum height/width your texture can be on the current hardware.

Because you are using directx I imagine d3d has something similar, I am not sure but this could be the one you need:
http://msdn.microsof...s.90%29.aspx#Y0

Share this post


Link to post
Share on other sites
Depends on your D3D version. If 9 you can use GetDeviceCaps and query the values of MaxTextureWidth and MaxTextureHeight. If you want to be sure of always being able to create a square texture, just take the lowest of these two values. D3D10 and 11 on the other hand guarantee a minimum maximum (!!!) texture size, which I believe is 8192 in the case of 10 and 16384 in the case of 11. Some hardware may go above this, of course.

Share this post


Link to post
Share on other sites
You could also chunk the image into separate chunks and just render the chunks that are visible. It'll work on a lot of modern cards, but if you're targeting the average computer you could run into some problems creating a texture that size (the main problem lies in creating the texture, not necessarily just rendering it, though that itself can be a separate problem).

Share this post


Link to post
Share on other sites

I got a warning in MSVS stating that some graphics cards can't support images that large.

Visual Studio gave you a warning about texture size? What exactly are we talking about, C++ and DirectX or C# and XNA or ... ?


I don't intend to display the entire image at once, instead the camera will pan around to allow the user to view sections of the image at a time. Would said graphics cards still have a problem with this?


This won't be of any importance. The device still must load and store the whole texture and the texture will be probably applied to some quad - whether you display only part of the quad doesn't matter at all.
As others said, you could split the texture to be sure it will be ok, for example instead of one quad with 4000x2500 texture you could have four quads each with 2000x1250.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!