@woosh/meep-engine 3.42.0 → 3.43.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.
Files changed (62) hide show
  1. package/package.json +91 -96
  2. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  3. package/src/shade/playground/vgeo_runtime/README.md +5 -4
  4. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  5. package/src/shade/renderer/Renderer.js +6 -5
  6. package/src/shade/renderer/atmosphere/GPUSky.d.ts +12 -0
  7. package/src/shade/renderer/atmosphere/GPUSky.d.ts.map +1 -1
  8. package/src/shade/renderer/atmosphere/GPUSky.js +162 -147
  9. package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.d.ts.map +1 -1
  10. package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.js +10 -3
  11. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  12. package/src/shade/renderer/particles/DESIGN.md +13 -9
  13. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts +1 -1
  14. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.js +1 -1
  15. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  16. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +3 -2
  17. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  18. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +3 -2
  19. package/src/shade/renderer/scene/GPUSceneContext.d.ts +9 -1
  20. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  21. package/src/shade/renderer/scene/GPUSceneContext.js +23 -1
  22. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +4 -1
  23. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  24. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +74 -3
  25. package/src/shade/renderer/volumetrics/NOTES.md +1023 -957
  26. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +5 -4
  27. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts.map +1 -1
  28. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +5 -4
  29. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.d.ts +1 -1
  30. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.js +1 -1
  31. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.d.ts +1 -1
  32. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.js +1 -1
  33. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts +41 -0
  34. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts.map +1 -0
  35. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.js +112 -0
  36. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +9 -23
  37. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
  38. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +18 -126
  39. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts +22 -0
  40. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts.map +1 -0
  41. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.js +228 -0
  42. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
  43. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +0 -53
  44. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -3
  45. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts.map +1 -1
  46. package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +17 -7
  47. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  48. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +69 -23
  49. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
  50. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +13 -5
  51. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +29 -8
  52. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  53. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +155 -30
  54. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +6 -1
  55. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  56. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +157 -39
  57. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +91 -21
  58. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
  59. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +442 -70
  60. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +11 -3
  61. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  62. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +3 -0
@@ -11,25 +11,54 @@ export const WATER_PARTICLE_CORNERS: 4;
11
11
  /** Buckets ordered by particle; a crowded bucket past this keeps its arrival order. */
12
12
  export const WATER_PARTICLE_RANK_LIMIT: 64;
13
13
  /**
14
- * Packets a crowded cell keeps: where more crowd a cell, each is drawn by its share of the cell's summed steepness
15
- * times this, so about this many stay, the steepest whole. Well under the surface sampler's gather budget and the rank
16
- * limit, so a point reads all of its cell and every bucket keeps the particles' order.
14
+ * Packets a crowded point keeps. A point reads a cell of every level its body has, and a cell is crowded where its most
15
+ * crowded point reads more than this: a point of it at its level and the coarser ones, or one under it where finer
16
+ * levels hold packets too. Then each run of a front in it is drawn by its packets' least share of their cells: this
17
+ * many times the packet's steepness over the summed steepness that point reads, whatever the levels it is read at. So
18
+ * about this many stay at a point, the steepest whole wherever they sit, and a front stays whole or goes. What is
19
+ * elsewhere on the body does not count, so a splash far off, or a front moving to a coarser level, changes nothing here.
20
+ *
21
+ * A front's lot is its own for life and the same in every cell it reaches, so the fronts of the lowest lots are kept in
22
+ * every crowd they are in, whatever their size: the count at a point varies by fronts' worth around this, and a front
23
+ * the outline broke is drawn particle by particle, ~20 entries in one cell. Where a point would read more than the
24
+ * gather budget, its cells keep no more of it than their steepness's part, the lowest keys first
25
+ * ({@link WATER_PARTICLE_CROWD_BINS}), so no point reads past the budget. A whole front is drawn as the seven it was
26
+ * emitted as (water_particle_group), so three fresh splashes cross whole, whatever their steepness and levels; a fourth
27
+ * over them thins one.
28
+ *
29
+ * A cell only one front reaches is not crowded, however many of its packets it holds: one front puts at most ~40 in
30
+ * a cell, within the gather budget.
31
+ */
32
+ export const WATER_PARTICLE_CELL_SHARE: 24;
33
+ /**
34
+ * Octaves a crowded cell counts its entries in, by the key its lottery keeps them by (a front's lot over its
35
+ * steepness; the lowest kept first), below the most it can keep: bin j holds keys from 2^-(j+1) of that reach to
36
+ * 2^-j of it, the last everything below. A cell whose point could read past the gather budget drops its octaves from
37
+ * the top until the rest fit its part of the budget, so it may keep up to an octave's worth fewer than would fit.
38
+ */
39
+ export const WATER_PARTICLE_CROWD_BINS: 4;
40
+ /**
41
+ * Words a bucket's crowd takes, as the weigh pass sums it: its summed steepness, its largest front and complement of a
42
+ * front entered, and its entries.
17
43
  */
18
- export const WATER_PARTICLE_CELL_SHARE: 16;
44
+ export const WATER_PARTICLE_CROWD_WORDS: 4;
45
+ /**
46
+ * Words the nest pass adds to a bucket's crowd, in a buffer of their own so that it reads weigh's sums as plain loads:
47
+ * the most entries and the most summed steepness a point under it reads where finer levels hold packets, and its
48
+ * entries by key, {@link WATER_PARTICLE_CROWD_BINS} octaves.
49
+ */
50
+ export const WATER_PARTICLE_NEST_WORDS: number;
19
51
  /** Width of the ramp a thinned packet fades over, a fraction of its share. */
20
52
  export const WATER_PARTICLE_THINNING_RAMP: 0.25;
21
53
  /** The step's settings: one immediate per entry point. */
22
54
  export const WATER_PARTICLE_STEP_STRUCT: WebGPUStruct;
23
55
  /** The pool's limits for the frame's finalize. */
24
56
  export const WATER_PARTICLE_LIMITS_STRUCT: WebGPUStruct;
25
- /**
26
- * Advance every live particle of a body simulated this frame in place and count what it leaves: 0, 1 or 3. A paused
27
- * body's particles stand still and leave themselves.
28
- */
29
57
  export const shader_water_particles_update: ComputeShader;
30
58
  /**
31
- * Write what each particle leaves into the next array at its scanned offset, in order: a split particle's
32
- * three at θ − β/3, θ, θ + β/3 with β/3 each. Past capacity, the tail is dropped.
59
+ * Write what each particle leaves into the next array at its scanned offset, in order: the particle, then the mirror
60
+ * image it left; each split one's three at θ − β/3, θ, θ + β/3 with β/3 each. So a front's particles stay in a row
61
+ * and in order, and an image follows its packet as a front of its own. Past capacity, the tail is dropped.
33
62
  */
34
63
  export const shader_water_particles_split: ComputeShader;
35
64
  /** The next array's count: everything the scan placed, up to capacity. */
@@ -37,30 +66,71 @@ export const shader_water_particles_total: ComputeShader;
37
66
  /**
38
67
  * Each queued splash of a row on the culling pass's emit list becomes a ring
39
68
  * (WATER_SURFACE_SIMULATION_PLAN_2026_10_06.md §5.3): packets of the splash's radius r, two radii out from its centre,
40
- * a front's width apart, ridge height strength·r/c (a vertical velocity over the time a crest takes to cross the
69
+ * their windows' arcs no longer than their envelopes, ridge height strength·r/c (a vertical velocity over the time a crest takes to cross the
41
70
  * packet), no steeper than 0.1. The row's queue is spent. A paused body's ring stands still with its other particles,
42
71
  * which this frame's binning does not visit, so the ring's bound is added to the body's own here.
43
72
  */
44
73
  export const shader_water_particles_emit: ComputeShader;
45
74
  /**
46
75
  * The live count, clamped to capacity (emitters append past it), and the frame's hash table size: twice the
47
- * entries the particles can take, a power of two, at least ${WATER_PARTICLE_TABLE_MIN}.
76
+ * entries the particles can take, a power of two, at least ${WATER_PARTICLE_TABLE_MIN}; and the command that clears
77
+ * that much of the table, a thread a bucket.
48
78
  */
49
79
  export const shader_water_particles_finalize: ComputeShader;
50
80
  /**
51
- * Each particle of a body simulated this frame adds its steepness to every cell its support overlaps: how crowded a
52
- * cell is, for the bin pass to thin it by.
81
+ * Zero the frame's table, as far as finalize sized it: each bucket's count, largest |a| and crowd. A frame pays for the
82
+ * table its particles take, not for the pool's capacity; the buckets past it are never read.
83
+ */
84
+ export const shader_water_particles_clear: ComputeShader;
85
+ /**
86
+ * Where each front's run of particles begins: 1 at a particle not of the front before it, else 0. A front keeps its
87
+ * particles in a row and in order — a ring is emitted whole, a split puts its three in its place, the dead leave no
88
+ * gap — so the inclusive scan of these numbers each run from 1. A mirror image follows its packet in the row: it
89
+ * breaks its front's run there, as a death does, and is a front of its own.
90
+ */
91
+ export const shader_water_particles_fronts: ComputeShader;
92
+ /**
93
+ * Two words a run: its first particle, and the share its crowd leaves it, none yet (the share pass lowers it).
94
+ */
95
+ export const shader_water_particles_runs: ComputeShader;
96
+ /**
97
+ * Two words a particle: its run, and how the frame draws it ({@link chunk_water_particle}'s water_particle_group): 1 as
98
+ * itself, 0 not at all, 3^g for the middle of a whole front's group of 3^g, drawn as one packet.
99
+ */
100
+ export const shader_water_particles_groups: ComputeShader;
101
+ /**
102
+ * Each packet drawn of a body simulated this frame adds its steepness to every cell its support overlaps: how crowded
103
+ * a cell is, for the share pass to thin it by. Per bucket ({@link WATER_PARTICLE_CROWD_WORDS}) the sum, the largest
104
+ * front and complement of a front entered, which are each other's complements only where one front alone was, and the
105
+ * entries. And its level to its body's: a point reads a cell of every level its body has.
53
106
  */
54
107
  export const shader_water_particles_weigh: ComputeShader;
55
108
  /**
56
- * Enter each particle of a body simulated this frame in every hash cell its support overlaps: count it into the cell's
57
- * bucket, keep its slot there, raise the bucket's largest |a| to its own, and mark its level on its body. One atomic
58
- * each: no compare-exchange loop a crowded bucket would serialize. A paused body's particles take no slot: nothing
59
- * draws them this frame.
109
+ * Each packet drawn of a body simulated this frame, its cells weighed: what a point of each of its cells reads at its
110
+ * level and the coarser ones, entries and summed steepness, raised onto the cell over it at every coarser level its
111
+ * body has, so a cell knows its most crowded point where finer levels hold packets under it; and its entry counted
112
+ * among its cell's by its key (water_particle_crowd_bin), for the share pass to cap a crowd by.
113
+ */
114
+ export const shader_water_particles_nest: ComputeShader;
115
+ /**
116
+ * Each packet drawn its share of the most crowded of its cells, lowered onto its run: a run is thinned whole, by the most
117
+ * crowded cell any of its packets is in, so a front is never holed. A cell is crowded where its most crowded point (one
118
+ * of it at its level and the coarser ones, or one under it the nest pass raised) reads more than
119
+ * {@link WATER_PARTICLE_CELL_SHARE} entries, and a packet's share there is that many times its steepness over the summed
120
+ * steepness that point reads. Where that point would read more than the gather budget, the cell keeps no more of it
121
+ * than its own steepness's part: its keys' octaves dropped from the top until the rest fit
122
+ * ({@link WATER_PARTICLE_CROWD_BINS}). A cell only one front reaches does not count.
123
+ */
124
+ export const shader_water_particles_share: ComputeShader;
125
+ /**
126
+ * Enter each packet drawn of a body simulated this frame in every hash cell its support overlaps: count it into the
127
+ * cell's bucket, keep its slot there, raise the bucket's largest |a| to its own, and mark its level on its body. One
128
+ * atomic each: no compare-exchange loop a crowded bucket would serialize. A paused body's particles take no slot:
129
+ * nothing draws them this frame.
60
130
  *
61
- * Where cells are crowded (the weigh pass), a particle is drawn by how much its most crowded cell leaves it
62
- * ({@link WATER_PARTICLE_CELL_SHARE}): one decision for all its cells, so the surface stays continuous across them, and
63
- * from its own lot, so it does not change with the order particles arrive in. One left out takes no slot.
131
+ * Where cells are crowded (the share pass), a run is drawn by the share its most crowded cell leaves it and its
132
+ * front's lot: one decision for all its packets and all their cells, so neither a front nor the surface across cells
133
+ * is holed, and it does not change with the order particles arrive in. One left out takes no slot.
64
134
  */
65
135
  export const shader_water_particles_bin: ComputeShader;
66
136
  /** Each entry to its bucket's range, in arrival order, at the height its crowd leaves it; the rank pass orders it. */
@@ -1 +1 @@
1
- {"version":3,"file":"shader_water_particles.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/shader_water_particles.js"],"names":[],"mappings":"AAuBA,uFAAuF;AACvF,uDAGE;AAEF,+DAA+D;AAC/D,8DAGE;AAEF,oFAAoF;AACpF,yDAGE;AAEF,0DAA0D;AAC1D,4CAA6C;AAE7C,gFAAgF;AAChF,uCAAwC;AAExC,uFAAuF;AACvF,2CAA4C;AAE5C;;;;GAIG;AACH,2CAA4C;AAE5C,8EAA8E;AAC9E,gDAAiD;AAOjD,0DAA0D;AAC1D,sDAAqH;AAErH,kDAAkD;AAClD,wDAA0H;AAe1H;;;GAGG;AACH,0DA0B8G;AAS9G;;;GAGG;AACH,yDAsB+E;AAQ/E,0EAA0E;AAC1E,yDAOiD;AAYjD;;;;;;GAMG;AACH,wDAwC0C;AAQ1C;;;GAGG;AACH,4DASiD;AA+DjD;;;GAGG;AACH,yDAekE;AAalE;;;;;;;;;GASG;AACH,uDAqCkE;AAUlE,sHAAsH;AACtH,2DAqBkE;AAUlE;;;;GAIG;AACH,wDA8BkE;AAUlE;;;;;GAKG;AACH,0DAqBkE;6BAjfrC,sCAAsC;8BAJrC,kCAAkC"}
1
+ {"version":3,"file":"shader_water_particles.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/shader_water_particles.js"],"names":[],"mappings":"AA0BA,uFAAuF;AACvF,uDAGE;AAEF,+DAA+D;AAC/D,8DAGE;AAEF,oFAAoF;AACpF,yDAGE;AAEF,0DAA0D;AAC1D,4CAA6C;AAE7C,gFAAgF;AAChF,uCAAwC;AAExC,uFAAuF;AACvF,2CAA4C;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,2CAA4C;AAE5C;;;;;GAKG;AACH,0CAA2C;AAE3C;;;GAGG;AACH,2CAA4C;AAE5C;;;;GAIG;AACH,+CAAuE;AAEvE,8EAA8E;AAC9E,gDAAiD;AAUjD,0DAA0D;AAC1D,sDAAqH;AAErH,kDAAkD;AAClD,wDAA0H;AAuF1H,0DACyB;AAUzB;;;;GAIG;AACH,yDA4B+E;AAQ/E,0EAA0E;AAC1E,yDAOiD;AAYjD;;;;;;GAMG;AACH,wDAyC0C;AAS1C;;;;GAIG;AACH,4DAaiD;AASjD;;;GAGG;AACH,yDAWsC;AA6FtC;;;;;GAKG;AACH,0DAQ4D;AAQ5D;;GAEG;AACH,wDAY+E;AAS/E;;;GAGG;AACH,0DAc4D;AAW5D;;;;;GAKG;AACH,yDAuBkE;AAYlE;;;;;GAKG;AACH,wDAwCkE;AAalE;;;;;;;;GAQG;AACH,yDAoDkE;AAclE;;;;;;;;;GASG;AACH,uDA6BkE;AAWlE,sHAAsH;AACtH,2DAuBkE;AAWlE;;;;GAIG;AACH,wDAgCkE;AAWlE;;;;;GAKG;AACH,0DAuBkE;6BAp2BrC,sCAAsC;8BAJrC,kCAAkC"}