We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
how can i play alpha transparent video without P3D OR P2D render ?
any help will be good
Thanks.
mycode:
import processing.video.*;
Movie mov;
PImage img;
Capture cam;
void setup() {
size(640, 480);
frameRate(30);
mov = new Movie(this, "../../../files/movie/Final.mov");
mov.play();
cam = new Capture(this, 640, 480);
cam.start();
}
void draw() {
background(0);
image(cam, 0, 0);
image(mov, 0, 0);
}
void movieEvent(Movie m) {
m.read();
}
void captureEvent(Capture cam) {
cam.read();
}
Answers
@saurahb -- do you mean that you want to take an opaque video and make it partly transparent?
To fade a video frame, just like any image, use either use tint, or use PGraphics. This works with any renderer.
The easiest way is to use a tint command before your movie command. Change the alpha down by "fader" variable.
You can reset tint manually, or isolate your tint command with pushStyle / popStyle.