i am using GLES 3 to create 3D textures and render data in surface view. Is it possible to read this data from the screen/texture some how.
Asked
Active
Viewed 1,477 times
1 Answers
1
You can read what you've rendered with glReadPixels()
, but that tends to be slow.
Depending on what you're trying to do, you may get better results by rendering to an FBO.
You can find some example code in Grafika; see for example EglSurfaceBase#saveFrame().
-
But the saveFrame() method calls glReadPixels() ... GLES20.glReadPixels(0, 0, width, height, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buf); ... is that just an empty call ? – jesses.co.tt Nov 17 '14 at 22:45
-
`saveFrame()` is an example of using glReadPixels() to read the pixel data. If you're asking about FBO rendering, you can find an example of FBO use in the "record GL app" activity (https://github.com/google/grafika/blob/master/src/com/android/grafika/RecordFBOActivity.java). – fadden Nov 17 '14 at 22:55
-
Yes, Im familiar with the activity, and am in the midst of writing a question about implementing it right now - was hoping to tag you so you could weigh in on it if you have a chance... – jesses.co.tt Nov 17 '14 at 22:59
-
tried to tag you in my new question, but was unable to. would love if you could take a look at http://stackoverflow.com/questions/26984073/adapting-grafika-recordfboactivity-to-work-with-android-gpuimage – jesses.co.tt Nov 17 '14 at 23:44