amenui
en·中 github ↗ v0.0.1
01docs 02components 03lab 04works
en·中github ↗
×

docs / lab / silk docs / lab /

Silk

On this page ▾
  1. Formula
  2. Parameters
  3. How it is made
drawn by amenuiopen ↗

Many marks carried by the curl of drifting noise (a flow without sources, so they never bunch), plus a flow grid the pointer's velocity is stirred into and that fades back. Each mark is drawn as the stroke it travelled. The count is a request to the frame budget.

Formula

text
ṗ = v · s · curl n(p/s) + u(p);  u += v_ptr · e^(−d²/24²);  u ×= e^(−dt/τ)

Parameters

Every number is a number control under the cell (type, arrow keys, drag sideways); none is a slider.

namedefaultrangewhat it is
N1400100–20000marks asked for
v22 px/s0–60drift speed
s60 px10–200noise feature size
τ0.6 s0.05–3how long a stir lasts

How it is made

field::Swarm::advect, field::curl, field::Flow::stir; budget::grant(N) says how many this frame may move. The code is examples/lab/silk.rs.