@woosh/meep-engine 3.78.0 → 3.78.1

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 (190) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/engine/graphics3/GraphicsEngine.d.ts +19 -1
  5. package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -1
  6. package/src/engine/graphics3/GraphicsEngine.js +24 -2
  7. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  8. package/src/engine/physics/cloth/solver/cloth_step.js +4 -1
  9. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +36 -2
  10. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
  11. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +60 -3
  12. package/src/shade/device/pipeline/ComputePipelineManager.d.ts +8 -0
  13. package/src/shade/device/pipeline/ComputePipelineManager.d.ts.map +1 -1
  14. package/src/shade/device/pipeline/ComputePipelineManager.js +18 -0
  15. package/src/shade/device/pipeline/RenderPipelineManager.d.ts +8 -0
  16. package/src/shade/device/pipeline/RenderPipelineManager.d.ts.map +1 -1
  17. package/src/shade/device/pipeline/RenderPipelineManager.js +17 -0
  18. package/src/shade/playground/avboit_footprint/index.html +20 -0
  19. package/src/shade/playground/avboit_footprint/main.d.ts +2 -0
  20. package/src/shade/playground/avboit_footprint/main.d.ts.map +1 -0
  21. package/src/shade/playground/avboit_footprint/main.js +428 -0
  22. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  23. package/src/shade/playground/probe_clipmap/main.js +7 -3
  24. package/src/shade/playground/screen_probes/main.d.ts.map +1 -1
  25. package/src/shade/playground/screen_probes/main.js +7 -3
  26. package/src/shade/renderer/Renderer.d.ts +18 -8
  27. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  28. package/src/shade/renderer/Renderer.js +201 -16
  29. package/src/shade/renderer/RendererConfiguration.d.ts +95 -0
  30. package/src/shade/renderer/RendererConfiguration.d.ts.map +1 -0
  31. package/src/shade/renderer/RendererConfiguration.js +119 -0
  32. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +8 -0
  33. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  34. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +34 -0
  35. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts +7 -0
  36. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts.map +1 -1
  37. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js +15 -0
  38. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +10 -2
  39. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  40. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +37 -3
  41. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +6 -0
  42. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  43. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +31 -0
  44. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +7 -0
  45. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  46. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +20 -0
  47. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +8 -0
  48. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
  49. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +14 -0
  50. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +7 -0
  51. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
  52. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +13 -0
  53. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts +6 -0
  54. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -1
  55. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +9 -0
  56. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +11 -0
  57. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  58. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +71 -1
  59. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +6 -0
  60. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -1
  61. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +9 -0
  62. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +6 -0
  63. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -1
  64. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +9 -0
  65. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts +6 -0
  66. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts.map +1 -1
  67. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.js +13 -0
  68. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +9 -0
  69. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
  70. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +47 -0
  71. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +6 -0
  72. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  73. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +17 -0
  74. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +8 -0
  75. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  76. package/src/shade/renderer/particles/GPUParticleSystem.js +20 -1
  77. package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts +6 -0
  78. package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts.map +1 -1
  79. package/src/shade/renderer/particles/bounds/graph_particle_bounds.js +11 -1
  80. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +6 -0
  81. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  82. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +15 -0
  83. package/src/shade/renderer/particles/graph_particles.d.ts +8 -0
  84. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  85. package/src/shade/renderer/particles/graph_particles.js +28 -3
  86. package/src/shade/renderer/particles/graph_particles_avboit.d.ts +7 -0
  87. package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
  88. package/src/shade/renderer/particles/graph_particles_avboit.js +14 -0
  89. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.d.ts.map +1 -1
  90. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +5 -7
  91. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts +7 -0
  92. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  93. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +15 -0
  94. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts +6 -0
  95. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
  96. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +16 -2
  97. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts +6 -0
  98. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts.map +1 -1
  99. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.js +9 -0
  100. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts +11 -0
  101. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts.map +1 -1
  102. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.js +10 -0
  103. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +6 -0
  104. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
  105. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +10 -1
  106. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +7 -0
  107. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts.map +1 -1
  108. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +21 -0
  109. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts +7 -0
  110. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts.map +1 -1
  111. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.js +11 -1
  112. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts +9 -0
  113. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts.map +1 -1
  114. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.js +29 -0
  115. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts +6 -0
  116. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts.map +1 -1
  117. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.js +13 -1
  118. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts +6 -0
  119. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts.map +1 -1
  120. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.js +11 -0
  121. package/src/shade/renderer/postprocess/nss/NSS.d.ts +9 -0
  122. package/src/shade/renderer/postprocess/nss/NSS.d.ts.map +1 -1
  123. package/src/shade/renderer/postprocess/nss/NSS.js +33 -18
  124. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +8 -0
  125. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  126. package/src/shade/renderer/postprocess/ssr/SSR.js +42 -2
  127. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts +6 -0
  128. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts.map +1 -1
  129. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.js +10 -0
  130. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts +6 -0
  131. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts.map +1 -1
  132. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.js +11 -0
  133. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts +8 -0
  134. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  135. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +27 -3
  136. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts +6 -0
  137. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts.map +1 -1
  138. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.js +10 -0
  139. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +5 -4
  140. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  141. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +5 -4
  142. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts +3 -3
  143. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js +3 -3
  144. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
  145. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -7
  146. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts.map +1 -1
  147. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js +5 -7
  148. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts +34 -0
  149. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts.map +1 -0
  150. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.js +42 -0
  151. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts +5 -4
  152. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts.map +1 -1
  153. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.js +8 -7
  154. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts +2 -2
  155. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts.map +1 -1
  156. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.js +4 -5
  157. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +9 -0
  158. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  159. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +18 -0
  160. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts +9 -0
  161. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
  162. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +15 -0
  163. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +6 -0
  164. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts.map +1 -1
  165. package/src/shade/renderer/restir/di/ReSTIRDI.js +10 -1
  166. package/src/shade/renderer/restir/di/graph_restir_di.d.ts +9 -0
  167. package/src/shade/renderer/restir/di/graph_restir_di.d.ts.map +1 -1
  168. package/src/shade/renderer/restir/di/graph_restir_di.js +19 -1
  169. package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts +6 -0
  170. package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts.map +1 -1
  171. package/src/shade/renderer/restir/di/graph_restir_di_denoise.js +9 -0
  172. package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts +7 -0
  173. package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts.map +1 -1
  174. package/src/shade/renderer/scene/movers/graph_scene_movers.js +11 -0
  175. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts +10 -0
  176. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
  177. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +25 -1
  178. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts +7 -0
  179. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts.map +1 -1
  180. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.js +14 -0
  181. package/src/shade/renderer/text/shaders/shader_text_avboit.d.ts.map +1 -1
  182. package/src/shade/renderer/text/shaders/shader_text_avboit.js +5 -7
  183. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +9 -1
  184. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  185. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +16 -1
  186. package/src/shade/renderer/water/shader_water_avboit.d.ts.map +1 -1
  187. package/src/shade/renderer/water/shader_water_avboit.js +16 -13
  188. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts +0 -33
  189. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts.map +0 -1
  190. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.js +0 -45
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### Cloth: a cloth that slides is not pulled back to where it landed
6
+
7
+ - **Fixed:** cloth friction pulled a sliding particle towards the point where its contact began, for as long as
8
+ the contact lasted. A sheet shoved across a floor swung back through where it started, and a sheet carried by a
9
+ turning collider went on round after the collider stopped. A friction row at its cap now brings its anchor up
10
+ behind the particle; a contact that holds is unchanged (cloth `MEASUREMENTS.md` §70).
11
+ - **Changed:** `cloth_contact_dual_update` takes `alpha` and `gamma` after the collider table.
12
+
5
13
  ### Sound: beat-locked music
6
14
 
7
15
  - **Added:** `sopra/music/`, an adaptive score as layers of stems on one tempo grid. `MusicGrid` (tempo, meter
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  Meep is a game engine with a GPU-driven WebGPU renderer, physics, spatial audio, rollback
6
6
  networking and an in-app editor.
7
7
 
8
- [Examples](https://meep.company-named.com/examples/) · [Documentation](https://meep.company-named.com/docs/getting-started/) · [Licence & pricing](https://meep.company-named.com/pricing/)
8
+ [Examples](https://meep.company-named.com/examples/) · [Documentation](https://meep.company-named.com/docs/getting-started/) · [Licence & pricing](https://meep.company-named.com/pricing/) · [Check your device](https://webgpu.report/check?features=indirect-first-instance,float32-blendable,texture-formats-tier1,subgroups&maxStorageBuffersPerShaderStage=10&maxColorAttachmentBytesPerSample=32)
9
9
 
10
10
  ## Getting started
11
11
 
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Advanced 3D game engine",
7
7
  "type": "module",
8
8
  "author": "Alexander Goldring",
9
- "version": "3.78.0",
9
+ "version": "3.78.1",
10
10
  "exports": {
11
11
  "./build/*": "./build/*",
12
12
  "./src/*": "./src/*",
@@ -6,7 +6,7 @@
6
6
  * start(), stop(), render(), updateSize()}` — because that is what `Engine` needs in order to boot,
7
7
  * and because the facade is deliberately not allowed to grow past §4.2 (D14).
8
8
  *
9
- * **Four things have been let through since, each by name.** {@link add_extension} /
9
+ * **Five things have been let through since, each by name.** {@link add_extension} /
10
10
  * {@link remove_extension} (E9), because an extension has to survive the restart that replaces the
11
11
  * renderer holding it; {@link add_transparency_channel} / {@link remove_transparency_channel}
12
12
  * (2026-09-24, trails), the same door for the one thing an extension cannot do — draw inside the
@@ -20,6 +20,10 @@
20
20
  * callers that have no other route, not a migration target — the old engine's 44
21
21
  * `.renderer`/`getRenderer()` call sites are each still a migration item.
22
22
  *
23
+ * {@link renderer_configuration} is the fifth: what every renderer this engine starts begins as. It
24
+ * is held here for the reason extensions are — it is stated before a device exists, and it outlives
25
+ * the renderer a restart replaces — and it is data the caller writes, not the renderer.
26
+ *
23
27
  * What is deliberately absent, and stays absent: `getRenderer()` (the old engine's accessor, and
24
28
  * the shape those call sites are being ported off), `layers` (CPU visibility dies with GPU
25
29
  * culling), `scene` (entities reach the scene through the mesh system, not through the facade),
@@ -44,6 +48,19 @@ export class GraphicsEngine {
44
48
  * @returns {Renderer|null}
45
49
  */
46
50
  get renderer(): Renderer;
51
+ /**
52
+ * What every renderer {@link start} makes begins as: the settings that decide which pipelines it
53
+ * compiles ahead of its first frame, so a frame is not held up compiling them when it first draws
54
+ * with them. Write to it before {@link start}.
55
+ *
56
+ * {@link start} reads it each time, so a restart begins from it again. Once a renderer is running
57
+ * its own fields are the state: a change made here waits for the next {@link start}, and a change
58
+ * made on the renderer does not come back here.
59
+ *
60
+ * @readonly
61
+ * @type {RendererConfiguration}
62
+ */
63
+ readonly renderer_configuration: RendererConfiguration;
47
64
  /**
48
65
  * @param {boolean} v
49
66
  */
@@ -409,6 +426,7 @@ export type GPUSceneContext = import("../../shade/renderer/scene/GPUSceneContext
409
426
  export type ShadeTexture = import("../../shade/renderer/texture/ShadeTexture.js").ShadeTexture;
410
427
  export type Camera = import("../graphics/ecs/camera/Camera.js").Camera;
411
428
  import { Renderer } from "../../shade/renderer/Renderer.js";
429
+ import { RendererConfiguration } from "../../shade/renderer/RendererConfiguration.js";
412
430
  import { ShadeCameraAdapter } from "./ShadeCameraAdapter.js";
413
431
  import Signal from "../../core/events/signal/Signal.js";
414
432
  import { Vector2 } from "../../core/geom/Vector2.js";
@@ -1 +1 @@
1
- {"version":3,"file":"GraphicsEngine.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/GraphicsEngine.js"],"names":[],"mappings":"AA0DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;IACI;;;;;OAKG;IACH,gCAEC;IAUD;;;;OAIG;IACH,yBAEC;IAwDD;;OAEG;IACH,0CAQC;IAlBD;;OAEG;IACH,yCAEC;IA0CG;;;;;;OAMG;IACH,QAFU,kBAAkB,CAEsB;IAElD;QACI;;;;;;;;WAQG;mBADO,MAAM;QAIhB;;;;;WAKG;oBADO,MAAM;QAIhB;;;;WAIG;qBADO,MAAM;QAIhB;;;;;;;WAOG;;QAGH;;;;;WAKG;;MAEN;IAID;;;;;OAKG;IACH,4BAFU,OAAO,CAEyB;IAE1C;;;;;;OAMG;IACH,UAFU,SAAS,CAEY;IAG/B;;OAEG;IACH,YAFU,iBAAiB,GAAC,IAAI,CAEV;IAEtB;;;;;OAKG;IACH,UAFU,OAAO,CAEG;IAEpB;;;;;OAKG;IACH,UAFU,OAAO,CAEG;IAEpB;;OAEG;IACH,YAFU,MAAM,CAEG;IAoBvB;;;;;;;;;;;;OAYG;IACH,mDAEC;IAED;;;;;;;;OAQG;IACH,iBAFW,KAAK,QAgBf;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,6BAFW,YAAY,QAStB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,yBAHW,eAAe,GACb,eAAe,CAa3B;IAED;;;;;;;;;;OAUG;IACH,uBAHW,UAAU,GACR,MAAM,CAclB;IAED;;;;;;OAMG;IACH,4BAHW,eAAe,GACb,OAAO,CAgBnB;IAED;;;;;;;;;;;;;OAaG;IACH,kCAHW,iBAAiB,GACf,iBAAiB,CAqB7B;IAED;;;;;;OAMG;IACH,8BAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,qCAHW,iBAAiB,GACf,OAAO,CAgBnB;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,qBALW,KAAK,GACH,eAAe,GAAC,IAAI,CAehC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,yBARW,KAAK,UACL,MAAM,SACN,MAAM,UACN,MAAM,GACJ,QAAQ,SAAS,CAAC,CAwD9B;IAED;;;;OAIG;IACH,0BAEC;IAED;;;;;;;;;;OAUG;IACH,SAFa,QAAQ,IAAI,CAAC,CAyDzB;IAED;;;;;;;;;;;;;;;OAeG;IACH,qBAFW,iBAAiB,QAc3B;IAED;;;;;OAKG;IACH,aAiBC;IASD;;;;;;;;OAQG;IACH,8BAHW,OAAO,GAAC,OAAO,UACf,OAAO,GAAC,OAAO,QAQzB;IAED;;;;;;;;;;;;;;;OAeG;IACH,yBALW,MAAM,KACN,MAAM,UACN,OAAO,aACP,OAAO,QAIjB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,mBAyBC;IAED;;;;;;;;;OASG;IACH,4BAPW,MAAM,GAKJ,OAAO,CA2DnB;;CACJ;sBAx6BY,OAAO,4BAA4B,EAAE,OAAO;yBAC5C,OAAO,8CAA8C,EAAE,UAAU;8BACjE,OAAO,mDAAmD,EAAE,eAAe;gCAC3E,OAAO,mEAAmE,EAAE,iBAAiB;8BAC7F,OAAO,+CAA+C,EAAE,eAAe;2BACvE,OAAO,8CAA8C,EAAE,YAAY;qBACnE,OAAO,kCAAkC,EAAE,MAAM;yBAdrC,kCAAkC;mCAKxB,yBAAyB;mBAXzC,oCAAoC;wBAC/B,4BAA4B;sBAQ9B,kCAAkC;yCAJf,kDAAkD;sBAErE,qCAAqC;0BACjC,0CAA0C"}
1
+ {"version":3,"file":"GraphicsEngine.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/GraphicsEngine.js"],"names":[],"mappings":"AA2DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IACI;;;;;OAKG;IACH,gCAEC;IAUD;;;;OAIG;IACH,yBAEC;IAED;;;;;;;;;;;OAWG;IACH,iCAFU,qBAAqB,CAEsB;IAwDrD;;OAEG;IACH,0CAQC;IAlBD;;OAEG;IACH,yCAEC;IA0CG;;;;;;OAMG;IACH,QAFU,kBAAkB,CAEsB;IAElD;QACI;;;;;;;;WAQG;mBADO,MAAM;QAIhB;;;;;WAKG;oBADO,MAAM;QAIhB;;;;WAIG;qBADO,MAAM;QAIhB;;;;;;;WAOG;;QAGH;;;;;WAKG;;MAEN;IAID;;;;;OAKG;IACH,4BAFU,OAAO,CAEyB;IAE1C;;;;;;OAMG;IACH,UAFU,SAAS,CAEY;IAG/B;;OAEG;IACH,YAFU,iBAAiB,GAAC,IAAI,CAEV;IAEtB;;;;;OAKG;IACH,UAFU,OAAO,CAEG;IAEpB;;;;;OAKG;IACH,UAFU,OAAO,CAEG;IAEpB;;OAEG;IACH,YAFU,MAAM,CAEG;IAoBvB;;;;;;;;;;;;OAYG;IACH,mDAEC;IAED;;;;;;;;OAQG;IACH,iBAFW,KAAK,QAgBf;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,6BAFW,YAAY,QAStB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,yBAHW,eAAe,GACb,eAAe,CAa3B;IAED;;;;;;;;;;OAUG;IACH,uBAHW,UAAU,GACR,MAAM,CAclB;IAED;;;;;;OAMG;IACH,4BAHW,eAAe,GACb,OAAO,CAgBnB;IAED;;;;;;;;;;;;;OAaG;IACH,kCAHW,iBAAiB,GACf,iBAAiB,CAqB7B;IAED;;;;;;OAMG;IACH,8BAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,qCAHW,iBAAiB,GACf,OAAO,CAgBnB;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,qBALW,KAAK,GACH,eAAe,GAAC,IAAI,CAehC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,yBARW,KAAK,UACL,MAAM,SACN,MAAM,UACN,MAAM,GACJ,QAAQ,SAAS,CAAC,CAwD9B;IAED;;;;OAIG;IACH,0BAEC;IAED;;;;;;;;;;OAUG;IACH,SAFa,QAAQ,IAAI,CAAC,CA4DzB;IAED;;;;;;;;;;;;;;;OAeG;IACH,qBAFW,iBAAiB,QAc3B;IAED;;;;;OAKG;IACH,aAiBC;IASD;;;;;;;;OAQG;IACH,8BAHW,OAAO,GAAC,OAAO,UACf,OAAO,GAAC,OAAO,QAQzB;IAED;;;;;;;;;;;;;;;OAeG;IACH,yBALW,MAAM,KACN,MAAM,UACN,OAAO,aACP,OAAO,QAIjB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,mBAyBC;IAED;;;;;;;;;OASG;IACH,4BAPW,MAAM,GAKJ,OAAO,CA2DnB;;CACJ;sBA77BY,OAAO,4BAA4B,EAAE,OAAO;yBAC5C,OAAO,8CAA8C,EAAE,UAAU;8BACjE,OAAO,mDAAmD,EAAE,eAAe;gCAC3E,OAAO,mEAAmE,EAAE,iBAAiB;8BAC7F,OAAO,+CAA+C,EAAE,eAAe;2BACvE,OAAO,8CAA8C,EAAE,YAAY;qBACnE,OAAO,kCAAkC,EAAE,MAAM;yBAfrC,kCAAkC;sCACrB,+CAA+C;mCAKlD,yBAAyB;mBAZzC,oCAAoC;wBAC/B,4BAA4B;sBAS9B,kCAAkC;yCALf,kDAAkD;sBAGrE,qCAAqC;0BACjC,0CAA0C"}
@@ -6,6 +6,7 @@ import { TextureDescriptor } from "../../shade/descriptor/texture/TextureDescrip
6
6
  import { PerspectiveCamera } from "../../shade/renderer/camera/PerspectiveCamera.js";
7
7
  import { DynamicResolutionScaling } from "../../shade/renderer/DynamicResolutionScaling.js";
8
8
  import { Renderer } from "../../shade/renderer/Renderer.js";
9
+ import { RendererConfiguration } from "../../shade/renderer/RendererConfiguration.js";
9
10
  import { Scene } from "../../shade/renderer/scene/Scene.js";
10
11
  import { Sampler2D } from "../graphics/texture/sampler/Sampler2D.js";
11
12
  import EmptyView from "../../view/elements/EmptyView.js";
@@ -64,7 +65,7 @@ const TARGET_FRAME_RATE = 30;
64
65
  * start(), stop(), render(), updateSize()}` — because that is what `Engine` needs in order to boot,
65
66
  * and because the facade is deliberately not allowed to grow past §4.2 (D14).
66
67
  *
67
- * **Four things have been let through since, each by name.** {@link add_extension} /
68
+ * **Five things have been let through since, each by name.** {@link add_extension} /
68
69
  * {@link remove_extension} (E9), because an extension has to survive the restart that replaces the
69
70
  * renderer holding it; {@link add_transparency_channel} / {@link remove_transparency_channel}
70
71
  * (2026-09-24, trails), the same door for the one thing an extension cannot do — draw inside the
@@ -78,6 +79,10 @@ const TARGET_FRAME_RATE = 30;
78
79
  * callers that have no other route, not a migration target — the old engine's 44
79
80
  * `.renderer`/`getRenderer()` call sites are each still a migration item.
80
81
  *
82
+ * {@link renderer_configuration} is the fifth: what every renderer this engine starts begins as. It
83
+ * is held here for the reason extensions are — it is stated before a device exists, and it outlives
84
+ * the renderer a restart replaces — and it is data the caller writes, not the renderer.
85
+ *
81
86
  * What is deliberately absent, and stays absent: `getRenderer()` (the old engine's accessor, and
82
87
  * the shape those call sites are being ported off), `layers` (CPU visibility dies with GPU
83
88
  * culling), `scene` (entities reach the scene through the mesh system, not through the facade),
@@ -116,6 +121,20 @@ export class GraphicsEngine {
116
121
  return this.#renderer;
117
122
  }
118
123
 
124
+ /**
125
+ * What every renderer {@link start} makes begins as: the settings that decide which pipelines it
126
+ * compiles ahead of its first frame, so a frame is not held up compiling them when it first draws
127
+ * with them. Write to it before {@link start}.
128
+ *
129
+ * {@link start} reads it each time, so a restart begins from it again. Once a renderer is running
130
+ * its own fields are the state: a change made here waits for the next {@link start}, and a change
131
+ * made on the renderer does not come back here.
132
+ *
133
+ * @readonly
134
+ * @type {RendererConfiguration}
135
+ */
136
+ renderer_configuration = new RendererConfiguration();
137
+
119
138
  /**
120
139
  * Trades internal resolution for frame time — see {@link dynamic_resolution}.
121
140
  *
@@ -709,7 +728,10 @@ export class GraphicsEngine {
709
728
  }
710
729
 
711
730
  try {
712
- await renderer.initialize({ context: canvas.getContext('webgpu') });
731
+ await renderer.initialize({
732
+ context: canvas.getContext('webgpu'),
733
+ configuration: this.renderer_configuration,
734
+ });
713
735
  } catch (failure) {
714
736
  this.#canvas = null;
715
737
 
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_step.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/cloth_step.js"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkIG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,kDAfW,MAAM,kBACN,MAAM,kBAEN,MAAM,kBACN,MAAM,YACN,MAAM,cACN,MAAM,mBACN,YAAY,GAAC,YAAY,GAAC,IAAI,mBAE9B,MAAM,WACN;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAC,aAChK,YAAY,GAAC,IAAI,QAwI3B"}
1
+ {"version":3,"file":"cloth_step.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/cloth_step.js"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkIG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,kDAfW,MAAM,kBACN,MAAM,kBAEN,MAAM,kBACN,MAAM,YACN,MAAM,cACN,MAAM,mBACN,YAAY,GAAC,YAAY,GAAC,IAAI,mBAE9B,MAAM,WACN;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAC,aAChK,YAAY,GAAC,IAAI,QA2I3B"}
@@ -302,7 +302,10 @@ export function cloth_step(
302
302
  cloth_backstop_dual_update(state, beta, k_max_ratio, inverse_h_squared);
303
303
 
304
304
  if (contacts !== null) {
305
- cloth_contact_dual_update(state, contacts, beta, k_max_ratio, inverse_h_squared, contact_ramp_ratio);
305
+ cloth_contact_dual_update(
306
+ state, contacts, alpha, gamma, beta,
307
+ k_max_ratio, inverse_h_squared, contact_ramp_ratio
308
+ );
306
309
  }
307
310
  }
308
311
 
@@ -38,15 +38,22 @@ export function cloth_contact_warm_start(state: ClothState, alpha: number, gamma
38
38
  * the next iteration. It costs a second field evaluation per contact per
39
39
  * iteration and it is what makes the multiplier converge within the step.
40
40
  *
41
+ * A friction row that ends the update at its cap has yielded, and its anchor is
42
+ * brought up behind the particle — the module docblock says how far and why.
43
+ *
41
44
  * @param {ClothState} state
42
- * @param {Float32Array|Float64Array} table
45
+ * @param {Float32Array|Float64Array} table packed colliders, cloth-local, posed
46
+ * at the substep in progress
47
+ * @param {number} alpha the multiplier's regularisation, as
48
+ * {@link cloth_contact_warm_start} takes it
49
+ * @param {number} gamma the multiplier's decay, with `alpha`
43
50
  * @param {number} beta the friction row's ramp, N/m²
44
51
  * @param {number} k_max_ratio
45
52
  * @param {number} inverse_h_squared
46
53
  * @param {number} [ramp_ratio] the normal row's ramp, as the fraction of the
47
54
  * band gained per contact offset of violation per iteration
48
55
  */
49
- export function cloth_contact_dual_update(state: ClothState, table: Float32Array | Float64Array, beta: number, k_max_ratio: number, inverse_h_squared: number, ramp_ratio?: number): void;
56
+ export function cloth_contact_dual_update(state: ClothState, table: Float32Array | Float64Array, alpha: number, gamma: number, beta: number, k_max_ratio: number, inverse_h_squared: number, ramp_ratio?: number): void;
50
57
  /**
51
58
  * # Contact — the collision row and its friction row, which are one contact
52
59
  *
@@ -95,6 +102,33 @@ export function cloth_contact_dual_update(state: ClothState, table: Float32Array
95
102
  * frame to frame is a choice with state in it — which is exactly what §7 P4(a)
96
103
  * exists to keep out of this system.
97
104
  *
105
+ * ## The anchor follows a row that has yielded
106
+ *
107
+ * The anchor remembers a point only while the row holds. A row at its cap is
108
+ * sliding, and Coulomb friction opposes the slide — not the way back to where
109
+ * the particle first touched. An anchor left behind turns the cap into a pull
110
+ * towards that point whichever way the particle is moving, which is a
111
+ * potential: it takes speed from a particle going out and hands it back on the
112
+ * return.
113
+ *
114
+ * So when the dual update finds a row at its cap, the anchor is brought up
115
+ * behind the particle, along the slip, to
116
+ *
117
+ * ‖P_t(x − a)‖ = (1 − α·γ) · μ·f_n / k_f
118
+ *
119
+ * and no closer. The invariant is that **a row enters a substep carrying no
120
+ * more than its cap**. The row's force is `k_f·‖P_t(x − a)‖ + λ_f`, and the
121
+ * warm start keeps `α·γ` of `λ_f`; the offset carries what that drops. Closer,
122
+ * and a contact held near its cap has to slide every substep to rebuild the
123
+ * force the multiplier lost. Further, and the offset and the multiplier carry
124
+ * more than the cap between them, so a row that has yielded is still at its cap
125
+ * after the particle has stopped. The friction penalty's own decay only takes
126
+ * the row further inside the cap.
127
+ *
128
+ * A row under its cap is not touched, so static friction holds a particle to
129
+ * the point it stuck at exactly as before. What is left of the pull is that
130
+ * offset: a particle that slides to a stop settles back by at most that far.
131
+ *
98
132
  * ## Which force the friction cap reads
99
133
  *
100
134
  * The *current iteration's* normal force, not the previous iteration's
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_contact_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_contact_row.js"],"names":[],"mappings":"AAwIA;;;;;;;;GAQG;AACH,sDANW,YAAY,+BAEZ,MAAM,SACN,YAAY,GAAC,YAAY,QA+LnC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,mEARW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,kBACN,MAAM,QAkDhB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,oEAPW,YAAY,GAAC,YAAY,QACzB,MAAM,eACN,MAAM,qBACN,MAAM,eACN,MAAM,QA2GhB;AAnfD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;;GAKG;AACH,qCAFU,MAAM,CAE2B"}
1
+ {"version":3,"file":"cloth_contact_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_contact_row.js"],"names":[],"mappings":"AAmKA;;;;;;;;GAQG;AACH,sDANW,YAAY,+BAEZ,MAAM,SACN,YAAY,GAAC,YAAY,QA+LnC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,mEARW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,kBACN,MAAM,QAkDhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oEAXW,YAAY,GAAC,YAAY,SAEzB,MAAM,SAEN,MAAM,QACN,MAAM,eACN,MAAM,qBACN,MAAM,eACN,MAAM,QAkIhB;AA5iBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;;GAKG;AACH,qCAFU,MAAM,CAE2B"}
@@ -72,6 +72,33 @@ import { CLOTH_CONTACT_GAMMA, CLOTH_CONTACT_RAMP_RATIO } from "../cloth_solver_c
72
72
  * frame to frame is a choice with state in it — which is exactly what §7 P4(a)
73
73
  * exists to keep out of this system.
74
74
  *
75
+ * ## The anchor follows a row that has yielded
76
+ *
77
+ * The anchor remembers a point only while the row holds. A row at its cap is
78
+ * sliding, and Coulomb friction opposes the slide — not the way back to where
79
+ * the particle first touched. An anchor left behind turns the cap into a pull
80
+ * towards that point whichever way the particle is moving, which is a
81
+ * potential: it takes speed from a particle going out and hands it back on the
82
+ * return.
83
+ *
84
+ * So when the dual update finds a row at its cap, the anchor is brought up
85
+ * behind the particle, along the slip, to
86
+ *
87
+ * ‖P_t(x − a)‖ = (1 − α·γ) · μ·f_n / k_f
88
+ *
89
+ * and no closer. The invariant is that **a row enters a substep carrying no
90
+ * more than its cap**. The row's force is `k_f·‖P_t(x − a)‖ + λ_f`, and the
91
+ * warm start keeps `α·γ` of `λ_f`; the offset carries what that drops. Closer,
92
+ * and a contact held near its cap has to slide every substep to rebuild the
93
+ * force the multiplier lost. Further, and the offset and the multiplier carry
94
+ * more than the cap between them, so a row that has yielded is still at its cap
95
+ * after the particle has stopped. The friction penalty's own decay only takes
96
+ * the row further inside the cap.
97
+ *
98
+ * A row under its cap is not touched, so static friction holds a particle to
99
+ * the point it stuck at exactly as before. What is left of the pull is that
100
+ * offset: a particle that slides to a stop settles back by at most that far.
101
+ *
75
102
  * ## Which force the friction cap reads
76
103
  *
77
104
  * The *current iteration's* normal force, not the previous iteration's
@@ -411,17 +438,28 @@ export function cloth_contact_warm_start(state, alpha, gamma, k_min_ratio, k_max
411
438
  * the next iteration. It costs a second field evaluation per contact per
412
439
  * iteration and it is what makes the multiplier converge within the step.
413
440
  *
441
+ * A friction row that ends the update at its cap has yielded, and its anchor is
442
+ * brought up behind the particle — the module docblock says how far and why.
443
+ *
414
444
  * @param {ClothState} state
415
- * @param {Float32Array|Float64Array} table
445
+ * @param {Float32Array|Float64Array} table packed colliders, cloth-local, posed
446
+ * at the substep in progress
447
+ * @param {number} alpha the multiplier's regularisation, as
448
+ * {@link cloth_contact_warm_start} takes it
449
+ * @param {number} gamma the multiplier's decay, with `alpha`
416
450
  * @param {number} beta the friction row's ramp, N/m²
417
451
  * @param {number} k_max_ratio
418
452
  * @param {number} inverse_h_squared
419
453
  * @param {number} [ramp_ratio] the normal row's ramp, as the fraction of the
420
454
  * band gained per contact offset of violation per iteration
421
455
  */
422
- export function cloth_contact_dual_update(state, table, beta, k_max_ratio, inverse_h_squared, ramp_ratio = CLOTH_CONTACT_RAMP_RATIO) {
456
+ export function cloth_contact_dual_update(state, table, alpha, gamma, beta, k_max_ratio, inverse_h_squared, ramp_ratio = CLOTH_CONTACT_RAMP_RATIO) {
423
457
  const particle_count = state.particle_count;
424
458
 
459
+ // What the next warm start drops from a friction multiplier, which is what
460
+ // a yielded row's anchor has to carry in its place.
461
+ const carried_by_anchor = 1 - alpha * gamma;
462
+
425
463
  const collider = state.contact_collider;
426
464
  const mass_inverse = state.mass_inverse;
427
465
  const position = state.position;
@@ -516,7 +554,26 @@ export function cloth_contact_dual_update(state, table, beta, k_max_ratio, inver
516
554
 
517
555
  const unclamped = kf * slip + friction_lambda[slot];
518
556
 
519
- friction_lambda[slot] = unclamped < cap ? (unclamped > 0 ? unclamped : 0) : cap;
557
+ if (unclamped < cap) {
558
+ friction_lambda[slot] = unclamped > 0 ? unclamped : 0;
559
+ } else {
560
+ friction_lambda[slot] = cap;
561
+
562
+ // The row has yielded, so the anchor follows (the module
563
+ // docblock). A penalty of zero puts the reach at `Infinity`
564
+ // and leaves the anchor where it is.
565
+ const reach = carried_by_anchor * cap / kf;
566
+
567
+ if (slip > reach) {
568
+ const follow = 1 - reach / slip;
569
+
570
+ ANCHOR_WORLD[0] += tx * follow;
571
+ ANCHOR_WORLD[1] += ty * follow;
572
+ ANCHOR_WORLD[2] += tz * follow;
573
+
574
+ cloth_collider_to_local_array(anchor, slot * 3, table, record, ANCHOR_WORLD, 0);
575
+ }
576
+ }
520
577
 
521
578
  const ramped_friction = kf + beta * slip;
522
579
 
@@ -23,6 +23,14 @@ export class ComputePipelineManager {
23
23
  * @returns {number}
24
24
  */
25
25
  get pending_count(): number;
26
+ /**
27
+ * How many pipelines {@link obtain} has made itself, because {@link prepare} had not made them by the time a
28
+ * frame asked: each one compiled where the frame waits for it. Zero for a renderer whose every pipeline was
29
+ * offered to a {@link PipelineEnquiry} ahead of use.
30
+ *
31
+ * @returns {number}
32
+ */
33
+ get created_on_demand_count(): number;
26
34
  /**
27
35
  * Whether `descriptor` is no longer waiting on an asynchronous {@link prepare} compilation.
28
36
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ComputePipelineManager.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/pipeline/ComputePipelineManager.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;IAsFI;;;;;OAKG;IACH,wCAHW,qBAAqB,WACrB,oBAAoB,EAc9B;IA7FD;;;OAGG;IACH,0EAEC;IAoBD;;;;OAIG;IACH,4BAEC;IAED;;;;;OAKG;IACH,qBAHW,yBAAyB,GACvB,OAAO,CAOnB;IAED;;;;;OAKG;IACH,iCAHW;QAAE,GAAG,CAAC,UAAU,EAAE,yBAAyB,GAAG,OAAO,CAAA;KAAE,GACrD,OAAO,CAoBnB;IAyDD;;;;OAIG;IACH,mBAHW,yBAAyB,sBAQnC;IAED;;;;;;;;;;OAUG;IACH,oBAHW,yBAAyB,GACvB,QAAQ,IAAI,CAAC,CAwCzB;;CAEJ;wCAjNY,OAAO,gEAAgE,EAAE,yBAAyB;mCAClG,OAAO,mCAAmC,EAAE,oBAAoB;oCAChE,OAAO,4BAA4B,EAAE,qBAAqB;8BAC1D,OAAO,sBAAsB,EAAE,eAAe"}
1
+ {"version":3,"file":"ComputePipelineManager.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/pipeline/ComputePipelineManager.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;IAsGI;;;;;OAKG;IACH,wCAHW,qBAAqB,WACrB,oBAAoB,EAc9B;IA7GD;;;OAGG;IACH,0EAEC;IAoBD;;;;OAIG;IACH,4BAEC;IAOD;;;;;;OAMG;IACH,sCAEC;IAED;;;;;OAKG;IACH,qBAHW,yBAAyB,GACvB,OAAO,CAOnB;IAED;;;;;OAKG;IACH,iCAHW;QAAE,GAAG,CAAC,UAAU,EAAE,yBAAyB,GAAG,OAAO,CAAA;KAAE,GACrD,OAAO,CAoBnB;IA2DD;;;;OAIG;IACH,mBAHW,yBAAyB,sBAQnC;IAED;;;;;;;;;;OAUG;IACH,oBAHW,yBAAyB,GACvB,QAAQ,IAAI,CAAC,CAwCzB;;CAEJ;wCAnOY,OAAO,gEAAgE,EAAE,yBAAyB;mCAClG,OAAO,mCAAmC,EAAE,oBAAoB;oCAChE,OAAO,4BAA4B,EAAE,qBAAqB;8BAC1D,OAAO,sBAAsB,EAAE,eAAe"}
@@ -54,6 +54,22 @@ export class ComputePipelineManager {
54
54
  return this.#pending.size;
55
55
  }
56
56
 
57
+ /**
58
+ * @type {number}
59
+ */
60
+ #created_on_demand_count = 0;
61
+
62
+ /**
63
+ * How many pipelines {@link obtain} has made itself, because {@link prepare} had not made them by the time a
64
+ * frame asked: each one compiled where the frame waits for it. Zero for a renderer whose every pipeline was
65
+ * offered to a {@link PipelineEnquiry} ahead of use.
66
+ *
67
+ * @returns {number}
68
+ */
69
+ get created_on_demand_count() {
70
+ return this.#created_on_demand_count;
71
+ }
72
+
57
73
  /**
58
74
  * Whether `descriptor` is no longer waiting on an asynchronous {@link prepare} compilation.
59
75
  *
@@ -145,6 +161,8 @@ export class ComputePipelineManager {
145
161
  * @returns {GPUComputePipeline}
146
162
  */
147
163
  #create(descriptor) {
164
+ this.#created_on_demand_count++;
165
+
148
166
  return this.#device.createComputePipeline(this.#gpu_descriptor(descriptor));
149
167
  }
150
168
 
@@ -22,6 +22,14 @@ export class RenderPipelineManager {
22
22
  * @returns {number}
23
23
  */
24
24
  get pending_count(): number;
25
+ /**
26
+ * How many pipelines {@link obtain} has made itself, because {@link prepare} had not made them by the time a
27
+ * frame asked: each one compiled where the frame waits for it. Zero for a renderer whose every pipeline was
28
+ * offered to a {@link PipelineEnquiry} ahead of use.
29
+ *
30
+ * @returns {number}
31
+ */
32
+ get created_on_demand_count(): number;
25
33
  /**
26
34
  * Whether `descriptor` is no longer waiting on an asynchronous {@link prepare} compilation.
27
35
  *
@@ -1 +1 @@
1
- {"version":3,"file":"RenderPipelineManager.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/pipeline/RenderPipelineManager.js"],"names":[],"mappings":"AAKA;;;;GAIG;AAGH;IAoFI;;;;;OAKG;IACH,wCAHW,qBAAqB,WACrB,oBAAoB,EAc9B;IA3FD;;;OAGG;IACH,0EAEC;IAoBD;;;;OAIG;IACH,4BAEC;IAED;;;;;OAKG;IACH,qBAHW,wBAAwB,GACtB,OAAO,CAMnB;IAED;;;;;OAKG;IACH,iCAHW;QAAE,GAAG,CAAC,UAAU,EAAE,wBAAwB,GAAG,OAAO,CAAA;KAAE,GACpD,OAAO,CAoBnB;IA4FD;;;;;OAKG;IACH,mBAJW,wBAAwB,6BACxB,kBAAkB,qBAgB5B;IAED;;;;;;;;;;;OAWG;IACH,oBAJW,wBAAwB,GAEtB,QAAQ,IAAI,CAAC,CAuCzB;;CAEJ;mCA5PY,OAAO,mCAAmC,EAAE,oBAAoB;oCAChE,OAAO,4BAA4B,EAAE,qBAAqB;8BAC1D,OAAO,sBAAsB,EAAE,eAAe;yCANlB,8DAA8D"}
1
+ {"version":3,"file":"RenderPipelineManager.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/pipeline/RenderPipelineManager.js"],"names":[],"mappings":"AAKA;;;;GAIG;AAGH;IAoGI;;;;;OAKG;IACH,wCAHW,qBAAqB,WACrB,oBAAoB,EAc9B;IA3GD;;;OAGG;IACH,0EAEC;IAoBD;;;;OAIG;IACH,4BAEC;IAOD;;;;;;OAMG;IACH,sCAEC;IAED;;;;;OAKG;IACH,qBAHW,wBAAwB,GACtB,OAAO,CAMnB;IAED;;;;;OAKG;IACH,iCAHW;QAAE,GAAG,CAAC,UAAU,EAAE,wBAAwB,GAAG,OAAO,CAAA;KAAE,GACpD,OAAO,CAoBnB;IA6FD;;;;;OAKG;IACH,mBAJW,wBAAwB,6BACxB,kBAAkB,qBAgB5B;IAED;;;;;;;;;;;OAWG;IACH,oBAJW,wBAAwB,GAEtB,QAAQ,IAAI,CAAC,CAuCzB;;CAEJ;mCA7QY,OAAO,mCAAmC,EAAE,oBAAoB;oCAChE,OAAO,4BAA4B,EAAE,qBAAqB;8BAC1D,OAAO,sBAAsB,EAAE,eAAe;yCANlB,8DAA8D"}
@@ -56,6 +56,22 @@ export class RenderPipelineManager {
56
56
  return this.#pending.size;
57
57
  }
58
58
 
59
+ /**
60
+ * @type {number}
61
+ */
62
+ #created_on_demand_count = 0;
63
+
64
+ /**
65
+ * How many pipelines {@link obtain} has made itself, because {@link prepare} had not made them by the time a
66
+ * frame asked: each one compiled where the frame waits for it. Zero for a renderer whose every pipeline was
67
+ * offered to a {@link PipelineEnquiry} ahead of use.
68
+ *
69
+ * @returns {number}
70
+ */
71
+ get created_on_demand_count() {
72
+ return this.#created_on_demand_count;
73
+ }
74
+
59
75
  /**
60
76
  * Whether `descriptor` is no longer waiting on an asynchronous {@link prepare} compilation.
61
77
  *
@@ -159,6 +175,7 @@ export class RenderPipelineManager {
159
175
  * @returns {GPURenderPipeline}
160
176
  */
161
177
  #create(descriptor) {
178
+ this.#created_on_demand_count++;
162
179
 
163
180
  const device = this.#device;
164
181
 
@@ -0,0 +1,20 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>AVBOIT · tilted surfaces</title>
4
+ <style>
5
+ :root{color-scheme:dark;font:14px/1.45 system-ui,sans-serif;color:#d6e4ea;background:#10161b}*{box-sizing:border-box}
6
+ body{margin:0;display:flex;align-items:flex-start;min-height:100vh}
7
+ #viewport{flex:none;overflow:hidden;position:relative;outline:none;background:#000}#viewport canvas{width:100%;height:100%;display:block}
8
+ aside{padding:16px 20px;width:340px;flex:none}h1{font-size:18px;margin:0 0 6px}h2{font-size:13px;color:#8cb9bf;text-transform:uppercase;letter-spacing:.07em;margin:18px 0 8px}
9
+ p{margin:8px 0;color:#9faeb9;font-size:12px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:11px/1.5 monospace;color:#8bd3d5;background:#0c151b;padding:10px;border-radius:5px;margin:0}
10
+ #status{border-left:3px solid #70b8b5;padding:8px 10px;font-size:12px;background:#1d2c32}
11
+ #cases a{display:block;color:#b9cdd6;text-decoration:none;font-size:12px;padding:3px 6px;border-radius:4px}#cases a:hover{background:#22323b}#cases a.current{background:#2b4550;color:#fff}
12
+ </style></head>
13
+ <body><div id="viewport" tabindex="0"></div>
14
+ <aside><h1>AVBOIT / tilted surfaces</h1><p>A transparent surface that runs through depth across one voxel, sharing its pixels with something else.</p>
15
+ <div id="status">Starting renderer…</div>
16
+ <h2 id="title"></h2><pre id="expect"></pre>
17
+ <h2>Cases</h2><div id="cases"></div>
18
+ </aside>
19
+ <script type="module" src="./main.js"></script>
20
+ </body></html>
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/avboit_footprint/main.js"],"names":[],"mappings":""}