Skip to main content

ShaderPassOptions

Index

Properties

optionalfiltering

filtering?: ImageFiltering

Filtering used when this pass's auto-allocated intermediate framebuffer is sampled by the next pass. Default ImageFiltering.Blended (linear).

optionalfragmentSource

fragmentSource?: string

Fragment source, processed with the glsl tagged template (straight-alpha authoring, automatic #version/precision).

Conventions available to every pass:

  • uniform sampler2D u_image - the source (positional shorthand); named sources bind to their record keys
  • uniform vec2 u_resolution - destination resolution in pixels
  • uniform vec2 u_texelSize - 1.0 / primary source resolution
  • uniform float u_time_ms - total time in milliseconds
  • uniform float u_elapsed_ms - elapsed milliseconds since the last frame when provided
  • in vec2 v_uv - 0-1 UV over the destination

If omitted the pass is a passthrough (fragColor = texture(u_image, v_uv))

graphicsContext

optionalname

name?: string

Name the pass for debugging

optionalscale

scale?: number

Relative resolution of this pass's output when ShaderPipeline auto-allocates its intermediate framebuffer, e.g. 0.5 renders at half resolution. Default 1.

optionaluniforms

Declarative per-pass uniforms, the same watched dictionary as Shader.uniforms