PDA

View Full Version : transition effects using opengl es 2



guihazan
09-26-2012, 01:52 PM
Hi,

I'm targetting Android and iOS OpenGL ES 2.

How can i create a transition effect using double-buffering? I would like to change from a screen to another one using something like stripes.

Maybe i could get the current backbuffer using glGetPixels and save it in 1. Then, i would draw the new screen in the backbuffer and save it in 2. Then i would recover the saved buffer 1, then draw the saved buffer 2 using the stripes... would this work? Or maybe using eglCopyBuffers?

Any help is greatly appreciated.

thank

guich

V-man
09-27-2012, 04:30 AM
Render to a texture and then you can do whatever you want with it. Apply the texture to strips or whatever.

guihazan
09-27-2012, 07:39 AM
How can i render directly to a texture instead of rendering to the buffer? I'm using EGL.

thanks!

guich

thecodinguniverse
09-27-2012, 08:13 AM
Have you tried using a Framebuffer Object (http://www.songho.ca/opengl/gl_fbo.html)? The link uses an ARB extension, but since the framebuffer methods were promoted to the core spec in ES 2, you'll be able to use them normally.