how to use jit.gl.multiple

Garrett's icon

Hi

I'm trying to figure out how to use jit.gl.multiple, not the easiest since I can't seem to find any great documentation of it but I'm working from the great patch here:

I've managed to replace the jit.gl.sketch in that with a jit.gl.videoplane and control movement along x, y and z axis. Now I'm a bit stuck on how to multiply the videoplane more than 3 times and how to put different textures on each of the videoplanes. I've seen a comment on another post which seems to suggest that @targetname is the solution to this second problem but I'm unsure how. Below is what I have so far - any help much appreciated.

a+
gar

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


Rob Ramirez's icon

currently, for gl.multiple to function properly, the dimensions of all the input matrices for the glparams need to be the same. this will be changed in a future release.

therefore, you must set the dim attribute for all your input matrices to the same. you have them set differently in your patch.

Garrett's icon

hi

ok so I've changed the dimensions on all to jit.matrix 3 float32 15 15 apart from the texture matrix and that seems to allow as many as I need. I also had a play with using pak dim 0 0 to modify each dimension separately and I see what you mean about getting the jit.gl.multiple to function properly. What I didn't understand was how the videoplanes were multipling accross by 3 and then appearing on each other but I've spotted that now as the 3 in the formula ((cell[0]%3)-1)*in[0]. Do you know where I can find some info on jit.gl.multiple? The help is pretty thin.

Also any idea how I get different textures onto those videoplanes now? Thanks.

a+
gar

Rob Ramirez's icon

here is a patch demoing multiple textures with gl.multiple.

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

Garrett's icon

Hi

Many thanks for the example but unfortunately I don't have Max 5 so can't view this.

a+
gar

Rob Ramirez's icon

attached screenshot and the maxpat, which can be converted to m4 with the supercollider converter. best i can do.

Garrett's icon

ahh I see, beginning to make more sense now - for anyone trying to do this and failing with Max 4 I've included a version. Many thanks for your help

a+
gar

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

Nat's icon

@Rob: Just wanted to say, I've been trying to understand jit.gl.multiple for some weeks now and the patch you posted made me understand in 10 minutes. You should really consider using this for the help file as the current one is really hard to understand...

Thanks for that patch !