8

I am creating a sprite engine that uses the concept of "graphics banks" to speed up rendering using batches. I was wondering if anyone knows if 1024x1024 textures are widely supported enough these days to "count on", and/or if there is a way to find out how far back there has been support for 1024x0124 in terms of graphics chipsets / cards, like a chart or something, and from that decide based on estimated compatibility % if I should go with 1024x1024 or limit banks to 512x512 (which I have a feeling is more widely supported, if you count integrated accelerators)

afuzzyllama
  • 6,538
  • 5
  • 47
  • 64
Roger Levy
  • 105
  • 1
  • 1
  • 9
  • You could support both. Check for `GL_MAX_TEXTURE_SIZE` and scale the textures down programatically before uploading them. Dividing the resolution by half is very easy if you use power-of-two widths and heights, the new pixel in the smaller image is the average of four pixels in your original image. – Marius Oct 24 '13 at 18:59
  • Yes, I thought about this. Scaling down has two big counts against it; 1) My sprite engine will use 4-bit paletted graphics, with 4 palettes pre-calculated within each bank (each quadrant uses a different palette, to avoid having to rely on pixel shader support) so the pixelated style will be ruined by the filtering; 2) this may not be worth the cost in code complexity and maintenance; i'd rather keep it simple and depend on the smaller size (or let the driver do any downscaling) - or outright refuse to run if the max texture size isn't supported. don't want to waste my life writing glue... – Roger Levy Oct 24 '13 at 19:21
  • Yes, 1024 is a common desktop size. OpenGL 3.0 implementations are _required_ to support this resolution at the minimum. A huge leap from OpenGL 2.0, which only required 64x64 texel textures :) Most desktop GPUs support 4096-16384, and with sparse textures in 4.x, the maximum supported texture dimensions will be almost meaningless. – Andon M. Coleman Oct 25 '13 at 03:41
  • Thanks for the reply. I wouldn't say maximum texture size will be almost, or even nearly meaningless. I just read up on it and sparse textures will be blurry when there's a cache miss – Roger Levy Oct 25 '13 at 13:49
  • What I meant by that was that the addressable texel range will be so large that you will not have to worry. Sparse textures aren't about cache efficiency, they are about defining behavior when part of a texture that's not been loaded yet are loaded for the first time. Think of the situation like a page fault in traditional virtual memory, latency has to be introduced to service the fault, but you can have an application that uses resources far greater than could ever fit into memory all at once. T – Andon M. Coleman Oct 26 '13 at 00:48

1 Answers1

14

According to this SO answer "what is the max size of the texture iphone can support?" the iPhone 3g can support 1024x1024 texture sizes. That phone was released in 2008, which leads me to believe that most desktop would be able to support the same 5 years ago.

The GL_MAX_TEXTURE_SIZE is defined by the implementation. Wild Fire Games has also been kind enough to offer their OpenGL capabilities report which has max texture sizes from their data set. As of writing this, only 18 out of 33085 (0.05%) users have reported to not have the ability to render a GL_MAX_TEXTURE_SIZE 1024 or more.

Community
  • 1
  • 1
afuzzyllama
  • 6,538
  • 5
  • 47
  • 64
  • Thank you for the link to the study; also, that title is better. I'm skeptical about the study; "wildfiregames" makes me think that their sample is largely made up of "hardcore" gamers. – Roger Levy Oct 24 '13 at 18:19
  • @RogerLevy - Looking at the vendors list, the only ones who have less than 1024 are powered by the open source MESA library. I don't think you are going to find many systems that use such a configuration. It seems most integrated GPUs can handle 1024. – afuzzyllama Oct 24 '13 at 18:44
  • ok. thank you, that helped convince me. it will really be great if i can make the banks larger and run on 99% of my potential audience's machines; the penalty for switching textures is lousy. – Roger Levy Oct 24 '13 at 19:23