A newer version of Max is available. Click here to access the latest version of this document.

jit.gl.slab

Performs a GL accelerated grid-based evaluation

Description

The jit.gl.slab object provides a streamlined interface for performing a general purpose GPU based grid evaluation. Multiple jit.matrix or jit.gl.texture objects can be attached to inlets and used in combination with a jit.gl.shader object and a specialized form of view-aligned geometry with a one-to-one pixel mapping to perform an accurate spatial evaluation. The results of this calculation are automatically saved and made available via a jit.gl.texture object referenced from the leftmost outlet. The resulting jit.gl.texture object can then be bound to any OB3D object, sent to a jit.matrix object, or used as an input to another jit.gl.slab object.
The jit.gl.slab object requires one argument: the name of a drawing context. 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. This value may also be set via the OB3D drawto attribute.

Information for Jitter 3D Object (OB3D) messages and attributes to this object

Messages

(drag) When an shader file is dragged from the Max 5 File Browser to a jit.gl.slab object, the file will be loaded.
dispose Disposes the currently loaded shader, passing the data through using the default multi-texturing behavior.
dump type [symbol]
Dumps the indicated shader data to the max console window. Valid types are params, source, assembly.
getparamdefault name [symbol]
Sends the default data values for the indicated shader parameter for the internal jit.gl.shader object out the right-most outlet.
getparamlist Sends the names of all the internal jit.gl.shader object shader parameters out the right-most outlet.
getparamtype name [symbol]
Sends the name of the datatype for the indicated shader parameter for the internal jit.gl.shader object out the right-most outlet.
getparamval name [symbol]
Sends the data values for the indicated shader parameter for the internal jit.gl.shader object out the right-most outlet.
param Sets the given shader parameter with the given atom values as defined in a JXS (Jitter shader) file.
sendinput message [list]
Sends the input jit.gl.texture object attached to the active inlet the corresponding message. An optional integer as a first argument lets one send the message to a specific input (zero based, left to right).
sendoutput message [list]
Sends the output jit.gl.texture object the corresponding message.
sendshader message [list]
Sends the internal jit.gl.shader object the corresponding message.
read filename [symbol]
Loads the given JXS shader file from disk.

Attributes

Name Type g/s Description
thru int Thru mode flag (default = 1) When the flag is set, a matrix is output when another one is received.
activeinput int Input number used for jit_matrix method (default = 0) Useful for multiple input Image Units used from Java or JavaScript.
adapt int Enables or disables adapting and resizing to input source dimensions (default = 1).
colormode symbol The colorspace mode to use for each input textures (default = auto). Supported modes are:
auto
luminance
intensity
depth
lumalpha
rgb
argb
uyvy
depth float The depth or z-offset for the slab geometry. (default = 0.0)
dim int The dimensions of the output jit.gl.texture object when adapt is disabled (default = 720 480)
dimscale float The dimension scaling factors of the output jit.gl.texture object when adapt is enabled (default = 1. 1.). This is useful for upsampling or downsampling shaders (such as uyvy conversion) which can adapt with the following logic:
output.dim[0] = input.dim[0]*dimscale[0];
output.dim[1] = input.dim[1]*dimscale[1];
displaylist int Cache in displaylist flag (default = 0) This feature may be used to speed up rendering time by creating and storing a list of gl drawing commands on the graphics card. This will have no effect if matrixoutput turned on.
edges int Flags to enable or disable rendering each edge (only valid when shape == edges) (default = 1 1 1 1)/
file symbol The shader file to use (default = none)
inputs int Input count (default = 2)
out_name symbol (get) Returns the name of the internal jit.gl.texture object.
rect float The extent or rectangular coordinates bounding the slab geometry (default = 0 0 1 1)/
shape symbol The shape or geometry to render (default = cubes) Supported modes are:
quad
grid
edges
subdiv int The number of subdivisions to use for generating grid based geometry (only valid when shape == grid) (default = 1 1)
texrect float The extent or rectangular coordinates bounding the texture coordinates for the slab geometry (default = 0 0 1 1)/
type symbol The name of the datatype to use. (default = auto) Supported modes are:
auto (adapt to matrix datatype)
char (8bit unsigned byte)
long (32bit integer)
half (16bit float)
float (32bit float)
float16 (16bit float)
float32 (32bit float)
wrap int Flags to enable or disable wrapping along each edge (only valid when shape == edges) (default = 0 0 0 0)

Information for box attributes common to all objects

Examples

See Also

Name Description
jit.gl.graph Open GL floating-point data visualization
jit.gl.gridshape Generate simple geometric shapes as a connected grid
jit.gl.handle Use mouse movement to control position/rotation
jit.gl.isosurf Generates a GL based surface extraction
jit.gl.mesh Generates GL geometry from existing data
jit.gl.model Read and draw Wavefront .obj models
jit.gl.nurbs Generate NURBS surface
jit.gl.plato Generate platonic solids
jit.gl.render Render Open GL
jit.gl.shader Manages a GL shader
jit.gl.sketch GL parallel to lcd
jit.gl.text2d Write bitmap text
jit.gl.text3d Write vector text
jit.gl.texture Manages a GL texture
jit.gl.videoplane GL accelerated video plane
jit.gl.volume Creates a GL accelerated volume vizualization
Tutorial 42: Slab: Data Processing on the GPU Tutorial 42: Slab: Data Processing on the GPU