Forums > Jitter

How to control render sequences with jit.gl.node?

June 7, 2013 | 9:42 am

Hi

I have been banging my head at this problem now for a while, and didnt find a solution:

I need to control the sequence in which the jit.gl.node contexts are rendered.

<pre><code>

– Pasted Max Patch, click to expand. –

</code></pre>

the provided example shows what I wanna do. ironically in this patch the sequence is correct (at least it makes sence in this kind of setup). you can see it in the max output window, first capture2, than capture1.

but how can I change that order? I tried "layer", I tried "automatic 0" with bangs (not shown here in this patch) but none seems to work.


June 8, 2013 | 5:52 am

@layer on gl.node and gl.camera is the right approach.

If you provide a patch that doesn’t work, I can better provide feedback.


June 8, 2013 | 6:12 am

Fair enough. Thanks for taking your time looking into this:

<code>

– Pasted Max Patch, click to expand. –

</code>

On first sight, this patch seems to work just fine, but the sequence of rendering is wrong: inside the max window you will see that after the "erase" command, it renders first the texture of the camera of subctx2, and then the texture of of the camera of subctx1.

this means that the picture of the ball inside the videoplane of subctx2 is always one frame behind. but I need to have subctx1 rendered first, and then subctx2 rendered…


June 8, 2013 | 6:15 am

UPs, I just added layer 0 and layer 1 and now it works…

<code>

– Pasted Max Patch, click to expand. –

</code>

sorry, I must have made a mistake in my original patch since I though I excessively explored this path..


June 8, 2013 | 6:31 am

No mistakes in my original patch (it is far to elaborate to publish it here). I am actually using 5 jit.gl.node objects and @layer does not the trick, even adding it to the attached cameras as well.

But I found a way to circumvent: sending the message "drawto noWhere, drawto mycontext" to the node objects I can control the sequence of rendering:

Send it first to the node that needs to render first, then to the one second, than to the one third etc…


June 8, 2013 | 10:03 am

If you have a patch that doesn’t work, I recommend you post it here so we can troubleshoot it. Or to submit it to Max Support so they can see if there is a bug.


Viewing 6 posts - 1 through 6 (of 6 total)