masking jit.gl.mesh with video - a question


    Nov 09 2012 | 6:22 pm
    Hello everybody,
    Taking inspiration from this topic: http://cycling74.com/forums/topic.php?id=36373
    and combining with the "SoundLump" jitter recipe, I obtained this patch, using jit.gl.mesh to visualize the lines generated with jit.catch and a "masking" texture captured from camera:
    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.
    Any ideas?

    • Nov 09 2012 | 9:42 pm
      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.
    • Nov 10 2012 | 12:16 pm
      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 jit.gl.pix. I think it's a little more efficient, now
      Thanks again