How do i enable the alpha chanel with JMCMovieGL for partly transparent video display ?
in
Contributed Library Questions
•
2 years ago
hey there,
i'm trying to use the JMCMovie library to create an alpha enabled video.
in order to have a "cutout" person walking on a plane.
i prepared the video by keying the background, leaving just the person, with a valid alpha chanel in AE.
so i have an .mov in animation codec with enabled alpha, double checked.
now i am trying to display this clip, like discussed here:
http://processing.org/discourse/yabb2/YaBB.pl?num=1276082717
in order to activate the alpha chanel, for just displaying the walking person.
but somehow it seems it is not truly blending just the alpha chanel, instead the whole image get's blended with the object (here a plane but also tested with two videos). I tryed a bunch of blending routines, but eithers the supposed alpha chanel is displyed solid black, or as mentioned the whole image is blended, multiplied with other objects.
should i go in the gl core and bind the image as a texture, with enabled alphablending by hand, like u would to with a normal texture? or is the problem mixing PApplet and OpenGL..
has anyone experience with that?
here's my code so far:
public void setup(){
size(640, 480, OPENGL);
myMovie = new JMCMovieGL(this,"slowwalk_clip.mov",PImage.ARGB);
myMovie.loop();
}
public void draw(){
PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;
background(0);
fill(0,0,60);
stroke(255);
beginShape(QUADS);
vertex(0,height,-500);
vertex(width,height,-500);
vertex(width,height,500);
vertex(0,height,500);
endShape();
GL gl = pgl.beginGL();
{
gl.glEnable (gl.GL_BLEND);
gl.glBlendFunc (gl.GL_ONE, gl.GL_ONE);
myMovie.image(gl, 0, 0, myMovie.width, myMovie.height);
}
pgl.endGL();
gl.glDisable(gl.GL_BLEND);
}
i'm trying to use the JMCMovie library to create an alpha enabled video.
in order to have a "cutout" person walking on a plane.
i prepared the video by keying the background, leaving just the person, with a valid alpha chanel in AE.
so i have an .mov in animation codec with enabled alpha, double checked.
now i am trying to display this clip, like discussed here:
http://processing.org/discourse/yabb2/YaBB.pl?num=1276082717
in order to activate the alpha chanel, for just displaying the walking person.
but somehow it seems it is not truly blending just the alpha chanel, instead the whole image get's blended with the object (here a plane but also tested with two videos). I tryed a bunch of blending routines, but eithers the supposed alpha chanel is displyed solid black, or as mentioned the whole image is blended, multiplied with other objects.
should i go in the gl core and bind the image as a texture, with enabled alphablending by hand, like u would to with a normal texture? or is the problem mixing PApplet and OpenGL..
has anyone experience with that?
here's my code so far:
public void setup(){
size(640, 480, OPENGL);
myMovie = new JMCMovieGL(this,"slowwalk_clip.mov",PImage.ARGB);
myMovie.loop();
}
public void draw(){
PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;
background(0);
fill(0,0,60);
stroke(255);
beginShape(QUADS);
vertex(0,height,-500);
vertex(width,height,-500);
vertex(width,height,500);
vertex(0,height,500);
endShape();
GL gl = pgl.beginGL();
{
gl.glEnable (gl.GL_BLEND);
gl.glBlendFunc (gl.GL_ONE, gl.GL_ONE);
myMovie.image(gl, 0, 0, myMovie.width, myMovie.height);
}
pgl.endGL();
gl.glDisable(gl.GL_BLEND);
}
1