Package Jitter

jit.gl.pass

Render scene passes with shader processing

Description

The jit.gl.pass object encapsulates processing of one or more sub-passes. A sub-pass consists of a single frame of gl, and post-processing shader, and is defined in a xml pass description file (JXP). Complex scene-processing hierarchies can be obtained by chaining multiple jit.gl.pass objects.

Discussion

Each JXP file contains one or more <pass> effects. Each pass-effect contains one or more <subpass> tags. The <subpass> specifies a shader file for processing its pass, using the "file" attribute, or a jit.gl.pix gen file using the "gen" attribute and contains one or more <input> tags. Certain attributes of jit.gl.slab or jit.gl.pix can also be set here (e.g. dimscale, rect). The subpass can also contain a "name" attribute, allowing it to be referred to as an input for other subpasses. The number of input and output textures processed by the subpass can be specified by "inputs" and "outputs" attributes.

The input specifies its texture source by setting either "name", "source", or "subpass". Name can be any named texture, subpass can be any named subpass, and source can be one of the following:
COLOR - the jit.gl.node color render target (or color output of previous jit.gl.pass)
NORMALS - the jit.gl.node normals render target + depth in alpha channel
VELOCITY - the jit.gl.node velocity render target
PREVIOUS - the preceding subpass output
HISTORY - the previous jit.gl.pass output
TEXTURE0..N - the jit.gl.pass texture attribute list of texture names
SUBPASS0..N - any subpass output of the current jit.gl.pass
Texture and subpass indexing starts at 0, so SUBPASS0 refers to the first subpass output, SUBPASS1 the second and so on.

The output index of a multi-output subpass input type is specified using an "output" attribute and 0-based indexing. The previous frame of supass input types can be requested using the history keyword and setting it to 1. For example to set second output of the previous frame as the input.


			<input subpass="mysubpass" output="1" history="1" />
		 
Both "output" and "history" only work on "subpass" type inputs.

Pass effects that request NORMALS or VELOCITY as input sources require jit.gl.material or jit.gl.pbr objects bound to any geometry objects in the scene. These effects include depth , dof , motionblur , and ssao .

For an example of creating custom pass effects, see the pass.custom.effects example patch.

Read in JXP files by their pass name using @fxname. This is not the same as the filename, and is determined by the pass name in the JXP file. Below are included <pass> effects linking to corresponding examples :

atmospheric - Atmospheric scattering and ground fog
bloom - Produce atmospheric light extending along the borders of bright areas
fxaa - Fast approximate anti aliasing
gamma - Tone mapping, gamma correction and dithering noise pass
motionblur - Blur effect based on pixel velocity
motionglitch - Data mosh type glitch effects
smear example - Pixel smearing effect
ssao - Screen-space ambient occlusion
ssr - Screen-space reflection approximation
tonemap - Modify tonal value of pixels
tssao-gi - Temporal screen-space ambient occlusion with global illumination
tssao-gi-ssr - Temporal screen-space ambient occlusion with global illumination and screen-space reflections
dof-hq - High quality depth of field with bokeh parameters and auto-focus
taa - Temporal anti aliasing
gi - Global illumination via ReSTIR
vignette - Cinematic vignette
grain - Film grain

Attributes

amount[4 floats]

TEXT_HERE

autowatch[int]

TEXT_HERE

child[symbol]

The child jit.gl.pass name (default = none). Set automatically by patchcord connection, and manually by providing a valid jit.gl.pass object name.

embed[int]

TEXT_HERE

depth_drawto[symbol]
read-only

Depth drawto gl context name. Unless set by user, depth_drawto equals drawto

file[symbol]

JXP file name (default = none)

fxname[symbol]

Load a named pass effect. Several built-in pass effects are available to load from this menu, listed below. Custom pass effects from Packages can also be loaded. The jxp files for these effects must be located in a media/jitter/passes folder inside the package folder. Toggling fxname will override the file attribute. Possible values:

'atmospheric'
'bloom'
'bloom-tonemap'
'bloom-hq'
'depth'
'depth2pass'
'dof'
'dof-hq'
'fxaa'
'gamma'
'grain'
'motionblur'
'motion-gauss-blur'
'motionglitch'
'motionglitch-ext'
'gi'
'smear'
'ssao'
'ssao-gl2'
'ssr'
'taa'
'tonemap'
'tssao-gi-ssr'
'tssao-gi'
'vignette'

out_name[symbol]
read-only

Output texture name (default = UID). If there is a name collison then the UID will be appended to the name that is in conflict.

quality[symbol]

Internal texture quality (deault = med). Changeing quality changes the type attribute of internal jit.gl.texture objects. Possible values:

'lo' ( type = char )
'med' ( type = float16 )
'hi' ( type = float32 )

OB3D Attributes

automatic[int]

Automatic rendering flag (default = 1) When the flag is set, rendering occurs when the associated jit.gl.render object receives a bang message

drawto[symbol]

The named drawing context in which to draw (default = none) A named drawing context is a named instance of a jit.window, jit.pwindow, or jit.matrix object that has an instance of the jit.gl.render object associated with it.

enable[int]

Enable flag (default = 1) When the flag is set, drawing is enabled.

layer[int]

Object layer number (default = 0) When in automatic mode, the layer number determines the rendering order (low to high). Objects in the same layer have no guarantee which will be rendered first.

name[symbol]

The instance name (default = UID)

texture[8 symbols]

The name of the texture to be applied (default = none). If multiple textures are specified, uses multi-texturing.

Common Box Attributes

Below is a list of attributes shared by all objects. If you want to change one of these attributes for an object based on the object box, you need to place the word sendbox in front of the attribute name, or use the object's Inspector.

annotation[symbol]

Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.

background[int]: 0

Adds or removes the object from the patcher's background layer. background 1 adds the object to the background layer, background 0 removes it. Objects in the background layer are shown behind all objects in the default foreground layer.

color[4 floats]

Sets the color for the object box outline.

fontface[int]

Sets the type style used by the object. The options are:

plain
bold
italic
bold italic Possible values:

0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'

fontname[symbol]

Sets the object's font.

fontsize[float]

Sets the object's font size (in points). Possible values:

'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'

hidden[int]: 0

Toggles whether an object is hidden when the patcher is locked.

hint[symbol]

Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.

ignoreclick[int]: 0

Toggles whether an object ignores mouse clicks in a locked patcher.

jspainterfile[symbol]

JS Painter File

patching_rect[4 floats]: 0. 0. 100. 0.

Sets the position and size of the object in the patcher window.

position[2 floats]
write-only

Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.

presentation[int]: 0

Sets whether an object belongs to the patcher's presentation.

presentation_rect[4 floats]: 0. 0. 0. 0.

Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.

rect[4 floats]
write-only

Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).

size[2 floats]
write-only

Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.

textcolor[4 floats]

Sets the color for the object's text in RGBA format.

textjustification[int]

Sets the justification for the object's text. Possible values:

0 = 'left'
1 = 'center'
2 = 'right'

varname[symbol]

Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.

Messages

anything

Get and set dynamic attributes generated from sub-pass shader parameters.

(drag)

Drag and drop a .jxp file

(mouse)

Open the JXP file

param

Sets the given shader parameter with the given atom values as defined in a JXS (Jitter shader) file.

read

Load a JXP file from disk

readbuffer

TEXT_HERE

OB3D Messages

bang

Equivalent to the draw message.

draw

Draws the object in the named drawing destination. If the matrixoutput attribute is supported and set to 1, the geometry matrices are sent out the object's left outlet.

drawraw

Equivalent to draw with the inherit_all attribute set to 1.

drawimmediate

Equivalent to draw but ignoring any potential renderer setup

jit_gl_texture

Binds the texture specified by texture-name to this object. Equivalent to setting the texture attribute to texture-name .

Arguments:
  • texture-name [symbol]

See Also

Name Description
External Text Editor External Text Editor
jit.gl.node Create hierarchical rendering groups
jit.gl.slab Process texture data
jit.gl.pix Generates pixel processing shaders from a gen patcher
jit.gl.shader Manage a GL shader
jit.gl.camera Set a rendering view
jit.gl.light Place a light source in a 3D scene