Options
All
  • Public
  • Public/Protected
  • All
Menu

class that can merge effects

Hierarchy

  • Merger

Index

Constructors

constructor

Properties

Private channels

channels: (null | WebGLTexture | ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas)[] = ...

additional channels

Private fShaders

fShaders: WebGLShader[] = ...

Private framebuffer

framebuffer: WebGLFramebuffer

Readonly gl

gl: WebGL2RenderingContext

the context to render to

Private options

options: undefined | MergerOptions

Private programLoop

programLoop: WebGLProgramLoop

Private programMap

programMap: ProgramMap

Private source

source: WebGLTexture | ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas

the context to apply post-processing to

tex

tex: TexInfo

textureMode

textureMode: boolean

Private uniformLocs

uniformLocs: UniformLocs = ...

Private vShader

vShader: WebGLShader

Private vertexBuffer

vertexBuffer: WebGLBuffer

Methods

changeProgram

  • changeProgram(str: string): void
  • changes the current program loop

    Parameters

    • str: string

      key in the program map

    Returns void

delete

  • delete(): void
  • delete all resources created by construction of this Merger; use right before intentionally losing a reference to this merger object. this is useful if you want to construct another Merger to use new effects

    Returns void

draw

  • draw(timeVal?: number, mouseX?: number, mouseY?: number): void
  • use the source and channels to draw effect to target context; mouse position (as with all positions) are stored from the bottom left corner as this is how texture data is stored

    Parameters

    • timeVal: number = 0

      number to set the time uniform to (supply this if you plan to use time)

    • mouseX: number = 0

      the x position of the mouse (supply this if you plan to use mouse or nmouse)

    • mouseY: number = 0

      the y position of the mouse (supply this if you plan to use mouse or nmouse)

    Returns void

Generated using TypeDoc