// luma.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors import type {Binding} from '@luma.gl/core'; import type {PickBindings, PickUniforms, ShaderModule} from './shader-module'; import type {UniformValue} from '../utils/uniform-types'; /** * A ShaderPass is a ShaderModule that can be run "standalone" (e.g. post processing effects) * It adds additional information on how to run the module. * A ShaderPass can require one or more sub passes. */ export type ShaderPass< PropsT extends Record = Record, UniformsT extends Record = PickUniforms, BindingsT extends Record = PickBindings > = ShaderModule & { /** A shader pass can run multiple sub passes */ passes?: ShaderSubPass[]; // TODO better name // subPasses?: ShaderSubPass[]; }; /** Information on how to run a specific sub pass */ export type ShaderSubPass< UniformsT extends Record = Record > = { /** * Action indicates whether this pass: * - filters the color in each pixel (provides a `_filterColor()` shader function) * - performs its own sampling (provides a `_sampleColor()` shader function) */ action?: 'filter' | 'sample'; sampler?: boolean; filter?: boolean; uniforms?: UniformsT; };