gl.multiple color matrix problem with gl.sketch

carsol's icon

hi...

im trying to change colors using the color matrix glparam of a gl.multiple that have associated a gl.sketch and theres no way to do it... but this works fine if i change to a gl.gridshape object...

theres any special consideration i should have to do it with a sketch object?

thank you very much!
best!

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

Joshua Kit Clayton's icon

This isn't possible, since jit.gl.sketch works differently than a single object. I would use Javascript, or poly, or jit.gl.sketch itself for rendering multiple instances of another jit.gl.sketch.

larme's icon

Sorry to bump this. Is there anyway to use roundedplane in gl.multiple? Because seems only gl.sketch has the roundedplane command.

Rob Ramirez's icon

you can can use gl.multiple and gl.sketch together, you just can't use @glparam color with the multiple.

larme's icon

Thanks, but I want many roundedplane with different colors.

Because the positions and dimensions of these rounded plane is fixed, can I pre-render all these rounded plane with the same color into a matrix and down sampling it into a 1-0 matrix so I have a black-white matrix. Then I can multiply it by a color matrix to get the final product. Will this way hurt the performance/frame rate, if the dimension of the matrix is thousands by thousands?

Rob Ramirez's icon

as joshua said, probably best to use javascript of poly~ for this.

larme's icon

So assuming I want to use poly~ to draw multiple gl.sketch object, does that mean I draw on a single gl.sketch object in the ploy~ patch? That's what I do in the attached patch. I generate a 6 plane matrix (2 planes for position and 4 planes for color), then iterate the matrix using jit.iter and send the resulting list to the poly~ patch. The poly~ patch receive the list and draw a single rounded plane. The patch run well for the first several seconds and then the frame rate drops.

Also, do I need to mute and unmute the poly~ patch even though I have no audio in the poly~ patch?

2962.polytest.zip
zip
Rob Ramirez's icon

hi larme.
you are not using poly~ correctly.

in this case, you don't need poly~ at all. you can use a single jit.gl.sketch object.

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

here's your patch modified to do this:

larme's icon

Thanks. It now works!