Edgblend help

Apr 19, 2010 at 10:16pm

Edgblend help

Hi. I’m trying to use a video-plane in such a way that it has the option to be transparent in some areas. I want to be able to overlay one plane on another and being able to do some opperations which leaves parts of the video-plane transparent. I’v manage to do this, but I also want to be able to edge blend the the video-plane, but this does not seem to work. The point is that i do not want to blend two videos in one plane, but the videoplane’s them selfs.
Point me in the right direction?

– Pasted Max Patch, click to expand. –
Apr 19, 2010 at 11:57pm

the problem is that the edgeblend shader creates it’s own alpha channel, overwriting any existing alpha channel.
a simple solution could be to multiply the alpha channels of both the alphaglue and edgeblend.

a better solution would be to modify the shaders to include the multiply in the actual shader code.

also, make sure you have @depth_enable 0 on any geometry that you want to have transparency blending (ie your videoplanes).

– Pasted Max Patch, click to expand. –
Apr 20, 2010 at 6:21am

Thank you. I’ll look into this. This was very helpful.

Apr 20, 2010 at 11:13am

I’v been looking at the tutorial for writing Shaders but I was wondering, do you mean that I shoud make a shader witch includes the edgeblend and the multilpy?

Apr 20, 2010 at 6:38pm

You can add the following line to the edgeblend shader to preserve your alpha channel:

wiped.a *= a.a;

This should go directly before the line that starts with gl_FragColor…

Altering existing shaders is a great way to get oriented with writing your own. Most of the ones included with Jitter are pretty simple.


Apr 21, 2010 at 7:44am

I have been looking at the different shaders and the tutorial “your very first shader”, I think this is really interesting .
Thanks for all the help. :)


You must be logged in to reply to this topic.