jit.gl.cornerpin and alpha blending with background
Hi everyone,
I have been searching the forum for a few days and found no solution so far:
Is there a way (and how) to create alpha blending between [jit.gl.cornerpin] and a background image?
I'm working on a dance show and the idea is to light up the stage using a video projection controlled with max.
Basically: an image serves as a background and different images are mapped to different parts of the stage on top of it.
Obviously, we need to be able to alpha blend those mapped images with the background.
To do so (and make the setup more intuitive for the artist) I use [jit.gl.cornerpin] to map the different images on the stage.
But I can't figure out the blending part with the background.
I attached a patch in which I had found a trick to blend the control the background luminosity and do the blending. It worked just fine until the idea of using an image as a background came up... Nevertheless, it gives the overall idea of what I'm looking for.
If no solution exist, what would be the best way to approach this issue of blending a background image with mapped ones? (cornerpin has the advantage of being easy to manipulate when doing the mapping)
Thanks a lot for your help!!!
Alex
This is all in OPEN GL, take the time to look at it.
Hope it helps.
Hi Andro, thanks for your help!
I'm pretty new to jitter and openGl in general.
What I try to do is a bit different from your patch where you blend an image and a background and output it through [cornerpin]:
I would like to blend the output of the [cornerpin] with with the background (which would be the size of the screen).
So far, I'm still stuck ;)
But maybe the solution would be to create 2D textured shapes that will serve for the mapping and blend them with the background the way you do.
The downside is that the manipulation/positioning of the shapes won't be as easy and intuitive as what [cornerpin] allow.
Not behind the computer now but its pretty simple.
The two videoplanes both go to jit.gl.node.
This then gos to cornerpin
Just send one to cornerpin and the other to jit.window.
Eg.
Background jit.gl.videoplane window-context @layer 0
Jit.gl.videoplane node-a @ layer 1
Oh thanks, I really feel like a noob... I tried such things before but knowing your way around the different attributes does help ;)
Nearly there, I'll do some more tinkering with it later today.
Only thing though is that :
1/ Background jit.gl.videoplane window-context @layer 0
Jit.gl.videoplane node-a @ layer 1
=> no blending
1/ Background jit.gl.videoplane window-context @layer 1
Jit.gl.videoplane node-a @ layer 0
=> Background can blend on top of the cornerpin
It seems cornerpin has a hard time blending with previous layers.
But that might only be a question of parameters.
I'll tell you what comes out of it once I take time to play with that.
make sure you set @depth_enable 0 on your videoplanes
Hi everyone,
Thanks a lot for your help, It works great!
Actually I spent some time banging my head on the walls because o a simple mistake.
But everything is finally up and running.
Thanks again!