Skip to content

ComputeEffectSource

Defined in: postprocess/effects.ts:60

An effect that is a compute shader over the picture rather than a draw. The WGSL is handed, at group 0: @binding(0) the image so far (texture_2d<f32>), @binding(1) the image it writes (texture_storage_2d<rgba16float, write>), @binding(2) a uniform block of the effect’s uniforms as f32s in the order they are listed, @binding(3) the size (vec4f(w, h, 1/w, 1/h)), @binding(4) the scene’s depth (texture_depth_2d) and @binding(5) a linear clamp sampler; it declares the ones it uses and an entry point named main. Only a device with a compute stage (WebGPU) runs it: on WebGL2 the effect is left out.

source: string

Defined in: postprocess/effects.ts:61


optional workgroupSize?: [number, number]

Defined in: postprocess/effects.ts:63

The workgroup size the shader declares; it is dispatched over the whole picture in groups of this. Default 8 x 8.