Forums > Jitter

Alpha compositing with OpenGL

June 14, 2006 | 11:26 pm

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


June 15, 2006 | 12:16 am

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.


Viewing 2 posts - 1 through 2 (of 2 total)