Create shader effect
create_shader_effectSave reusable WGSL ShaderFX effects with source validation and a parameter manifest, returning an effect ID and parameter table for later use.
Instructions
Save a reusable ShaderFX effect: WGSL defining fn fx(c: FxCtx) -> vec4 (straight rgba). Validated before saving; errors come back as [{ line, column, message }] in your source lines. Returns effect_id and the param table. FxCtx, helpers, manifest and v3 (textures, feedback, passes, data, particles) with examples: load_skill shaderfx-effects.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"source": "<source>",
"manifest": "<manifest>"
},
"name": "create_shader_effect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | [v3] Up to 16384 floats for data(i). | |
| name | Yes | Effect name. | |
| source | Yes | WGSL with fn fx(c: FxCtx) -> vec4<f32> (no bindings, no @fragment). ≤ 24 KB (v3: 48 KB). | |
| data_url | No | [v3] URL of a JSON array or CSV, resolved to floats at apply time. | |
| feedback | No | [v3] { enabled, warmup_sec?, clear? }: prev(uv) reads the previous output frame. | |
| geometry | No | [v3] { mode: "quads"|"points", count }: instanced particles drawn by fn instance(i, c). | |
| manifest | Yes | { kind: "filter"|"transition"|"generator", output: "add"|"normal"|"replace", params: [{ name, type: float|vec2|vec3|color|bool, min?, max?, default }] }; v3 adds passes / textures / feedback / geometry. Leave abi out. | |
| textures | No | [v3] Up to 4 named textures; read with tex_<name>(uv). | |
| is_public | No | Share publicly (default false). | |
| overwrite | No | Replace your effect with the same name. | |
| project_id | No | Optional project context. | |
| description | No | One-line description. |