How to control render sequences with jit.gl.node?
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.
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.
@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.
Fair enough. Thanks for taking your time looking into this:
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...
UPs, I just added layer 0 and layer 1 and now it works...
sorry, I must have made a mistake in my original patch since I though I excessively explored this path..
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...
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.