1

I have a few questions mostly about textures in OpenGL ES for my 2D Android game .

  1. What is the least number of texture units that I know I can use? The game will require Android 2.3.3 and up, so, I think Adreno 200 will be the oldest GPU to do this job. Supposing the newer ones have more texture units, the question translates into "how many texture units have Adreno 200?"

  2. How big textures can be? What is the "safe" size to use for my bitmaps in pixels? Of course, since OpenGL ES holds the textures in a compressed format, probably a 1000x1000 texture filled with, let's say, blue will be really tiny compared to a 1000x1000 picture of the ocean floor, but, on average, what size u consider "safe to use"? I know I could find out if I use too much memory when I will test my app but I don't want to do work in vain.

  3. Are textures/vbos/others stored in RAM? On PC dedicated graphic cards I know it doesn't, but as far as I know, phones (at least the low-end ones) use RAM to store the prime resource for the GPU. Am I wrong or not?

  4. Is it good or bad to use mip-mapping in a 2D game where the objects won't resize too much and/or too often?

3 Answers 3

2

From the spec:

  1. Page 154, Table 6.20, GL_MAX_TEXTURE_IMAGE_UNITS, minimum 8
  2. Page 152, Table 6.18, GL_MAX_TEXTURE_SIZE, minimum 64
  3. Could be. That's not constrained by the spec.
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! So, minimum 8 texture units, I guess that's pretty good. But what does 64 means at GL_MAX_TEXTURE_SIZE? And, in question #3, I ask about what happens in practice on low/old phones. Since the spec doesn't constrain it, I guess the textures are actually stored on RAM? :)
It means a conforming ES 2.0 implementation must support textures at least as large as 64x64. Most will support things in the 1024-2048 range. They could, there's no way to tell within the limits of the API.
1
  1. Adreno 200 has 4 texture units for vertex shader and 16 texture units for fragment shader. More details.

  2. The maximum texture size of Adreno 200 is 2048x2048.

  3. AFAIK, Adreno 200 uses shared memory architecture with main memory.

  4. Using mipmaps means you need x1.3 more memory to store the texture pixels.

Comments

0

For question 4: Mipmaps are used when scaling textures down, so most probably you don't have any use for them in regular 2D game. For other questions, I don't have any good answers.

2 Comments

Yes, but I will scale the textures down too, even if it is a 2D game. I will make them like 80% of the original, not less. Will the image look bad in this conditions if I don't use mipmaps, based on your experience? If it does look bad, does it worth to use mipmaps for something as little as that or the drawbacks are too big (like more memory required)?
Normally, as far as I know, mipmaps are used when bitmap is scaled down a lot. IIRC, default "first" level has bitmap with 50% size of the original, second one has 25% size, and so on. So, I think, that if you scale like 80% of the original, you don't need mipmaps. But yes, if you have large downscaling, you might want to generate mipmaps.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.