jit.gl.gridshape mask?

Artem Malyshev's icon

Hello!
Trying and failing to implement a sort of a "lens" effect for a gridshape slider moving across a waveform so that the waveform colors are inversed when under the slider. Is it possible without writing a custom shader / material? And if not would appreciate any pointers in the right direction.

Max Patch
Copy patch and select New From Clipboard in Max.

Matteo Marson's icon

Hi!
You're on the right track:

Max Patch
Copy patch and select New From Clipboard in Max.

Here’s what I changed to make it behave as intended:

  • Enabled blending on both jit.gl.mesh and jit.gl.gridshape

  • Disabled depth testing with @depth_enable 0, and handled the draw order manually using the @layer attribute

  • Updated jit.expr to generate signed normalized coordinates, snorm[0], so there’s no need to modify the position attribute in jit.gl.mesh

  • Set jit.world @ortho 2 to remove perspective and keep the slider coordinates within the [-1, +1] range

Artem Malyshev's icon

This is great, way more simple than I expected it to be. Thanks, Matteo!