Skip to main content

Type Alias: EffectDefinition<TargetName>

EffectDefinition<TargetName> = object

Defined in: modules/engine/src/api/passes/effect-renderer.ts:49

A reusable, device-independent description of a fullscreen effect.

An effect receives the preceding color image and can sample additional textures supplied for the frame. Passes write either private named targets or the shared color chain. Each use of a definition gets its own render targets and history.

Use EffectDefinition<'targetA' | 'targetB'> to check local target references when declaring an effect as a module-level constant. Treat the definition as immutable once a renderer uses it.

Type Parameters​

TargetName​

TargetName extends string = string

Names of textures owned by this effect.

Properties​

initialPasses?​

optional initialPasses?: object

Defined in: modules/engine/src/api/passes/effect-renderer.ts:66

Optional backend alternatives for a stage before the shared passes. Both implementations must produce the named textures the shared passes consume. The renderer selects the implementation once when constructed.

compute?​

optional compute?: NonNullable<FullscreenEffectPlan<TargetName>["initialPasses"]>["compute"]

A fused WebGPU dispatch. Declare each storage output by binding name, and mark the corresponding resource with storage: true. The first listed output determines dispatch dimensions. The renderer checks device limits and storage-format support and chooses the fragment sequence if needed.

fragment​

fragment: EffectPass<TargetName>[]

Portable fullscreen draws in execution order.


name​

name: string

Defined in: modules/engine/src/api/passes/effect-renderer.ts:51

Label used to identify the effect and its GPU resources in diagnostics.


passes​

passes: EffectPass<TargetName>[]

Defined in: modules/engine/src/api/passes/effect-renderer.ts:84

Shared fullscreen draws in execution order. Use previous to read or update the color chain, original to read the stack's input image, and a local resource name to route a texture between draws within the effect.


resources?​

optional resources?: Record<TargetName, EffectResource>

Defined in: modules/engine/src/api/passes/effect-renderer.ts:59

Textures owned by each occurrence of this effect. A target's scale is relative to the renderer size. History targets retain their prior frame value and may declare how to initialize it. Use an empty object for an effect that only writes to the shared color chain.