Combining 3 jit.window objects in one

salvo's icon

Hi there, I am working on a patch which involves 3 different jit.window objects. I was wondering how I could blend them together in one window object??
I need to keep the other 3 as I control 3d coordinates using the mouse on the videos!
Hope someone can help!!
thanks

please find attached a simple example

4788.exwin.maxpat
Max Patch
Yoann's icon

jit.glue. But it might be better to do it in openGL / texture.

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

salvo's icon

Hi Yoann, thank you for you replay. Unfortunately it is not what I am looking for, I want to do a blend of 2 jit.windows.. I upload the patch so you can understand better. I have tried everything but I am sure there is the way to do that. The windows I want to blend are highlighted in red (Sample - Sample1) and the final window (Blended). with the object jit.handle I can transform each 3d object using the mouse.
Hope you can help me.
Thank you anyway

salvo's icon

here the file sorry

4790.EXpatchBlend.maxpat
Max Patch
Rajan Craveri - micron's icon

I'm not sure I understand what you want to do but
try to "render to texture" and than blend with jit.gl.slab and send the result to the third window.
ciao
Rajan

salvo's icon

Ciao micron,
i just want to blend jit.window 1 and jit.window 2 into another jit.window and mix them. Anyway I ll try what u suggest..

thank youu

Rob Ramirez's icon

you just need a few more objects to make this work.
based on what you've already setup, you want three distinct render contexts (i'm assuming you are sending to 3 separate display outputs. if not, there are simpler ways to do this).

you want to enabled @shared 1 on all three jit.window's
you then want to create two jit.gl.nodes for the two main contexts, and add the gl.mesh and gl.texture to those gl.nodes.
then you enable capture to texture on the gl.node (@capture 1).
this will output the attached objects as a texture out the gl.node's first outlet.
then you create a videoplane to display the texture in each of the main contexts, and two videoplanes with blending enabled, in your Blended context.

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

that's about it.
let me know if you have further questions.

salvo's icon

Thank Robert, that is very helpful, I understood the process, however, in ur patch I dont get the jit.ql.node I dont have installed in my Max 5. Anyplace where I can get this object?
Thank you sooo much.

Rob Ramirez's icon

max 6 only. sorry.

salvo's icon

thats amazing Robert, it works in Max 6, the render its different, however, i just have the demo. :( I have copied jit.ql.node.mxo from Max 6 to max 5 but is not working..

salvo's icon

any other solution for Max 5?

Rob Ramirez's icon

theoretically you can do this in max 5 by setting the capture attribute on you jit.gl.mesh to a named texture and setting @shared_context on your jit.gl.render (instead of @shared 1 on the jit.window), and then basically doing the same thing as in my patch.

salvo's icon

mmm ... did not quite get it ;(

salvo's icon

thanks robert SOLVED

salvo's icon

I bought max 6 ;) .... now the problem is how do I connect jit.ql.record to save the final results?

diablodale's icon

capture the output of your desired final nodel of the context. For example if you have a jit.gl.node which is the "top" node, then set @capture=1 on it. It will send out matrices rather than to the display window. the matricies can then be sent to jit.qt.record and you can record them.

You could also use jit.gl.asyncread, but I've heard that jit.gl.node will perform far better.

Rob Ramirez's icon

a corrections to what dale says above.
jit.gl.node with capture enabled sends out textures, not matrices. textures live on the GPU, not the CPU.
jit.qt.record (and jit.vcr) expects matrices.

you can easily convert a texture to a matrix by sending the texture output from gl.node into a jit.matrix object. you can then plug the jit.matrix output into a jit.qt.record.

this will degrade the performance of your patch as a result of the texture readback to the CPU (as well as normal jit.qt.record usage).
an alternative is a screen grabbing software, such as iShowU or Fraps, and may result in better performance.

agustin genoud's icon

Hi all!
how would you do this if you only need the last rendered window with the two render contexts inside? (let's say that I have 2 worlds and want them inside a third one which is the only output I need),

Nileet Jacob Philip's icon

Hi @salvo, Can you share your patch if the blending issue is resolved.