MasterSelects has a modular GPU effect system built around registered effect modules, shared WGSL utilities, and a compositor pipeline that can run inline color ops without extra passes.
- 37 blend modes are implemented in
src/shaders/composite.wgsl. - 30 GPU effects are registered in
src/effects/. - Registered effect categories are
color,blur,distort,stylize,keying,generate,time, andtransition. generate,time, andtransitioncurrently have no registered effects and are hidden from the add-effect UI.
The effect registry is built from category exports in src/effects/index.ts. Each effect definition provides:
id,name, andcategory- WGSL shader source
- fragment
entryPoint uniformSize- parameter definitions
packUniforms(...)- optional
passesandcustomControls
The production editor UI is src/components/panels/properties/EffectsTab.tsx.
src/effects/EffectControls.tsx is a generic fallback renderer.
color(9): Brightness, Contrast, Saturation, Vibrance, Hue Shift, Temperature, Exposure, Levels, Invertblur(5): Box Blur, Gaussian Blur, Radial Blur, Zoom Blur, Motion Blurdistort(7): Pixelate, Kaleidoscope, Mirror, RGB Split, Twirl, Wave, Bulgestylize(8): Vignette, Grain, Sharpen, Posterize, Glow, Edge Detect, Scanlines, Thresholdkeying(1): Chroma Key
EffectsTab renders effect parameters directly from the registry.
- Number parameters use a slider plus
DraggableNumber. - Boolean parameters use a checkbox.
- Select parameters use a dropdown.
- Parameters marked
quality: trueare grouped in a collapsibleQualitysection. - Quality values can be dragged past the visible slider max in the editor.
- Parameters marked
animatable: falseare shown as static controls.
The registered quality parameters are currently:
- Gaussian Blur:
samples - Motion Blur:
samples - Radial Blur:
samples - Zoom Blur:
samples - Glow:
rings,samplesPerRing
Right-click on a numeric control resets that parameter to its default.
The performanceMonitor service can also reset quality parameters to defaults when rendering becomes too slow.
These effects are applied directly in the composite shader instead of running as separate effect passes:
- Brightness
- Contrast
- Saturation
- Invert
That keeps them zero-overhead relative to the full ping-pong effect chain.
Non-inline effects are compiled from shared WGSL utilities plus the effect shader itself.
The pipeline creates one GPU render pipeline per registered effect and filters out disabled effects and audio- effects during application.
Effects with uniformSize 0 use no uniform buffer.
Most effects use a 16-byte-aligned uniform block; a few multi-parameter effects use larger blocks.
Numeric effect parameters can be keyframed through the timeline using the property path format:
effect.{effectId}.{paramName}EffectsTab reads interpolated values from the timeline store and writes animated numbers back through setPropertyValue.
colorandpointparameter types exist in the effect type system, but the current registered effects do not use them.- The empty
generate,time, andtransitioncategories are present in the type system so they can be populated later without changing the registry shape.