jit.gl.pix Reference

Generates pixel processing shaders from a gen patcher

jit.gl.pix

Description

The jit.gl.pix object generates new pixel processing shaders from a patcher. jit.gl.pix is essentially a jit.gl.slab object whose shader files are generated from gen patchers.

Examples

Generates pixel processing shaders from a patcher

Attributes

activeinput [int]

The current input used for texture and matrix messages (default = 0). Useful when calling input messages from Java or JavaScript.

adapt [int] (default: 1)

Enable adapt to input (default = 1). When enabled the texture output dimensions will match the input dimensions.

colormode [symbol]

Texture color mode (default = argb)

Possible values:

'argb'
'uyvy'

dim [2 ints]

The texture output dimensions when adapt is disabled (default = 256 256)

dimscale [2 floats]

The output dimension scaling factor of the output (default = 1 1). Useful for upsampling or downsampling texture output.
output.dim = input.dim*dimscale

dirty [int]

g/s(get)

Gen patcher dirty flag

exportfolder [symbol]

Sets the folder to export gen patchers into when using the exportcode message.

gen [symbol] (default: )

The name of the gen patcher to use.

inputs [int]

Input count (default = 2)

out_name [32 symbols]

g/s(get)

Output texture name

outputs [int]7.0.0

Number of texture outputs (default = 1). Texture outputs correspond to gen patcher outs.

rect [4 floats]

Geometry rectangle (default = 0 0 1 1). The four values represent normalized coordinates for the left, bottom, right and top sides of the geometry rectangle. To flip the image horizontally use rect 1 0 0 1 or to flip vertically use rect 0 1 1 0 .

rectangle [int]

Enable texture rectangle mode on internal texture objects(default = 1). When enabled the internal GL texture is treated as a rectangular texture, and must be referenced using sampler2DRect and sampled using texture2DRect when sampled from a GLSL shader. When disabled the texture dimensions are upsampled to the nearest power of two value, and must be referenced and sampled using sampler2D and texture2D. Certain texture attributes and GLSL effects require rectangle mode disabled.

thru [int]

Enable thru mode (default = 1). When the flag is set, texture output is sent whenever input is received.

t [symbol]

Gen patcher title

title [symbol]

Gen patcher title

type [symbol]

The output texture data type (default = auto). When type is auto the type is set by the input texture or matrix type.

Possible values:

'auto' ( Adapt to input data type )
'char' ( 8bit unsigned byte )
'long' ( 32bit integer )
'half' ( 16bit float )
'float' ( 32bit float )
'float16' ( 16bit float )
'float32' ( 32bit float )

Common Box Attributes

OB3D Attributes

Messages

anything

Set parameter values in the Gen patcher

(drag)

Drag and drop a .genjit Gen patcher

compile

Compile the Gen patcher

(mouse)

Double-click to open gen patcher window

exportcode

Arguments

target [symbol]
Export a gen patcher as shader code. With no arguments, jit.gl.pix will export a standard Jitter JXS shader file with GLSL code. The optional arguments can be either 'jxs' or 'webgl' or 'isf'.

In the 'webgl' case, jit.gl.pix will export an .html file suitable for loading in a WebGL context . The code uses TWGL as a helper library and requires the twgl-full.min.js file be in the same directory as the exported html file.

In the 'isf' case, jit.gl.pix will export a .fs fragment shader suitable for loading in a ISF (Interactive Shader Format) context

full_source_code

Opens an editor window with the generated source code formatted as a JXS file.

getparamdefault

Sends the default data values for the indicated shader parameter for the internal jit.gl.shader object out the right-most outlet.

getparamdescription

Get a parameter description

getparamlist

Sends the names of all the internal jit.gl.shader object shader parameters out the right-most outlet.

getparamtype

Sends the name of the datatype for the indicated shader parameter for the internal jit.gl.shader object out the right-most outlet.

getparamval

Sends the data values for the indicated shader parameter for the internal jit.gl.shader object out the right-most outlet.

open

Open the Gen patcher window

param

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

sendinput

Arguments

index [int]
message [symbol]
values [list]
Sends an input jit.gl.texture a message. If the first arg is an int, it specifies the texture index to send the message, otherwise all input textures receive the message.

sendoutput

Arguments

message [symbol]
values [list]
Sends the output jit.gl.texture objects a message.

sendshader

Arguments

message [symbol]
values [list]
Sends the internal jit.gl.shader object a message

wclose

Close the Gen patcher

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL
Video and Graphics Programming Tutorials Video and Graphics Programming Tutorials
Online Resources Online Resources
jit.gen
jit.pix
jit.gl.slab
jit.expr
jit.matrix
gen~
Gen Overview Gen Overview
GenExpr GenExpr
Gen Common Operators Gen Common Operators
Jitter Operators Jitter Operators