jit.gl.bfg Reference

Procedural basis function texture generator

jit.gl.bfg

Description

Generates OpenGL texture output from a library of procedural basis functions. The functions are processed on the graphics card as OpenGL GLSL shaders. The three categories of functions include noise, fractal and distorted.

Attributes

adapt [int] (default: 1)

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

basis [symbol]

The name of the basis function to use for the evaluation. (default = noise.perlin)

Possible values:

'noise.perlin' ( Classic Perlin noise, periodic variant )
'noise.simplex' ( Simplex weighted pseudo-random values )
'noise.cell' ( Coherent blocky noise )
'noise.checker' ( Periodic checker squares )
'fractal.multi.rigid' ( Multiplicative fractal with sharp ridges )
'fractal.multi.hybrid' ( A hybrid additive and multiplicative fractal )
'fractal.fbm' ( Fractal Brownian motion )
'fractal.multi' ( Multiplicative fractal with varying simularity across scales )
'fractal.hetero' ( Heterogenous multiplicative fractal )
'noise.voronoi' ( Distance weighted pseudo-random feature points )
'noise.voronoi.crackle' ( Variation of Voronoi )
'noise.voronoi.smooth' ( Variation of Voronoi with distance filtering )
'noise.voronoise' ( Generalized Voronoi and Noise )
'noise.voronoi.id' ( Voronoi variation with cells colorized by ID )
'distorted' ( Domain distorted combinational noise )
'distorted.2axis' ( Distortion along 2 axes )
'input.distorted' ( Distortion of input texture )
'input.distorted.2axis' ( Distortion of input texture along 2 axes )

basis.inner [symbol]

Set the innter basis function when basis is a distorted type function (default = noise.perlin).

Possible values:

'noise.perlin'
'noise.simplex'
'noise.cell'
'noise.checker'
'fractal.multi.rigid'
'fractal.multi.hybrid'
'fractal.fbm'
'fractal.multi'
'fractal.hetero'
'noise.voronoi'
'noise.voronoi.crackle'
'noise.voronoi.smooth'
'noise.voronoise'
'noise.voronoi.id'

basis.outer [symbol]

Set the outer basis function when basis is a distorted type function (default = noise.simplex).

Possible values:

'noise.perlin'
'noise.simplex'
'noise.cell'
'noise.checker'
'fractal.multi.rigid'
'fractal.multi.hybrid'
'fractal.fbm'
'fractal.multi'
'fractal.hetero'
'noise.voronoi'
'noise.voronoi.crackle'
'noise.voronoi.smooth'
'noise.voronoise'
'noise.voronoi.id'

colorize [int]

Colorize the output texture using a cosine function (default = 0). See the palette attribute for making adjustments to the colorization.

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

distortion [float]

Adjust the amount of distortion for distorted type functions (default = 1).

fractal_params [4 floats]

Adjust parameters of fractal type functions. The parameters correspond to h, lacunarity, offset, and gain. Not all fracal functions respond to all parameters. Unused paramters are set to 0.
fractal.multi.rigid uses h, lacunarity, offset, gain
fractal.multi, fractal.hetero and fractal.multi.hybrid uses h, lacunarity, offset
fractal.fbm uses h, lacunarity

offset [2 floats]

The dimensional offsets to use for generating the spatial grid coordinates (default = 0 0).

out_name [symbol]

g/s(get)

Output texture name

palette [3 floats]

Adjust the colorization effect when colorize is enabled (default = 0 1 2).

rect [4 floats]

Slab 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.

scale [2 floats]

The dimensional scale factors to use for generating the spatial grid coordinates (default = 1 1).

texrect [128 floats]

Texture rectangle mapping values (default = 0 0 1 1...). The four values represent texture mapping coordinates for the left, bottom, right and top sides of the geometry rectangle, and can be used to easily crop the input image. There are four values for each texture input.

time [float]

Time animation parameter

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 )

voronoi_crackle [3 floats]

Voronoi crackle effect values (default = 8.0 2.0 0.5). Only used when basis is noise.voronoi.crackle

voronoi_jitter [float]

Voronoi jitter amount (default = 1). Only used when basis is a noise.voronoi type function.

voronoi_shade [float]

Simulate cell shading effect when basis is noise.voronoi.id (default = 0.5).

voronoi_smooth [float]

Adjust the smoothing factor when basis is noise.voronoi.smooth (default = 64).

voronoise_amt [float]

Adjust the mix between the Voronoi and noise functions when basis is noise.voronoise (default = 0).

zoom [float]

Adjust both the scale and offset values to simulate zooming in and out of the function center (default = 1).

Common Box Attributes

OB3D Attributes

Messages

full_source_code

Open an editor window containing the generated JXS shader code based on object state.

getparamdefault

Arguments

name [symbol]
Report shader parameter's default value

getparamdescription

Arguments

name [symbol]
Get a parameter description

getparamlist

Report shader parameter names

getparamtype

Arguments

name [symbol]
Report shader parameter's type

getparamval

Arguments

name [symbol]
Report shader parameter's value

param

Arguments

name [symbol]
message [symbol]
values [list]
Set a shader parameter value

sendinput

Arguments

index [int]
message [symbol]
values [list]
Sends an input jit.gl.texture object a message.

sendoutput

Arguments

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

sendshader

Arguments

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

OB3D Messages

See Also

Name Description
jit.bfg
jit.gl.pix
jit.gl.shader
jit.gl.slab
jit.gl.texture
Tutorial 42: Slab: Data Processing on the GPU Tutorial 42: Slab: Data Processing on the GPU
Tutorial 50: Procedural Texturing & Modeling Tutorial 50: Procedural Texturing & Modeling