Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AllVals

AllVals: Float | Vec

all possible expressions

ArithOp

ArithOp: "/" | "*" | "+" | "-"

Float

all possible float expressions

TypeString

TypeString: "float" | "vec2" | "vec3" | "vec4"

all type strings

Vec

all possible vec expressions

Vec2

all possible vec2 expressions

Vec3

all possible vec3 expressions

Vec4

all possible vec4 expressions

Variables

Const glslFuncs

glslFuncs: { brightness: string; channel: string; contrast: string; depth2occlusion: string; fxaa: string; gauss13: string; gauss5: string; gauss9: string; gaussian: string; godrays: string; gradientnoise: string; hsv2rgb: string; invert: string; monochrome: string; random: string; random2: string; rgb2hsv: string; rotate2d: string; simplexhelpers: string; simplexnoise: string; sobel: string; texture2D_region: string; truedepth: string } = ...

glsl source code for external functions

Type declaration

  • brightness: string
  • channel: string
  • contrast: string
  • depth2occlusion: string
  • fxaa: string
  • gauss13: string
  • gauss5: string
  • gauss9: string
  • gaussian: string
  • godrays: string
  • gradientnoise: string
  • hsv2rgb: string
  • invert: string
  • monochrome: string
  • random: string
  • random2: string
  • rgb2hsv: string
  • rotate2d: string
  • simplexhelpers: string
  • simplexnoise: string
  • sobel: string
  • texture2D_region: string
  • truedepth: string

Const settings

settings: { offset: number; verbosity: number } = ...

Type declaration

  • offset: number
  • verbosity: number

Functions

a1

a2

bloom

  • bloom(threshold?: Float | number, horizontal?: Float | number, vertical?: Float | number, boost?: Float | number, samplerNum?: number, taps?: 5 | 9 | 13, reps?: number): BloomLoop
  • creates a bloom loop

    Parameters

    • Optional threshold: Float | number

      values below this brightness don't get blurred (0.4 is about reasonable, which is also the default)

    • Optional horizontal: Float | number

      how much to blur vertically (defaults to 1 pixel)

    • Optional vertical: Float | number

      how much to blur horizontally (defaults to 1 pixel)

    • Optional boost: Float | number
    • Optional samplerNum: number
    • Optional taps: 5 | 9 | 13

      how many taps for the blur (defaults to 9)

    • Optional reps: number

      how many times to loop the blur (defaults to 3)

    Returns BloomLoop

blur2d

  • blur2d(horizontalExpr?: Float | number, verticalExpr?: Float | number, reps?: number, taps?: 5 | 9 | 13, samplerNum?: number): Blur2dLoop
  • creates a loop that runs a horizontal, then vertical gaussian blur (anything more than 1 pixel in the horizontal or vertical direction will create a ghosting effect, which is usually not desirable)

    Parameters

    • Optional horizontalExpr: Float | number

      float for the horizontal blur (1 pixel default)

    • Optional verticalExpr: Float | number

      float for the vertical blur (1 pixel default)

    • Optional reps: number

      how many passes (defaults to 2)

    • Optional taps: 5 | 9 | 13

      how many taps (defaults to 5)

    • Optional samplerNum: number

      change if you want to sample from a different channel and the outer loop has a different target

    Returns Blur2dLoop

brightness

  • changes the brightness of a color

    Parameters

    • val: Float | number

      float for how much to change the brightness by (should probably be between -1 and 1)

    • Optional col: Vec4

      the color to increase the brightness of (defaults to current fragment color)

    Returns Brightness

center

cfloat

changecomp

channel

  • creates an expression that samples from one of the user-defined channels. don't sample from the same channel that you are using target on in a loop, just use fcolor

    Parameters

    • channel: number

      which channel to sample from

    • Optional vec: Vec2

      where to sample the channel texture (defaults to the normalized frag coord)

    Returns ChannelSampleExpr

checkLegalComponents

  • checkLegalComponents(comps: string, vec: Vec): void
  • checks if components accessing a vector are legal. components can be illegal if they mix sets (e.g. v.rgzw) or contain characters outside of any set (e.g. v.lmno)

    Parameters

    • comps: string

      components string

    • vec: Vec

      vector being accessed

    Returns void

contrast

  • changes the contrast of a color

    Parameters

    • val: Float | number

      float for how much to change the contrast by (should probably be between -1 and 1)

    • Optional col: Vec4

      the color to increase the contrast of (defaults to current fragment color)

    Returns ContrastExpr

cvec2

cvec3

cvec4

depth2occlusion

  • converts a 1 / distance depth texture to an occlusion texture, with all occluded geometry being rendered as black

    Parameters

    • depthCol: Vec4

      the color representing the inverse depth (defaults to sampling from channel 0)

    • newCol: Vec4

      the color to replace unoccluded areas by (defaults to white and is mutable by default)

    • threshold: Float | number

      values below this are not occluded (set to something low, like 0.1 or lower; defaults to 0.01 and is mutable by default)

    Returns DepthToOcclusionExpr

dof

  • creates depth of field expression; all values are mutable by default

    Parameters

    • Optional depth: Float | number

      float for what inverse depth to focus on (1 on top of the camera; 0 is infinity)

    • Optional rad: Float | number

      float for how deep the band of in-focus geometry is (a value between 0.01 and 0.1 is reasonable)

    • Optional depthInfo: Float | number

      float the expression that represents the inverse depth (defaults to sampling the red component from channel 0)

    • Optional reps: number

      how many times to repeat the gaussian blur

    Returns DoFLoop

edge

  • edge(style: Float | number | "dark" | "light", samplerNum?: number): EdgeExpr
  • returns an expression highlights edges where they appear

    Parameters

    • style: Float | number | "dark" | "light"

      "dark" for dark edges and "light" for light edges, or a custom number or expression (between -1 and 1) for a more gray style of edge

    • Optional samplerNum: number

      where to sample from

    Returns EdgeExpr

edgecolor

  • creates a colored edge detection expression

    Parameters

    • color: Vec4

      what color to make the edge

    • Optional samplerNum: number

      where to sample from

    • Optional stepped: boolean

      whether to round the result of sobel edge detection (defaults to true)

    Returns EdgeColorExpr

fcolor

float

fractalize

  • take any function from a position to a float, and repeatedly sum calls to it with doubling frequency and halving amplitude (works well with simplex and perlin)

    Parameters

    Returns Float

fxaa

  • fxaa(): FXAAExpr

gauss

  • gauss(direction: Vec2, taps?: 5 | 9 | 13, samplerNum?: number): BlurExpr
  • creates expression that performs one pass of a gaussian blur

    Parameters

    • direction: Vec2

      direction to blur (keep magnitude less than or equal to 1 for best effect)

    • taps: 5 | 9 | 13 = 5

      number of taps (defaults to 5)

    • Optional samplerNum: number

      which channel to sample from (default 0)

    Returns BlurExpr

get2comp

  • creates an expression that gets 2 components from a vector

    Type parameters

    Parameters

    • vec: T

      the vector to get components of

    • comps: string

      components string

    Returns Get2CompExpr<T>

get3comp

  • creates an expression that gets 3 components from a vector

    Type parameters

    Parameters

    • vec: T

      the vector to get components of

    • comps: string

      components string

    Returns Get3CompExpr<T>

get4comp

  • creates an expression that gets 4 components from a vector

    Type parameters

    Parameters

    • vec: T

      the vector to get components of

    • comps: string

      components string

    Returns Get4CompExpr<T>

getcomp

  • creates an expression that gets 1 component from a vector

    Type parameters

    Parameters

    • vec: T

      the vector to get components of

    • comps: string

      components string

    Returns GetCompExpr<T>

godrays

  • create a godrays expression which requires an occlusion map; all values are mutable by default

    Parameters

    • options: GodraysOptions = ...

      object that defines godrays properties (has sane defaults)

    Returns GodRaysExpr

grain

  • creates an expression that adds random grain

    Parameters

    • val: Float | number

      how much the grain should impact the image (0 to 1 is reasonable)

    Returns GrainExpr

hsv2rgb

input

  • creates an expression that samples the original scene

    Parameters

    • Optional vec: Vec2

      where to sample the original scene texture (defaults to the normalized frag coord, but change this if you want to transform the coordinate space of the original image)

    Returns SceneSampleExpr

invert

len

  • creates an expreession that calculates the length of a vector

    Type parameters

    Parameters

    • vec: T

    Returns LenExpr<T>

loop

makeTexture

  • makeTexture(gl: WebGL2RenderingContext, options?: MergerOptions): WebGLTexture
  • creates a texture given a context and options

    Parameters

    • gl: WebGL2RenderingContext
    • Optional options: MergerOptions

    Returns WebGLTexture

monochrome

motionblur

  • creates a frame averaging motion blur effect

    Parameters

    • Optional target: number

      the channel where your accumulation buffer is (defaults to 0, which you might be using for something like the depth texture, so be sure to change this to suit your needs)

    • Optional persistence: Float | number

      close to 0 is more ghostly, and close to 1 is nearly no motion blur at all (defaults to 0.3)

    Returns MotionBlurLoop

mouse

mut

nmouse

norm

op

pblur

  • fast approximate blur for large blur radius that might look good in some cases

    Parameters

    • size: number

      the radius of the blur

    Returns PowerBlurLoop

perlin

pfloat

pixel

  • creates an expression that evaluates to the frag coord in pixels (samplers take normalized coordinates, so you might want [[nfcoord]] instead)

    Returns FragCoordExpr

pos

pvec2

pvec3

  • pvec3(comp1: number, comp2: number, comp3: number): PrimitiveVec3

pvec4

  • pvec4(comp1: number, comp2: number, comp3: number, comp4: number): PrimitiveVec4

random

  • creates expression that evaluates to a pseudorandom number between 0 and 1

    Parameters

    • seed: Vec2

      vec2 to to seed the random number (defaults to the normalized frag coord)

    Returns RandomExpr

region

resolution

rgb2hsv

rotate

  • creates an expression that rotates a vector by a given angle

    Parameters

    • vec: Vec2

      the vector to rotate

    • angle: Float | number

      radians to rotate vector by

    Returns RotateExpr

sendTexture

  • sendTexture(gl: WebGL2RenderingContext, src: TexImageSource | WebGLTexture | null): void
  • copies onto texture

    Parameters

    • gl: WebGL2RenderingContext
    • src: TexImageSource | WebGLTexture | null

    Returns void

simplex

sobel

  • creates a Sobel edge detection expression that outputs the raw result; for more highly processed edge detection expressions, see edgecolor or edge

    Parameters

    • Optional samplerNum: number

      where to sample from

    Returns SobelExpr

tag

ternary

time

translate

truedepth

vec2

vec3

vec4

wrapInValue

  • wrapInValue<T>(num: T | number): T
  • wrapInValue<T>(num: T | number | undefined): T | PrimitiveFloat | undefined

Generated using TypeDoc