vireuikit 0.3.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 — colored vapor, condensation and light tracks — that plugs
6
- 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 @@ into VireGlass's WebGL2 renderer as a backdrop pass.
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,65 +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: colored vapor and condensation
48
-
49
- `createMediumBackdrop()` returns a `VireGlassBackdropPass` factory: a self-contained fluid
50
- simulation (curl-noise vapor, condensing droplets, decaying light tracks) that composites straight
51
- into the texture VireGlass's lens samples — no offscreen canvas, no readback.
52
-
53
- ```ts
54
- import { createMediumBackdrop } from 'vireuikit/web';
55
- import { createVireGlassRenderer } from 'vireglass/web';
56
-
57
- const medium = createMediumBackdrop();
58
- const renderer = createVireGlassRenderer(canvas);
59
- renderer.resize(canvas.width, canvas.height);
60
-
61
- let last = performance.now();
62
- function frame(now: number) {
63
- const dt = (now - last) / 1000;
64
- last = now;
65
- renderer.render({
66
- density: window.devicePixelRatio,
67
- debug: 'normal',
68
- pieces,
69
- backdrop: medium.pass({ gridWidth: 128, gridHeight: 72, dt }),
70
- });
71
- requestAnimationFrame(frame);
72
- }
73
- ```
74
-
75
- Turbulence and light-track emission in response to playback come from `createMediumDynamics()`,
76
- which is platform-neutral: feed `step()` a playback state, BPM and a deterministic position, and
77
- pass the `emissions` it returns on as `MediumFrame.emissions`.
78
-
79
- The backdrop reads as a chamber seen from the side, not a flat field, without a second simulation:
80
- the composite samples the same vapor/condensate grid twice, once at identity and once at a larger
81
- scale and a fixed offset (`MEDIUM_DEFAULTS.depthFarScale`/`depthFarOffsetFrac`, the offset as a
82
- 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`. An
84
- 8-tap rotated ring blur on that far read (`depthFarBlurRadius`) supplies aerial perspective's
85
- softness and lower contrast in the same pass, weighted down (`depthFarWeight`) so it never competes
86
- with the near plane; the ring (not an axis-aligned box) keeps that blur from turning a residual
87
- seam or resize artifact into parallel straight lines. Gravity is two separate properties: a small
88
- downward drift on vapor's own velocity (`gravityVaporDrift`, a motion cue only — a uniform drift on
89
- this periodic grid cannot itself accumulate density) and a compositing-only density boost near the
90
- bottom of the frame (`gravityBottomBoost`/`gravityBottomBoostStart`, a steady-state property that
91
- cannot affect the conserved water total) that actually produces the "denser at the bottom" reading.
92
- Condensate settling adds a second, always-on share of the ambient curl field's own sideways push
93
- (`condensateSettleWiggle`) so a droplet falling at a constant speed doesn't trace a dead-straight
94
- vertical line when turbulence is otherwise low. Each emitted track also carries a `depth` (0 far …
95
- 1 near) that scales its own width and intensity, so a track reads thinner, dimmer and softer the
96
- farther back it lives.
97
-
98
- The curl-noise potential itself is periodic over the simulation grid in space, the same way it
99
- already was in time: each octave's spatial frequency is adjusted, per grid size, to the nearest
100
- value that makes a full grid width (or height) an exact integer number of lattice cells
101
- (`computeMediumSpatialPeriods`) — so velocity never jumps at the domain's own wrap, and the far
102
- plane's tile boundary reads as an ordinary point in the field rather than a seam. The near plane's
103
- vapor and condensate reads use cubic B-spline reconstruction (4 bilinear taps) instead of plain
104
- bilinear, so the simulation grid's own cells don't read as squares at typical (coarse) grid sizes.
105
-
106
46
  ## License
107
47
 
108
48
  Apache-2.0. See [LICENSE](./LICENSE) and [NOTICE](./NOTICE).