PDA

View Full Version : Maximum Image Size (When using Andorra 2D, ... or any other, might be gpu limitation)



robert83
30-07-2011, 08:27 PM
Dear Forum,

I've created a nice little demo app with andorra 2d (just for fun...and to start learning) all was fine, on my computer GTX 285 it runs fine , I have some images PNG large as 620x6200 ( I have in this large PNG a lot of small images, it's a moving Moon,this is why it's so large). The same application even if I only try to load the resource file causes an access violation in AndorraDX93D.dll. Now I was trying to see if it's a limitation of the IGP on the Laptop Intel 945 , and tryied out various image sizes ... and it seems like 2048x2048 is the limit. Is there a way to bypass this ?

Greetings
Robert

robert83
31-07-2011, 08:03 PM
Meanwhile I was told that it must be the power of two

32,64,128,256,512,1024,2048

Max Image size for Integrated GPU's , tested on two laptops is 2048x2048

Greetings
Rob

chronozphere
31-07-2011, 08:14 PM
I guess these limitations are imposed by the hardware and memory management done by the driver. The only way to get around this, is to either upgrade your video hardware or to chop the picture into multiple parts.

There are some good programs that allow you to view the Direct3D/OpenGL capabilities. I believe some of them also show you these maximum texture size numbers.

User137
01-08-2011, 08:47 PM
I think the real solution is to find another way for the problem. 2048 is definitely a good maximum.

Daikrys
01-08-2011, 09:25 PM
yeah i mean why should you use a texture bigger then 1024?
youre 620x6200 example sounds like a map, such big images should be chopped
its not only about the graphiccards maximum texture size its also useful for the GPU to reduce oversized textures to be rendered permanently

robert83
02-08-2011, 10:47 AM
OK, so after reading a few docs and some older system specs... I think I'll stick to
16x16,32x32,64x64,128x128 Images for Sprites.

My only other problem is (I'm confused) . If my game resolution is 640x480 ... and for now I've created a background image for the menu that is also 640x480 (but according to the Andorra 2d faq it's not efficient since it must be the power of two so it will be upscaled to ... 1024x512 ... and that is a lot of waste) ... how do the pros do this ? when they wanna fill the screen ? with a static hand drawn background... should I chop this image into
256x512
256x512
128x512

Even so I'm wasting the bottom 512-480= 640x32 )

Or should I use a 512x512 resolution for my game...and strech it to 640x480 ... but that would look really bad no?

I need a bit of help about this :)

Thank you

Rob

Daikrys
02-08-2011, 11:29 AM
making a texture bigger then the screen solution is okay cause scaling down provide still a good quality
and if you have not much of this big images it would also render nice on youre laptop


Or should I use a 512x512 resolution for my game...and strech it to 640x480 ... but that would look really bad no?
yeah never do this, stick to normal screen solutions, its also helpful if you use fullscreen

robert83
02-08-2011, 12:42 PM
Oh sorry , I do use full screen, right now 640x480 is enough for my pixel needs...

so you are telling me if I'm planing to use like 20-30 hand drawn background images... I can go with 640x480 resolution for the PNG file as well ? (and need not overcomplicate it by choping etc...)

Rob

User137
02-08-2011, 03:36 PM
512x512 texture scaled up to 640x480 screen will look just fine, possibly with bi-linear filtering. Just remember that the big image is just the background. Draw your menu buttons, frames, fonts and all the sharp stuff on top of it.

Make sure you do the downscaling properly with good image software. Something like free Gimp can do it well. Have the real 640x480 background saved separately and scale it for texture image down to 512x512.

Also what you need to do is not having all 30 background pictures loaded to your program same time. Have 1-3 texture slots for backgrounds and load them from the disk (not per-frame but when screens change).

robert83
02-08-2011, 04:37 PM
Thank you everyone,

Sorry that some of them questions might seem dumb for you, but I'm just starting and trying to make it right :) ... you are right, I will not need to load all them images for background at once... and meanwhile I've also realized something, some of my animations...need not be (well I think none of them) in 16bit , probably will seem stupid :) but I just realized my Moon animation, only needs 4bit instead of 16bit, I did not know that 4 bit can hold any kind of four colors (for example 4 shades of yellow) ...

Thank you again!!!

Rob

User137
02-08-2011, 09:21 PM
I know nothing about Andorra... but images on disk can be compressed as small as you can. When loaded to graphics card memory they are converted to 24 or 32bit. That depends if you use alpha channel or not, meaning each of R,G,B,A will take 8 bits in order to be byte-aligned. So it's usually quite safe to use full color textures nowadays, unless you go for advanced optimizing things. Just know that even if the image is just 4 bit in drawing software, it may be much larger when loaded in game.