Well, first of all: I'm not an expert on OpenGL ES 2.0. I was in the same situation when I wanted to do a multi-pass rendering setup in one of my first OpenGL ES applications.
I also used an orange book. Check out Chapter 12. Framebuffer Objects> Examples. The first example demonstrates how to use the framebuffer to render a texture, and then draws that texture for display.
Basically, using this example, I created an application that renders some texture geometry using the shader effect, then displays this texture for display, overlays other content using a different shader.
I am not sure if this is the best approach, but it works for my purposes. My setup:
- I create two framebuffers, the default and off-screen. Same thing for rendering buffers
- I create a texture that the application will display for
- I bind an external framebuffer and attach a texture to it using glFramebufferTexture2D
My rendering:
- binds an external framebuffer.
- use my first shader program
- draw my geometry
- binds default framebuffer
- use my second shader program
- draw a full-screen quad-core processor with a texture attached to it.
Joris kluivers
source share