masking with video – a question

Nov 9, 2012 at 6:22pm

masking with video – a question

Hello everybody,
Taking inspiration from this topic:
and combining with the “SoundLump” jitter recipe, I obtained this patch, using to visualize the lines generated with jit.catch and a “masking” texture captured from camera:

– Pasted Max Patch, click to expand. –

the only issues regards lines color, which in the “non-masked” version of the patch are white, while in the above patch they appear black.
Am I missing something? Maybe inverting planes?

Here is the SoundLines patch without masking.

– Pasted Max Patch, click to expand. –

Any ideas?

Nov 9, 2012 at 9:42pm

i don’t think you’ve quite set this up correctly.
i’ve modified your patch to capture the gl.mesh to a texture using gl.node.
this texture is sent to the left input of the alphaglue slab, and the video “mask” is sent to the right input.

this creates a texture with an alpha channel based on the luminance of the mask.
to actually see the mask effect, you need to enable @blend_enable and disable @depth_enable on the videoplane that is displaying the texture.

you can now change the background color with the gl.render @erase_color, and the line color with gl.mesh @color.

hope this helps.

– Pasted Max Patch, click to expand. –
Nov 10, 2012 at 12:16pm

Thank you Robert, now it works just like I wanted.

By the way, I added a little “roundness” to the lines modifying the expression in jit.vexpr and sent all the video elaborations in gl using jit.slab and I think it’s a little more efficient, now

– Pasted Max Patch, click to expand. –

Thanks again


You must be logged in to reply to this topic.