Expand description
engawa-snow — flagship snow effect, end-to-end demonstration of engawa + engawa-lisp + engawa-wgpu.
┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ snow.tlisp │──► │ engawa::Render- │──► │ engawa-wgpu │
│ snow.wgsl │ │ Graph (compiled) │ │ pipeline │
└──────────────┘ └──────────────────┘ └──────────────┘
│ ▲
└─── embedded via include_str! ──────────────┘Operators get one struct (SnowEffect::new()), a typed
per-frame state push (SnowParams), and a compiled_graph()
/ material_name() pair to feed any engawa Dispatcher.
§Usage
use engawa_snow::{SnowEffect, SnowParams};
let _effect = SnowEffect::new().expect("snow lisp lowers cleanly");
let mut state = SnowParams::default()
.with_resolution([800.0, 600.0])
.with_intensity(0.85)
.with_layer_count(3.0);
// each frame:
state.set_time(1.0);
state.set_cursor([100.0, 200.0]);
state.set_wind(0.3);
// queue.write_buffer(&uniform_buf, 0, bytemuck::bytes_of(&state));Pairs with shikumi’s notify watcher if you want hot-reload
of the snow.tlisp / snow.wgsl pair — re-call SnowEffect::new()
and swap the compiled graph in place.
Structs§
- Snow
Effect - The shipped snow effect. Holds the compiled engawa
RenderGraph; consumers feed it to anyDispatcherimpl (engawa-wgpu, or a custom one). - Snow
Params - Per-frame snow uniform. 64 bytes, std140-friendly (every
field is a vec4-aligned tuple of f32s). Push via
queue.write_buffer(buf, 0, bytemuck::bytes_of(¶ms)).
Enums§
Constants§
- SNOW_
MATERIAL_ NAME - Material name as authored in snow.tlisp. Use this to look up the material in the compiled graph or to bind a wgpu pipeline by name.
- SNOW_
TLISP - The snow.tlisp graph topology — embedded at compile time.
- SNOW_
UNIFORM_ RESOURCE - Uniform-buffer resource name as authored in snow.tlisp.
- SNOW_
UNIFORM_ SIZE - Uniform-buffer byte size declared in snow.tlisp.
SnowParamsis exactly this many bytes; if you change the struct, update the .tlisp. - SNOW_
WGSL - The snow.wgsl fragment shader — embedded at compile time.