Results 1 to 2 of 2

Thread: Performance issue in GLES20.glreadpixels in android?

  1. #1
    Newbie Newbie
    Join Date
    Sep 2014
    Posts
    1

    Performance issue in GLES20.glreadpixels in android?

    Is there any way to improve the performance of glreadpixels in android? Is there any other way to read the display data to convert to image in openGL?

    Thank you.

  2. #2
    Newbie OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,789
    If you want to convert the screen image to a texture, then glCopyTexImage and glCopyTexSubImage are the preferred ways. The copy will be carried out by the GPU and shouldn't involve any round-tripping, read-backs or synchronization.

    If you just want to read back the screen pixels in order to do some software operation on them, then there is no fast way. The best you can get is glReadPixels with parameters carefully chosen to match the display mode (being careul to not fall into the trap of using e.g GL_RGB because you think it will save memory - all that it will do is cause an even slower format conversion in the driver), but either way you're going to get a huge pipeline stall.

    The exception to this is if you don't need the data immediately following the read-back. In desktop GL you can do an asynchronous readback to a pixel buffer object (PBO) but this facility doesn't seem to be available in ES.

Similar Threads

  1. Issue building program on Android
    By achauhan in forum OpenCL
    Replies: 0
    Last Post: 02-22-2017, 03:36 AM
  2. Android 5.1.1 Nexus 5 OpenGL issue?
    By RobMGold in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 06-26-2015, 01:19 PM
  3. Issue with OPENGL ES rendering for Android and iOS
    By hoanglinh in forum OpenGL ES
    Replies: 0
    Last Post: 06-11-2015, 11:08 PM
  4. glReadPixels on Android
    By gadget in forum OpenGL ES
    Replies: 3
    Last Post: 12-23-2012, 05:57 PM
  5. glReadPixels just returns 0s in Android.
    By as32b in forum OpenGL ES
    Replies: 0
    Last Post: 07-19-2010, 12:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean