vireuikit 0.4.0 → 0.5.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/NOTICE CHANGED
@@ -4,8 +4,5 @@ Copyright 2026 Danil Kotlaev
4
4
  This product includes software developed as part of the vireSpace platform
5
5
  (https://github.com/pruffit/vire).
6
6
 
7
- Built on VireGlass (https://github.com/pruffit/vireglass). The Oklab color-mixing math
8
- implements the model published by Björn Ottosson (https://bottosson.github.io/posts/oklab/).
9
- The MacCormack advection scheme implements the method described in Selle, Fedkiw, Kim, Liu and
10
- Rossignac, "An Unconditionally Stable MacCormack Method" (2007). No third-party code or assets
11
- are included in or distributed with this software; these are citations, not redistribution.
7
+ Built on VireGlass (https://github.com/pruffit/vireglass). No third-party code or assets are
8
+ included in or distributed with this software.
package/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  # VireUIKit
2
2
 
3
3
  A UI kit built on top of [VireGlass](https://github.com/pruffit/vireglass)'s physically-derived
4
- glass material: atom state and press/hover/selection behavior for controls, a capsule-to-target
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.
4
+ glass material: atom state and press/hover/selection behavior for controls, and a
5
+ capsule-to-target growth morph.
7
6
 
8
7
  **Status: 0.x.** The API can still change between minor versions.
9
8
 
@@ -13,8 +12,8 @@ condensation tracks — that plugs into VireGlass's WebGL2 renderer as a backdro
13
12
  npm install vireuikit vireglass
14
13
  ```
15
14
 
16
- `vireglass` is a peer dependency — this package draws on its material model and its WebGL2 render
17
- pipeline rather than shipping its own.
15
+ `vireglass` is a peer dependency — this package draws on its material model rather than
16
+ shipping its own.
18
17
 
19
18
  ## Atom state and morph
20
19
 
@@ -44,85 +43,6 @@ const frame = growthFrame(sourceShape, targetShape, anchorPoint, growthPhase(sta
44
43
  // frame.body: the shape to draw as glass this frame.
45
44
  ```
46
45
 
47
- ## GPU backdrop: a lit chamber, not colored smoke
48
-
49
- `createMediumBackdrop()` returns a `VireGlassBackdropPass` factory: a self-contained fluid
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.
71
-
72
- ```ts
73
- import { createMediumBackdrop } from 'vireuikit/web';
74
- import { createVireGlassRenderer } from 'vireglass/web';
75
-
76
- const medium = createMediumBackdrop();
77
- const renderer = createVireGlassRenderer(canvas);
78
- renderer.resize(canvas.width, canvas.height);
79
-
80
- let last = performance.now();
81
- function frame(now: number) {
82
- const dt = (now - last) / 1000;
83
- last = now;
84
- renderer.render({
85
- density: window.devicePixelRatio,
86
- debug: 'normal',
87
- pieces,
88
- backdrop: medium.pass({ gridWidth: 128, gridHeight: 72, dt }),
89
- });
90
- requestAnimationFrame(frame);
91
- }
92
- ```
93
-
94
- Turbulence and light-track emission in response to playback come from `createMediumDynamics()`,
95
- which is platform-neutral: feed `step()` a playback state, BPM and a deterministic position, and
96
- pass the `emissions` it returns on as `MediumFrame.emissions`.
97
-
98
- The backdrop reads as a chamber seen from the side, not a flat field, without a second simulation:
99
- the composite samples the same vapor/condensate grid twice, once at identity and once at a larger
100
- scale and a fixed offset (`MEDIUM_DEFAULTS.depthFarScale`/`depthFarOffsetFrac`, the offset as a
101
- fraction of the grid so it stays clear of the wrap at any grid size) — the far read is both slower
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.
125
-
126
46
  ## License
127
47
 
128
48
  Apache-2.0. See [LICENSE](./LICENSE) and [NOTICE](./NOTICE).