Alpha compositing with OpenGL

Laurent Ostiz's icon

Hi

I have a patch reading movies without alpha channel and sending them to a series of jit.gl.slab objects (kind of mixing). At the end of this process, I would like to be able to fade in and fade out a predefined png image with alpha channel (kind of a mask) over the resulting movies, then sending the result (masked movies) to again some jit.gl.slab objects. I cannot find what to use to compose my alpha-enabled image over my mixed movies. Is there someone who could give me some clue ?

[Movie] -+- [Movie 2]
|
jit.gl.slab
|
+--- [fade in/fade out an alpha mask]
|
jit.gl.slab
|
.....

Thanks

Laurent

Andrew Benson's icon

Hi Laurent,
You may need to write a simple shader that does alphablending (if we
don't already have one included). the function would look something like:

gl_FragColor = mix(source1,source2,source1.a);

FWIW, the next version of Jitter will include some more shaders for
doing this sort of thing.

cheers,
Andrew B.