@luma.gl/shaders/plugins
@luma.gl/shaders/plugins offers a small catalog of predefined shader plugins.
Pass the exported ShaderPlugin descriptors to the @luma.gl/engine Model class through its plugins array prop. When using ShaderAssembler directly, call resolveShaderPlugins() for the target shader language and pass the resolved contributions to the assembler.
import {clipPlugin, filterPlugin} from '@luma.gl/shaders/plugins';
| Plugin | What the host supplies | What the descriptor adds |
|---|---|---|
filterPlugin | FILTER_POSITION vertex shader target. filterValues scalar column, with one value tested per row. | Declares the vertex input and injects a range check that moves rejected vertices outside clip space. |
clipPlugin | CLIP_POSITION vertex target and CLIP_COLOR fragment target. | Injects clipping at both targets and carries clipCoordinates from vertex to fragment for per-pixel clipping. |