@vitreajs/vitrea 0.10.0 → 0.13.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.
@@ -255,9 +255,167 @@ var DEFAULT_MATERIAL_PROFILE = {
255
255
  tint: srgbToLinear(SRGB_WHITE_TINT),
256
256
  tintAlpha: 0.46,
257
257
  rimWidth: 1.5,
258
- rimAlpha: 0.18,
258
+ /*
259
+ * REFITTED 0.18 → 0.844 (W23 G1; claims §5.100 §4, W23 Decision Log 2 (a)),
260
+ * as the intercept of the amplitude law below rather than as the whole rim.
261
+ *
262
+ * It is not the same quantity it was. Before W23 this constant WAS the rim,
263
+ * and 0.18 drew the same +0.060…0.078 of linear luminance at the contour on
264
+ * every cell of the light bed against a reference of +0.10…+0.26; now it is
265
+ * one of two terms, and on a light surface whose own level is 0.48 the pair
266
+ * draws `0.844 − 0.628 × 0.48 = 0.542` of amplitude — three times the old
267
+ * constant, for a rim about a third brighter than the old one at the
268
+ * contour, because the amplitude is not the rim: the band weight `W` the
269
+ * first two CSS px carry is 0.38…0.46 (claims §5.100 §4).
270
+ *
271
+ * Fitted on vitrea's OWN captures, not on a prediction: the shader's rim is
272
+ * linear in each constant, so a base capture at the shipped `rimAlpha`
273
+ * gives each cell's band weight and one rendered `rimLevelGain` point gives
274
+ * `W × L`, and the pair is solved by least squares over 40 rendered solid
275
+ * rows on 10 cells. **The canonical bed cannot fit it** — over a solid
276
+ * backdrop, unclipped, uncollapsed and outside the holdout the light bed
277
+ * leaves exactly two cells at bodies 0.48 and 0.43, and two nearly collinear
278
+ * rows separate no slope from an intercept (solved on 1x alone they give
279
+ * (0.302, +0.569) and on 2x alone (0.383, +0.183), a factor of three apart
280
+ * and both with the wrong sign) — so W9's light probe grid, whose bodies
281
+ * span 0.43…0.93, is what conditions the solve (9.7). That the routine
282
+ * harness captures no probe grid is recorded as a gap, not fixed here.
283
+ *
284
+ * Rendered, on the rows the wave's acceptance names: the light 1x solid
285
+ * cells go from 0.087 to 0.016 mean |rim − reference| per side (worst 0.168
286
+ * → 0.033) and `dark-solid__rrect-md` from 0.068 to 0.227 against the
287
+ * reference's 0.229.
288
+ *
289
+ * W22 G1 declined this constant on the same rows and that decline is not
290
+ * rewritten (claims §5.94 §3): it was read through the declared box's 3 CSS
291
+ * px band, whose peak-row mean over a dark backdrop carries the corners'
292
+ * backdrop and dilutes a one-pixel line, and it was the right answer to the
293
+ * question that instrument asked. The contour read is a different question.
294
+ */
295
+ rimAlpha: 0.844,
296
+ /*
297
+ * FITTED 1.35 (W23 G1; claims §5.100 §5, Decision Log 2 (d)) — the band at
298
+ * dpr 2, about 10 % narrower than at dpr 1.
299
+ *
300
+ * Two clauses of the wave meet on this constant and they pull opposite
301
+ * ways, which is why it is not simply the minimiser of one of them. The
302
+ * uncollapsed 2x solids want the band NARROW: at 1.5 `dark-solid__rrect-md`
303
+ * reads +0.2467 against the reference's +0.2052 on the light bed, and the
304
+ * rendered ladder point at 1.2 reads +0.1883, so the row's own answer is
305
+ * 1.29. The COLLAPSED cells want it wide, because `rimCollapsed` was
306
+ * fitted through this same band: at 1.5 they read −0.0017 from the
307
+ * reference and at 1.2 −0.0059, which is outside the wave's 0.005.
308
+ *
309
+ * 1.35 leaves the solids at +0.0123 against a bound of 0.03 and the
310
+ * collapsed sides at 0.0038 against a bound of 0.005 — each clause inside
311
+ * its own bound with margin in proportion to how tight that bound is. The
312
+ * joint minimiser over the twelve rows is 1.30, and it is not taken: at
313
+ * 1.30 the collapsed sides read 0.0045 against a 0.005 bound, a margin of
314
+ * 0.0005 on an instrument whose 8-bit resolution at that level is 0.00067.
315
+ *
316
+ * The dark bed does not identify it — its one 2x solid row moves by 0.0061
317
+ * across the whole ladder and is inside the bound at every value — so this
318
+ * is the light bed's constant, checked against the dark bed rather than
319
+ * fitted on it.
320
+ */
321
+ rimWidth2x: 1.35,
259
322
  specularPower: 6,
260
- specularGain: 0.55,
323
+ /*
324
+ * FITTED 0.55 → 0 (W22 G1; claims §5.94 §3, W22 Decision Log 2 (b)). The
325
+ * light reference's rim has no vertical light in it, and the constant that
326
+ * said it did had been fitting a defect.
327
+ *
328
+ * What was measured: the declared-geometry rim per side (the box's outer
329
+ * 3 CSS px, a peak per side) on the five untinted solid calibration cells
330
+ * of the light bed — `light-solid__{capsule-button,rrect-md,rrect-ml}` and
331
+ * `dark-solid__{capsule-button,rrect-md}` — at both backing scales, over
332
+ * eight rendered documents differing in this constant alone.
333
+ *
334
+ * Why per contrast rather than per side: a side's peak under the declared
335
+ * box mixes rim with the background the rounded shape leaves inside a
336
+ * rectangle's band, and the mixture's weight differs between the horizontal
337
+ * and the vertical pair, so only `T−B` and `L−R` — two sides of identical
338
+ * geometry — are clean. A mean pooled over sides is worse than unclean: it
339
+ * PREFERS 0.55, because the specular lifts `dark-solid__rrect-md`'s top row
340
+ * from −0.061 to +0.062 against a reference of +0.047 while leaving its
341
+ * bottom at −0.061 against the same +0.047. It buys one side of a pair by
342
+ * breaking the other, and only the contrast can see that.
343
+ *
344
+ * The rows, and what they say: eleven of the twenty contrast rows separate
345
+ * the constant, and every one of them minimises at 0. The objective is
346
+ * monotone in the gain on both contrasts — mean |Δ| over the separating
347
+ * rows 0.00097 at 0 rising to 0.03102 at 0.55 — and the separating row is
348
+ * `dark-solid__rrect-md` `T−B` at both scales, where the reference splits
349
+ * top from bottom by +0.0002 and this constant at 0.55 splits them by
350
+ * +0.1237 (1x) and +0.1817 (2x).
351
+ *
352
+ * Why it survived three waves of rim work: until W22 gated the specular
353
+ * sweep on a shimmer amplitude, the highlight pass parked a stationary band
354
+ * on the left edge of every resting surface, so `L−R` was unreadable and
355
+ * `T−B` was being fitted beside a defect worth 0.12–0.15 of luminance. With
356
+ * the band gone the reference's own structure is legible — left equal to
357
+ * right to 0.0002, top over bottom by +0.0002 over a dark backdrop and
358
+ * +0.0086…+0.0162 over a bright one — and this term is an order of
359
+ * magnitude larger than anything it was supposed to be reproducing.
360
+ *
361
+ * The `clear` variant's 0.45 does not move: no scene on the calibration bed
362
+ * declares that variant, so it has no rows and nothing to be fitted on.
363
+ * `lightDirection` and `rimAlpha` were read on the same rows and declined
364
+ * (claims §5.94 §3); the direction still feeds the inner shadow through
365
+ * `platform-web`'s `light.xy`, and it is only on the RIM that this fit
366
+ * makes it inert.
367
+ */
368
+ specularGain: 0,
369
+ /*
370
+ * FITTED −0.628 (W23 G1; claims §5.100 §4, W23 Decision Log 2 (a)) — the
371
+ * light rim is a fraction of the body's HEADROOM, and the negative sign is
372
+ * the measurement.
373
+ *
374
+ * On the reference's own solid, unclipped, uncollapsed light sides — 44 of
375
+ * them, bodies 0.4287…0.9326, from both canonical scales and W9's probe
376
+ * grid — the rim falls as the surface brightens: `0.3559 − 0.2752 × base`,
377
+ * mean |residual| 0.0081 where an additive constant reads 0.0249 and a pure
378
+ * screen 0.0168. A pure screen would need the slope to be exactly −α; it is
379
+ * −0.275 against the −0.43 the screen form requires, which the canonical
380
+ * bed's two cells at 0.43 and 0.48 could not have told apart and the probe
381
+ * grid's range can. So the light rim is a white line composited source-over
382
+ * — the form the CSS tier's inset `box-shadow` has always drawn — with an
383
+ * additive part beside it, and this is that composite written once.
384
+ *
385
+ * The gain is steeper here (−0.628) than on the reference (−0.2752) for the
386
+ * same reason `rimAlpha` is larger than the rim: this constant multiplies
387
+ * the shader's per-pixel `rimLuma` before the band weight, and the fit is
388
+ * the one solved on rendered rows.
389
+ */
390
+ rimLevelGain: -0.628,
391
+ /*
392
+ * ADOPTED 1.15 (W24 G2, on G0's fit; claims §5.108 §1, W24 Decision Log 2
393
+ * (a)) — one exponent for both schemes and both scales, and the value at
394
+ * which the most rows meet the wave's clause.
395
+ *
396
+ * The rows, and what they separate. Fitted on the reference's own angular
397
+ * bins over the nineteen untinted solid cells of both canonical beds and
398
+ * both probe grids (285 bins, each cell normalised by its own brightest
399
+ * bin), the joint minimiser is 1.05; the 2x rows — whose arcs the raster
400
+ * actually resolves — give 1.10 light and 1.30 dark, and vitrea's own
401
+ * rendered rows read against the reference give 1.10 ± 0.22 light and
402
+ * 1.24 ± 0.17 dark. The schemes OVERLAP, so what the rows separate is one
403
+ * constant and not two, and 1.15 is where four of the twelve solid rows
404
+ * meet both halves of clause 1 against two at 1.00, two at 1.30 and none
405
+ * at 1.45.
406
+ *
407
+ * What it is not. It is not a per-scale pair: every 2x row wants 1.30–1.45
408
+ * and every 1x row 0.85–1.10, which is a real scale dependence in the
409
+ * reference's own angular contrast (its lit-diagonal bins over its
410
+ * straight-side bins read 1.07 at 1x against 1.39 at 2x on the dark
411
+ * `dark-solid` capsule). A `rimLitExponent2x` sibling on the precedent of
412
+ * `rimWidth2x` would be a third constant fitted on four rows, so the
413
+ * dependence is recorded (W24's Deferred list) rather than carried.
414
+ *
415
+ * The `clear` variant keeps 0 below: no scene on either bed declares it, so
416
+ * it has no rows and nothing to be fitted on (C9a §6.2).
417
+ */
418
+ rimLitExponent: 1.15,
261
419
  shadowDepth: 0.35,
262
420
  /*
263
421
  * REFITTED 0.55 → 0.05 (2026-08-31), and it is the largest single
@@ -282,8 +440,16 @@ var DEFAULT_MATERIAL_PROFILE = {
282
440
  tintAlpha: 0.1,
283
441
  rimWidth: 1.25,
284
442
  rimAlpha: 0.14,
443
+ // No scene on the calibration bed declares this variant, so its rim has no
444
+ // rows: the amplitude law stays at the additive form and the band stays
445
+ // ungraded across the scales (W22's rule for `clear`, C9a §6.2).
446
+ rimWidth2x: 1.25,
285
447
  specularPower: 8,
286
448
  specularGain: 0.45,
449
+ rimLevelGain: 0,
450
+ // No scene declares this variant, so the lit edge has no rows here either
451
+ // and the factor stays inert (C9a §6.2, as `rimLevelGain` above).
452
+ rimLitExponent: 0,
287
453
  shadowDepth: 0.22,
288
454
  shadowAlpha: 0.4,
289
455
  highlight: srgbToLinear(SRGB_WHITE_TINT)
@@ -602,6 +768,122 @@ var DEFAULT_MATERIAL_PROFILE = {
602
768
  * thickness axis now.
603
769
  */
604
770
  backdropToneSizeBias: 0.05,
771
+ /*
772
+ * FITTED 0.017 at dpr 1 and 0.070 at dpr 2 (W24 G1, landed by G2; claims
773
+ * §5.108 §2, W24 Decision Log 2 (b) and (d)) — one pair for both schemes, on
774
+ * the peak of the collapsed `impulse__capsule-button`'s centre dot.
775
+ *
776
+ * At `k` 1 the composite is exactly `(1 − c)·toneColour + c·backdrop`, so the
777
+ * dot's excess is LINEAR in this constant and one non-zero rendered rung fixes
778
+ * it: at c 0.10 vitrea's collapsed capsule passes +0.0386 at 1x and +0.0363 at
779
+ * 2x where the reference passes +0.0066 and +0.0254, which gives 0.0171 and
780
+ * 0.0700. Rendered back at the fit the dot lands +0.0067 and +0.0256 —
781
+ * clause 2's peak met to ±0.0002 against a bound of 0.005 — and the structure
782
+ * that had been passing 0.0000 passes 0.0066 at 1x and 0.0250 at 2x against
783
+ * the reference's 0.0104 and 0.0205.
784
+ *
785
+ * The light and dark rungs read the same numbers to four decimals on that
786
+ * cell, which is why this is one pair in both schemes and lives on the shared
787
+ * default rather than in a per-scheme patch. What separates the two ANCHORS is
788
+ * the kernel and not the scheme: the reference transmits through σ 2.63 device
789
+ * px at 1x and 1.30 at 2x — invariant in neither CSS nor device pixels — where
790
+ * vitrea's runs 1.68 → 4.86, so the SHARE that comes through cannot be one
791
+ * number over a width that is two. How wide the dot ARRIVES is the material's
792
+ * own scatter law and is a recorded gap, not a fit (the dot's FWHM lands 4.99
793
+ * CSS px at 1x against the reference's 7.57, and 4.64 against 3.80 at 2x).
794
+ *
795
+ * What it costs the bed is two cells. `impulse__capsule-button` at 2x pays
796
+ * ΔE +0.00006 and `ssimMean` −0.00096 while its `ssimMin` improves by 0.068
797
+ * and its interior level closes 68 % of its gap; `impulse__rrect-md` at 1x
798
+ * improves; every other capture on both beds is byte-identical, including
799
+ * `dark-solid__capsule-button`, the collapsed stop, where a solid backdrop
800
+ * makes the target's lerp the identity by construction.
801
+ *
802
+ * The correction this constant carries is set beside W7's paragraph above, not
803
+ * over it: "texture collapse" was fitted on `dark-solid`, where a mean and a
804
+ * pixel are the same number and no fit could have told them apart. Every
805
+ * figure W7 recorded stands; what it did not measure is what happens over a
806
+ * backdrop that HAS texture, and the impulse bed says the reference keeps it.
807
+ */
808
+ collapseTransmission: 0.017,
809
+ collapseTransmission2x: 0.07,
810
+ /*
811
+ * FITTED 0.038 (W23 G1; claims §5.100 §3, W23 Decision Log 2 (b)) — and it is
812
+ * NOT the dark material's rim, which is the one thing the charter thought it
813
+ * might be.
814
+ *
815
+ * The reference's collapsed rim, read at the contour over 11 cells and 28
816
+ * sides of both beds at both scales, is +0.0189 mean (+0.0196…+0.0204 over
817
+ * `dark-solid`, +0.0149…+0.0168 over `impulse` — the spread is the backdrop,
818
+ * not noise). The dark material's OWN rim over the same backdrop, uncollapsed,
819
+ * is +0.0256…+0.0258. The two are 0.0068 apart, nine 8-bit codes at that level
820
+ * on an instrument that is exact in float and resolves 0.00067 there, so the
821
+ * collapsed rim is an absolute constant in its own units and the charter's
822
+ * conditional resolves to no.
823
+ *
824
+ * 0.038 is the minimiser over every collapsed side: the worst residual reads
825
+ * 0.0042 at 0.035, **0.0031 at 0.038**, 0.0041 at 0.040 and 0.0065 at 0.045,
826
+ * and it is the only value that leaves every untinted collapsed side inside
827
+ * the wave's clause 1 (0.005) with margin. Rendered, the collapsed sides go
828
+ * from 0.0180 to 0.0021 mean |rim − reference|.
829
+ *
830
+ * The per-row answers span 0.0317…0.0441, which under a rule that refuses a
831
+ * constant its rows do not separate (C9a §6.2) needs a stated reason: the rows
832
+ * disagree because the REFERENCE's own collapsed rim differs by backdrop —
833
+ * +0.0200 over `dark-solid` against +0.0158 over `impulse` — and not because
834
+ * the constant is unidentified on vitrea's side, where the leverage is exactly
835
+ * linear and every row reads the same slope.
836
+ *
837
+ * The collapsed BODY is read and not chased: 0.01103 native against 0.01171
838
+ * web over `dark-solid` (+1.05 codes) and 0.00664 against 0.00367 over
839
+ * `impulse` (−6.2 codes). This constant does not touch it.
840
+ */
841
+ rimCollapsed: 0.038,
842
+ /*
843
+ * REFITTED 0.337 → 0.520 (W23 G3; claims §5.102) under the painted rim's own
844
+ * composition. The reference's collapsed tint-orange capsule keeps +0.1149 of
845
+ * contour rim at 1x and +0.1179 at 2x where the bare one keeps +0.0200, and
846
+ * the drawn rim is linear in this constant, so one rendered point per scale
847
+ * gives each row its own answer.
848
+ *
849
+ * It moved because the LIGHT is now spent differently, not because the reading
850
+ * did. `rimTintChroma` spends a painted surface's rim in the paint's own
851
+ * chromaticity, and an orange paint's red channel is already at 255, so the
852
+ * share of the light that goes there is lost to the raster: at 0.337 the
853
+ * collapsed painted rim fell from +0.115 to +0.072 against a reference of
854
+ * +0.118. The constant carries what the composition costs, which is what an
855
+ * absolute constant is for.
856
+ *
857
+ * The per-side answers are 0.510 at 1x and 0.544 at 2x — the difference is the
858
+ * band, which is scale-graded and this constant is not — and 0.520 is the
859
+ * minimiser over all twelve sides, worst residual 0.0055. The three non-holdout
860
+ * cells that carry it (`dark-solid__capsule-button__rest-tint-orange` and
861
+ * `impulse__capsule-button__rest-tint-orange` on the light bed and
862
+ * `dark-solid__capsule-button__rest-tint-orange` on the dark one) answer the
863
+ * same value in both schemes, because the constant is absolute (X4).
864
+ */
865
+ rimCollapsedTinted: 0.52,
866
+ /*
867
+ * FITTED 1 (W23 G3; claims §5.102) — the rim's light on a painted surface is
868
+ * spent ENTIRELY in the paint's own chromaticity.
869
+ *
870
+ * The rows do not merely prefer it, they ask for more than the constant can be:
871
+ * over 52 tinted sides of both beds at both scales the per-side answer is
872
+ * 0.921…1.732 with a mean of 1.154, and the objective is monotone up to the
873
+ * bound. A mix weight cannot exceed 1, so 1 is both the fit and the ceiling,
874
+ * and what the rows are really saying past it is that the tinted rows' AMOUNT
875
+ * is short in the dark scheme — which is the amplitude law's residual and not
876
+ * this constant's (see below).
877
+ *
878
+ * Rendered, mean |Δ| of the contour row's OKLab against the reference's, over
879
+ * every tinted side of both beds at both scales: **b 0.0554 → 0.0093** and
880
+ * **a 0.0399 → 0.0222**, with the sides outside the wave's 0.02 falling from
881
+ * 52 of 52 to 36. The whole of the remaining 36 is `a` on the dark bed's tinted
882
+ * rows, where vitrea's rim is 0.031 against a reference of 0.127: a rim that
883
+ * dim cannot move its row's hue whatever colour it is spent in, so that
884
+ * residual is the dark law's amount and is recorded as one.
885
+ */
886
+ rimTintChroma: 1,
605
887
  /*
606
888
  * MEASURED (W9 probe, claims §5.30–§5.33): the anchors are the probe bed's
607
889
  * settled reference levels, frequency-settled over seven attested runs,
@@ -713,6 +995,7 @@ var DEFAULT_MATERIAL_PROFILE = {
713
995
  sizeGain: 0
714
996
  },
715
997
  lightDirection: [-0.3714, -0.9285],
998
+ rimLitAxis: [-0.7071, -0.7071],
716
999
  sweepBandRadians: 0.55,
717
1000
  glowRadiusCss: 44,
718
1001
  glowGain: 0.6,
@@ -757,6 +1040,8 @@ var BACKDROP_TONE_MAX = DEFAULT_MATERIAL_PROFILE.backdropToneMax;
757
1040
  var BACKDROP_TONE_LOW = DEFAULT_MATERIAL_PROFILE.backdropToneLow;
758
1041
  var BACKDROP_TONE_HIGH = DEFAULT_MATERIAL_PROFILE.backdropToneHigh;
759
1042
  var BACKDROP_TONE_SIZE_BIAS = DEFAULT_MATERIAL_PROFILE.backdropToneSizeBias;
1043
+ DEFAULT_MATERIAL_PROFILE.collapseTransmission;
1044
+ DEFAULT_MATERIAL_PROFILE.collapseTransmission2x;
760
1045
  DEFAULT_MATERIAL_PROFILE.backdropToneAnchorX;
761
1046
  DEFAULT_MATERIAL_PROFILE.backdropToneResponseThin;
762
1047
  DEFAULT_MATERIAL_PROFILE.backdropToneResponseThick;
@@ -833,12 +1118,18 @@ function withMaterialOverrides(base, patch) {
833
1118
  backdropToneLow: patch.backdropToneLow ?? base.backdropToneLow,
834
1119
  backdropToneHigh: patch.backdropToneHigh ?? base.backdropToneHigh,
835
1120
  backdropToneSizeBias: patch.backdropToneSizeBias ?? base.backdropToneSizeBias,
1121
+ collapseTransmission: patch.collapseTransmission ?? base.collapseTransmission,
1122
+ collapseTransmission2x: patch.collapseTransmission2x ?? patch.collapseTransmission ?? base.collapseTransmission2x,
1123
+ rimCollapsed: patch.rimCollapsed ?? base.rimCollapsed,
1124
+ rimCollapsedTinted: patch.rimCollapsedTinted ?? base.rimCollapsedTinted,
1125
+ rimTintChroma: patch.rimTintChroma ?? base.rimTintChroma,
836
1126
  backdropToneAnchorX: patch.backdropToneAnchorX ?? base.backdropToneAnchorX,
837
1127
  backdropToneResponseThin: patch.backdropToneResponseThin ?? base.backdropToneResponseThin,
838
1128
  backdropToneResponseThick: patch.backdropToneResponseThick ?? base.backdropToneResponseThick,
839
1129
  backdropToneResponseStrength: patch.backdropToneResponseStrength ?? base.backdropToneResponseStrength,
840
1130
  outerShadow: { ...base.outerShadow, ...patch.outerShadow },
841
1131
  lightDirection: patch.lightDirection ?? base.lightDirection,
1132
+ rimLitAxis: patch.rimLitAxis ?? base.rimLitAxis,
842
1133
  sweepBandRadians: patch.sweepBandRadians ?? base.sweepBandRadians,
843
1134
  glowRadiusCss: patch.glowRadiusCss ?? base.glowRadiusCss,
844
1135
  glowGain: patch.glowGain ?? base.glowGain,
@@ -856,10 +1147,27 @@ function opticsUnderPolicy(optics, policy, profile = DEFAULT_MATERIAL_PROFILE) {
856
1147
  ...next,
857
1148
  tintAlpha: occlusionAlphaUnderPolicy(next.tintAlpha, policy.occlusion, profile.increasedOcclusionLift)
858
1149
  };
859
- if (policy.border === "strong")
860
- next = { ...next, ...profile.strongBorderRim };
1150
+ if (policy.border === "strong") {
1151
+ next = {
1152
+ ...next,
1153
+ rimWidth: profile.strongBorderRim.rimWidth,
1154
+ rimWidth2x: profile.strongBorderRim.rimWidth,
1155
+ rimAlpha: profile.strongBorderRim.rimAlpha,
1156
+ rimLevelGain: 0,
1157
+ // And the lit edge stands down with it (W24): a border a preference asked
1158
+ // for is one brightness the whole way round, and a directional factor
1159
+ // would take it to nothing on two of its four corners.
1160
+ rimLitExponent: 0
1161
+ };
1162
+ }
861
1163
  return next;
862
1164
  }
1165
+ function collapsedRimUnderPolicy(policy, tintStrength, profile = DEFAULT_MATERIAL_PROFILE) {
1166
+ if (policy.border === "strong")
1167
+ return profile.strongBorderRim.rimAlpha;
1168
+ const strength = Math.min(1, Math.max(0, tintStrength));
1169
+ return profile.rimCollapsed + (profile.rimCollapsedTinted - profile.rimCollapsed) * strength;
1170
+ }
863
1171
  function adaptationStrength(policy, analysisExact, profile = DEFAULT_MATERIAL_PROFILE) {
864
1172
  if (!analysisExact)
865
1173
  return 0;
@@ -1035,6 +1343,12 @@ function rampAtScale(at1x, at2x, devicePixelRatio) {
1035
1343
  return at2x;
1036
1344
  return at1x + (at2x - at1x) * t;
1037
1345
  }
1346
+ function rimWidthAtScale(optics, devicePixelRatio = 1) {
1347
+ return rampAtScale(optics.rimWidth, optics.rimWidth2x, devicePixelRatio);
1348
+ }
1349
+ function collapseTransmissionAtScale(profile = DEFAULT_MATERIAL_PROFILE, devicePixelRatio = 1) {
1350
+ return rampAtScale(profile.collapseTransmission, profile.collapseTransmission2x, devicePixelRatio);
1351
+ }
1038
1352
  function scatterGainAtScale(profile = DEFAULT_MATERIAL_PROFILE, devicePixelRatio = 1) {
1039
1353
  return rampAtScale(profile.sizeScatterGainMax, profile.sizeScatterGainMax2x, devicePixelRatio);
1040
1354
  }
@@ -2151,6 +2465,7 @@ var IDLE_CHANNELS = {
2151
2465
  press: 0,
2152
2466
  glow: 0,
2153
2467
  sweep: 0,
2468
+ shimmer: 0,
2154
2469
  lensStrength: 1
2155
2470
  };
2156
2471
 
@@ -3022,7 +3337,9 @@ var WGSL_OPTICS_PASS = `struct OpticsUniforms {
3022
3337
  /// accessibility fold \u2014 the refraction ladder read at the preference's cap,
3023
3338
  /// which every facet's span-dependent rise is multiplied by (W11c)
3024
3339
  tone : vec4f,
3025
- /// rimWidthPx, rimAlpha, specularPower, specularGain
3340
+ /// rimWidthPx, rimAlpha; (z) and (w) carried specularPower and specularGain
3341
+ /// until W24 retired the one-sided specular from the rim (claims 5.108
3342
+ /// section 1) and are written but unread
3026
3343
  rim : vec4f,
3027
3344
  /// light direction, unit (xy), shadowDepth (z), shadowAlpha (w)
3028
3345
  light : vec4f,
@@ -3071,7 +3388,11 @@ var WGSL_OPTICS_PASS = `struct OpticsUniforms {
3071
3388
  /// three anchors for a surface of sizeThickness 0 (xyz); w is the law's
3072
3389
  /// per-profile authority \u2014 0 on dark profiles, whose response is unmeasured
3073
3390
  toneRowThin : vec4f,
3074
- /// the thick row (sizeThickness saturated), same layout
3391
+ /// the thick row (sizeThickness saturated), xyz as the thin row's; w is the
3392
+ /// collapse's transmission (W24 G1), in the padding slot this vec4's alignment
3393
+ /// already required \u2014 it belongs to the tone block and the tone block's other
3394
+ /// three vec4s are full. At 0 the collapse's target is the group's mean
3395
+ /// backdrop colour and this pass is W7's to the bit.
3075
3396
  toneRowThick : vec4f,
3076
3397
  /// the size law's bands: the scatter facet's floor (x, resolved at the
3077
3398
  /// group's device ratio since W15 G1 \u2014 the deep value is per-scale, claims
@@ -3112,6 +3433,17 @@ var WGSL_OPTICS_PASS = `struct OpticsUniforms {
3112
3433
  /// which is the only place the CSS-px-to-texel conversion is knowable, and
3113
3434
  /// already clamped to chainMaxLod (w)
3114
3435
  shadowLift : vec4f,
3436
+ /// the rim's amplitude law (W23): the gain on the surface's own rendered
3437
+ /// luminance (x), the rim the COLLAPSED appearance keeps \u2014 bare (y) and at the
3438
+ /// author tint's full coverage (z) \u2014 which rises with the adaptation the
3439
+ /// scheme's own rim falls with, and how much of an author tint's own colour
3440
+ /// the rim's light is spent in (w)
3441
+ rimLaw : vec4f,
3442
+ /// the lit edge (W24): the axis the rim's directional factor is symmetric
3443
+ /// about, unit, viewport coordinates with y down (xy), and the factor's
3444
+ /// exponent (z) \u2014 0 leaves the factor at 1 for every normal and the rim
3445
+ /// exactly as W23 left it. (w) is free.
3446
+ rimLit : vec4f,
3115
3447
  };
3116
3448
 
3117
3449
  @group(0) @binding(0) var<uniform> ou : OpticsUniforms;
@@ -3596,15 +3928,22 @@ fn fs_optics(in : FullscreenOut) -> @location(0) vec4f {
3596
3928
  * 'sizeK' is still per pixel, so a container holding a small control and a large
3597
3929
  * platter adapts each of them by its own thickness out of one pass.
3598
3930
  *
3599
- * Strength is zero where the host measured no tone, and the whole axis stands
3600
- * down where there is no backdrop at all rather than reading the zero vector as
3601
- * a black backdrop and dissolving the surface into nothing.
3931
+ * Strength is zero where the host measured no tone, and that strength is the
3932
+ * WHOLE gate (W22 G3). It used to be read together with 'hasBackdrop', because
3933
+ * a group with no pyramid to sample had no measured tone either and the pair
3934
+ * said one thing twice \u2014 until a group stacked over other glass acquired a
3935
+ * backdrop the host can state without a texture to sample ('backdrop-stack.ts').
3936
+ * The concern the flag stood in for is the zero vector being read as a black
3937
+ * backdrop, and 'toneAdapt.w' answers exactly that: it is zero wherever nothing
3938
+ * was measured, and zero wherever the policy has stood the axis down. Reading
3939
+ * the flag as well is what left a nested pane drawing its unadapted body over
3940
+ * glass it had measured \u2014 0.0493 against the law's 0.0245 (claims 5.94 section 5).
3602
3941
  *
3603
3942
  * Written out instead of calling smoothstep() so that a profile patched with
3604
3943
  * low >= high degrades to a step rather than to NaN.
3605
3944
  */
3606
3945
  var toneAdapt = 0.0;
3607
- if (ou.flags.x > 0.5 && ou.toneAdapt.w > 0.0) {
3946
+ if (ou.toneAdapt.w > 0.0) {
3608
3947
  let toneX = ou.toneColour.w + ou.toneAdapt.z * sizeK;
3609
3948
  let toneT = clamp(
3610
3949
  (toneX - ou.toneAdapt.x) / max(ou.toneAdapt.y - ou.toneAdapt.x, 1e-6),
@@ -3637,6 +3976,11 @@ fn fs_optics(in : FullscreenOut) -> @location(0) vec4f {
3637
3976
  * measured response. Chroma is untouched \u2014 the shift is achromatic \u2014 and
3638
3977
  * the author tint still displaces the result per the composition contract.
3639
3978
  *
3979
+ * The solve reads the backdrop as 'toneAnchor.w' \u2014 the group's own linear mean
3980
+ * \u2014 and never as the per-pixel sample, so it is the same closed form whether
3981
+ * this pass composites the backdrop itself or writes a layer for the browser to
3982
+ * composite over a proxy carrying the same mean (W22 G3).
3983
+ *
3640
3984
  * Three stand-downs, each measured rather than defensive: the whole axis is
3641
3985
  * off where no backdrop tone was measured (same gate as the collapse); the
3642
3986
  * solve's authority fades to zero below the dark anchor, where the only
@@ -3646,7 +3990,7 @@ fn fs_optics(in : FullscreenOut) -> @location(0) vec4f {
3646
3990
  */
3647
3991
  var solvedNeutral = neutral;
3648
3992
  var solvedAlpha = sizedAlpha;
3649
- if (ou.flags.x > 0.5 && ou.toneAdapt.w > 0.0 && ou.toneRowThin.w > 0.0 &&
3993
+ if (ou.toneAdapt.w > 0.0 && ou.toneRowThin.w > 0.0 &&
3650
3994
  sizedAlpha > 1e-3 && toneAdapt < 0.995) {
3651
3995
  let encodedInput = srgb_encode(ou.toneColour.w);
3652
3996
  let anchor = max(ou.toneAnchor.x, 1e-4);
@@ -3684,11 +4028,44 @@ fn fs_optics(in : FullscreenOut) -> @location(0) vec4f {
3684
4028
  }
3685
4029
  }
3686
4030
 
4031
+ /*
4032
+ * The collapse's TARGET (W24 G1) \u2014 what the material converges on where it has
4033
+ * adapted, and the one place the transmission was lost.
4034
+ *
4035
+ * The pair below reduces exactly to 'colour = (1 \u2212 k)\xB7M + k\xB7target', with 'M'
4036
+ * the unadapted composite '(1 \u2212 \u03B1)\xB7backdrop + \u03B1\xB7neutral'. At 'target' =
4037
+ * 'toneColour.rgb', the group's MEAN backdrop colour, a fully collapsed
4038
+ * surface is one flat number and nothing under it comes through \u2014 which is
4039
+ * exactly what the reference's collapsed capsule over the impulse grid does
4040
+ * NOT do (claims \xA75.107 \xA72: it passes the centre dot at four times its own
4041
+ * body). So the target lerps toward the per-pixel blurred backdrop the
4042
+ * refraction path above already sampled, by the profile's own constant.
4043
+ *
4044
+ * Only the target moves. The tone axis's argument is still the group's mean
4045
+ * luminance and the response solve still composites against 'toneAnchor.w',
4046
+ * so 'k' and the law's level are the numbers W7 and W9 fitted: the collapse
4047
+ * still collapses the level, and stops flattening the structure.
4048
+ *
4049
+ * The alpha solve above needs no gate of its own, and this is arithmetic
4050
+ * rather than a choice: on a fully collapsed surface it never runs (its own
4051
+ * 'toneAdapt < 0.995' stands it down where the collapse owns the pixel), and
4052
+ * below that it is the (1 \u2212 k) half of the same lerp, which transmits already.
4053
+ *
4054
+ * Gated on 'flags.x': with no pyramid to sample 'backdrop' is the zero vector
4055
+ * and this pass writes a layer for the browser to composite, so a target
4056
+ * lerped toward it would be a black surface rather than a transmitting one.
4057
+ * There the CSS tier's own 'backdrop-filter' is what carries the transmission.
4058
+ */
4059
+ var toneTarget = ou.toneColour.rgb;
4060
+ if (ou.flags.x > 0.5) {
4061
+ toneTarget = mix(toneTarget, backdrop, clamp(ou.toneRowThick.w, 0.0, 1.0));
4062
+ }
4063
+
3687
4064
  let adaptedAlpha = solvedAlpha + toneAdapt * (1.0 - solvedAlpha);
3688
4065
  var adapted = solvedNeutral;
3689
4066
  if (toneAdapt > 0.0 && adaptedAlpha > 0.0) {
3690
4067
  adapted =
3691
- (solvedNeutral * ((1.0 - toneAdapt) * solvedAlpha) + ou.toneColour.rgb * toneAdapt) /
4068
+ (solvedNeutral * ((1.0 - toneAdapt) * solvedAlpha) + toneTarget * toneAdapt) /
3692
4069
  adaptedAlpha;
3693
4070
  }
3694
4071
 
@@ -3746,6 +4123,45 @@ fn fs_optics(in : FullscreenOut) -> @location(0) vec4f {
3746
4123
  // seed); and '1 \u2212 toneAdapt' folds the shade out where the collapse has made
3747
4124
  // the material a dark body, where the reference renders the pure seed too.
3748
4125
  // At zero grip the layer is the bare seed \u2014 the author's colour, flat.
4126
+ /*
4127
+ * The material's own composite, kept beside the tinted one (W23; claims \xA75.100
4128
+ * \xA75). The rim is the MATERIAL's mark and the author's colour is painted over
4129
+ * it, so the amplitude law below reads the level the material reached and not
4130
+ * the level the paint left \u2014 which is what the reference does: its tinted rows
4131
+ * read +0.13\u2026+0.17 of contour rim in BOTH colour schemes, where the two
4132
+ * materials' own laws on the PAINTED level differ by a factor of five and land
4133
+ * the dark bed's tinted rows 0.216 over.
4134
+ *
4135
+ * For an untinted pixel these carry exactly 'colour' and 'bodyAlpha', so the
4136
+ * rim below is bit-identical to the law without them.
4137
+ */
4138
+ var materialColour = colour;
4139
+ var materialAlpha = bodyAlpha;
4140
+ /*
4141
+ * The colour the rim's light is spent in (W23 G3; claims \xA75.102). White on a
4142
+ * bare surface, and on a PAINTED one the author's own CHROMATICITY: the
4143
+ * reference's rim on a tinted capsule is the paint lifted rather than white
4144
+ * added over it \u2014 orange (255, 148, 0) rises to (254, 188, 0) with its blue
4145
+ * channel still at 0, where vitrea drew (255, 192, 130).
4146
+ *
4147
+ * The layer is normalised by its own LUMINANCE and not by its brightest
4148
+ * channel, which is what the rows chose: on the collapsed orange capsule at 2x
4149
+ * the reference lifts the green channel by 0.213 of linear light where a white
4150
+ * rim of the same amount lifts it by 0.304, and 0.213 / 0.304 = 0.70 is exactly
4151
+ * the green coefficient of that orange divided by its luminance. Normalising by
4152
+ * the brightest channel instead reproduces the hue and loses the AMOUNT \u2014 it
4153
+ * divides the rim's luminance by the paint's, which on the same cell took the
4154
+ * contour rim from 0.115 to 0.030 against a reference of 0.118. Chromaticity is
4155
+ * unbounded as a paint darkens, so the divisor has a floor of 0.05: below that
4156
+ * the paint has no readable hue and the normalisation would be a colour cast of
4157
+ * arbitrary size rather than a rim.
4158
+ *
4159
+ * 'rimTintChroma' (rimLaw.w) is how much of that is taken, and it is
4160
+ * multiplied by the pixel's own tint strength, so an UNTINTED pixel keeps a
4161
+ * white rim at every value of the constant \u2014 which is what makes the mechanism
4162
+ * reach painted pixels only (W23 S10).
4163
+ */
4164
+ var rimTintColour = vec3f(1.0);
3749
4165
  if (aux.w > 0.0) {
3750
4166
  // The untinted material's luminance at this pixel. Over a backdrop that is
3751
4167
  // the composite; as a layer it is the layer over the tone the host measured
@@ -3756,6 +4172,8 @@ fn fs_optics(in : FullscreenOut) -> @location(0) vec4f {
3756
4172
  let shade = mix(1.0, clamp(mix(ou.tone.x, ou.tone.y, clamp(u, 0.0, 1.0)), 0.0, 1.0), grip);
3757
4173
  let layer = ou.seed.rgb * shade;
3758
4174
  let s = clamp(aux.w, 0.0, 1.0);
4175
+ let layerLuma = max(dot(layer, vec3f(0.2126, 0.7152, 0.0722)), 0.05);
4176
+ rimTintColour = mix(vec3f(1.0), layer / layerLuma, clamp(ou.rimLaw.w, 0.0, 1.0) * s);
3759
4177
  let encodedMaterial = linear_to_srgb(clamp(colour, vec3f(0.0), vec3f(1.0)));
3760
4178
  let encodedLayer = linear_to_srgb(layer);
3761
4179
  if (ou.flags.x > 0.5) {
@@ -3800,15 +4218,91 @@ fn fs_optics(in : FullscreenOut) -> @location(0) vec4f {
3800
4218
  let shadowedAlpha = 1.0 - shadowKeep * (1.0 - bodyAlpha);
3801
4219
  colour = colour * (shadowKeep * bodyAlpha / max(shadowedAlpha, 1e-6));
3802
4220
  bodyAlpha = shadowedAlpha;
4221
+ // The same occlusion on the material's own composite, so that the rim's law
4222
+ // reads a level the inner shadow has reached exactly as it always did.
4223
+ let materialShadowedAlpha = 1.0 - shadowKeep * (1.0 - materialAlpha);
4224
+ materialColour = materialColour * (shadowKeep * materialAlpha / max(materialShadowedAlpha, 1e-6));
4225
+ materialAlpha = materialShadowedAlpha;
3803
4226
 
3804
- // Rim and specular from the gradient. The rim is unlit ambient edge brightness;
3805
- // the specular term is the same edge lit from 'light.xy'.
4227
+ /*
4228
+ * The rim from the gradient. Its amplitude law is below and the direction it
4229
+ * is LIT from is the factor after it.
4230
+ *
4231
+ * The one-sided specular that used to be added here \u2014 'pow(clamp(dot(normal,
4232
+ * light.xy), 0, 1), rim.z) * rim.w' \u2014 is retired (W24; claims \xA75.108 \xA71). Read
4233
+ * around the whole contour the reference's rim is symmetric about the diagonal
4234
+ * rather than one-sided, and a term that can only reach one end of it fits at
4235
+ * 0.288 of normalised RMS where the symmetric factor fits at 0.148. 'rim.z'
4236
+ * and 'rim.w' are written by the pass and no longer read.
4237
+ */
3806
4238
  let rw = rim_weight(d, ou.rim.x);
3807
- let facing = dot(normal, ou.light.xy);
3808
- let spec = pow(clamp(facing, 0.0, 1.0), max(ou.rim.z, 1e-3)) * ou.rim.w;
3809
- let rim = rw * (ou.rim.y + spec) * present;
4239
+ /*
4240
+ * The rim's amplitude law, and the rim that survives the collapse (W23;
4241
+ * claims \xA75.100 \xA7\xA73-4).
4242
+ *
4243
+ * - The amplitude is affine in the MATERIAL's own rendered luminance, taken
4244
+ * exactly as the tint shade takes it above \u2014 the composite where this layer
4245
+ * covers the pixel, the group's measured backdrop tone where it does not,
4246
+ * and in both cases before the author's colour is painted over it \u2014
4247
+ * so that a rim fitted as 'a fraction of the body's headroom' (a negative
4248
+ * gain, the screen form the CSS tier's inset shadow already is) and a rim
4249
+ * fitted as 'a line that rides its own body up' (a positive one, which is
4250
+ * what the dark reference's rows read as) are the same expression with the
4251
+ * sign the rows chose. The environment term the wave chartered beside it is
4252
+ * not here: it is worse than this law on the reference in both schemes and
4253
+ * no row of either bed separates it, so it is not carried (C9a \xA76.2).
4254
+ * - 'rimCollapsed' rises with 'toneAdapt' exactly as the rest of the
4255
+ * appearance falls with it. At toneAdapt 1 the surface draws its backdrop
4256
+ * with this rim and nothing else, which is what the reference's collapsed
4257
+ * capsule does; at 0 it contributes nothing at all.
4258
+ * The collapsed rim it rises to is the AUTHOR TINT's coverage lerped between
4259
+ * two absolute constants: the reference's collapsed capsule keeps +0.020 of
4260
+ * contour rim bare and +0.115 painted, and both are absolutes rather than
4261
+ * fractions of the appearance's own rim, because the reference draws one
4262
+ * collapsed appearance out of two materials whose amplitude laws differ by
4263
+ * 1.8\xD7 (claims \xA75.100 \xA75). 'aux.w' is the same per-pixel tint strength the
4264
+ * author tint layer composites with sixty lines above.
4265
+ */
4266
+ let rimLuma = materialAlpha * dot(materialColour, vec3f(0.2126, 0.7152, 0.0722))
4267
+ + (1.0 - materialAlpha) * ou.toneColour.w;
4268
+ let rimAmplitude = ou.rim.y + ou.rimLaw.x * rimLuma;
4269
+ let rimCollapsed = mix(ou.rimLaw.y, ou.rimLaw.z, clamp(aux.w, 0.0, 1.0));
4270
+ /*
4271
+ * The lit edge (W24; claims \xA75.107) \u2014 the directional factor the whole rim is
4272
+ * multiplied by, symmetric about 'rimLit.xy'.
4273
+ *
4274
+ * Apple's rim is not one number around the contour. Read at 720 or more points
4275
+ * of the declared boundary and binned by the NORMAL's angle, the reference's
4276
+ * north-west and south-east bins are five to twenty-five times its north-east
4277
+ * and south-west ones on every untinted solid cell of both beds, while every
4278
+ * per-side reader in three waves read it flat \u2014 a light on the diagonal
4279
+ * projects equally on all four straight sides. This is the shape of that.
4280
+ *
4281
+ * '1.4142135' is the amplitude's re-expression and not a scale: it normalises
4282
+ * the dot product by 'cos 45 deg', so at the default axis the factor is exactly
4283
+ * 1 wherever the normal is horizontal or vertical, at EVERY exponent. W23
4284
+ * fitted 'rimAlpha' and 'rimLevelGain' on those straight spans, so they keep
4285
+ * their meaning untouched and only the corners and the arcs move \u2014 which is
4286
+ * also why the CSS tier, whose one inset layer cannot vary around a contour,
4287
+ * needs no counterpart and no re-fit.
4288
+ *
4289
+ * The factor multiplies the COLLAPSED rim as well as the appearance's own. That
4290
+ * is a measurement and not a symmetry: the reference's collapsed cells \u2014 the
4291
+ * 'dark-solid' capsule at both scales and the probe grids' 'dark-solid'
4292
+ * rrect-sm and rrect-lg \u2014 fit the same axis (136.0 deg) and the same exponent
4293
+ * (1.15 against 1.00) as the uncollapsed rows, so one factor outside the
4294
+ * bracket is what the rows say and two constants would be one more than they
4295
+ * separate.
4296
+ *
4297
+ * The floor is 1e-6 and not 0 so that 'pow' is defined where the normal is
4298
+ * exactly perpendicular to the axis; at exponent 0 it returns 1 there as it
4299
+ * does everywhere else, which is what makes this term inert at the defaults.
4300
+ */
4301
+ let lit = pow(max(abs(dot(normal, ou.rimLit.xy)) * 1.4142135, 1e-6), ou.rimLit.z);
4302
+ let rim = rw * lit * (rimAmplitude * present + rimCollapsed * toneAdapt);
4303
+ let rimLight = rim * rimTintColour;
3810
4304
  if (ou.flags.x > 0.5) {
3811
- colour = colour + vec3f(rim);
4305
+ colour = colour + rimLight;
3812
4306
  } else {
3813
4307
  // Added light has no premultiplied form of its own \u2014 a canvas colour may
3814
4308
  // not exceed its alpha \u2014 so the layer carries the light in its opacity:
@@ -3819,8 +4313,11 @@ fn fs_optics(in : FullscreenOut) -> @location(0) vec4f {
3819
4313
  // shows through \u2014 where the mix form ("white over the layer at the rim's
3820
4314
  // weight") is short by the rim times the whole composite, which halved
3821
4315
  // the rim on a tinted panel.
4316
+ // The alpha the rim carries is its LIGHT and not its colour: a coloured rim
4317
+ // spends the same light through a narrower set of channels, so the layer's
4318
+ // opacity is still 'rim' and only the colour it carries is tinted.
3822
4319
  let carried = clamp(bodyAlpha + rim, 0.0, 1.0);
3823
- colour = min((colour * bodyAlpha + vec3f(rim)) / max(carried, 1e-6), vec3f(1.0));
4320
+ colour = min((colour * bodyAlpha + rimLight) / max(carried, 1e-6), vec3f(1.0));
3824
4321
  bodyAlpha = carried;
3825
4322
  }
3826
4323
 
@@ -4102,7 +4599,7 @@ function createPassRunner(context) {
4102
4599
  };
4103
4600
  },
4104
4601
  opticsPass(encoder, args) {
4105
- const slot = uniformSlot(`optics:${args.groupId}`, 96);
4602
+ const slot = uniformSlot(`optics:${args.groupId}`, 104);
4106
4603
  const d = slot.data;
4107
4604
  d[0] = args.viewportDevice[0];
4108
4605
  d[1] = args.viewportDevice[1];
@@ -4175,7 +4672,7 @@ function createPassRunner(context) {
4175
4672
  d[68] = args.backdropToneResponseThick[0];
4176
4673
  d[69] = args.backdropToneResponseThick[1];
4177
4674
  d[70] = args.backdropToneResponseThick[2];
4178
- d[71] = 0;
4675
+ d[71] = args.collapseTransmission;
4179
4676
  d[72] = args.sizeScatterFloor;
4180
4677
  d[73] = args.sizeScatterRampStartThin;
4181
4678
  d[74] = args.sizeSpanMin;
@@ -4200,6 +4697,13 @@ function createPassRunner(context) {
4200
4697
  d[93] = args.outerShadowLift[1];
4201
4698
  d[94] = args.outerShadowLift[2];
4202
4699
  d[95] = args.outerShadowLift[3];
4700
+ d[96] = args.rimLevelGain;
4701
+ d[97] = args.rimCollapsed;
4702
+ d[98] = args.rimCollapsedTinted;
4703
+ d[99] = args.rimTintChroma;
4704
+ d[100] = args.rimLitAxis[0];
4705
+ d[101] = args.rimLitAxis[1];
4706
+ d[102] = args.rimLitExponent;
4203
4707
  slot.write();
4204
4708
  const chain = args.backdrop?.chain ?? placeholderView;
4205
4709
  const body = args.backdrop?.body ?? placeholderView;
@@ -5244,11 +5748,40 @@ function createWebGPURenderer(options = {}) {
5244
5748
  tintSeed: (policy.glass === "none" ? void 0 : groupTintSeed(input)) ?? optics.tint,
5245
5749
  tintToneAdaptation: tintToneAdaptation(policy, material),
5246
5750
  tintShade: [material.tintShadeDark, material.tintShadeLight, material.tintShadeStrength],
5247
- rimWidth: optics.rimWidth,
5751
+ // The band's half-width is a per-scale reading since W23: the reference's
5752
+ // rim narrows between the scales where vitrea's widened (claims §5.100
5753
+ // §5). At dpr 1, and on any variant whose two anchors are equal, this is
5754
+ // `optics.rimWidth` exactly.
5755
+ rimWidth: rimWidthAtScale(optics, dpr),
5248
5756
  rimAlpha: optics.rimAlpha,
5249
5757
  specularPower: optics.specularPower,
5250
5758
  specularGain: optics.specularGain,
5759
+ // The rim's amplitude law (W23). The level gain is per variant, because
5760
+ // a variant with a different `rimAlpha` has a different rim; the two
5761
+ // collapsed rims are the profile's, because the collapsed appearance is
5762
+ // one appearance and the reference's fixtures carry it identically in
5763
+ // both schemes, painted or bare (X4).
5764
+ rimLevelGain: optics.rimLevelGain,
5765
+ // Both ends of the collapsed rim's tint lerp, under the accessibility
5766
+ // regime: `collapsedRimUnderPolicy` returns the two absolute constants
5767
+ // unless a preference has asked for a border, in which case both ends are
5768
+ // the border's own alpha and the shader's `mix` is that constant at every
5769
+ // tint strength (W23 G1's review fix).
5770
+ rimCollapsed: collapsedRimUnderPolicy(policy, 0, material),
5771
+ rimCollapsedTinted: collapsedRimUnderPolicy(policy, 1, material),
5772
+ // The rim's light in the author's own colour (W23 G3). Under a strong
5773
+ // border the rim is the preference's mark and not the material's, so it
5774
+ // stays white: an accessibility border that took the paint's hue would
5775
+ // be the paint again, which is what it exists not to be.
5776
+ rimTintChroma: policy.border === "strong" ? 0 : material.rimTintChroma,
5251
5777
  lightDirection: material.lightDirection,
5778
+ // The lit edge (W24): the rim's own axis, kept apart from
5779
+ // `lightDirection` because the shadow reads that one and the two are
5780
+ // measured 22 degrees apart. The exponent comes from the variant's
5781
+ // optics under the accessibility fold, so a strong border's rim is one
5782
+ // brightness the whole way round.
5783
+ rimLitAxis: material.rimLitAxis,
5784
+ rimLitExponent: optics.rimLitExponent,
5252
5785
  shadowDepth: optics.shadowDepth,
5253
5786
  shadowAlpha: optics.shadowAlpha,
5254
5787
  // The size law's gains, per group (W2); the per-pixel factor they
@@ -5325,6 +5858,16 @@ function createWebGPURenderer(options = {}) {
5325
5858
  // were fitted on.
5326
5859
  backdropToneResponseStrength: backdropToneUnderPolicy(policy, material) >= 0.999 ? material.backdropToneResponseStrength : 0,
5327
5860
  backdropToneLinearMean: input.backdropToneLinearLuminance ?? backdropToneLevel,
5861
+ /*
5862
+ * The collapse's transmission (W24 G1) rides the UN-DEGRADED regime, on
5863
+ * the same gate and for the same reason as the response law above: it is
5864
+ * fitted on the standard reference, and the accessibility references are
5865
+ * a nearly opaque material whose collapsed appearance was never read
5866
+ * over a textured backdrop. Where any policy fold touches the tone axis
5867
+ * the collapse's target is the group's mean, which is W7's behaviour and
5868
+ * what those profiles were fitted on.
5869
+ */
5870
+ collapseTransmission: backdropToneUnderPolicy(policy, material) >= 0.999 ? collapseTransmissionAtScale(material, dpr) : 0,
5328
5871
  outerShadow: [
5329
5872
  // The thin regime's LINEAR occlusion at this group's backdrop (W14
5330
5873
  // G1). The conversion to the compositing space moved into the shader
@@ -5372,8 +5915,25 @@ function createWebGPURenderer(options = {}) {
5372
5915
  cssPerDevice,
5373
5916
  sweep: lead.channels.sweep,
5374
5917
  sweepBandRadians: material.sweepBandRadians,
5375
- // Reduced Motion removes shimmer travel outright rather than freezing it.
5376
- sweepGain: policy.glass === "none" ? 0 : material.sweepGain,
5918
+ /*
5919
+ * The band's amplitude, from the same lead surface that supplies its
5920
+ * phase. `shimmer` is 0 on a resting surface and nothing in v1 drives
5921
+ * it, so a surface nobody is animating contributes exactly no sweep
5922
+ * term and the pass writes nothing on its rim — the contract the
5923
+ * pass's own comment states, which the profile's `sweepGain` alone
5924
+ * could not keep, because 0 radians of the band's angular coordinate
5925
+ * is the left edge rather than nowhere (W22's Design; the defect
5926
+ * claims §5.90 §4 isolated).
5927
+ *
5928
+ * Reduced Motion removes shimmer travel outright rather than freezing
5929
+ * it, on this same product, and that zeroing is unchanged.
5930
+ */
5931
+ sweepGain: policy.glass === "none" ? 0 : material.sweepGain * lead.channels.shimmer,
5932
+ // `rimWidth`, NOT the scale-graded band the optics pass takes (W23).
5933
+ // The second anchor was fitted on the ambient rim read at the contour
5934
+ // on a resting surface, and this band carries the specular sweep,
5935
+ // which is gated to nothing at rest (W22) and has no row on any bed.
5936
+ // A constant whose rows do not separate it is not applied here either.
5377
5937
  rimWidth: optics.rimWidth,
5378
5938
  pressPointCss: lead.channels.pressPoint ?? lead.centre,
5379
5939
  glowRadiusCss: material.glowRadiusCss,
@@ -5632,6 +6192,6 @@ function createWebGPURenderer(options = {}) {
5632
6192
  };
5633
6193
  }
5634
6194
 
5635
- export { ADAPTIVE_LUMINANCE_HIGH, ADAPTIVE_LUMINANCE_LOW, ADAPTIVE_TINT_DARK, ADAPTIVE_TINT_LIGHT, ANALYSIS_DISPATCH, ANALYSIS_GRID, ANALYSIS_PASS_ID, ANALYSIS_STATS_FLOATS, ANALYSIS_TARGET_EXTENT, ANALYSIS_WORKGROUP, BACKDROP_ALPHA_MODES, BACKDROP_COLOR_SPACES, BACKDROP_KINDS, BACKDROP_PASS_ID, BACKDROP_TONE_HIGH, BACKDROP_TONE_LOW, BACKDROP_TONE_MAX, BACKDROP_TONE_SIZE_BIAS, CANVAS_FORMAT, CHAIN_SIGMA_AT_LEVEL_1, CROSS_CHECK_SHAPE_FLOATS, CROSS_CHECK_WORKGROUP, DEFAULT_MATERIAL_PROFILE, FAMILY_C_CROSS_CHECK, FIELD_PASS_ID, GOVERNOR_LADDER, HIGHLIGHT_PASS_ID, IDENTITY_FIT, IDLE_CHANNELS, INCREASED_OCCLUSION_LIFT, INSTANCE_BYTES, INSTANCE_FLOATS, LENS_AMOUNT_MAX, LENS_AMOUNT_PER_SPAN, LENS_EXTENT_GAIN, LENS_HEIGHT_MAX, LENS_HEIGHT_PER_SPAN, LENS_OVALIZATION, LENS_PROFILE_EXPONENT, LENS_REFRACTION_GAIN, LENS_SIZE_GAIN_MAX, LENS_THICKNESS_REFERENCE, LUMINANCE_WEIGHTS, MATERIAL_OPTICS, MATERIAL_VARIANTS, MAX_CHAIN_LEVELS, MIN_LEVEL_EXTENT, NOMINAL_GOVERNOR, NOMINAL_MATERIAL_POLICY, OPTICS_PASS_ID, OUTER_SHADOW, OUTER_SHADOW_THICK_SPANS, OUTER_SHADOW_THIN_L, OUTER_SHADOW_UNMEASURED_BACKDROP_LUMINANCE, OUTPUT_TEXTURE_FORMAT, PASS_LABEL, REFRACTION_LADDER, REFRACTION_SCALE, RENDERER_ERROR_CODES, RENDERER_PASS_IDS, RendererError, SIZE_OCCLUSION_GAIN, SIZE_SCATTER_FLOOR, SIZE_SCATTER_FLOOR_2X, SIZE_SCATTER_GAIN_FAR_2X, SIZE_SCATTER_GAIN_MAX, SIZE_SCATTER_GAIN_MAX_2X, SIZE_SCATTER_RAMP_REACH_1X_PX, SIZE_SCATTER_RAMP_REACH_2X_PX, SIZE_SCATTER_RAMP_START_FAR_1X, SIZE_SCATTER_RAMP_START_FAR_2X, SIZE_SCATTER_RAMP_START_THICK_1X, SIZE_SCATTER_RAMP_START_THICK_2X, SIZE_SCATTER_RAMP_START_THIN_1X, SIZE_SCATTER_RAMP_START_THIN_2X, SIZE_SCATTER_SPAN_MAX, SIZE_SCATTER_SPAN_MAX_2X, SIZE_SHADOW_GAIN_MAX, SIZE_SPAN_MAX, SIZE_SPAN_MIN, SRGB_ENCODING_EXPONENT, SUPPORTED_APP_TEXTURE_FORMATS, WGSL_ANALYSIS_PASS, WGSL_CROSS_CHECK_PASS, WGSL_DOWNSAMPLE_PASS, WGSL_FIELD_KERNELS, WGSL_FIELD_PASS, WGSL_FIELD_SAMPLE, WGSL_HIGHLIGHT_PASS, WGSL_IMPORT_PASS, WGSL_INSTANCE_STRUCT, WGSL_OPTICS_PASS, WGSL_PRELUDE, WGSL_RSUPN_GRAD, WGSL_RSUP_GRAD, WGSL_SMOOTH_UNION, WORKING_TEXTURE_FORMAT, ZERO_STATS, accessibilityRefractionCap, adaptationStrength, adaptedTintAlpha, adaptedTintColour, adaptiveTint, allShaderSource, alphaNormalisationMode, analysisModule, backdropFit, backdropToneAdaptation, backdropToneResponse, backdropToneSizeBiasUnderPolicy, backdropToneSolveWeight, backdropToneUnderPolicy, bodyBlurPlan, chainModule, clipFieldRectToCanvas, coverFit, createAdaptationState, createAppTextureProvider, createCopyProvider, createDeviceHost, createGovernor, createGpuContext, createGradientProvider, createPassRunner, createPipelineCache, createPyramidStore, createRebuildLedger, createStorageSlot, createTexturePool, createTimingCollector, createUniformSlot, createVideoProvider, createWebGPURenderer, crossCheckKernelModule, displayP3ToSrgbLinear, effectiveRefraction, encodeOutput, encodeOutputBytes, fieldModule, fieldPassSource, groupFieldRect, highlightModule, importColorMatrix, importModule, importPassSource, isUsablePlacement, lensAmountBasePx, lensDepthPx, lensDirection, lensDisplacementPx, lensExtentPx, lensHeightBasePx, lensMagnitudePx, lensOvalizationAt, lensSizeGain, lensSizeGainFromThickness, linearGradientStops, linearToSrgb, linearToSrgbChannel, occlusionAlphaUnderPolicy, opticsModule, opticsUnderPolicy, outerShadowAlpha, outerShadowFalloff, outerShadowLiftRise, outerShadowOcclusionAt, outerShadowReachPx, outerShadowThickOcclusion, outerShadowThinOcclusion, outerShadowUnderPolicy, packInstances, pipelineKey, placementFit, planPyramid, poolKey, readbackDue, refractionRank, relativeLuminance, rendererError, resolveSurfaces, samePlacement, scatterDeepThickness, scatterFloorAtScale, scatterGainAt, scatterGainAtScale, scatterGainFarAtScale, scatterRampAreaMean, scatterRampReachDevicePx, scatterRampStart, scatterSharpShare, scatterSpanMaxAtScale, scatterThickness, shadowDepthPx, sizeOcclusionAlpha, sizeOcclusionAlphaAt, sizeOuterShadowOcclusion, sizeOuterShadowOcclusionAt, sizeScatterSigma, sizeScatterSigmaAt, sizeShadowDepth, sizeShadowDepthAt, sizeThickness, sizeThicknessUnderPolicy, snapRectToDevicePixels, srgbToLinear, srgbToLinearChannel, statsFromBuffer, supportsTimestamps, texelsPerCssPx, tintShade, tintShadeLayer, tintToneAdaptation, tintedMaterialColour, validateAppTexture, withMaterialOverrides };
5636
- //# sourceMappingURL=dist-3OXBJGMC.js.map
5637
- //# sourceMappingURL=dist-3OXBJGMC.js.map
6195
+ export { ADAPTIVE_LUMINANCE_HIGH, ADAPTIVE_LUMINANCE_LOW, ADAPTIVE_TINT_DARK, ADAPTIVE_TINT_LIGHT, ANALYSIS_DISPATCH, ANALYSIS_GRID, ANALYSIS_PASS_ID, ANALYSIS_STATS_FLOATS, ANALYSIS_TARGET_EXTENT, ANALYSIS_WORKGROUP, BACKDROP_ALPHA_MODES, BACKDROP_COLOR_SPACES, BACKDROP_KINDS, BACKDROP_PASS_ID, BACKDROP_TONE_HIGH, BACKDROP_TONE_LOW, BACKDROP_TONE_MAX, BACKDROP_TONE_SIZE_BIAS, CANVAS_FORMAT, CHAIN_SIGMA_AT_LEVEL_1, CROSS_CHECK_SHAPE_FLOATS, CROSS_CHECK_WORKGROUP, DEFAULT_MATERIAL_PROFILE, FAMILY_C_CROSS_CHECK, FIELD_PASS_ID, GOVERNOR_LADDER, HIGHLIGHT_PASS_ID, IDENTITY_FIT, IDLE_CHANNELS, INCREASED_OCCLUSION_LIFT, INSTANCE_BYTES, INSTANCE_FLOATS, LENS_AMOUNT_MAX, LENS_AMOUNT_PER_SPAN, LENS_EXTENT_GAIN, LENS_HEIGHT_MAX, LENS_HEIGHT_PER_SPAN, LENS_OVALIZATION, LENS_PROFILE_EXPONENT, LENS_REFRACTION_GAIN, LENS_SIZE_GAIN_MAX, LENS_THICKNESS_REFERENCE, LUMINANCE_WEIGHTS, MATERIAL_OPTICS, MATERIAL_VARIANTS, MAX_CHAIN_LEVELS, MIN_LEVEL_EXTENT, NOMINAL_GOVERNOR, NOMINAL_MATERIAL_POLICY, OPTICS_PASS_ID, OUTER_SHADOW, OUTER_SHADOW_THICK_SPANS, OUTER_SHADOW_THIN_L, OUTER_SHADOW_UNMEASURED_BACKDROP_LUMINANCE, OUTPUT_TEXTURE_FORMAT, PASS_LABEL, REFRACTION_LADDER, REFRACTION_SCALE, RENDERER_ERROR_CODES, RENDERER_PASS_IDS, RendererError, SIZE_OCCLUSION_GAIN, SIZE_SCATTER_FLOOR, SIZE_SCATTER_FLOOR_2X, SIZE_SCATTER_GAIN_FAR_2X, SIZE_SCATTER_GAIN_MAX, SIZE_SCATTER_GAIN_MAX_2X, SIZE_SCATTER_RAMP_REACH_1X_PX, SIZE_SCATTER_RAMP_REACH_2X_PX, SIZE_SCATTER_RAMP_START_FAR_1X, SIZE_SCATTER_RAMP_START_FAR_2X, SIZE_SCATTER_RAMP_START_THICK_1X, SIZE_SCATTER_RAMP_START_THICK_2X, SIZE_SCATTER_RAMP_START_THIN_1X, SIZE_SCATTER_RAMP_START_THIN_2X, SIZE_SCATTER_SPAN_MAX, SIZE_SCATTER_SPAN_MAX_2X, SIZE_SHADOW_GAIN_MAX, SIZE_SPAN_MAX, SIZE_SPAN_MIN, SRGB_ENCODING_EXPONENT, SUPPORTED_APP_TEXTURE_FORMATS, WGSL_ANALYSIS_PASS, WGSL_CROSS_CHECK_PASS, WGSL_DOWNSAMPLE_PASS, WGSL_FIELD_KERNELS, WGSL_FIELD_PASS, WGSL_FIELD_SAMPLE, WGSL_HIGHLIGHT_PASS, WGSL_IMPORT_PASS, WGSL_INSTANCE_STRUCT, WGSL_OPTICS_PASS, WGSL_PRELUDE, WGSL_RSUPN_GRAD, WGSL_RSUP_GRAD, WGSL_SMOOTH_UNION, WORKING_TEXTURE_FORMAT, ZERO_STATS, accessibilityRefractionCap, adaptationStrength, adaptedTintAlpha, adaptedTintColour, adaptiveTint, allShaderSource, alphaNormalisationMode, analysisModule, backdropFit, backdropToneAdaptation, backdropToneResponse, backdropToneSizeBiasUnderPolicy, backdropToneSolveWeight, backdropToneUnderPolicy, bodyBlurPlan, chainModule, clipFieldRectToCanvas, collapsedRimUnderPolicy, coverFit, createAdaptationState, createAppTextureProvider, createCopyProvider, createDeviceHost, createGovernor, createGpuContext, createGradientProvider, createPassRunner, createPipelineCache, createPyramidStore, createRebuildLedger, createStorageSlot, createTexturePool, createTimingCollector, createUniformSlot, createVideoProvider, createWebGPURenderer, crossCheckKernelModule, displayP3ToSrgbLinear, effectiveRefraction, encodeOutput, encodeOutputBytes, fieldModule, fieldPassSource, groupFieldRect, highlightModule, importColorMatrix, importModule, importPassSource, isUsablePlacement, lensAmountBasePx, lensDepthPx, lensDirection, lensDisplacementPx, lensExtentPx, lensHeightBasePx, lensMagnitudePx, lensOvalizationAt, lensSizeGain, lensSizeGainFromThickness, linearGradientStops, linearToSrgb, linearToSrgbChannel, occlusionAlphaUnderPolicy, opticsModule, opticsUnderPolicy, outerShadowAlpha, outerShadowFalloff, outerShadowLiftRise, outerShadowOcclusionAt, outerShadowReachPx, outerShadowThickOcclusion, outerShadowThinOcclusion, outerShadowUnderPolicy, packInstances, pipelineKey, placementFit, planPyramid, poolKey, readbackDue, refractionRank, relativeLuminance, rendererError, resolveSurfaces, samePlacement, scatterDeepThickness, scatterFloorAtScale, scatterGainAt, scatterGainAtScale, scatterGainFarAtScale, scatterRampAreaMean, scatterRampReachDevicePx, scatterRampStart, scatterSharpShare, scatterSpanMaxAtScale, scatterThickness, shadowDepthPx, sizeOcclusionAlpha, sizeOcclusionAlphaAt, sizeOuterShadowOcclusion, sizeOuterShadowOcclusionAt, sizeScatterSigma, sizeScatterSigmaAt, sizeShadowDepth, sizeShadowDepthAt, sizeThickness, sizeThicknessUnderPolicy, snapRectToDevicePixels, srgbToLinear, srgbToLinearChannel, statsFromBuffer, supportsTimestamps, texelsPerCssPx, tintShade, tintShadeLayer, tintToneAdaptation, tintedMaterialColour, validateAppTexture, withMaterialOverrides };
6196
+ //# sourceMappingURL=dist-2V7EQHSR.js.map
6197
+ //# sourceMappingURL=dist-2V7EQHSR.js.map