[SOLVED] jit.world not drawing to jit.gl.asyncread when @visible 0

Nodanoma's icon


Hey all, hopefully someone can shed some light on this behaviour:
I would like jit.world to draw to a jit.gl.asyncread but at the same time hide the rendering window. This is because the dimensions/size are scaled up to 4+K for non-raeltime rendering. It all works fine, albeit, the rendering window has to always be visible in full scale to render accordingly. Dispensing with jit.gl.asyncread is not an option since all attribute changes are handled remotely using JS and the (matrix) output of jit.world cannot be captured remotely asaik.

Is there a specific reason for this behaviour?
Which flag/setting have I perhaps overlooked to make it work?
Can this be solved in future Jitter versions otherwise?

Big thaks + stay mentally healthy

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

jit.world drawing to 'capture' (jit.gl.asyncread) which does not produce any jit_matrix when jit.world @visible 0

Rob Ramirez's icon

you simply need to send the texture output from your jit.world to the jit.gl.asyncread input (instead of binding to the jit.world drawto context). The texture readback functionality is not linked to the context visible state.

Nodanoma's icon

Thanks Rob for the prompt explanation. Now, how can the output texture's name be queried?

I have tried capturing the texture output from jit.world, however, I seem to be unable to access the texture name from within JS since the 'getout_name' method is ignored by jit.world. This way I'd require a patchcord connection to get the texture name — it needs to work remotely though (JS). I had expected jit.gl.asyncread to continue to bind to jit.world's drawto context but it stops once visibility of the rendering window is unflagged. Clues?

Rob Ramirez's icon

"sendnode getout_name"

Nodanoma's icon

it makes total sense that the internal node would be the place to look for the texture output name instead of jit.world. The 'sendnode getout_name' method, however, outputs the texture name from the dumpoutlet of the object — how can it be queried and further used inside JS only ?

world.sendnode("getout_name") yields the same output from the jit.world object and the internal node cannot be accessed since its name cannot be queried (I reckon). As with other gl-objects, their texture output can be accessed with the 'out_name'-property — if I knew how to access the internal node I could query it this way.

Rob Ramirez's icon

sorry it's not clear to me what your setup is. if you want to provide a stripped down example of how your jit.world interacts with your JS I can possibly offer some suggestions.

Nodanoma's icon

I am rendering HiQ scenes using JS. Currently, the rendering window of jit.world needs to always be visible, although having to be scaled up to full dimensions to render accordingly (size/dim). I would like to hide the window when rendering offline in HiQ but I can neither access the world's node's out_name in JS nor will jit.gl.asyncread draw when the window is hidden. Hope this explains it better. Thanks!

Max Patch
Copy patch and select New From Clipboard in Max.
world.capture.js
application/x-javascript 0.84 KB
JS file

Nodanoma's icon

note that in the final setup there is no physical connection between jit.world and the js-based abstraction since the offline rendering is handled from JS itself without automatic render bangs from jit.world

quick look

Rob Ramirez's icon

you can use jit.proxy for this. first get the name of the jit.world internal node (which is simply jit.world name attribute), and bind that to a jit.proxy object. then use the jit.proxy to query the out_name:
var proxy = new JitterObject("jit.proxy");
proxy.name = world.getattr("name");
var texname = proxy.send("getout_name");

in the bang method:

async.jit_gl_texture(texname);

Nodanoma's icon

Excellent. That was the missing link and works like a charm.
Thanks a ton !