Scenes through OpenGL

I would like to render two scenes in OpenGL and then do a visual crossfade from one scene to the second. Can anyone suggest a starting point for learning how to do this?

+2


source to share


3 answers


The most interesting thing you need to learn is to render a texture.



When you have two scenes of 2 textures, it's really just cross between them. Actually its quite simple to make all the estate of interesting fade effects :)

+9


source


Here's an example of crossfading code . This seems a bit different from what Goz has since the two scenes are dynamic. The example uses a crossfade stencil buffer.



+1


source


I could think of another way of crossing scenes, but it depends on how complex your scene rendering is. If it's easy, you can run the shader program before rendering the second scene, which does the blending effect you want. I would try glBlend (GL_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and manipulate the alpha values ​​of the fragments in the shader.

The TSF is by the way. available for many years - extension or not. If your renderer is complex and uses shader programs, you can render both scenes for FBOs in the same way and mix them. Using FBOs is a very common technique, making it easy to apply all kinds of rendering effects.

0


source







All Articles