@woosh/meep-engine 3.78.0 → 3.78.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.
Files changed (213) hide show
  1. package/CHANGELOG.md +21 -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/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts +119 -0
  13. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts.map +1 -0
  14. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.js +563 -0
  15. package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.d.ts +11 -0
  16. package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.d.ts.map +1 -0
  17. package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.js +10 -0
  18. package/src/generation/wfc/GridWFCCompiledTileSet.d.ts +123 -0
  19. package/src/generation/wfc/GridWFCCompiledTileSet.d.ts.map +1 -0
  20. package/src/generation/wfc/GridWFCCompiledTileSet.js +355 -0
  21. package/src/generation/wfc/GridWFCEdge.d.ts +13 -0
  22. package/src/generation/wfc/GridWFCEdge.d.ts.map +1 -0
  23. package/src/generation/wfc/GridWFCEdge.js +14 -0
  24. package/src/generation/wfc/GridWFCTileSet.d.ts +120 -0
  25. package/src/generation/wfc/GridWFCTileSet.d.ts.map +1 -0
  26. package/src/generation/wfc/GridWFCTileSet.js +275 -0
  27. package/src/shade/device/pipeline/ComputePipelineManager.d.ts +8 -0
  28. package/src/shade/device/pipeline/ComputePipelineManager.d.ts.map +1 -1
  29. package/src/shade/device/pipeline/ComputePipelineManager.js +18 -0
  30. package/src/shade/device/pipeline/RenderPipelineManager.d.ts +8 -0
  31. package/src/shade/device/pipeline/RenderPipelineManager.d.ts.map +1 -1
  32. package/src/shade/device/pipeline/RenderPipelineManager.js +17 -0
  33. package/src/shade/playground/avboit_footprint/index.html +20 -0
  34. package/src/shade/playground/avboit_footprint/main.d.ts +2 -0
  35. package/src/shade/playground/avboit_footprint/main.d.ts.map +1 -0
  36. package/src/shade/playground/avboit_footprint/main.js +428 -0
  37. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  38. package/src/shade/playground/probe_clipmap/main.js +7 -3
  39. package/src/shade/playground/screen_probes/main.d.ts.map +1 -1
  40. package/src/shade/playground/screen_probes/main.js +7 -3
  41. package/src/shade/renderer/Renderer.d.ts +18 -8
  42. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  43. package/src/shade/renderer/Renderer.js +201 -16
  44. package/src/shade/renderer/RendererConfiguration.d.ts +95 -0
  45. package/src/shade/renderer/RendererConfiguration.d.ts.map +1 -0
  46. package/src/shade/renderer/RendererConfiguration.js +119 -0
  47. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +8 -0
  48. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  49. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +34 -0
  50. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts +7 -0
  51. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts.map +1 -1
  52. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js +15 -0
  53. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +10 -2
  54. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  55. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +37 -3
  56. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +6 -0
  57. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  58. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +31 -0
  59. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +7 -0
  60. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  61. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +20 -0
  62. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +8 -0
  63. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
  64. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +14 -0
  65. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +7 -0
  66. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
  67. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +13 -0
  68. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts +6 -0
  69. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -1
  70. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +9 -0
  71. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +11 -0
  72. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  73. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +71 -1
  74. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +6 -0
  75. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -1
  76. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +9 -0
  77. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +6 -0
  78. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -1
  79. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +9 -0
  80. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts +6 -0
  81. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts.map +1 -1
  82. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.js +13 -0
  83. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +9 -0
  84. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
  85. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +47 -0
  86. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +6 -0
  87. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  88. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +17 -0
  89. package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -1
  90. package/src/shade/renderer/hair/GPUHairSystem.js +28 -9
  91. package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts +50 -9
  92. package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts.map +1 -1
  93. package/src/shade/renderer/hair/HAIR_SIMULATION.js +71 -11
  94. package/src/shade/renderer/hair/shader_hair_simulate.d.ts +22 -16
  95. package/src/shade/renderer/hair/shader_hair_simulate.d.ts.map +1 -1
  96. package/src/shade/renderer/hair/shader_hair_simulate.js +151 -78
  97. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +8 -0
  98. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  99. package/src/shade/renderer/particles/GPUParticleSystem.js +20 -1
  100. package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts +6 -0
  101. package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts.map +1 -1
  102. package/src/shade/renderer/particles/bounds/graph_particle_bounds.js +11 -1
  103. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +6 -0
  104. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  105. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +15 -0
  106. package/src/shade/renderer/particles/graph_particles.d.ts +8 -0
  107. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  108. package/src/shade/renderer/particles/graph_particles.js +28 -3
  109. package/src/shade/renderer/particles/graph_particles_avboit.d.ts +7 -0
  110. package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
  111. package/src/shade/renderer/particles/graph_particles_avboit.js +14 -0
  112. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.d.ts.map +1 -1
  113. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +5 -7
  114. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts +7 -0
  115. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  116. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +15 -0
  117. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts +6 -0
  118. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
  119. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +16 -2
  120. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts +6 -0
  121. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts.map +1 -1
  122. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.js +9 -0
  123. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts +11 -0
  124. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts.map +1 -1
  125. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.js +10 -0
  126. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +6 -0
  127. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
  128. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +10 -1
  129. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +7 -0
  130. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts.map +1 -1
  131. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +21 -0
  132. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts +7 -0
  133. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts.map +1 -1
  134. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.js +11 -1
  135. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts +9 -0
  136. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts.map +1 -1
  137. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.js +29 -0
  138. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts +6 -0
  139. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts.map +1 -1
  140. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.js +13 -1
  141. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts +6 -0
  142. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts.map +1 -1
  143. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.js +11 -0
  144. package/src/shade/renderer/postprocess/nss/NSS.d.ts +9 -0
  145. package/src/shade/renderer/postprocess/nss/NSS.d.ts.map +1 -1
  146. package/src/shade/renderer/postprocess/nss/NSS.js +33 -18
  147. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +8 -0
  148. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  149. package/src/shade/renderer/postprocess/ssr/SSR.js +42 -2
  150. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts +6 -0
  151. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts.map +1 -1
  152. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.js +10 -0
  153. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts +6 -0
  154. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts.map +1 -1
  155. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.js +11 -0
  156. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts +8 -0
  157. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  158. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +27 -3
  159. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts +6 -0
  160. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts.map +1 -1
  161. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.js +10 -0
  162. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +5 -4
  163. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  164. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +5 -4
  165. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts +3 -3
  166. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js +3 -3
  167. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
  168. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -7
  169. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts.map +1 -1
  170. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js +5 -7
  171. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts +34 -0
  172. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts.map +1 -0
  173. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.js +42 -0
  174. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts +5 -4
  175. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts.map +1 -1
  176. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.js +8 -7
  177. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts +2 -2
  178. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts.map +1 -1
  179. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.js +4 -5
  180. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +9 -0
  181. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  182. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +18 -0
  183. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts +9 -0
  184. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
  185. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +15 -0
  186. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +6 -0
  187. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts.map +1 -1
  188. package/src/shade/renderer/restir/di/ReSTIRDI.js +10 -1
  189. package/src/shade/renderer/restir/di/graph_restir_di.d.ts +9 -0
  190. package/src/shade/renderer/restir/di/graph_restir_di.d.ts.map +1 -1
  191. package/src/shade/renderer/restir/di/graph_restir_di.js +19 -1
  192. package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts +6 -0
  193. package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts.map +1 -1
  194. package/src/shade/renderer/restir/di/graph_restir_di_denoise.js +9 -0
  195. package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts +7 -0
  196. package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts.map +1 -1
  197. package/src/shade/renderer/scene/movers/graph_scene_movers.js +11 -0
  198. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts +10 -0
  199. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
  200. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +25 -1
  201. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts +7 -0
  202. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts.map +1 -1
  203. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.js +14 -0
  204. package/src/shade/renderer/text/shaders/shader_text_avboit.d.ts.map +1 -1
  205. package/src/shade/renderer/text/shaders/shader_text_avboit.js +5 -7
  206. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +9 -1
  207. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  208. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +16 -1
  209. package/src/shade/renderer/water/shader_water_avboit.d.ts.map +1 -1
  210. package/src/shade/renderer/water/shader_water_avboit.js +16 -13
  211. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts +0 -33
  212. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts.map +0 -1
  213. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.js +0 -45
@@ -1,7 +1,10 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
2
  import { fluid_cascade_ruler } from "../../fluid/fluid_cascade_ruler.js";
3
3
  import { INDIRECT_LIGHTING } from "../../INDIRECT_LIGHTING.js";
4
- import { graph_build_world_light_clusters } from "../../light/world_cluster/graph_build_world_light_clusters.js";
4
+ import {
5
+ enquire_build_world_light_clusters_pipelines,
6
+ graph_build_world_light_clusters
7
+ } from "../../light/world_cluster/graph_build_world_light_clusters.js";
5
8
  import { CLIPMAP_LEVEL_STRUCT } from "../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
6
9
  import { ShaderSwitchSet } from "../../shader/compiler/ShaderSwitchSet.js";
7
10
  import { graph_import_buffer } from "../../shader/graph/graph_import_buffer.js";
@@ -65,6 +68,18 @@ export class GPUIrradianceClipmap {
65
68
  /** @type {GPUDevice} */
66
69
  #device;
67
70
 
71
+ /**
72
+ * Offer the pipelines {@link graph_update} dispatches — see {@link PipelineEnquiry}. For whoever reads the
73
+ * clipmap: a frame nothing reads it in culls its build.
74
+ *
75
+ * @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
76
+ * @param {ShaderSwitchSet} shader_switches the renderer's, which the build is made for
77
+ */
78
+ enquirePipelines(enquiry, shader_switches) {
79
+ enquire_build_world_light_clusters_pipelines(enquiry);
80
+ enquiry.compute.push(shader_irradiance_clipmap_build.variant(shader_switches).pipeline);
81
+ }
82
+
68
83
  /** @type {GPUTileAtlas3D} */
69
84
  #atlas;
70
85
 
@@ -1 +1 @@
1
- {"version":3,"file":"shader_water_avboit.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/water/shader_water_avboit.js"],"names":[],"mappings":"AAkCA,mDAwBG;AAQH,+CAqCG;AAUH,4CA4BG;AAOH,uDAYG;AAOH,6CAqCG;8BA3L2B,4BAA4B;4BAC9B,0BAA0B"}
1
+ {"version":3,"file":"shader_water_avboit.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/water/shader_water_avboit.js"],"names":[],"mappings":"AAiCA,mDAwBG;AAQH,+CAyCG;AAUH,4CA4BG;AAOH,uDAYG;AAOH,6CAqCG;8BA/L2B,4BAA4B;4BAC9B,0BAA0B"}
@@ -3,7 +3,7 @@ import { chunk_sample_volumetrics } from "../deferred/chunk_sample_volumetrics.j
3
3
  import { AVBOIT_OCCUPANCY_WORDS, AVBOIT_VOXEL_DOWNSCALE } from "../rasterize/native/avboit/AVBOIT_CONSTANTS.js";
4
4
  import { AVBOIT_WARP_STRUCT } from "../rasterize/native/avboit/AVBOIT_WARP_STRUCT.js";
5
5
  import { AVBOIT_DRAW_TARGETS } from "../rasterize/native/avboit/avboit_draw_fragment_body.js";
6
- import { chunk_avboit_footprint_bias } from "../rasterize/native/avboit/chunk_avboit_footprint_bias.js";
6
+ import { chunk_avboit_footprint_depth } from "../rasterize/native/avboit/chunk_avboit_footprint_depth.js";
7
7
  import { chunk_avboit_occupancy_mark } from "../rasterize/native/avboit/chunk_avboit_occupancy_mark.js";
8
8
  import { chunk_avboit_rgb_contribution } from "../rasterize/native/avboit/chunk_avboit_rgb_contribution.js";
9
9
  import { chunk_avboit_sample_transmittance } from "../rasterize/native/avboit/chunk_avboit_sample_transmittance.js";
@@ -11,7 +11,6 @@ import { chunk_avboit_splat_slice } from "../rasterize/native/avboit/chunk_avboi
11
11
  import { chunk_avboit_split_counts } from "../rasterize/native/avboit/chunk_avboit_split_counts.js";
12
12
  import { chunk_avboit_transmittance_to_extinction } from "../rasterize/native/avboit/chunk_avboit_transmittance_to_extinction.js";
13
13
  import { chunk_avboit_view_depth_to_physical } from "../rasterize/native/avboit/chunk_avboit_view_depth_to_physical.js";
14
- import { chunk_avboit_view_depth_to_virtual } from "../rasterize/native/avboit/chunk_avboit_view_depth_to_virtual.js";
15
14
  import { AVBOIT_OCCUPANCY_SETTINGS_STRUCT } from "../rasterize/native/avboit/shader_avboit_occupancy.js";
16
15
  import { chunk_get_view_space_depth } from "../shader/chunk/depth/chunk_get_view_space_depth.js";
17
16
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
@@ -75,7 +74,8 @@ fn main(@builtin(global_invocation_id) id: vec3u) {
75
74
  let hi = min(lo + vec2u(${AVBOIT_VOXEL_DOWNSCALE}u), size);
76
75
  var total_t = vec3f(0.0);
77
76
  var samples = 0.0;
78
- var nearest = 1e30;
77
+ var wet = 0.0;
78
+ var wet_depth = 0.0;
79
79
  for (var y = lo.y; y < hi.y; y++) {
80
80
  for (var x = lo.x; x < hi.x; x++) {
81
81
  let coord = vec2u(x, y);
@@ -83,16 +83,19 @@ fn main(@builtin(global_invocation_id) id: vec3u) {
83
83
  var t = vec3f(1.0);
84
84
  if (d > 0.0) {
85
85
  t = textureLoad(transmission, coord, 0).rgb;
86
- nearest = min(nearest, get_view_space_depth(d, camera));
86
+ wet += 1.0; wet_depth += d;
87
87
  }
88
88
  total_t += t; samples += 1.0;
89
89
  }
90
90
  }
91
- if (nearest == 1e30 || samples == 0.0) { return; }
92
- // One area-averaged event, not 64 full-coverage layers. Dry samples retain T=1.
91
+ if (wet == 0.0) { return; }
92
+ // One area-averaged event, not 64 full-coverage layers. Dry samples retain T=1. It goes where every
93
+ // source's does, at the depth under the column's centre (avboit_footprint_depth): device depth is linear
94
+ // across the screen for a plane, so the wet samples' mean is the surface's depth under their centre.
95
+ let z_splat = get_view_space_depth(wet_depth / wet, camera);
93
96
  let extinction = avboit_transmittance_to_extinction(total_t / samples);
94
97
  let counts = avboit_extinction_to_counts(extinction);
95
- let p = avboit_view_depth_to_physical(&warp, nearest) - 0.5;
98
+ let p = avboit_view_depth_to_physical(&warp, z_splat) - 0.5;
96
99
  let slice = i32(floor(p));
97
100
  let upper = avboit_split_counts(counts, fract(p));
98
101
  let column = id.y * warp.voxel_width + id.x;
@@ -124,19 +127,19 @@ fn main(@builtin(position) coord: vec4f) -> WaterContribution {
124
127
  let d = textureLoad(interface_depth, pixel, 0).r;
125
128
  let z = get_view_space_depth(d, camera);
126
129
  // the water splats into the volume too, and a plane seen at an angle runs through depth across a
127
- // voxel (avboit_footprint_bias). Taken before the discard, in uniform control flow; a dry pixel's
128
- // virtual coordinate clamps, so the derivative at the shore stays finite and the cap holds it
129
- let footprint = avboit_footprint_bias(&warp, fwidth(avboit_view_depth_to_virtual(&warp, z)));
130
+ // voxel (avboit_footprint_depth). Taken before the discard, in uniform control flow; a dry pixel's
131
+ // depth is the far plane's, so the derivative at the shore stays finite
132
+ let footprint = avboit_footprint_depth(z, fwidth(1.0 / z));
130
133
  if (d <= 0.0) { discard; }
131
134
  let uv = coord.xy / vec2f(textureDimensions(interface_depth, 0));
132
- let front = avboit_sample_transmittance(&warp, tIntegral, sLinear, uv, z, footprint);
135
+ let front = avboit_sample_transmittance(&warp, tIntegral, sLinear, uv, footprint);
133
136
  let t = textureLoad(transmission, pixel, 0).rgb;
134
137
  let w = textureLoad(radiance, pixel, 0).rgb;
135
138
  let fog = sample_volumetrics(z, uv, coord.xy);
136
139
  let c = avboit_rgb_contribution(w, t, front, fog);
137
140
  return WaterContribution(c.color, c.norm, c.extinction, c.emission);
138
141
  }
139
- `, [chunk_get_view_space_depth, chunk_avboit_view_depth_to_virtual, chunk_avboit_footprint_bias,
142
+ `, [chunk_get_view_space_depth, chunk_avboit_footprint_depth,
140
143
  chunk_avboit_sample_transmittance, chunk_avboit_rgb_contribution, chunk_sample_volumetrics]),
141
144
  }), targets: AVBOIT_DRAW_TARGETS,
142
145
  });
@@ -193,7 +196,7 @@ fn main(@builtin(position) coord: vec4f) -> @location(0) vec4f {
193
196
  let z = get_view_space_depth(textureLoad(interface_depth, pixel, 0).r, camera);
194
197
  // without the draw's footprint (a derivative this switch cannot take): where the water is
195
198
  // seen at an angle this also shows it occluding itself, which the draw looks past
196
- let front = avboit_sample_transmittance(&warp, tIntegral, sLinear, uv, z, 0.0);
199
+ let front = avboit_sample_transmittance(&warp, tIntegral, sLinear, uv, z);
197
200
  color = select(front, (1.0 - t.rgb) * front, inspection.mode == 9u);
198
201
  }
199
202
  default: {}
@@ -1,33 +0,0 @@
1
- /**
2
- * How much further toward the camera, in virtual slices, a fragment has to look the integral up so
3
- * that its own surface does not occlude it through the neighbouring voxel columns — given
4
- * `virtual_fwidth`, the fragment's `fwidth` of its virtual slice coordinate
5
- * (`avboit_view_depth_to_virtual`), which the caller takes in the fragment stage.
6
- *
7
- * The volume is 1/8 resolution and every column holds a surface at the depth under the column's
8
- * centre. The draw reads the four nearest columns bilinearly, up to one voxel away. On a surface
9
- * tilted away from the camera, the neighbour on its near side holds the same surface nearer by the
10
- * surface's depth change over that distance, and once that exceeds the two-slice base bias the
11
- * surface occludes itself — by an amount that depends on where the pixel sits in its voxel, so an
12
- * overlapping layer showed 8-pixel stripes (ledger entry 26: 3–5 sRGB codes on the device at 45–60°).
13
- * A voxel's width of the surface's own depth change, `AVBOIT_VOXEL_DOWNSCALE × fwidth`, covers the
14
- * farthest column the lookup reaches. The virtual coordinate is convex along a plane seen in
15
- * perspective, so its derivative at the fragment bounds the change toward the near side.
16
- *
17
- * What it costs: a tilted fragment is not occluded by what lies within that band in front of it, the
18
- * depth the volume cannot tell apart from the surface itself at this resolution. The band is capped at
19
- * the base bias of the coarsest slicing, `V / P` base biases — the separation every surface already
20
- * has whenever the volume is full and the warp halves down to `V = P` — so where the derivative runs
21
- * away, at a silhouette or a grazing angle, the extra a fragment ignores is never more than that. The
22
- * whole reach is the base bias plus the band: at most `2 + 2 V / P` virtual slices, twice the coarsest
23
- * separation when the volume is full, about the coarsest separation at `V = 4096`. Past the cap (about
24
- * 85° at 1080p in a sparse volume) the stripes can return.
25
- *
26
- * A fragment that writes nothing into the volume — an additive particle's — has nothing of its own there
27
- * to occlude it and takes no footprint.
28
- *
29
- * @type {CodeChunk}
30
- */
31
- export const chunk_avboit_footprint_bias: CodeChunk;
32
- import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
33
- //# sourceMappingURL=chunk_avboit_footprint_bias.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunk_avboit_footprint_bias.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,0CAFU,SAAS,CAYjB;0BA5CwB,uCAAuC"}
@@ -1,45 +0,0 @@
1
- import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
- import { AVBOIT_SAMPLE_BIAS_SLICES, AVBOIT_VOXEL_DOWNSCALE } from "./AVBOIT_CONSTANTS.js";
3
- import { AVBOIT_WARP_STRUCT } from "./AVBOIT_WARP_STRUCT.js";
4
-
5
- /**
6
- * How much further toward the camera, in virtual slices, a fragment has to look the integral up so
7
- * that its own surface does not occlude it through the neighbouring voxel columns — given
8
- * `virtual_fwidth`, the fragment's `fwidth` of its virtual slice coordinate
9
- * (`avboit_view_depth_to_virtual`), which the caller takes in the fragment stage.
10
- *
11
- * The volume is 1/8 resolution and every column holds a surface at the depth under the column's
12
- * centre. The draw reads the four nearest columns bilinearly, up to one voxel away. On a surface
13
- * tilted away from the camera, the neighbour on its near side holds the same surface nearer by the
14
- * surface's depth change over that distance, and once that exceeds the two-slice base bias the
15
- * surface occludes itself — by an amount that depends on where the pixel sits in its voxel, so an
16
- * overlapping layer showed 8-pixel stripes (ledger entry 26: 3–5 sRGB codes on the device at 45–60°).
17
- * A voxel's width of the surface's own depth change, `AVBOIT_VOXEL_DOWNSCALE × fwidth`, covers the
18
- * farthest column the lookup reaches. The virtual coordinate is convex along a plane seen in
19
- * perspective, so its derivative at the fragment bounds the change toward the near side.
20
- *
21
- * What it costs: a tilted fragment is not occluded by what lies within that band in front of it, the
22
- * depth the volume cannot tell apart from the surface itself at this resolution. The band is capped at
23
- * the base bias of the coarsest slicing, `V / P` base biases — the separation every surface already
24
- * has whenever the volume is full and the warp halves down to `V = P` — so where the derivative runs
25
- * away, at a silhouette or a grazing angle, the extra a fragment ignores is never more than that. The
26
- * whole reach is the base bias plus the band: at most `2 + 2 V / P` virtual slices, twice the coarsest
27
- * separation when the volume is full, about the coarsest separation at `V = 4096`. Past the cap (about
28
- * 85° at 1080p in a sparse volume) the stripes can return.
29
- *
30
- * A fragment that writes nothing into the volume — an additive particle's — has nothing of its own there
31
- * to occlude it and takes no footprint.
32
- *
33
- * @type {CodeChunk}
34
- */
35
- export const chunk_avboit_footprint_bias = CodeChunk.from(
36
- //language=WGSL
37
- `
38
- fn avboit_footprint_bias(warp: ptr<storage, ${AVBOIT_WARP_STRUCT.wgsl_ref}, read>, virtual_fwidth: f32) -> f32 {
39
- let cap = ${AVBOIT_SAMPLE_BIAS_SLICES.toFixed(1)} * f32((*warp).virtual_count) / f32(max((*warp).physical_count, 1u));
40
- return min(${AVBOIT_VOXEL_DOWNSCALE.toFixed(1)} * virtual_fwidth, cap);
41
- }
42
- `, [
43
- AVBOIT_WARP_STRUCT.declaration_chunk,
44
- ]
45
- );