@woosh/meep-engine 3.34.0 → 3.35.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 (90) hide show
  1. package/package.json +1 -1
  2. package/src/shade/device/timing/profile/GPUProfileSession.d.ts +25 -11
  3. package/src/shade/device/timing/profile/GPUProfileSession.d.ts.map +1 -1
  4. package/src/shade/device/timing/profile/GPUProfileSession.js +553 -474
  5. package/src/shade/playground/avboit/main.d.ts.map +1 -1
  6. package/src/shade/playground/avboit/main.js +888 -916
  7. package/src/shade/playground/particle_ecs/README.md +13 -7
  8. package/src/shade/playground/particle_ecs/bonfire_effects.d.ts +5 -5
  9. package/src/shade/playground/particle_ecs/bonfire_effects.js +5 -5
  10. package/src/shade/playground/particle_ecs/effects/smoke.json +1859 -1859
  11. package/src/shade/playground/particle_ecs/effects/soot.json +1605 -1605
  12. package/src/shade/playground/particle_system/README.md +1 -2
  13. package/src/shade/playground/profile_hotkey.d.ts.map +1 -1
  14. package/src/shade/playground/profile_hotkey.js +4 -40
  15. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  16. package/src/shade/playground/skinned_blas_refit/main.js +4 -39
  17. package/src/shade/playground/volumetrics_froxel/main.d.ts.map +1 -1
  18. package/src/shade/playground/volumetrics_froxel/main.js +4 -39
  19. package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
  20. package/src/shade/playground/volumetrics_froxel/measure.js +2 -4
  21. package/src/shade/renderer/Renderer.d.ts +1 -1
  22. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  23. package/src/shade/renderer/Renderer.js +3 -1
  24. package/src/shade/renderer/light/GPULightCollection.d.ts +9 -1
  25. package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
  26. package/src/shade/renderer/light/GPULightCollection.js +41 -0
  27. package/src/shade/renderer/light/environment/shader_project_environment_sh.d.ts +37 -0
  28. package/src/shade/renderer/light/environment/shader_project_environment_sh.d.ts.map +1 -0
  29. package/src/shade/renderer/light/environment/shader_project_environment_sh.js +105 -0
  30. package/src/shade/renderer/particles/DESIGN.md +65 -8
  31. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +7 -1
  32. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  33. package/src/shade/renderer/particles/GPUParticleSystem.js +1247 -1244
  34. package/src/shade/renderer/particles/graph_particles_avboit.d.ts +7 -1
  35. package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
  36. package/src/shade/renderer/particles/graph_particles_avboit.js +9 -0
  37. package/src/shade/renderer/particles/shaders/chunk_particle_billboard_vertex.d.ts.map +1 -1
  38. package/src/shade/renderer/particles/shaders/chunk_particle_billboard_vertex.js +4 -2
  39. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts +15 -9
  40. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts.map +1 -1
  41. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.js +29 -11
  42. package/src/shade/renderer/particles/shaders/chunk_particle_lighting_model.d.ts +24 -0
  43. package/src/shade/renderer/particles/shaders/chunk_particle_lighting_model.d.ts.map +1 -0
  44. package/src/shade/renderer/particles/shaders/chunk_particle_lighting_model.js +45 -0
  45. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.d.ts +3 -0
  46. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.d.ts.map +1 -1
  47. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.js +38 -0
  48. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.d.ts.map +1 -1
  49. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +190 -185
  50. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +8 -0
  51. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  52. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +5 -0
  53. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +8 -1
  54. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  55. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +9 -0
  56. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +13 -3
  57. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  58. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +9 -1
  59. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +39 -0
  60. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts.map +1 -0
  61. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +107 -0
  62. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_froxel_centre_ws.d.ts +15 -0
  63. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_froxel_centre_ws.d.ts.map +1 -0
  64. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_froxel_centre_ws.js +44 -0
  65. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.d.ts +19 -0
  66. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.d.ts.map +1 -0
  67. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.js +48 -0
  68. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.d.ts +29 -0
  69. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.d.ts.map +1 -0
  70. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.js +90 -0
  71. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_brick4.d.ts +10 -0
  72. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_brick4.d.ts.map +1 -0
  73. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_brick4.js +55 -0
  74. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_ibl.d.ts +10 -0
  75. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_ibl.d.ts.map +1 -0
  76. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_ibl.js +47 -0
  77. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_lpv.d.ts +10 -0
  78. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_lpv.d.ts.map +1 -0
  79. package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi_lpv.js +63 -0
  80. package/src/shade/renderer/volumetrics/gi/volumetrics_gi_resources.d.ts +17 -0
  81. package/src/shade/renderer/volumetrics/gi/volumetrics_gi_resources.d.ts.map +1 -0
  82. package/src/shade/renderer/volumetrics/gi/volumetrics_gi_resources.js +26 -0
  83. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +8 -1
  84. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
  85. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +50 -2
  86. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
  87. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +488 -436
  88. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts +1 -1
  89. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts.map +1 -1
  90. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +254 -63
@@ -115,8 +115,13 @@ Two things to know before editing one:
115
115
  - **The flame does not darken what is behind it.** Additive emitters write the emission accumulator,
116
116
  which the resolve adds outside the coverage normalization — so the fire lights the frame instead of
117
117
  taking coverage from it. The smoke, which is matter, does cover.
118
- - **The soot flakes cross in front of the flame and are lit by nothing**, and still read, because
119
- they are dark against something bright. That is the cheapest depth cue in the set.
118
+ - **The smoke is lit, not painted.** Its gradient is an albedo — tar-brown near the fire, paling to
119
+ grey as it thins — and `EMITTER_FLAG.LIGHTING` does the rest: the firelight warms its underside,
120
+ the moon greys the column above, both shadowed, both read out of the froxel volume that lights
121
+ the fog. Orbit until the moon is behind it: the thin edges pass moonlight through (back-face
122
+ transmission) and the dense core holds it back.
123
+ - **The soot flakes cross in front of the flame** and read because they are near-black — lit like the
124
+ smoke, with an albedo to match. That is the cheapest depth cue in the set.
120
125
  - **Orbit around it.** The particles and the transparent surfaces composite against each other with
121
126
  no order between them — both write extinction into one voxel volume and both resolve out of the
122
127
  same accumulators. Switch the renderer to MBOIT and the particles vanish while everything else
@@ -140,11 +145,8 @@ ask for it.
140
145
 
141
146
  ## What it deliberately does not do
142
147
 
143
- - **No emitter opts into `EMITTER_FLAG.LIGHTING`.** The shipped hook is
144
- `chunk_particle_lighting_unlit`, a pass-through, so the flag would cost a bit in a record and
145
- change no pixel. The smoke and the soot are *painted* lit instead: their gradients carry the fire's
146
- warmth low down and the moon's blue higher up, over the particle's own age. When a lit hook lands,
147
- those gradients are the thing to reconsider.
148
+ - **The flame and the embers are not lit.** They are additive and they are the light; the firelight
149
+ is a point light at the fire, because a particle does not light anything.
148
150
  - **No emitter opts into culling.** One fire, always on screen; the frustum test in the tick pass
149
151
  would never be taken. The measured bounds are still published every frame and still read by the
150
152
  occupancy pass.
@@ -201,3 +203,7 @@ The four programs are around 620 VM instructions each in UPDATE, most of which i
201
203
  is twelve of them for a divergence-free field: over a metre of flame nobody can tell, and the four
202
204
  effects share the register budget above — the editor's toolbar reports both numbers after every
203
205
  recompile, which is the cheapest way to notice an edit that has gone past them.
206
+
207
+ Lighting the smoke and the soot costs the particle draw +200..275 us at 1898x926 and +0.8..1.2 ms at
208
+ 3818x2006 on an RTX 4090, over ~450 us and ~2.1 ms unlit; `renderer/particles/DESIGN.md` has how that was
209
+ measured and where it goes.
@@ -115,11 +115,11 @@ export function bonfire_sprite_urls(textures?: object): {
115
115
  *
116
116
  * ## Lighting
117
117
  *
118
- * None of these opt into `EMITTER_FLAG.LIGHTING`, and that is not an oversight: the shipped lighting
119
- * hook is `chunk_particle_lighting_unlit`, a pass-through, so the flag would cost a bit in a record
120
- * and change no pixel. The smoke and the soot are *painted* lit instead — their gradients carry the
121
- * fire's warmth low down where the fire would light them and the moon's blue higher up, over the
122
- * particle's own age. When the lit hook lands the gradients are what to reconsider.
118
+ * The smoke and the soot are lit (`EMITTER_FLAG.LIGHTING`), so their gradients are albedo: the smoke
119
+ * tar-brown at birth paling to grey as it thins, the soot near-black throughout — the alpha ramps are
120
+ * the same as when the gradients were painted lit, emitted colour carrying the fire's warmth low down
121
+ * and the moon's blue higher up. The fire and the moon now do that. The flame and the embers are
122
+ * additive and unlit: they are the light.
123
123
  */
124
124
  /**
125
125
  * The four saved documents, by the key the page knows them by.
@@ -62,11 +62,11 @@ import soot_json from "./effects/soot.json";
62
62
  *
63
63
  * ## Lighting
64
64
  *
65
- * None of these opt into `EMITTER_FLAG.LIGHTING`, and that is not an oversight: the shipped lighting
66
- * hook is `chunk_particle_lighting_unlit`, a pass-through, so the flag would cost a bit in a record
67
- * and change no pixel. The smoke and the soot are *painted* lit instead — their gradients carry the
68
- * fire's warmth low down where the fire would light them and the moon's blue higher up, over the
69
- * particle's own age. When the lit hook lands the gradients are what to reconsider.
65
+ * The smoke and the soot are lit (`EMITTER_FLAG.LIGHTING`), so their gradients are albedo: the smoke
66
+ * tar-brown at birth paling to grey as it thins, the soot near-black throughout — the alpha ramps are
67
+ * the same as when the gradients were painted lit, emitted colour carrying the fire's warmth low down
68
+ * and the moon's blue higher up. The fire and the moon now do that. The flame and the embers are
69
+ * additive and unlit: they are the light.
70
70
  */
71
71
 
72
72
  /**