StringTune-3D/Docs

Rendering

Custom Filters

Define custom post-process filters and expose parsed arguments to the runtime through the filter registry.

Type
Rendering feature
Status
Advanced
Scope
API only
Activation
String3DCustomFilterRegistry.register(...)

Custom Filters

Custom filters extend the --filter grammar with your own names.

Registration

TypeScript
import { String3DCustomFilterRegistry } from 'string-tune-3d';

String3DCustomFilterRegistry.register({
  name: 'heat',
  implementations: {
    webgl: {
      kind: 'shader',
      language: 'glsl',
      stage: 'fragment',
      code: 'void main() {}',
    },
  },
  parse: (args) => ({ amount: Number.parseFloat(args) || 0 }),
});

Detailed Behavior

  • Filter names are matched during --filter parsing.
  • parse() turns the CSS argument string into uniforms.
  • Backend-specific implementations are resolved through the engine runtime.