@vitreajs/vitrea 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/dist/{dist-RGWZAZ6J.js → dist-OHNXYEZP.js} +125 -34
- package/dist/dist-OHNXYEZP.js.map +1 -0
- package/dist/index.d.ts +146 -24
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/dist-RGWZAZ6J.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -2031,6 +2031,111 @@ interface MaterialProfile {
|
|
|
2031
2031
|
* 0.0174.
|
|
2032
2032
|
*/
|
|
2033
2033
|
readonly sizeScatterSpanMax: number;
|
|
2034
|
+
/**
|
|
2035
|
+
* **The body's second scale** (W15 G1, from the measurement of claims §5.69
|
|
2036
|
+
* §1–§2) — the heavy width's gain, the deep value's floor and the deep
|
|
2037
|
+
* value's span top, each read again at dpr 2.
|
|
2038
|
+
*
|
|
2039
|
+
* At 2x the reference's body is a different object from the one the three
|
|
2040
|
+
* constants above describe, and §5.69 measured all of it: the deep interior
|
|
2041
|
+
* is FULLY heavy on the two largest spans and 0.90–0.95 heavy on `rrect-md`
|
|
2042
|
+
* (§2), where the 1x span curve leaves a sharp share of 0.24–0.36 there, and
|
|
2043
|
+
* the heavy component's own width is 8–11 device px against the 1x law's 10
|
|
2044
|
+
* CSS px (§1). One curve fitted at 1x cannot be both, so the deep value's two
|
|
2045
|
+
* constants and the gain get a second reading rather than a scale factor —
|
|
2046
|
+
* the same shape the ramp's anchors already have.
|
|
2047
|
+
*
|
|
2048
|
+
* Each is interpolated by `rampAtScale`: held at the 1x constant at dpr ≤ 1,
|
|
2049
|
+
* at this one from dpr 2 up, linear between. **At dpr 1 every one of them is
|
|
2050
|
+
* inert by construction, whatever it says** — W15's binding rule — so the 1x
|
|
2051
|
+
* material is byte-identical to the W13 bed and the landing's confirmation
|
|
2052
|
+
* measured exactly that: 49 of 49 1x GPU cells identical to the bed with
|
|
2053
|
+
* every capture byte-identical (claims §5.70 §8).
|
|
2054
|
+
*
|
|
2055
|
+
* Consumed at draw time, not folded into a constant: `scatterDeepThickness`
|
|
2056
|
+
* takes the ratio for the floor and the span top, the renderer resolves all
|
|
2057
|
+
* three from the viewport's own ratio and hands them to the optics pass
|
|
2058
|
+
* through the uniforms the shader already reads (`scatter.x`, `lensOval.w`
|
|
2059
|
+
* and `size.x`), and `scatterThickness`, `scatterSharpShare` and the ramp's
|
|
2060
|
+
* area-average projection read the resolved deep value.
|
|
2061
|
+
*
|
|
2062
|
+
* **FITTED** by W15 G1's runtime sweep at
|
|
2063
|
+
* `--profile apple-macos-26.5-2x-light-standard` on the calibration set, the
|
|
2064
|
+
* holdout untouched, and landed at the values below (claims §5.70 §2 and §8;
|
|
2065
|
+
* the four sweeps `results/2026-09-04-w15-body-2x/g1/stage1..stage3` and the
|
|
2066
|
+
* confirmation `confirm-3`, whose 2x holdout was read once for this
|
|
2067
|
+
* configuration). The rule W13 wrote after the paper model over-credited the
|
|
2068
|
+
* mip chain's heavy tap (§5.58 §1) held: no constant here lands on a paper
|
|
2069
|
+
* prediction, and the sweep contradicted the paper estimate.
|
|
2070
|
+
*
|
|
2071
|
+
* **The gain, 4.8.** Stage 2c swept it over 4.0 / 4.4 / 4.8 / 5.2 at the
|
|
2072
|
+
* chosen base and found an INTERIOR MINIMUM at 4.8 — the interior spread
|
|
2073
|
+
* against native reading 0.0335 / 0.0214 / 0.0120 / 0.0217 with the band's
|
|
2074
|
+
* rise at its top too. Through `bodySigmaCssFor` that is a heavy width of
|
|
2075
|
+
* **6 device px** at dpr 2, NARROWER than the 8–11 device px §5.69 §1
|
|
2076
|
+
* bounded as a Gaussian: the estimator carries ±40% on a real capture of a
|
|
2077
|
+
* known law (§5.69 §3) and the mip chain's tap is not a Gaussian, so the
|
|
2078
|
+
* renderer is the fitting instrument and 6 is the width it draws best.
|
|
2079
|
+
*
|
|
2080
|
+
* **The floor, 1.0** — the deep value FULLY heavy at dpr 2, which is what
|
|
2081
|
+
* G0's deep windows read on the two largest spans (§5.69 §2). `kDeep` is
|
|
2082
|
+
* therefore 1 at every span at this ratio, and the depth ramp above it is the
|
|
2083
|
+
* whole body (§5.70 §1).
|
|
2084
|
+
*
|
|
2085
|
+
* **The span top, 256** — the 1x value, unchanged, because a floor of 1
|
|
2086
|
+
* leaves the deep value nothing to rise to and the top has no work at this
|
|
2087
|
+
* ratio. Stage 1 swept it against 128 and the bed did not ask for the change.
|
|
2088
|
+
*/
|
|
2089
|
+
readonly sizeScatterGainMax2x: number;
|
|
2090
|
+
readonly sizeScatterFloor2x: number;
|
|
2091
|
+
readonly sizeScatterSpanMax2x: number;
|
|
2092
|
+
/**
|
|
2093
|
+
* **The heavy width's gain at the TOP of the scatter span curve, at dpr 2**
|
|
2094
|
+
* (W15 G1's re-form, from claims §5.70 §4 and §7 and the measurement of
|
|
2095
|
+
* §5.69 §1) — the second-scale term that lets the 2x heavy width GROW with
|
|
2096
|
+
* the span instead of being one number for the whole bed.
|
|
2097
|
+
*
|
|
2098
|
+
* `sizeScatterGainMax2x` above is one gain at dpr 2, and the sweep that fitted
|
|
2099
|
+
* it read the calibration cells, whose spans are 32–128. The reference's heavy
|
|
2100
|
+
* kernel is not one width: §5.69 §1's bounded per-span fit reads 8.0 / 7.5 /
|
|
2101
|
+
* 8.0 / 9.0 / 11.0 device px across the bed's spans, a ratio of 1.375 between
|
|
2102
|
+
* span 160 and span 96. Landing the single gain accordingly left the largest
|
|
2103
|
+
* span's deep interior about 40% too structured (`rrect-lg` at 2x, spread
|
|
2104
|
+
* 0.1134 against the reference's 0.0810, claims §5.70 §4) while every smaller
|
|
2105
|
+
* cell rose. So the gain takes a second grading, in SPAN:
|
|
2106
|
+
*
|
|
2107
|
+
* ```
|
|
2108
|
+
* gain(span, dpr) = gainAtScale(dpr)
|
|
2109
|
+
* + (gainFar(dpr) − gainAtScale(dpr))
|
|
2110
|
+
* · smoothstep(sizeSpanMax, sizeScatterSpanMax(dpr), span)
|
|
2111
|
+
* ```
|
|
2112
|
+
*
|
|
2113
|
+
* with `gainAtScale` the existing `scatterGainAtScale` and `gainFar` this
|
|
2114
|
+
* constant interpolated by `rampAtScale` from `sizeScatterGainMax`. The curve
|
|
2115
|
+
* is not a new span statistic: it is the same smoothstep the fourth form's
|
|
2116
|
+
* far-anchor decline already rides (`scatterRampStart`), so the width and the
|
|
2117
|
+
* ramp's start move along one curve above the thickness knee.
|
|
2118
|
+
*
|
|
2119
|
+
* **Inert at dpr 1 by construction.** `gainFar` interpolates from
|
|
2120
|
+
* `sizeScatterGainMax` — the 1x gain, not this constant — so at dpr ≤ 1 the
|
|
2121
|
+
* far gain IS the base gain and the whole term is a flat no-op whatever this
|
|
2122
|
+
* says. That is W15's binding rule (the 1x material does not move) discharged
|
|
2123
|
+
* by the shape of the formula rather than by a capture.
|
|
2124
|
+
*
|
|
2125
|
+
* **LANDED at 9.9** (claims §5.70 §8; W15 Decision Log 3, the user's landing
|
|
2126
|
+
* "the re-form"), and the value is G0's rather than the holdout row's: §5.69
|
|
2127
|
+
* §1's bounded per-span reading is 8 device px at span 96 and 11 at 160, a
|
|
2128
|
+
* ratio of 1.375, and this curve reads 0.352 at span 160, so 4.8 + (9.9 −
|
|
2129
|
+
* 4.8) · 0.352 reproduces that ratio over the base gain of 6 device px. The
|
|
2130
|
+
* heavy width at dpr 2 is therefore 6.0 device px at spans ≤ 96, 6.7 at 128,
|
|
2131
|
+
* 8.2 at 160 and 12.4 at 256 and beyond. The calibration cells neither chose
|
|
2132
|
+
* the value nor rejected it — `stage3` swept 4.8 / 7.5 / 9.9 / 12.5 and only
|
|
2133
|
+
* `rrect-ml` (span 128, a tenth of the grading) moves, its interior spread
|
|
2134
|
+
* 0.1125 → 0.0993 against native 0.1018 at 9.9, which is the sweep's best on
|
|
2135
|
+
* its own objective. The confirmation's holdout `rrect-lg` rose 0.9661 →
|
|
2136
|
+
* 0.9762 with its interior spread 0.0721 against native 0.0810.
|
|
2137
|
+
*/
|
|
2138
|
+
readonly sizeScatterGainFar2x: number;
|
|
2034
2139
|
/**
|
|
2035
2140
|
* **The body's depth ramp** (W13 G1, from the measurement of claims §5.61 §2
|
|
2036
2141
|
* and the re-forming its runtime sweep forced) — a near-contour excursion on
|
|
@@ -2113,15 +2218,15 @@ interface MaterialProfile {
|
|
|
2113
2218
|
* + (far − thick) · smoothstep(sizeSpanMax, sizeScatterSpanMax, span)
|
|
2114
2219
|
*
|
|
2115
2220
|
* Two curves the material already has, one more constant per scale, and no
|
|
2116
|
-
* new span statistic. At 2x
|
|
2117
|
-
* the
|
|
2118
|
-
*
|
|
2119
|
-
*
|
|
2221
|
+
* new span statistic. At 2x the decline is switched off rather than inverted:
|
|
2222
|
+
* `far` and `thick` carry the same number since W15 G1, because G0 read the
|
|
2223
|
+
* reference's 2x start FLAT across the thick spans (claims §5.69 §2, §5.70 §6
|
|
2224
|
+
* (iv)) — the decline is a 1x feature of this form.
|
|
2120
2225
|
*
|
|
2121
|
-
*
|
|
2122
|
-
*
|
|
2123
|
-
*
|
|
2124
|
-
* carry
|
|
2226
|
+
* The 1x three are FITTED (W13 G1's third and fourth sweeps) and the 2x four
|
|
2227
|
+
* are FITTED or read from G0 by W15 G1 (claims §5.70 §2 and §8); no constant
|
|
2228
|
+
* here lands on a paper prediction, because the paper model over-credited the
|
|
2229
|
+
* mip chain's heavy tap once already (§5.58 §1). What they carry:
|
|
2125
2230
|
*
|
|
2126
2231
|
* **1x — thin 0.64, thick 0.52, reach 120 device px.** G0's own start
|
|
2127
2232
|
* readings are 0.637 on `rrect-sm` and 0.642 on the capsule at the thin end
|
|
@@ -2132,20 +2237,27 @@ interface MaterialProfile {
|
|
|
2132
2237
|
* and is also G0's reading on that cell, so the fit is not traded against the
|
|
2133
2238
|
* form's own arithmetic.
|
|
2134
2239
|
*
|
|
2135
|
-
* **2x — thin 0.46, thick 0.
|
|
2136
|
-
*
|
|
2137
|
-
*
|
|
2138
|
-
*
|
|
2139
|
-
*
|
|
2140
|
-
*
|
|
2141
|
-
*
|
|
2142
|
-
*
|
|
2143
|
-
*
|
|
2144
|
-
*
|
|
2145
|
-
*
|
|
2146
|
-
*
|
|
2147
|
-
*
|
|
2148
|
-
*
|
|
2240
|
+
* **2x — thin 0.46, thick 0.21, far 0.21, reach 100 device px, and the ramp
|
|
2241
|
+
* is now the WHOLE body above the deep value** (W15 G1, claims §5.70 §1–§2).
|
|
2242
|
+
* W13 left these inert for the deep value's sake: at `sizeScatterFloor2x` 0.4
|
|
2243
|
+
* every anchor sat below its cell's deep sharp share and `max(0, s₀ − sDeep)`
|
|
2244
|
+
* was bit-exactly zero on the whole bed. W15 G1 fitted that deep value fully
|
|
2245
|
+
* heavy (`sizeScatterFloor2x` 1.0), so the deep sharp share at dpr 2 is 0 and
|
|
2246
|
+
* the anchors act on the numbers they were carrying — which is why the wave's
|
|
2247
|
+
* three gaps turned out to be one gap (§5.70 §6 (i)).
|
|
2248
|
+
*
|
|
2249
|
+
* The values are G0's readings where the sweep was flat and the sweep's where
|
|
2250
|
+
* it was not. **Thin 0.46** is G0's u 6 reading exactly (0.494 / 0.468 on the
|
|
2251
|
+
* thin cells) and stage 2b's best, over a top nine points within 0.002 of
|
|
2252
|
+
* each other. **Thick and far 0.21**: G0's 2x starts on the thick cells are
|
|
2253
|
+
* 0.163 / 0.199 / 0.210 at their own widths and 0.192 / 0.199 / 0.195 at one
|
|
2254
|
+
* common width — flat with span, not declining — so the two anchors take one
|
|
2255
|
+
* number and the fourth form's decline is off at this scale; stage 2a
|
|
2256
|
+
* measured the objective flat over 0.17–0.25 and worse at 0.33. **Reach 100
|
|
2257
|
+
* device px** = 50 CSS px against G0's measured 49 / 53 / 56, and stage 2b
|
|
2258
|
+
* found 100 and 130 indifferent.
|
|
2259
|
+
*
|
|
2260
|
+
* **far — 0.20 at 1x (FITTED on the W14 bed), 0.21 at 2x.** The fourth
|
|
2149
2261
|
* sweep (`results/2026-09-03-w13-ramp/g1/sweep-4/`) swept far over eight
|
|
2150
2262
|
* points from 0.52 (the third form) down to 0.15: S1 and S4 pass at every
|
|
2151
2263
|
* one, only `rrect-ml`'s rows move and they improve monotonically as far
|
|
@@ -2155,8 +2267,14 @@ interface MaterialProfile {
|
|
|
2155
2267
|
* is far = 0.207 through this form — and 0.20 is the measured grid point that
|
|
2156
2268
|
* carries it. The confirmation read `rrect-lg` at `ssimMean` +0.0056 against
|
|
2157
2269
|
* the W14 bed (the third form: −0.0026) with its interior 12% over the
|
|
2158
|
-
* reference (from 33% over). At 2x far
|
|
2159
|
-
*
|
|
2270
|
+
* reference (from 33% over). At 2x far equals the thick anchor, so the start
|
|
2271
|
+
* is flat past the knee at that scale — G0's own reading (§5.69 §2), and the
|
|
2272
|
+
* holdout's band supports it (`rrect-lg` +0.0106, claims §5.70 §8).
|
|
2273
|
+
*
|
|
2274
|
+
* At dpr 1 none of the 2x four is read at all: `rampAtScale` holds every one
|
|
2275
|
+
* of them at its 1x anchor below dpr 1, so the 1x material is byte-identical
|
|
2276
|
+
* to the W13 bed and the landing's confirmation measured that on 49 of 49 1x
|
|
2277
|
+
* GPU cells (claims §5.70 §8).
|
|
2160
2278
|
*/
|
|
2161
2279
|
readonly sizeScatterRampStartThin1x: number;
|
|
2162
2280
|
readonly sizeScatterRampStartThick1x: number;
|
|
@@ -2438,6 +2556,10 @@ interface MaterialProfilePatch {
|
|
|
2438
2556
|
readonly sizeScatterGainMax?: number;
|
|
2439
2557
|
readonly sizeScatterFloor?: number;
|
|
2440
2558
|
readonly sizeScatterSpanMax?: number;
|
|
2559
|
+
readonly sizeScatterGainMax2x?: number;
|
|
2560
|
+
readonly sizeScatterFloor2x?: number;
|
|
2561
|
+
readonly sizeScatterSpanMax2x?: number;
|
|
2562
|
+
readonly sizeScatterGainFar2x?: number;
|
|
2441
2563
|
readonly sizeScatterRampStartThin1x?: number;
|
|
2442
2564
|
readonly sizeScatterRampStartThick1x?: number;
|
|
2443
2565
|
readonly sizeScatterRampStartFar1x?: number;
|
package/dist/index.js
CHANGED
|
@@ -1092,7 +1092,7 @@ function isHealthy(state) {
|
|
|
1092
1092
|
|
|
1093
1093
|
// src/renderer-seam.ts
|
|
1094
1094
|
async function loadWebGPURendererModule() {
|
|
1095
|
-
return import('./dist-
|
|
1095
|
+
return import('./dist-OHNXYEZP.js');
|
|
1096
1096
|
}
|
|
1097
1097
|
async function loadWebGPURenderer() {
|
|
1098
1098
|
const { createWebGPURenderer } = await loadWebGPURendererModule();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitreajs/vitrea",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Framework-agnostic Liquid Glass material runtime: scene model, capability resolution, material policy, accessibility policy.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/SSFSKIM/designer",
|