0

I'm creating an iPad application which uses Open GL ES 1.1 to draw a textured cube. I'm an Open GL newbie, so maybe this questions will be stupid, but:

  • what is the maximum/preferred size of cube faces on iPad? I'm using 1024x1024 size, and in simulator everything works fine, but on device in 80% cases I get memory warning and crash. But when it loads first time, I can change cube faces without problems.

  • does cube faces size have to be a multiply of 2 (256, 512, 1024 etc) - I'm asking because when I load for example 750x750 face, I have a strange rendering, and I don't know if I have to change somethong in code, or it's a limitation.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Bartek
  • 1,986
  • 1
  • 14
  • 21

1 Answers1

0

Ok, i figured everything out, and if someone is curious:

  1. memory warning and crashes was caused by strange behaviour which was described Here and it was solved exactly as suggested

  2. textures size has to be power of 2

So topic is closed.

Bartek
  • 1,986
  • 1
  • 14
  • 21
  • Actually, your second point is incorrect. The iPad supports non-power-of-two textures through the `GL_APPLE_texture_2D_limited_npot` extension. See my answer here for more: http://stackoverflow.com/questions/4760174/rendering-to-non-power-of-two-texture-on-iphone/4761453#4761453 – Brad Larson Jul 09 '11 at 00:37
  • @Brad It's slightly correct - if using a compressed texture, the texture size _must_ be a power of two. I don't know which he's using, but if he had issues loading a NPOT texture, that might be what that particular problem was. –  Jul 09 '11 at 00:43
  • @nil - Yes, that's why it's a limited NPOT extension (there are also restrictions on clamping, etc.). I just wanted to point out that the textures don't *have* to be powers of 2 on the iPad. – Brad Larson Jul 09 '11 at 00:46