Scrolling Alpha Band on Image over 2nd Image
Hi!
I am trying to overlay two images, and to run a horizontal band vertically down the image, which pulls out the alpha, revealing the 2nd image below... I would love to do this in the most efficient way but have not spent a whole lot of time in jitter / open gl. I can make this effect quite easily in Resolume, running a 'horizontal line generator' that animates scrolling lines, fuzzing them a bit to get a transparent-white-transparent gradient band passing vertically, and then masking the below image with that, which reveals the 2nd image below that...
Any help achieving this in Max would be really appreciated. I've scoured the forums but haven't found much that has worked for me...
one of may ways to do this is use jit.gl.pix. You can perform alpha blending with pix using the mix operator. You can also draw the line in pix using a simple distance function (distance from some line center value) and control the line fade using smoothstep function.
Amazing! Thank you Rob. This works brilliantly. I also found where to change the direction from horizontal to vertical, in the 'swiz' object, within 'jit.gl.pix' :)
One nuance I am trying to solve for now is that the 'alpha bar' seems to jump from the end to the beginning- rather than disappearing off the canvas before starting again (also off-canvas). This is presumably due to calculating the canvas size and bar size based on the middle of the alpha, rather than its inner-most edge (including the fade). Any thoughts on where / how to add this math in, so that the bar starts entirely off canvas and ends off canvas, before repeating?
Secondly, any advice on if I am looking to have multiple 'bars' at passing once? Something like # of jit.time.saw at once, being offset equally across the canvas...
Update! I figured out to offset the 'center' with 'scale' that adds (and subtracts) half the 'width' to the of 'center' so that the bar completely leaves the screen and starts off screen, at the right distance.
Next I am figuring out how to have multiple of these alpha bands at once... any advice much appreciated!
you can add more lines by duplicating the single line logic in the pix patch for each extra line you want. you can then add these lines together prior to the mix operator.
Thank you! Now i'm figuring out how to reliably offset them in a way that still loops properly! Really appreciate the help. I'm well on my way :)