Photoshop-style composite blending between multiple videoplanes

Aug 12, 2011 at 8:49pm

Photoshop-style composite blending between multiple videoplanes

Hi,

I’m looking for a way to get all the Photoshop-style blend modes between multiple videoplanes. To be clear, I know how to use a slab to blend two sources onto a single videoplane via co.%s.jxs… but I want to use similar blend effects between images that are being rendered to different videoplanes.

I’ve read tons of posts that talk about using the blend_mode attribute of videoplanes (with @blend_enable 1 and @depth_enable 0). Experimentation seems to yield a few Photoshop-like modes, but so far I haven’t been able to get close to the full complement. Slab compositing doesn’t seem to be a solution since it appears to work only with multiple inputs and rendering to a single vidplane. I get some additional blends by putting jit.op or jit.gl.slab with op.%s.jxs between the matrix/movie sources and their respective videoplanes, but the possible combos of all the ops and videoplane blend_modes yields a daunting number of possibilities… and I’m still not convinced I’m on the right path to finding all the blends. In a perfect world, I’d also like to use alpha channels in this same blend/compositing process.

Any help is greatly appreciated!

Thanks,

Jeff

#58451
Aug 15, 2011 at 11:50pm

Tap, tap… is this thing on? ;)

#210059
Aug 16, 2011 at 6:42pm

you seem to be on the right path.
there is a limit to the number of photoshop style blend modes you will be able to achieve with fixed function.
here’s a start:
add:
blend_mode[0] = 1;
blend_mode[1] = 1;

multiply:
blend_mode[0] = 2;
blend_mode[1] = 0;

screen:
blend_mode[0] = 4;
blend_mode[1] = 1;

exclusion:
blend_mode[0] = 4;
blend_mode[1] = 5;

colorblend:
blend_mode[0] = 3;
blend_mode[1] = 4;

alphablend:
blend_mode[0] = 6;
blend_mode[1] = 7;

coloradd:
blend_mode[0] = 3;
blend_mode[1] = 1;

alphaadd:
blend_mode[0] = 6;
blend_mode[1] = 1;

beyond that, you must get in to shaders.
this link should help

http://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/

#210060
Aug 20, 2011 at 12:22am

Thanks so much, Robert!

I’ve not delved into creating my own shaders yet… perhaps this is the impetus. Quick question before I jump in off the high dive: The reason I’m not using the existing shaders like co.difference.jxs is that this family of shaders appears to require two inputs. I’m envisioning that I need shaders that use only one source/input on a slab for a single texture/videoplane… and that construct per videoplane will allow discrete control over layer blends a la Photoshop layer blends, right? Or am I missing a fundamental concept? ;)

I’d be eternally grateful if anybody wants to provide input/models/examples on how to turn the photoshop-math-with-glsl-shaders code into jitter-ready shaders.

Peace,

Jeff

#210061

You must be logged in to reply to this topic.