Did you know that jit.gl.pass Jitter object can be used to create dynamic OpenGL scene processing chains?
Jit.gl.pass can load jxs shader files and jit.gl.pix gen files to create custom effects for processing your OpenGL scenes. In this post, I want to show how simple it can be to load in an effect - and how to use jit.gl.pass objects for dynamic processing chains.
In this example patch, we work with two built-in pass effects (bloom and motionblur) and a custom effect (rota) based on a shader. Let’s take a look at how it’s made:
Jxp files, the format used by jit.gl.pass, load one or more jxs or jit.gl.pix gen files, which means you can use any of the shaders or jit.pix examples to get started; in this case, I used the td.rota.jxs shader that ships with Max.
All I had to do was identify the primary attributes used to control the shader - anchor, offset, zoom, theta and boundmode - and use the bind name method to wrap them into the jxp format.
You can double-click the object to see and edit the code directly - it looks like this:
Once the file is made, you just save it as a jxp file. When save the file to a location in your search path you can load it into your jit.gl.pass objects any time.
For a more detailed description of creating your own effects, you can refer to the “pass.custom.effects.maxpat” file in the Jitter examples. Hint: Search the file browser for jxs and genjit files to get a sense of what’s possible.
Now let’s look at chaining the effects together. The usual method of binding the middle outlet of one pass object to the next is powerful and convenient, it results in fixed signal processing chains and requires your objects to live on the same patcher level.
I recently began exploring a way of opening up the signal flow to enable use in multi-patcher and modular environments. By explicitly naming the jit.gl.pass objects and using the @child and @layer attributes, you can bypass the middle outlet connection and open up a lot of different terrain. The result of starting with rota, applying bloom and then a blur yields very different results than reversing the order.
While it takes some more effort to configure at the start, the ability to change the order of your effects on the fly gives you the opportunity to explore a wide range of permutations without having to reprogram for each possibility.
If you haven’t already, download and open up the patch to see how much of a difference the processing order can make.