Issues with jit.gl.pix

Feb 13, 2012 at 6:32pm

Issues with jit.gl.pix

Hi guys, I’m trying to make a live video processing patch for my wife.
I’m basing it on the patch from this tutorial:
http://cycling74.com/2009/09/23/the-video-processing-system-part-4/”

The problem I’m having is adding my own modules as whenever I put something new in I just get a black screen.

For example I wanted to replace the GL x.fade shader “jit.gl.slab mod @file co.normal.jxs” with a x.fade built in jit.gl.pix (using the [switch] object).
This simply returns a black screen.

The same happens with my jit.gl.pix RGB balancer and the jit.gl.pix ‘bleach’ shader from the examples folder.

Most of the patches work in jit.pix if I implement them before any GL stuff however.

I’ve pieced together a quick patch to show this:

– Pasted Max Patch, click to expand. –

Any ideas on what might be going wrong? I’m new to this whole GL optimisation thing and need some help getting my head around it.

#61756
Feb 13, 2012 at 7:03pm

Ok, the issue here is with the implicit context stuff not jit.gl.pix. If you see issues like this that don’t make sense with jit.gl.pix, send a message “getdrawto” to jit.gl.pix and look at the result coming out of the dumpout (far right outlet). In this case, jit.gl.pix didn’t find an implicit context because your jit.window object is in a subpatcher. Since contexts can also be attached to jit.pwindows, the jit.gl.pix finds the jit.pwindow and thinks it’s a context.

There are two solutions to this problem:

1) put jit.window in the same patch level as jit.gl.pix or any other implicitly attached jit.gl object
2) assign jit.gl.pix the context name explicitly

#222952
Feb 13, 2012 at 8:11pm

I see. So I would put for example [jit.gl.pix @drawto blargh]

I’ve implemented this in the patch bellow but I still seem to get a blank screen.

– Pasted Max Patch, click to expand. –

Thanks for your help by the way.

#222953
Feb 13, 2012 at 8:16pm

Yes, or simply [jit.gl.pix blargh]. If you close and reopen the patch after making this change does it work? It does for me.

#222954
Feb 13, 2012 at 8:29pm

Aha, that worked! Thanks very much. Is this sort of thing in the documentation or assumed knowledge?

#222955
Feb 13, 2012 at 8:51pm

Your patch should work without having to close and reopen. I’ve filed a bug report to look at so we can fix that problem. The implicit context stuff isn’t documented. We’re working on some updated jitter docs that will have all of this info in it though. In the meantime, here’s how it works:

If you create a jit.gl object without an explicit context name, it will do the following to find a context:

1) look for a jit.window object in the same patch
2) look for a jit.pwindow object in the same patch
3) if it hasn’t found any, it will look in the parent patch if it exists and start again at step 1

#222956

You must be logged in to reply to this topic.