2

im trying to make a book page curl effect.

What I have done is using Canvas and drawBitmapMesh. Works, but I have to hold onto strong references of multiple fullscreen size Bitmaps and possible OutOfMemoryExceptions bother me.

Would I benefit from OpenGL memory wise? (I have no experience with it). If Bitmap would be uploaded as texture to gl, does it still take up space in regular heap memory or do gl textures live somewhere else?

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
urSus
  • 12,492
  • 12
  • 69
  • 89
  • I don't think OpenGL is memory wise by itself, probably you would still need to take care of how much you're loading in memory. If you're working with textures you could use a specific compression for them, take a look at this answer: https://stackoverflow.com/a/9142449/2007154 – Perazzo Aug 06 '17 at 04:46
  • Here is another answer about texture size limitation on Android: https://stackoverflow.com/a/8573543/2007154 – Perazzo Aug 06 '17 at 04:53
  • Okay, so its not in java heap but native heap which doesnt have out of memory exceptions however opengl imposes texture limits on it self so I would get "different kind of OOM"? – urSus Aug 06 '17 at 05:03
  • I think it depends on the moment you ran out of memory. If you're decompressing a huge file or resource into a Bitmap object before binding it to texture, you will get a normal OOM. But if the device's memory gets depleted during an operation on OpenGL ES you would get another type crash, like this case here: https://stackoverflow.com/questions/9142099/android-opengl-possibly-running-out-of-memory. – Perazzo Aug 07 '17 at 19:32
  • Hey take a look at this question, it seems to summarize what we're discussing here: https://stackoverflow.com/questions/9475850/are-opengl-textures-more-memory-efficient-than-android-bitmaps?rq=1 – Perazzo Aug 07 '17 at 21:07

0 Answers0