Skip to main content

Crate engawa_snow

Crate engawa_snow 

Source
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§

SnowEffect
The shipped snow effect. Holds the compiled engawa RenderGraph; consumers feed it to any Dispatcher impl (engawa-wgpu, or a custom one).
SnowParams
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(&params)).

Enums§

SnowError

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. SnowParams is exactly this many bytes; if you change the struct, update the .tlisp.
SNOW_WGSL
The snow.wgsl fragment shader — embedded at compile time.