Reputation: 7686
I have an OpenGL ES game application which uses a single PNG sprite with 27 frames on it horizontaly, to represent an animated monster. So, my PNG currently is 27 * 96 px width and 96 px height.
I recently added new animations to it, so it became 57 frames, now it is 57 * 96 which is a little more than 5000 px wide. Now my textures are simply displayed as white squares!?
I've tested it with different images, sizes (in KB) and resolutions, and I've found that any texture wider than 4000 px gets this white square, no matter the file size.
Is it a memory problem?
Do you have any ideas on fixing it?
I am testing on HTC Desire which I believe operates with Adreno 200 GPU.
Upvotes: 2
Views: 502
Reputation: 3616
OpenGL implementations have a maximum texture width and height, whether it be desktop or mobile. What you should do is when the animation texture gets too wide, simply start a new line. I.f you use glEnvironment with GL_MAX_TEXTURE_SIZE, you can find out the maximum texture size for your device: opengl.org/wiki/Textures_-_more.
Note that it is dependent on the hardware, and so it may be 4096 for your HTC (which is staggeringly large, actually), but is certainly smaller for most other phones - especially older ones.
Upvotes: 3