Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative for glBlitFrameBuffer() in OpenGL ES 2.0

My Android program must use glBlitFrameBuffer() function to copy FrameBuffer object. But glBlitFrameBuffer() function is only supported on OpenGL ES 3.0+ devices. I want to support OpenGL ES 2.0+ devices.

Is there any solution/alternative for this function?

like image 820
nguoitotkhomaisao Avatar asked Aug 22 '14 03:08

nguoitotkhomaisao


1 Answers

  1. Bind texture that used as collor attachment on source frame buffer
  2. Bind destination framebuffer
  3. Draw full screen quad (if you need stretch or offseted reading manipulate with vertex/tex coordinates)
  4. Fetch data from bound texture in frament shader and put it to gl_FragColor
like image 71
ivaigult Avatar answered Feb 01 '23 19:02

ivaigult