PassEffect
Defined in: packages/three-flatland/src/pipeline/PassEffect.ts:105
Base class for post-processing pass effects.
Mirrors the MaterialEffect pattern: class-based, schema-driven, with property
accessors. Uses TSL uniform() nodes for zero-cost runtime parameter updates —
changing a parameter updates the uniform value directly without rebuilding the
node graph.
Examples
Section titled “Examples”class CRTEffect extends PassEffect { static readonly passName = 'crt' static readonly passSchema = { curvature: 0.1, scanlineIntensity: 0.2 } as const declare curvature: number declare scanlineIntensity: number
static buildPass({ uniforms }: PassEffectContext): PassEffectFn { return (input, uv) => crtComplete(input, uv, { curvature: uniforms.curvature, scanlineIntensity: uniforms.scanlineIntensity, }) }}const VignetteEffect = createPassEffect({ name: 'vignette', schema: { intensity: 0.5 }, pass: ({ uniforms }) => (input, uv) => vignette(input, uv, uniforms.intensity),})Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PassEffect():
PassEffect
Defined in: packages/three-flatland/src/pipeline/PassEffect.ts:232
Returns
Section titled “Returns”PassEffect
Properties
Section titled “Properties”
readonlyname:string
Defined in: packages/three-flatland/src/pipeline/PassEffect.ts:203
Pass name (from static).
passName
Section titled “passName”
readonlystaticpassName:string
Defined in: packages/three-flatland/src/pipeline/PassEffect.ts:111
Unique pass name. Must be overridden by subclass.
passSchema
Section titled “passSchema”
readonlystaticpassSchema:EffectSchema
Defined in: packages/three-flatland/src/pipeline/PassEffect.ts:113
Per-pass data schema with default values. Must be overridden by subclass.
Accessors
Section titled “Accessors”enabled
Section titled “enabled”Get Signature
Section titled “Get Signature”get enabled():
boolean
Defined in: packages/three-flatland/src/pipeline/PassEffect.ts:294
Whether this pass is enabled in the chain.
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set enabled(
value):void
Defined in: packages/three-flatland/src/pipeline/PassEffect.ts:299
Toggle enabled state. This is a structural change — rebuilds the chain.
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Methods
Section titled “Methods”buildPass()
Section titled “buildPass()”
staticbuildPass(_context):PassEffectFn
Defined in: packages/three-flatland/src/pipeline/PassEffect.ts:131
Build the pass function. Must be overridden by subclass (class-based path). Called once when the pass is added to Flatland. The returned function closes over uniform nodes for zero-cost parameter updates.