vireuikit 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -15
- package/dist/{chunk-BV5P6MF7.js → chunk-VY22O2II.js} +485 -46
- package/dist/chunk-VY22O2II.js.map +1 -0
- package/dist/{dynamics-DelasYER.d.cts → dynamics-DqGk_f1n.d.cts} +170 -14
- package/dist/{dynamics-DelasYER.d.ts → dynamics-DqGk_f1n.d.ts} +170 -14
- package/dist/index.cjs +434 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.js +1 -1
- package/dist/web/index.cjs +984 -145
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +63 -2
- package/dist/web/index.d.ts +63 -2
- package/dist/web/index.js +462 -13
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-BV5P6MF7.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A UI kit built on top of [VireGlass](https://github.com/pruffit/vireglass)'s physically-derived
|
|
4
4
|
glass material: atom state and press/hover/selection behavior for controls, a capsule-to-target
|
|
5
|
-
growth morph, and a live GPU backdrop —
|
|
6
|
-
into VireGlass's WebGL2 renderer as a backdrop pass.
|
|
5
|
+
growth morph, and a live GPU backdrop — a lit cloud-chamber: dark mist, static lights, and
|
|
6
|
+
condensation tracks — that plugs into VireGlass's WebGL2 renderer as a backdrop pass.
|
|
7
7
|
|
|
8
8
|
**Status: 0.x.** The API can still change between minor versions.
|
|
9
9
|
|
|
@@ -44,11 +44,30 @@ const frame = growthFrame(sourceShape, targetShape, anchorPoint, growthPhase(sta
|
|
|
44
44
|
// frame.body: the shape to draw as glass this frame.
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
## GPU backdrop:
|
|
47
|
+
## GPU backdrop: a lit chamber, not colored smoke
|
|
48
48
|
|
|
49
49
|
`createMediumBackdrop()` returns a `VireGlassBackdropPass` factory: a self-contained fluid
|
|
50
|
-
simulation (curl-noise vapor, condensing droplets, decaying
|
|
51
|
-
into the texture VireGlass's lens samples — no offscreen canvas, no readback.
|
|
50
|
+
simulation (curl-noise vapor, condensing droplets, decaying condensation tracks) that composites
|
|
51
|
+
straight into the texture VireGlass's lens samples — no offscreen canvas, no readback.
|
|
52
|
+
|
|
53
|
+
The chamber itself is dark; what's visible is light scattered by vapor, droplets and tracks, not
|
|
54
|
+
the gas's own color. `lights` (`VireUIKitMediumParams`, up to `MEDIUM_MAX_LIGHTS`) are static
|
|
55
|
+
sources — position, direction, cone half-angle, falloff, color, intensity. The defaults are an edge
|
|
56
|
+
strip along the chamber floor and two spotlights placed above the frame, aimed down across it. A
|
|
57
|
+
spotlight has no drawn edge: its beam is a soft lobe with static shafts fanning out from the lamp,
|
|
58
|
+
dimmed by the gas between the lamp and each point (a grid-resolution shadow pass,
|
|
59
|
+
`shadowExtinction`), so beams show where there is vapor to scatter them. `lightRigForCover`/
|
|
60
|
+
`lightRigForCharacter` tint the spotlights toward a cover's hue like colored gels and leave the
|
|
61
|
+
strip near neutral. Vapor species (`channelColors`) fold into a near-neutral ambient base;
|
|
62
|
+
`channelScatter` is how strongly each species scatters light.
|
|
63
|
+
|
|
64
|
+
Tracks come in three kinds (`MEDIUM_TRACK_PRESETS`): `alpha` (short, thick, thickening toward its
|
|
65
|
+
end — the playing source sprays a burst of them from the cover's position, a few on the beat and
|
|
66
|
+
the rest over the next 1.6 s), `electron` (thin, wiggly) and `muon` (long, straight,
|
|
67
|
+
thin). The calm state schedules a lone electron or muon every 8–20 s from no source at all. Each track is drawn twice: as a soft residue stamped into the simulation grid, and
|
|
68
|
+
as a crisp droplet chain in content pixels (`trackLayerAmount`, `MEDIUM_TRACK_LAYER_LOOK`) that
|
|
69
|
+
appears at full length, then broadens, sags and fades over one to two seconds. Tracks are lit by
|
|
70
|
+
the same lights, plus `trackLightFloor` so one is never fully dark.
|
|
52
71
|
|
|
53
72
|
```ts
|
|
54
73
|
import { createMediumBackdrop } from 'vireuikit/web';
|
|
@@ -80,16 +99,29 @@ The backdrop reads as a chamber seen from the side, not a flat field, without a
|
|
|
80
99
|
the composite samples the same vapor/condensate grid twice, once at identity and once at a larger
|
|
81
100
|
scale and a fixed offset (`MEDIUM_DEFAULTS.depthFarScale`/`depthFarOffsetFrac`, the offset as a
|
|
82
101
|
fraction of the grid so it stays clear of the wrap at any grid size) — the far read is both slower
|
|
83
|
-
on screen and finer-grained, since the field's own motion maps to screen motion as `v / scale`.
|
|
84
|
-
|
|
85
|
-
lower contrast in the same pass, weighted down (`depthFarWeight`) so it never competes
|
|
86
|
-
plane
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
on screen and finer-grained, since the field's own motion maps to screen motion as `v / scale`. An
|
|
103
|
+
8-tap rotated ring blur on that far read (`depthFarBlurRadius`) supplies aerial perspective's
|
|
104
|
+
softness and lower contrast in the same pass, weighted down (`depthFarWeight`) so it never competes
|
|
105
|
+
with the near plane; the ring (not an axis-aligned box) keeps that blur from turning a residual
|
|
106
|
+
seam or resize artifact into parallel straight lines. Gravity is two separate properties: a small
|
|
107
|
+
downward drift on vapor's own velocity (`gravityVaporDrift`, a motion cue only — a uniform drift on
|
|
108
|
+
this periodic grid cannot itself accumulate density) and a compositing-only density boost near the
|
|
109
|
+
bottom of the frame (`gravityBottomBoost`/`gravityBottomBoostStart`, a steady-state property that
|
|
110
|
+
cannot affect the conserved water total) that actually produces the "denser at the bottom" reading.
|
|
111
|
+
Condensate settling adds a second, always-on share of the ambient curl field's own sideways push
|
|
112
|
+
(`condensateSettleWiggle`) so a droplet falling at a constant speed doesn't trace a dead-straight
|
|
113
|
+
vertical line when turbulence is otherwise low. Each emitted track also carries a `depth` (0 far …
|
|
114
|
+
1 near) that scales its own width and intensity, so a far track reads thinner, dimmer and finer,
|
|
115
|
+
while the nearest tracks read a little LARGER than the base preset, not merely full-size — a
|
|
116
|
+
Gaussian stamp's edge softness scales with its own width, so the same knob gives depth of field too.
|
|
117
|
+
|
|
118
|
+
The curl-noise potential itself is periodic over the simulation grid in space, the same way it
|
|
119
|
+
already was in time: each octave's spatial frequency is adjusted, per grid size, to the nearest
|
|
120
|
+
value that makes a full grid width (or height) an exact integer number of lattice cells
|
|
121
|
+
(`computeMediumSpatialPeriods`) — so velocity never jumps at the domain's own wrap, and the far
|
|
122
|
+
plane's tile boundary reads as an ordinary point in the field rather than a seam. The near plane's
|
|
123
|
+
vapor and condensate reads use cubic B-spline reconstruction (4 bilinear taps) instead of plain
|
|
124
|
+
bilinear, so the simulation grid's own cells don't read as squares at typical (coarse) grid sizes.
|
|
93
125
|
|
|
94
126
|
## License
|
|
95
127
|
|