Addon ID

  • effect_template

Info

Statistics

  • Download count4 total downloads
  • Latest download count 4 downloads of latest version
  • Average download count1 downloads per day average

Owners

# Effect Template — Documentation

**Version:** 1.0.0.0 | WebGL · WebGL2 · WebGPU

---if you want buy me a coffe! buymeacoffee.com/fallout2remake

## User Guide

**Installation:** Menu → View → Addon Manager → Install new addon → select `.c3addon`

**Adding to object:** Properties → Effects → Add effect → Effect Template

**Properties**

| Property | Default | Description |

|----------|---------|-------------|

| Enable | 1 | `1` = active, `0` = disabled |

**Set via Events:**

```

System → Set effect parameter → "Enable" → 0 or 1

```

---

## Developer Guide

**File structure:**

```

addon.json — metadata and parameter definitions

effect.fx — WebGL1 shader (GLSL ES 1.0)

effect.webgl2.fx — WebGL2 shader (GLSL ES 3.0)

effect.wgsl — WebGPU shader (WGSL)

lang/en-US.json — display names

```

**Adding a parameter** (all 4 files must be updated):

`addon.json` → `parameters` array · `effect.fx` / `effect.webgl2.fx` → `uniform lowp float myParam;` · `effect.wgsl` → add `myParam : f32` to `ShaderParams` struct (order must match addon.json) · `lang/en-US.json` → add display name entry.

**Anchoring pattern to object (not screen):**

```glsl

// WebGL2

vec2 localUV = (vTex - srcOriginStart) / (srcOriginEnd - srcOriginStart);

vec2 pixelPos = localUV * abs(layoutEnd - layoutStart);

```

**Key C3 uniforms:** `vTex`, `seconds`, `pixelSize`, `layerAngle`, `samplerFront`, `samplerBack`, `layoutStart/End`, `srcOriginStart/End`

**addon.json flags:** `blends-background` · `uses-depth` · `cross-sampling` · `animated` · `must-predraw`

---

## Known C3 Limitations

- Effects run on the final **2D flat image** — no access to 3D geometry or individual face UVs

- No per-face effects on **3D Shape**

- `layerAngle` = layer angle, **not** object angle — use a custom float param instead

- Parameter type `bool` **not supported** — use `float` 0/1

- Rotated sprites: effect runs on the **AABB**, not the sprite rect