manipulate RGB, keep Alpha: jit.gl.gridshape, jit.gl.mesh, jit.gl.multiple, jit.gen

Konstantin's icon

Hi! I would like to multiply a square (dim 8 8) with different transparency values for each of the 64 segments and then change the RGB values of each entire square clone, but keep the Alpha value for the particular segments the same as defined in jit.gl.mesh. Is there a way to do it? In this example the squares should be red, green, blue and yellow, but the transprency of the square's segments should be different. Thanks!

squares_test.maxpat
text/plain 62.58 KB

Rob Ramirez's icon

there's a way to do it, but it's pretty tricky! you have to do it with texturing. enable @tex_map 1 on your target object, and then calculate the appropriate tex_plane_s/t values for each gl.multiple instance so that it gets a solid color from the texture. this can multiplied with the alpha value of the target object's color.

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

Konstantin's icon

That's simply amazing! Thank you so much!

videomaker's icon

hi rob,
interesting patch !
is there a hint to get it working with gl3 ?
best,
vm