I’m working on a visualisation creation tool at the moment. It has multiple visual presets in it. When the user loads another preset, I’d like the two presets to ‘blend’ into eachother, or at least for the previous preset to fade out.
I’m working in processing, and they’ve got a saveFrame() function which saves an image of the current stage. I can then apply that to QUADs and fade it out. That works fine, but it’s quite slow.
I was hoping there was an opengl alternative that might be faster ?
Essentially what I’d like to be able to do is :
-Save/record a shot of the current screen layout.
-Display that saved record, and fade it out.
Any suggestions ?
With glCopyTexSubImage2D you can easily (and pure hardware accelerated) copy to a texture (should be created beforehand to be faster) then blend your quads. Usage of mutitexturing should be faster.
GL_READ_BUFFER : front
GL_READ_BUFFER : back
draw blend of tex1 & tex2
during fade, goto :fadeloop
I played with these some time ago, you may have a look at my messy code, if you dare :
But forgot about pbuffers, it is completely outdated by FBO :
The only constraints of glCopyTex* is that if you have some other windows obscuring part of gl viewport.
In that case, you need the FBO route (Framebuffer object) to render direcly to texture.