Render
cinnabar:extension/render@0.1.0
Local custom rendering: sandboxed WGSL post-process passes and bounded world-space primitives.
Grants: render or world_draw for primitives; render or render_post for post passes; render_depth additionally for scene depth.
Imported type vector3: vector3.
Types
rgba
Linear colour; alpha scales coverage.
record rgba {
r: f32,
g: f32,
b: f32,
a: f32,
}
| Member | Type | Description |
|---|---|---|
r | f32 | |
g | f32 | |
b | f32 | |
a | f32 |
decal-style
Procedural ground styles animated by progress in 0–1.
enum decal-style {
telegraph,
disc,
crater,
shockwave,
dust,
}
| Member | Type | Description |
|---|---|---|
telegraph | ||
disc | ||
crater | ||
shockwave | ||
dust |
decal
A procedural ground primitive whose progress selects its current animated appearance.
record decal {
center: vector3,
radius: f32,
color: rgba,
progress: f32,
style: decal-style,
}
| Member | Type | Description |
|---|---|---|
center | vector3 | |
radius | f32 | |
color | rgba | |
progress | f32 | |
style | decal-style |
Types: decal-style, rgba, vector3.
ribbon
Camera-facing strip that tapers and fades from the first point (head) to the last.
record ribbon {
points: list<vector3>,
width: f32,
color: rgba,
}
| Member | Type | Description |
|---|---|---|
points | list<vector3> | |
width | f32 | |
color | rgba |
beam
Glowing animated strip from start to end; intensity scales its white-hot core.
record beam {
start: vector3,
end: vector3,
width: f32,
color: rgba,
intensity: f32,
}
| Member | Type | Description |
|---|---|---|
start | vector3 | |
end | vector3 | |
width | f32 | |
color | rgba | |
intensity | f32 |
billboard-pattern
The host’s procedural coverage patterns for a billboard quad.
enum billboard-pattern {
solid,
soft-disc,
ring,
spark,
silhouette,
sphere,
aura,
}
| Member | Type | Description |
|---|---|---|
solid | ||
soft-disc | ||
ring | ||
spark | ||
silhouette | ||
sphere | ||
aura |
billboard
Camera-facing quad; upright quads keep their vertical axis.
record billboard {
position: vector3,
width: f32,
height: f32,
color: rgba,
pattern: billboard-pattern,
upright: bool,
}
| Member | Type | Description |
|---|---|---|
position | vector3 | |
width | f32 | |
height | f32 | |
color | rgba | |
pattern | billboard-pattern | |
upright | bool |
Types: billboard-pattern, rgba, vector3.
primitives
The world primitives appended by one call; successful callbacks replace prior frame output.
record primitives {
decals: list<decal>,
ribbons: list<ribbon>,
beams: list<beam>,
billboards: list<billboard>,
}
| Member | Type | Description |
|---|---|---|
decals | list<decal> | |
ribbons | list<ribbon> | |
beams | list<beam> | |
billboards | list<billboard> |
Types: beam, billboard, decal, ribbon.
pass-spec
source defines fn effect(uv: vec2<f32>) -> vec3<f32>, the new scene colour, against the host prelude.
record pass-spec {
name: string,
order: s32,
source: string,
depth: bool,
}
| Member | Type | Description |
|---|---|---|
name | string | |
order | s32 | |
source | string | |
depth | bool |
line-pattern
Procedural line coverage; width and phase remain host-rendered.
enum line-pattern {
solid,
dashed,
dotted,
}
| Member | Type | Description |
|---|---|---|
solid | ||
dashed | ||
dotted |
line
Camera-facing line with width in physical pixels and an original procedural pattern.
record line {
points: list<vector3>,
width: f32,
color: rgba,
pattern: line-pattern,
}
| Member | Type | Description |
|---|---|---|
points | list<vector3> | |
width | f32 | |
color | rgba | |
pattern | line-pattern |
Types: line-pattern, rgba, vector3.
Functions
register-pass
register-pass: func(spec: pass-spec) -> result<_, string>;
Validates a pass; passes run after the scene and before the HUD, by order then name.
Types: pass-spec.
remove-pass
remove-pass: func(name: string) -> result<_, string>;
Removes this mod’s named post pass after the callback succeeds.
update-pass
update-pass: func(name: string, enabled: bool, params: list<f32>) -> result<_, string>;
Retained enable flag and up to 16 floats exposed to the shader as param(i).
draw
draw: func(primitives: primitives) -> result<_, string>;
Appends to this callback’s primitives; each successful callback replaces the drawn set.
Types: primitives.
draw-lines
draw-lines: func(lines: list<line>) -> result<_, string>;
Appends depth-tested lines with the same authority and shared ribbon budget.
Types: line.