@woosh/meep-engine 3.60.1 → 3.60.2
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/package.json +1 -1
- package/src/shade/playground/sh_exponential/main.js +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_CLIPMAP_PROPOSAL_2026_10_27.md +4 -0
- package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
- package/src/shade/renderer/light/GPULightCollection.js +3 -5
- package/src/shade/renderer/light/environment/execute_filter_environment_map.d.ts +13 -5
- package/src/shade/renderer/light/environment/execute_filter_environment_map.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/execute_filter_environment_map.js +133 -7
- package/src/shade/renderer/light/environment/graph_filter_environment_map.d.ts +9 -0
- package/src/shade/renderer/light/environment/graph_filter_environment_map.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/graph_filter_environment_map.js +33 -4
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_averages.d.ts +13 -0
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_averages.d.ts.map +1 -0
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_averages.js +169 -0
- package/src/shade/renderer/light/environment/shader_downsample_environment_map.d.ts +3 -0
- package/src/shade/renderer/light/environment/shader_downsample_environment_map.d.ts.map +1 -0
- package/src/shade/renderer/light/environment/shader_downsample_environment_map.js +105 -0
- package/src/shade/renderer/light/environment/sphere_probe_lod_to_roughness.d.ts +10 -0
- package/src/shade/renderer/light/environment/sphere_probe_lod_to_roughness.d.ts.map +1 -0
- package/src/shade/renderer/light/environment/sphere_probe_lod_to_roughness.js +23 -0
- package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.d.ts +8 -4
- package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.js +9 -5
- package/src/view/elements/progress/segmented/GhostTrail.d.ts +6 -0
- package/src/view/elements/progress/segmented/GhostTrail.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/GhostTrail.js +14 -0
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts +55 -19
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.js +173 -120
- package/src/view/elements/progress/segmented/playground/main.js +18 -11
- package/src/view/elements/progress/segmented/segment_cell_extent.d.ts +14 -0
- package/src/view/elements/progress/segmented/segment_cell_extent.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_cell_extent.js +44 -0
- package/src/view/elements/progress/segmented/segment_mask_url.d.ts +24 -0
- package/src/view/elements/progress/segmented/segment_mask_url.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_mask_url.js +74 -0
- package/src/view/elements/progress/segmented/segment_mask_width.d.ts +18 -0
- package/src/view/elements/progress/segmented/segment_mask_width.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_mask_width.js +46 -0
- package/src/view/elements/progress/segmented/segmented-resource-bar.css +6 -10
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chunk_texture_octahedral_skirt_texel_uv
|
|
3
|
+
} from "../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_texel_uv.js";
|
|
4
|
+
import {
|
|
5
|
+
chunk_uv_octahedral_unit_decode
|
|
6
|
+
} from "../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
7
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
8
|
+
import { ComputeShader } from "../../shader/ComputeShader.js";
|
|
9
|
+
import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
10
|
+
import { ShaderDescriptor } from "../../shader/ShaderDescriptor.js";
|
|
11
|
+
|
|
12
|
+
const resources = new ShaderResourceSetDescriptor();
|
|
13
|
+
|
|
14
|
+
resources.createGroup()
|
|
15
|
+
.addTexture("input", "float")
|
|
16
|
+
.addStorageTexture("output", "rgba16float")
|
|
17
|
+
;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* One level of a skirted octahedral map, half the side of the level it reads: the plain average the
|
|
21
|
+
* prefilter's filtered importance sampling picks its source texels from.
|
|
22
|
+
*
|
|
23
|
+
* Each output texel is the solid-angle-weighted mean of the source texels its footprint overlaps.
|
|
24
|
+
* A skirted level's interior is not half the one above (1022 → 510, 6 → 2), so the footprint is
|
|
25
|
+
* 2 + 2/n source texels wide rather than 2, up to 3 at the last level: taps at fixed offsets drift
|
|
26
|
+
* across the source grid and skip texels, which a bright sun then goes missing through. Weighting
|
|
27
|
+
* each overlap by its solid angle keeps a level's energy that of the one above. The solid angle is
|
|
28
|
+
* integrated from the density |d|_1^3 rather than taken from a texel's corners
|
|
29
|
+
* (chunk_octahedral_solid_angle): a texel the octahedral fold crosses is no pair of spherical
|
|
30
|
+
* triangles, and a bright one came out 4.7% dim.
|
|
31
|
+
*
|
|
32
|
+
* @see https://github.com/EpicGames/UnrealEngine/blob/5.4/Engine/Shaders/Private/ReflectionEnvironmentShaders.usf DownsamplePS
|
|
33
|
+
* @type {CodeChunk}
|
|
34
|
+
*/
|
|
35
|
+
const body = CodeChunk.from(
|
|
36
|
+
//language=WGSL
|
|
37
|
+
`
|
|
38
|
+
@compute @workgroup_size(16,16,1)
|
|
39
|
+
fn main(
|
|
40
|
+
@builtin(global_invocation_id) global_invocation_id : vec3<u32>,
|
|
41
|
+
){
|
|
42
|
+
let output_size = textureDimensions(output);
|
|
43
|
+
|
|
44
|
+
let output_texel_i = global_invocation_id.xy;
|
|
45
|
+
|
|
46
|
+
if(any(output_texel_i >= output_size)){
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// the skirt too: a skirt texel takes its interior twin's uv, so it is that texel, computed again
|
|
51
|
+
let out_uv = texture_octahedral_skirt_texel_uv(output_texel_i, output_size.x);
|
|
52
|
+
|
|
53
|
+
let output_interior = f32(output_size.x - 2u);
|
|
54
|
+
let input_interior = f32(textureDimensions(input).x - 2u);
|
|
55
|
+
|
|
56
|
+
// the footprint in the source's interior texels: [lo, lo + span), span = 2 + 2/n <= 3, so it overlaps at most 4 a side
|
|
57
|
+
let span = input_interior / output_interior;
|
|
58
|
+
let lo = floor(out_uv * output_interior) * span;
|
|
59
|
+
let first = floor(lo);
|
|
60
|
+
|
|
61
|
+
var sum = vec4(0.0);
|
|
62
|
+
var weight_sum = 0.0;
|
|
63
|
+
|
|
64
|
+
for (var y = 0u; y < 4u; y++) {
|
|
65
|
+
let texel_y = first.y + f32(y);
|
|
66
|
+
let overlap_y = min(texel_y + 1.0, lo.y + span) - max(texel_y, lo.y);
|
|
67
|
+
|
|
68
|
+
for (var x = 0u; x < 4u; x++) {
|
|
69
|
+
let texel_x = first.x + f32(x);
|
|
70
|
+
let overlap_x = min(texel_x + 1.0, lo.x + span) - max(texel_x, lo.x);
|
|
71
|
+
|
|
72
|
+
if (overlap_x <= 0.0 || overlap_y <= 0.0) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// the overlap's solid angle: the octahedron's solid angle per unit area is |d|_1^3 along unit d,
|
|
77
|
+
// across the folds too, integrated at 2x2 points of the overlap
|
|
78
|
+
let overlap_lo = vec2(max(texel_x, lo.x), max(texel_y, lo.y));
|
|
79
|
+
let overlap = vec2(overlap_x, overlap_y);
|
|
80
|
+
var density = 0.0;
|
|
81
|
+
for (var k = 0u; k < 4u; k++) {
|
|
82
|
+
let at = overlap_lo + overlap * (vec2<f32>(f32(k & 1u), f32(k >> 1u)) * 0.5 + 0.25);
|
|
83
|
+
let l1 = dot(abs(uv_octahedral_unit_decode(at / input_interior)), vec3(1.0));
|
|
84
|
+
density += l1 * l1 * l1;
|
|
85
|
+
}
|
|
86
|
+
let weight = overlap_x * overlap_y * density;
|
|
87
|
+
|
|
88
|
+
sum += textureLoad(input, vec2<u32>(vec2(texel_x, texel_y)) + 1u, 0) * weight;
|
|
89
|
+
weight_sum += weight;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
textureStore(output, output_texel_i, sum / weight_sum);
|
|
94
|
+
}
|
|
95
|
+
`, [
|
|
96
|
+
chunk_texture_octahedral_skirt_texel_uv,
|
|
97
|
+
chunk_uv_octahedral_unit_decode,
|
|
98
|
+
]
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
export const shader_downsample_environment_map = new ComputeShader(ShaderDescriptor.from({
|
|
102
|
+
label: 'Downsample environment map',
|
|
103
|
+
body,
|
|
104
|
+
resources
|
|
105
|
+
}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host twin of `chunk_sphere_probe_lod_to_roughness`: the linear roughness (blender's "UI roughness")
|
|
3
|
+
* a filtered level of the environment map is convolved at.
|
|
4
|
+
*
|
|
5
|
+
* @see https://projects.blender.org/blender/blender/src/commit/866ef5b468589587395b1ee7480ea75b4c0fbc26/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_mapping_lib.glsl#L113
|
|
6
|
+
* @param {number} lod in [0, SPHERE_PROBE_MIPMAP_LEVELS - 1]
|
|
7
|
+
* @returns {number}
|
|
8
|
+
*/
|
|
9
|
+
export function sphere_probe_lod_to_roughness(lod: number): number;
|
|
10
|
+
//# sourceMappingURL=sphere_probe_lod_to_roughness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sphere_probe_lod_to_roughness.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/sphere_probe_lod_to_roughness.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,mDAHW,MAAM,GACJ,MAAM,CAclB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SPHERE_PROBE_MIP_MAX_ROUGHNESS, SPHERE_PROBE_MIPMAP_LEVELS } from "./DEFINES.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Host twin of `chunk_sphere_probe_lod_to_roughness`: the linear roughness (blender's "UI roughness")
|
|
5
|
+
* a filtered level of the environment map is convolved at.
|
|
6
|
+
*
|
|
7
|
+
* @see https://projects.blender.org/blender/blender/src/commit/866ef5b468589587395b1ee7480ea75b4c0fbc26/source/blender/draw/engines/eevee_next/shaders/eevee_lightprobe_sphere_mapping_lib.glsl#L113
|
|
8
|
+
* @param {number} lod in [0, SPHERE_PROBE_MIPMAP_LEVELS - 1]
|
|
9
|
+
* @returns {number}
|
|
10
|
+
*/
|
|
11
|
+
export function sphere_probe_lod_to_roughness(lod) {
|
|
12
|
+
const a = lod / (SPHERE_PROBE_MIPMAP_LEVELS - 1);
|
|
13
|
+
|
|
14
|
+
// factors of the ratio and of its square root, see chunk_roughness_to_mip_ratio
|
|
15
|
+
const b = 0.6;
|
|
16
|
+
const c = 0.4;
|
|
17
|
+
|
|
18
|
+
const c2 = c * c;
|
|
19
|
+
|
|
20
|
+
const ratio = (-Math.sqrt(4.0 * a * b * c2 + c2 * c2) + 2.0 * a * b + c2) / (2.0 * b * b);
|
|
21
|
+
|
|
22
|
+
return ratio * SPHERE_PROBE_MIP_MAX_ROUGHNESS;
|
|
23
|
+
}
|
|
@@ -11,10 +11,14 @@
|
|
|
11
11
|
* - `probe_visibility_chebyshev`: the chance the point is not occluded from the probe, by Chebyshev's
|
|
12
12
|
* inequality over the probe's depth moments (mean, mean of squares) toward it, the distance in the
|
|
13
13
|
* moments' own units; 1 nearer than the mean. The variance is held off zero.
|
|
14
|
-
* - `probe_visibility_weight`: a smooth back-face term, a "wrap shading" ((n·d + 1)/2)
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* - `probe_visibility_weight`: a smooth back-face term, a "wrap shading" ((n·d + 1)/2)², times the
|
|
15
|
+
* visibility; then held off zero, and crushed below 0.2 along a continuous cubic, since a little light
|
|
16
|
+
* reads as more than it is. The trilinear weight is the caller's, after the crush.
|
|
17
|
+
* - DDGI adds 0.2 to the wrap term to keep probes behind small details in play. That floor is left out:
|
|
18
|
+
* a probe behind a thin wall, past its depth's mean at a grazing angle, passes Chebyshev at 0.94–0.97,
|
|
19
|
+
* and the floor alone held it at ≈0.25, just above the crush. On Sponza's outer wall such probes took
|
|
20
|
+
* 11% of the pick, 32% where the wall sits 0.15 of a spacing past a lattice plane, a dark lattice of
|
|
21
|
+
* blotches; without the floor 0.1% and 0.6%.
|
|
18
22
|
*
|
|
19
23
|
* @type {CodeChunk}
|
|
20
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_probe_visibility_weight.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"chunk_probe_visibility_weight.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,4CAFU,SAAS,CAiChB;0BAzDuB,gCAAgC"}
|
|
@@ -13,10 +13,14 @@ import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
|
13
13
|
* - `probe_visibility_chebyshev`: the chance the point is not occluded from the probe, by Chebyshev's
|
|
14
14
|
* inequality over the probe's depth moments (mean, mean of squares) toward it, the distance in the
|
|
15
15
|
* moments' own units; 1 nearer than the mean. The variance is held off zero.
|
|
16
|
-
* - `probe_visibility_weight`: a smooth back-face term, a "wrap shading" ((n·d + 1)/2)
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* - `probe_visibility_weight`: a smooth back-face term, a "wrap shading" ((n·d + 1)/2)², times the
|
|
17
|
+
* visibility; then held off zero, and crushed below 0.2 along a continuous cubic, since a little light
|
|
18
|
+
* reads as more than it is. The trilinear weight is the caller's, after the crush.
|
|
19
|
+
* - DDGI adds 0.2 to the wrap term to keep probes behind small details in play. That floor is left out:
|
|
20
|
+
* a probe behind a thin wall, past its depth's mean at a grazing angle, passes Chebyshev at 0.94–0.97,
|
|
21
|
+
* and the floor alone held it at ≈0.25, just above the crush. On Sponza's outer wall such probes took
|
|
22
|
+
* 11% of the pick, 32% where the wall sits 0.15 of a spacing past a lattice plane, a dark lattice of
|
|
23
|
+
* blotches; without the floor 0.1% and 0.6%.
|
|
20
24
|
*
|
|
21
25
|
* @type {CodeChunk}
|
|
22
26
|
*/
|
|
@@ -39,7 +43,7 @@ fn probe_visibility_weight(direction_to_probe: vec3<f32>, normal: vec3<f32>, vis
|
|
|
39
43
|
// the small offset keeps a probe exactly behind the surface from going to zero
|
|
40
44
|
let backface = max(0.0001, (dot(direction_to_probe, normal) + 1.0) * 0.5);
|
|
41
45
|
|
|
42
|
-
var weight =
|
|
46
|
+
var weight = backface * backface * visibility;
|
|
43
47
|
|
|
44
48
|
weight = max(1e-6, weight);
|
|
45
49
|
|
|
@@ -100,6 +100,12 @@ export class GhostTrail {
|
|
|
100
100
|
* @param {number} time_ms
|
|
101
101
|
*/
|
|
102
102
|
set(target: number, time_ms: number): void;
|
|
103
|
+
/**
|
|
104
|
+
* Stand the trail at `target` with nothing lost: every loss forgotten, whatever was showing. For a target that
|
|
105
|
+
* moved without anything being lost, such as the same amount out of a raised maximum.
|
|
106
|
+
* @param {number} target
|
|
107
|
+
*/
|
|
108
|
+
reset(target: number): void;
|
|
103
109
|
/**
|
|
104
110
|
* Where the trail is at a given time: the highest of the live losses' trails, and never below the target.
|
|
105
111
|
* @param {number} time_ms
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GhostTrail.d.ts","sourceRoot":"","sources":["../../../../../../src/view/elements/progress/segmented/GhostTrail.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;IACI;;;OAGG;IACH,UAFU,MAAM,CAED;IAEf;;;OAGG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,aAAS;IAET;;;;;OAKG;IACH,iBAA6C;IAE7C;;;OAGG;IACH,qBAAiB;IAEjB;;;;;OAKG;IACH,uBAIC;IAED;;;;;;OAMG;IACH,iBAgBC;IAED;;;;;;OAMG;IACH,kBAKC;IAED;;;;;;OAMG;IACH,mBAoBC;IAED;;;;OAIG;IACH,YAHW,MAAM,WACN,MAAM,QAsEhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAgBlB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAkBnB;CACJ"}
|
|
1
|
+
{"version":3,"file":"GhostTrail.d.ts","sourceRoot":"","sources":["../../../../../../src/view/elements/progress/segmented/GhostTrail.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;IACI;;;OAGG;IACH,UAFU,MAAM,CAED;IAEf;;;OAGG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,aAAS;IAET;;;;;OAKG;IACH,iBAA6C;IAE7C;;;OAGG;IACH,qBAAiB;IAEjB;;;;;OAKG;IACH,uBAIC;IAED;;;;;;OAMG;IACH,iBAgBC;IAED;;;;;;OAMG;IACH,kBAKC;IAED;;;;;;OAMG;IACH,mBAoBC;IAED;;;;OAIG;IACH,YAHW,MAAM,WACN,MAAM,QAsEhB;IAED;;;;OAIG;IACH,cAFW,MAAM,QAShB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAgBlB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAkBnB;CACJ"}
|
|
@@ -234,6 +234,20 @@ export class GhostTrail {
|
|
|
234
234
|
this.__to = target;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Stand the trail at `target` with nothing lost: every loss forgotten, whatever was showing. For a target that
|
|
239
|
+
* moved without anything being lost, such as the same amount out of a raised maximum.
|
|
240
|
+
* @param {number} target
|
|
241
|
+
*/
|
|
242
|
+
reset(target) {
|
|
243
|
+
if (!Number.isFinite(target)) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
this.__to = target;
|
|
248
|
+
this.__loss_count = 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
237
251
|
/**
|
|
238
252
|
* Where the trail is at a given time: the highest of the live losses' trails, and never below the target.
|
|
239
253
|
* @param {number} time_ms
|
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
* a ghost behind the fill trails a drop so the loss stays readable for a moment.
|
|
4
4
|
*
|
|
5
5
|
* Two modes:
|
|
6
|
-
* - notches (default): a continuous fill, with a notch at every multiple of each {@link SegmentTier}'s unit
|
|
7
|
-
*
|
|
6
|
+
* - notches (default): a continuous fill, with a notch at every multiple of each {@link SegmentTier}'s unit. Each
|
|
7
|
+
* tier is one layer the width of the bar (`.notch.<class_name>`), which CSS paints — colour, height — and a mask
|
|
8
|
+
* cuts to that tier's notches;
|
|
9
|
+
* - cells (`cells` given): `count` separate cells with exact, identical gaps, for counting rounds and the like. One
|
|
10
|
+
* strip (`.cell-strip`, the empty cells' colour) holding a `.cell-ghost` and a `.cell-fill`, cut into cells by a
|
|
11
|
+
* mask; the fill and ghost end on a cell's edge, or part way across one that is filling.
|
|
8
12
|
*
|
|
9
|
-
*
|
|
10
|
-
* and the
|
|
13
|
+
* The masks are drawn in whole device pixels and the layers they cut placed so those pixels land on the screen's,
|
|
14
|
+
* at any pixel ratio and under a CSS scale: every notch of a tier is the same width and every gap the same, at
|
|
15
|
+
* 125% as at 100%. Colours, notch heights and the ghost are styled by `segmented-resource-bar.css` through
|
|
16
|
+
* `--segmented-bar-*` custom properties. Where masks cannot be drawn (no canvas, as under jsdom) the layers are
|
|
17
|
+
* placed but uncut.
|
|
11
18
|
*/
|
|
12
19
|
export class SegmentedResourceBarView extends View {
|
|
13
20
|
/**
|
|
@@ -105,16 +112,34 @@ export class SegmentedResourceBarView extends View {
|
|
|
105
112
|
* @private
|
|
106
113
|
*/
|
|
107
114
|
private __animate_ghost;
|
|
115
|
+
/**
|
|
116
|
+
* The max moved since the fill was last drawn: the next fill resets the ghost rather than trailing a loss
|
|
117
|
+
* @type {boolean}
|
|
118
|
+
* @private
|
|
119
|
+
*/
|
|
120
|
+
private __max_moved;
|
|
108
121
|
__built_max: number;
|
|
109
122
|
__built_width: number;
|
|
110
123
|
__built_ratio: number;
|
|
111
124
|
__built_origin_phase: number;
|
|
112
125
|
/**
|
|
113
|
-
*
|
|
114
|
-
* @type {
|
|
126
|
+
* Cell mode: the cells as last laid out across {@link __el_strip}, or null before the bar has been measured
|
|
127
|
+
* @type {SegmentCellLayout|null}
|
|
128
|
+
* @private
|
|
129
|
+
*/
|
|
130
|
+
private __cell_layout;
|
|
131
|
+
/**
|
|
132
|
+
* Device pixels per CSS pixel the cells were laid out at
|
|
133
|
+
* @type {number}
|
|
134
|
+
* @private
|
|
135
|
+
*/
|
|
136
|
+
private __cell_ratio;
|
|
137
|
+
/**
|
|
138
|
+
* scratch: [x, width, ...] device-pixel columns for a mask
|
|
139
|
+
* @type {number[]}
|
|
115
140
|
* @private
|
|
116
141
|
*/
|
|
117
|
-
private
|
|
142
|
+
private __columns;
|
|
118
143
|
/**
|
|
119
144
|
*
|
|
120
145
|
* @type {List<NumericInterval>}
|
|
@@ -132,20 +157,19 @@ export class SegmentedResourceBarView extends View {
|
|
|
132
157
|
*/
|
|
133
158
|
private __value_fills;
|
|
134
159
|
/**
|
|
160
|
+
* Notch mode: one layer per tier, the whole bar wide, styled by the tier's class and masked to its notches
|
|
135
161
|
* @type {HTMLElement[]}
|
|
136
162
|
* @private
|
|
137
163
|
*/
|
|
138
|
-
private
|
|
164
|
+
private __tier_layers;
|
|
139
165
|
/**
|
|
140
|
-
*
|
|
166
|
+
* Cell mode: the strip the cells are cut from by a mask, and the ghost and fill drawn along it
|
|
167
|
+
* @type {HTMLElement|null}
|
|
141
168
|
* @private
|
|
142
169
|
*/
|
|
143
|
-
private
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
__cell_states: Uint8Array;
|
|
147
|
-
__cell_fill_drawn: Float64Array;
|
|
148
|
-
__cell_ghost_drawn: Float64Array;
|
|
170
|
+
private __el_strip;
|
|
171
|
+
__el_cell_ghost: HTMLDivElement;
|
|
172
|
+
__el_cell_fill: HTMLDivElement;
|
|
149
173
|
/**
|
|
150
174
|
* The notches' own box; what they are positioned in and what is measured to place them
|
|
151
175
|
* @type {HTMLElement}
|
|
@@ -168,19 +192,31 @@ export class SegmentedResourceBarView extends View {
|
|
|
168
192
|
/**
|
|
169
193
|
* Place the notches or cells again, if the max, the bar's width (by {@link REBUILD_WIDTH_THRESHOLD_PX} or more),
|
|
170
194
|
* its pixel ratio or the device-pixel phase of its left edge has moved since they were last placed.
|
|
195
|
+
*
|
|
196
|
+
* Both are drawn as a mask in whole device pixels over a layer CSS paints (see {@link segment_mask_url}): a DOM
|
|
197
|
+
* box per notch or cell cannot be put on the device-pixel grid at a fractional pixel ratio, where Chrome paints
|
|
198
|
+
* a row of equal 1 px gaps as 1, 2, 1, 2... whatever positions it is given (measured at 125% and 150%).
|
|
171
199
|
*/
|
|
172
200
|
updateSegments(): void;
|
|
201
|
+
/**
|
|
202
|
+
* @param {HTMLElement} el
|
|
203
|
+
* @param {number} width_device
|
|
204
|
+
* @param {number} shift_px
|
|
205
|
+
* @param {number} ratio
|
|
206
|
+
* @private
|
|
207
|
+
*/
|
|
208
|
+
private __place_layer;
|
|
173
209
|
/**
|
|
174
210
|
* @param {number} max
|
|
175
|
-
* @param {number}
|
|
176
|
-
* @param {number}
|
|
211
|
+
* @param {number} width_device
|
|
212
|
+
* @param {number} shift_px
|
|
177
213
|
* @param {number} ratio
|
|
178
214
|
* @private
|
|
179
215
|
*/
|
|
180
216
|
private __place_notches;
|
|
181
217
|
/**
|
|
182
|
-
* @param {number}
|
|
183
|
-
* @param {number}
|
|
218
|
+
* @param {number} width_device
|
|
219
|
+
* @param {number} shift_px
|
|
184
220
|
* @param {number} ratio
|
|
185
221
|
* @private
|
|
186
222
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedResourceBarView.d.ts","sourceRoot":"","sources":["../../../../../../src/view/elements/progress/segmented/SegmentedResourceBarView.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SegmentedResourceBarView.d.ts","sourceRoot":"","sources":["../../../../../../src/view/elements/progress/segmented/SegmentedResourceBarView.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACI;;;;;;;;;;;;OAYG;IACH;QAVgD,MAAM,EAA3C,CAAC,OAAO,kBAAgB,CAAC,EAAE;QAC0B,GAAG,GAAxD,OAAO,uCAAmC;QACvB,SAAS,GAA5B,MAAM,EAAE;QAC6E,KAAK,GAA1F;YAAC,IAAI,EAAC,MAAM,CAAC;YAAC,UAAU,EAAC,MAAM,CAAC;YAAC,QAAQ,EAAC,MAAM,CAAC;YAAC,cAAc,EAAC,MAAM,CAAA;SAAC,EAAE;QAC9B,KAAK,GAAjD;YAAC,KAAK,EAAC,MAAM,CAAC;YAAC,KAAK,EAAC,MAAM,CAAA;SAAC,GAAC,IAAI;QAChB,cAAc,GAA/B,MAAM;QACW,qBAAqB,GAAtC,MAAM;QACW,qBAAqB,GAAtC,MAAM;OAyShB;IA5QG;;;;OAIG;IACH,yBAA8B;IAE9B;;;;OAIG;IACH,oBAAsB;IAEtB;;;OAGG;IACH,gBAAoB;IAEpB;;;OAGG;IACH,gBAAoB;IAEpB;;;OAGG;IACH,gBAA+B;IAG/B;;;OAGG;IACH,gCAAoD;IAEpD;;;OAGG;IACH,gCAAoD;IAEpD;;;;OAIG;IACH,yBAAyB;IAEzB;;;OAGG;IACH,yBAAgH;IAEhH;;;;OAIG;IACH,oBAAuB;IAgiB3B;;OAEG;IACH,4BASC;IAxiBG,yBAA4B;IAC5B,mBAAmB;IA6fvB;;OAEG;IACH,wBAQC;IArgBG;;;;OAIG;IACH,oBAAwB;IAGxB,oBAAsB;IACtB,sBAAwB;IACxB,sBAAwB;IACxB,6BAA+B;IAE/B;;;;OAIG;IACH,sBAAyB;IAEzB;;;;OAIG;IACH,qBAAqB;IAErB;;;;OAIG;IACH,kBAAmB;IAEnB;;;OAGG;IACH,YAFU,qBAAqB,CAEH;IAG5B,mBAAuC;IASvC;;;OAGG;IACH,mBAA+C;IAG/C;;;OAGG;IACH,sBAAuB;IAEvB;;;;OAIG;IACH,sBAAuB;IAEvB;;;;OAIG;IACH,mBAAsB;IACtB,gCAA2B;IAC3B,+BAA0B;IAkBtB;;;;OAIG;IACH,oBAAgD;IAoCpD;;;OAGG;IACH,gBAFU,QAAQ,CAsChB;IAWF;;;;OAIG;IACH,uBAA2C;IAuC/C,eAGC;IAED,wBAMC;IAED;;;;;;;OAOG;IACH,uBA4DC;IAED;;;;;;OAMG;IACH,sBAKC;IAED;;;;;;OAMG;IACH,wBA2CC;IAED;;;;;OAKG;IACH,sBAoBC;IAED,mBAiDC;IAED;;;;OAIG;IACH,eAaC;IAED;;;;OAIG;IACH,qBAoBC;IAeD;;;;OAIG;IACH,mCAUC;CAeJ;iBA5rBgB,kBAAkB;iBALlB,0CAA0C;qBAGtC,6BAA6B;oBAF9B,kCAAkC"}
|