@woosh/meep-engine 3.74.0 → 3.76.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 (363) hide show
  1. package/CHANGELOG.md +20 -19
  2. package/package.json +1 -1
  3. package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts +11 -0
  4. package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts.map +1 -0
  5. package/src/core/geom/2d/hilbert/v2_hilbert_encode.js +46 -0
  6. package/src/engine/asset/GameAssetType.d.ts +1 -0
  7. package/src/engine/asset/GameAssetType.js +5 -1
  8. package/src/engine/asset/loaders/GroomAssetLoader.d.ts +33 -0
  9. package/src/engine/asset/loaders/GroomAssetLoader.d.ts.map +1 -0
  10. package/src/engine/asset/loaders/GroomAssetLoader.js +99 -0
  11. package/src/engine/graphics/ecs/hair/Hair.d.ts +47 -0
  12. package/src/engine/graphics/ecs/hair/Hair.d.ts.map +1 -0
  13. package/src/engine/graphics/ecs/hair/Hair.js +61 -0
  14. package/src/engine/graphics/hair/Groom.d.ts +130 -0
  15. package/src/engine/graphics/hair/Groom.d.ts.map +1 -0
  16. package/src/engine/graphics/hair/Groom.js +193 -0
  17. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts +24 -0
  18. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts.map +1 -0
  19. package/src/engine/graphics/hair/GroomSerializationAdapter.js +77 -0
  20. package/src/engine/graphics/hair/groom_build_group.d.ts +85 -0
  21. package/src/engine/graphics/hair/groom_build_group.d.ts.map +1 -0
  22. package/src/engine/graphics/hair/groom_build_group.js +487 -0
  23. package/src/engine/graphics/hair/groom_generate_scalp.d.ts +29 -0
  24. package/src/engine/graphics/hair/groom_generate_scalp.d.ts.map +1 -0
  25. package/src/engine/graphics/hair/groom_generate_scalp.js +184 -0
  26. package/src/engine/graphics/hair/groom_rank_order.d.ts +15 -0
  27. package/src/engine/graphics/hair/groom_rank_order.d.ts.map +1 -0
  28. package/src/engine/graphics/hair/groom_rank_order.js +53 -0
  29. package/src/engine/graphics/hair/groom_root_spacing.d.ts +12 -0
  30. package/src/engine/graphics/hair/groom_root_spacing.d.ts.map +1 -0
  31. package/src/engine/graphics/hair/groom_root_spacing.js +120 -0
  32. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +6 -0
  33. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
  34. package/src/engine/graphics/render/frame_graph/FrameGraph.js +9 -0
  35. package/src/engine/graphics3/GPUAcousticSystem.d.ts +29 -32
  36. package/src/engine/graphics3/GPUAcousticSystem.d.ts.map +1 -1
  37. package/src/engine/graphics3/GPUAcousticSystem.js +87 -162
  38. package/src/engine/graphics3/HairSystem.d.ts +102 -0
  39. package/src/engine/graphics3/HairSystem.d.ts.map +1 -0
  40. package/src/engine/graphics3/HairSystem.js +456 -0
  41. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  42. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
  43. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +35 -17
  44. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  45. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +2 -3
  46. package/src/engine/sound/simulation/AcousticSimulator.d.ts +7 -0
  47. package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -1
  48. package/src/engine/sound/simulation/AcousticSimulator.js +27 -0
  49. package/src/engine/sound/simulation/README.md +121 -107
  50. package/src/engine/sound/sopra/README.md +8 -3
  51. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts +2 -2
  52. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts.map +1 -1
  53. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.js +4 -3
  54. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts +118 -0
  55. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts.map +1 -0
  56. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.js +472 -0
  57. package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts +166 -0
  58. package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts.map +1 -0
  59. package/src/engine/sound/sopra/runtime/AcousticReverbLines.js +447 -0
  60. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts +69 -113
  61. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts.map +1 -1
  62. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.js +143 -491
  63. package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts +102 -0
  64. package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts.map +1 -0
  65. package/src/engine/sound/sopra/runtime/AcousticSpeakers.js +232 -0
  66. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +17 -3
  67. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
  68. package/src/engine/sound/sopra/runtime/BusGraph.js +55 -5
  69. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +8 -6
  70. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  71. package/src/engine/sound/sopra/runtime/EventInstance.js +113 -105
  72. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts +13 -0
  73. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts.map +1 -0
  74. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.js +15 -0
  75. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
  76. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +4 -6
  77. package/src/shade/assets/textures/hair_scattering.bin +0 -0
  78. package/src/shade/device/pipeline/PipelineEnquiry.d.ts +11 -0
  79. package/src/shade/device/pipeline/PipelineEnquiry.d.ts.map +1 -1
  80. package/src/shade/device/pipeline/PipelineEnquiry.js +13 -0
  81. package/src/shade/playground/hair/index.html +50 -0
  82. package/src/shade/playground/hair/main.d.ts +2 -0
  83. package/src/shade/playground/hair/main.d.ts.map +1 -0
  84. package/src/shade/playground/hair/main.js +274 -0
  85. package/src/shade/playground/screen_probes/README.md +54 -0
  86. package/src/shade/playground/screen_probes/index.html +271 -0
  87. package/src/shade/playground/screen_probes/main.d.ts +8 -0
  88. package/src/shade/playground/screen_probes/main.d.ts.map +1 -0
  89. package/src/shade/playground/screen_probes/main.js +527 -0
  90. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
  91. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +4 -5
  92. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  93. package/src/shade/playground/skinned_blas_refit/main.js +6 -12
  94. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  95. package/src/shade/playground/skinned_mesh_soup/main.js +1 -2
  96. package/src/shade/playground/vgeo_scene/README.md +12 -2
  97. package/src/shade/playground/vgeo_scene/main.js +1 -1
  98. package/src/shade/playground/volumetrics_froxel/README.md +191 -191
  99. package/src/shade/playground/volumetrics_froxel/measure.d.ts +3 -3
  100. package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
  101. package/src/shade/playground/volumetrics_froxel/measure.js +11 -13
  102. package/src/shade/playground/vsm/main.d.ts.map +1 -1
  103. package/src/shade/playground/vsm/main.js +5 -6
  104. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  105. package/src/shade/renderer/Renderer.js +85 -16
  106. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts +6 -0
  107. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts.map +1 -1
  108. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.js +10 -0
  109. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts +28 -0
  110. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts.map +1 -0
  111. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.js +42 -0
  112. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts +58 -0
  113. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts.map +1 -0
  114. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.js +108 -0
  115. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  116. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +161 -0
  117. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts.map +1 -0
  118. package/src/shade/renderer/acoustics/GPUAcousticProbes.js +760 -0
  119. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  120. package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts +12 -0
  121. package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts.map +1 -0
  122. package/src/shade/renderer/acoustics/acoustic_listener_order.js +56 -0
  123. package/src/shade/renderer/acoustics/chunk_acoustic_direct.d.ts.map +1 -1
  124. package/src/shade/renderer/acoustics/chunk_acoustic_direct.js +5 -0
  125. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts +57 -0
  126. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts.map +1 -0
  127. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.js +314 -0
  128. package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts +15 -0
  129. package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts.map +1 -0
  130. package/src/shade/renderer/acoustics/chunk_acoustic_finite.js +21 -0
  131. package/src/shade/renderer/acoustics/chunk_acoustic_gather.js +1 -1
  132. package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts +27 -0
  133. package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts.map +1 -0
  134. package/src/shade/renderer/acoustics/chunk_acoustic_lean.js +42 -0
  135. package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts +80 -0
  136. package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts.map +1 -0
  137. package/src/shade/renderer/acoustics/chunk_acoustic_listener.js +274 -0
  138. package/src/shade/renderer/acoustics/chunk_acoustic_partials.d.ts +2 -2
  139. package/src/shade/renderer/acoustics/chunk_acoustic_partials.js +2 -2
  140. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts +7 -0
  141. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts.map +1 -1
  142. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.js +24 -1
  143. package/src/shade/renderer/acoustics/chunk_acoustic_resample.js +1 -1
  144. package/src/shade/renderer/acoustics/chunk_acoustic_reservoir.js +1 -1
  145. package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts +43 -0
  146. package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts.map +1 -0
  147. package/src/shade/renderer/acoustics/chunk_acoustic_through.js +153 -0
  148. package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts +3 -1
  149. package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts.map +1 -1
  150. package/src/shade/renderer/acoustics/chunk_acoustic_trace.js +10 -1
  151. package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts +7 -3
  152. package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts.map +1 -1
  153. package/src/shade/renderer/acoustics/shader_acoustic_combine.js +22 -6
  154. package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts +14 -0
  155. package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts.map +1 -0
  156. package/src/shade/renderer/acoustics/shader_acoustic_coupling.js +102 -0
  157. package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts +12 -0
  158. package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts.map +1 -0
  159. package/src/shade/renderer/acoustics/shader_acoustic_listener.js +80 -0
  160. package/src/shade/renderer/acoustics/shader_acoustic_receive.d.ts.map +1 -1
  161. package/src/shade/renderer/acoustics/shader_acoustic_receive.js +27 -6
  162. package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts +11 -0
  163. package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts.map +1 -0
  164. package/src/shade/renderer/acoustics/shader_acoustic_room.js +111 -0
  165. package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts +18 -0
  166. package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts.map +1 -0
  167. package/src/shade/renderer/acoustics/shader_acoustic_source.js +130 -0
  168. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.d.ts.map +1 -1
  169. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.js +3 -1
  170. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts +23 -0
  171. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts.map +1 -0
  172. package/src/shade/renderer/deferred/chunk_shade_direct_lights.js +111 -0
  173. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts +17 -6
  174. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts.map +1 -1
  175. package/src/shade/renderer/deferred/chunk_shade_directional_lights.js +26 -21
  176. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts +12 -22
  177. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts.map +1 -1
  178. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.js +20 -100
  179. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.d.ts.map +1 -1
  180. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js +6 -4
  181. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts +15 -0
  182. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts.map +1 -0
  183. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.js +47 -0
  184. package/src/shade/renderer/extension/ViewLighting.d.ts +101 -0
  185. package/src/shade/renderer/extension/ViewLighting.d.ts.map +1 -0
  186. package/src/shade/renderer/extension/ViewLighting.js +168 -0
  187. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  188. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  189. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
  190. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  191. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  192. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.d.ts +2 -2
  193. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.js +2 -2
  194. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts +5 -2
  195. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts.map +1 -1
  196. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.js +5 -2
  197. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts +9 -2
  198. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
  199. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +48 -12
  200. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +0 -22
  201. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
  202. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +0 -42
  203. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +2 -18
  204. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
  205. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +2 -19
  206. package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.d.ts.map +1 -1
  207. package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.js +0 -1
  208. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +5 -4
  209. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  210. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +3 -1
  211. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -1
  212. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +3 -1
  213. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
  214. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +0 -1
  215. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +60 -14
  216. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
  217. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +75 -39
  218. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.d.ts.map +1 -1
  219. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js +3 -1
  220. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
  221. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +0 -9
  222. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
  223. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +45 -17
  224. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +7 -3
  225. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  226. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +43 -7
  227. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
  228. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +3 -1
  229. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +15 -7
  230. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
  231. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +40 -9
  232. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +23 -0
  233. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
  234. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +26 -0
  235. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.d.ts +1 -0
  236. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.js +6 -0
  237. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +13 -1
  238. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  239. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +23 -1
  240. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts.map +1 -1
  241. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +2 -0
  242. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +29 -0
  243. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -0
  244. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +102 -0
  245. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts +8 -1
  246. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts.map +1 -1
  247. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js +27 -1
  248. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +4 -1
  249. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
  250. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +4 -1
  251. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts +11 -5
  252. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts.map +1 -1
  253. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js +28 -10
  254. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +36 -2
  255. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
  256. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +149 -4
  257. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.d.ts.map +1 -1
  258. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.js +3 -1
  259. package/src/shade/renderer/hair/GPUHairSystem.d.ts +159 -0
  260. package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -0
  261. package/src/shade/renderer/hair/GPUHairSystem.js +1132 -0
  262. package/src/shade/renderer/hair/HAIR.d.ts +102 -0
  263. package/src/shade/renderer/hair/HAIR.d.ts.map +1 -0
  264. package/src/shade/renderer/hair/HAIR.js +115 -0
  265. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts +17 -0
  266. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts.map +1 -0
  267. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.js +71 -0
  268. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts +11 -0
  269. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts.map +1 -0
  270. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.js +48 -0
  271. package/src/shade/renderer/hair/HairFrame.d.ts +41 -0
  272. package/src/shade/renderer/hair/HairFrame.d.ts.map +1 -0
  273. package/src/shade/renderer/hair/HairFrame.js +76 -0
  274. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +42 -0
  275. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -0
  276. package/src/shade/renderer/hair/chunk_hair_bsdf.js +170 -0
  277. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +30 -0
  278. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -0
  279. package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +131 -0
  280. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts +32 -0
  281. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts.map +1 -0
  282. package/src/shade/renderer/hair/chunk_hair_pixel.js +116 -0
  283. package/src/shade/renderer/hair/chunk_hair_strand.d.ts +40 -0
  284. package/src/shade/renderer/hair/chunk_hair_strand.d.ts.map +1 -0
  285. package/src/shade/renderer/hair/chunk_hair_strand.js +85 -0
  286. package/src/shade/renderer/hair/chunk_hair_volume.d.ts +31 -0
  287. package/src/shade/renderer/hair/chunk_hair_volume.d.ts.map +1 -0
  288. package/src/shade/renderer/hair/chunk_hair_volume.js +106 -0
  289. package/src/shade/renderer/hair/hair_id_draw.d.ts +24 -0
  290. package/src/shade/renderer/hair/hair_id_draw.d.ts.map +1 -0
  291. package/src/shade/renderer/hair/hair_id_draw.js +135 -0
  292. package/src/shade/renderer/hair/hair_lighting.d.ts +53 -0
  293. package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -0
  294. package/src/shade/renderer/hair/hair_lighting.js +270 -0
  295. package/src/shade/renderer/hair/hair_scattering_lut.d.ts +75 -0
  296. package/src/shade/renderer/hair/hair_scattering_lut.d.ts.map +1 -0
  297. package/src/shade/renderer/hair/hair_scattering_lut.js +271 -0
  298. package/src/shade/renderer/hair/hair_stamp.d.ts +33 -0
  299. package/src/shade/renderer/hair/hair_stamp.d.ts.map +1 -0
  300. package/src/shade/renderer/hair/hair_stamp.js +175 -0
  301. package/src/shade/renderer/hair/shader_hair_classes.d.ts +21 -0
  302. package/src/shade/renderer/hair/shader_hair_classes.d.ts.map +1 -0
  303. package/src/shade/renderer/hair/shader_hair_classes.js +86 -0
  304. package/src/shade/renderer/hair/shader_hair_cull.d.ts +31 -0
  305. package/src/shade/renderer/hair/shader_hair_cull.d.ts.map +1 -0
  306. package/src/shade/renderer/hair/shader_hair_cull.js +194 -0
  307. package/src/shade/renderer/hair/shader_hair_lod.d.ts +33 -0
  308. package/src/shade/renderer/hair/shader_hair_lod.d.ts.map +1 -0
  309. package/src/shade/renderer/hair/shader_hair_lod.js +268 -0
  310. package/src/shade/renderer/hair/shader_hair_volume.d.ts +28 -0
  311. package/src/shade/renderer/hair/shader_hair_volume.d.ts.map +1 -0
  312. package/src/shade/renderer/hair/shader_hair_volume.js +167 -0
  313. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  314. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts +31 -0
  315. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts.map +1 -1
  316. package/src/shade/renderer/loader/usd/usd_build_scene.js +36 -21
  317. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts +60 -0
  318. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts.map +1 -0
  319. package/src/shade/renderer/loader/usd/usd_groom_extension.js +417 -0
  320. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
  321. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +4 -1
  322. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.d.ts.map +1 -1
  323. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.js +3 -1
  324. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  325. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +4 -1
  326. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  327. package/src/shade/renderer/postprocess/ssr/SSR.js +9 -0
  328. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +16 -1
  329. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
  330. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +47 -3
  331. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  332. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +5 -3
  333. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.d.ts.map +1 -1
  334. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.js +6 -5
  335. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.d.ts.map +1 -1
  336. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.js +5 -2
  337. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
  338. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -0
  339. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
  340. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +4 -1
  341. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.d.ts.map +1 -1
  342. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.js +5 -1
  343. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts.map +1 -1
  344. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +7 -4
  345. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +13 -8
  346. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
  347. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +18 -14
  348. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts +3 -2
  349. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts.map +1 -1
  350. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.js +12 -4
  351. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.d.ts.map +1 -1
  352. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js +1 -0
  353. package/src/shade/renderer/shader/chunk/material/chunk_compute_indirect_specular.js +1 -1
  354. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts +16 -0
  355. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts.map +1 -0
  356. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.js +25 -0
  357. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +2 -2
  358. package/src/shade/renderer/shader/compiler/ShaderSwitch.d.ts +1 -1
  359. package/src/shade/renderer/shader/compiler/ShaderSwitchSet.d.ts +1 -1
  360. package/src/shade/renderer/shader/resource/ShaderResourceDescriptor.d.ts +1 -1
  361. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.d.ts +2 -2
  362. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.js +2 -2
  363. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
@@ -0,0 +1,111 @@
1
+ import {
2
+ BRICK_ATLAS_TEXTURE_RESOURCE,
3
+ BRICK_LEVELS_RESOURCE,
4
+ BRICK_MAP_TEXTURE_RESOURCE,
5
+ BRICK_OCCUPANCY_TEXTURE_RESOURCE,
6
+ BRICK_SAMPLER_RESOURCE,
7
+ chunk_brick_clipmap_distance
8
+ } from "../global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js";
9
+ import { chunk_workgroup_sum_vec4 } from "../shader/chunk/subgroup/chunk_workgroup_sum_vec4.js";
10
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
11
+ import { ComputeShader } from "../shader/ComputeShader.js";
12
+ import { ShaderResourceSetDescriptor } from "../shader/resource/ShaderResourceSetDescriptor.js";
13
+ import { WebGPUBufferType } from "../shader/type/WebGPUBufferType.js";
14
+ import { ACOUSTIC_FRAME_STRUCT } from "./ACOUSTIC_FRAME_STRUCT.js";
15
+ import {
16
+ ACOUSTIC_LISTENER_GROUPS,
17
+ ACOUSTIC_LISTENER_PARTIAL_VEC4S,
18
+ ACOUSTIC_LISTENER_PARTIALS_RESOURCE
19
+ } from "./ACOUSTIC_LISTENER_RESOURCES.js";
20
+ import { ACOUSTIC_PROBE_RESULT_DESCRIPTOR } from "./ACOUSTIC_PROBE_DATABASE_SPEC.js";
21
+ import { chunk_acoustic_room } from "./chunk_acoustic_listener.js";
22
+ import { BRICK_ACOUSTICS_RESOURCE } from "./chunk_brick_acoustics.js";
23
+
24
+ const resources = new ShaderResourceSetDescriptor();
25
+
26
+ resources.createGroup()
27
+ .addUniform("acoustic_frame", ACOUSTIC_FRAME_STRUCT)
28
+ .addStorageBuffer("database", WebGPUBufferType.unsized, true)
29
+ .add(ACOUSTIC_LISTENER_PARTIALS_RESOURCE);
30
+
31
+ resources.createGroup()
32
+ .add(BRICK_LEVELS_RESOURCE)
33
+ .add(BRICK_MAP_TEXTURE_RESOURCE)
34
+ .add(BRICK_OCCUPANCY_TEXTURE_RESOURCE)
35
+ .add(BRICK_ATLAS_TEXTURE_RESOURCE)
36
+ .add(BRICK_SAMPLER_RESOURCE)
37
+ .add(BRICK_ACOUSTICS_RESOURCE);
38
+
39
+ /**
40
+ * The room about the listener, one workgroup: the listener workgroups' sums added, the room they make
41
+ * (`acoustic_room`), where its reflecting surface lies, the share of the rays that left (into open air, or into space not
42
+ * built yet) and how many rays were summed, written whole at row 0 of `acoustic_room`. A listener inside a solid has no
43
+ * room.
44
+ *
45
+ * @type {ComputeShader}
46
+ */
47
+ export const shader_acoustic_room = ComputeShader.from({
48
+ label: "Acoustic Room",
49
+ resources,
50
+ body: CodeChunk.from(
51
+ //language=WGSL
52
+ `
53
+ @compute @workgroup_size(64)
54
+ fn main(
55
+ @builtin(local_invocation_index) lane: u32,
56
+ @builtin(subgroup_invocation_id) subgroup_lane: u32,
57
+ @builtin(subgroup_size) subgroup_size: u32,
58
+ ) {
59
+ var counts = vec4<f32>(0.0);
60
+ var absorbed = vec4<f32>(0.0);
61
+ var lean = vec4<f32>(0.0);
62
+
63
+ if (lane < ${ACOUSTIC_LISTENER_GROUPS}u) {
64
+ let at = lane * ${ACOUSTIC_LISTENER_PARTIAL_VEC4S}u;
65
+
66
+ counts = acoustic_listener_partials[at];
67
+ absorbed = acoustic_listener_partials[at + 1u];
68
+ lean = acoustic_listener_partials[at + 2u];
69
+ }
70
+
71
+ counts = workgroup_sum_vec4(counts, lane, subgroup_lane, subgroup_size);
72
+ absorbed = workgroup_sum_vec4(absorbed, lane, subgroup_lane, subgroup_size);
73
+ lean = workgroup_sum_vec4(lean, lane, subgroup_lane, subgroup_size);
74
+
75
+ if (lane != 0u) {
76
+ return;
77
+ }
78
+
79
+ var result = ${ACOUSTIC_PROBE_RESULT_DESCRIPTOR.marshalling_method_read_rw}(&database, 0u);
80
+
81
+ let inside = brick_clipmap_distance(acoustic_frame.listener, acoustic_frame.cascade_count, acoustic_frame.atlas_shift) < 0.0;
82
+
83
+ result.inside = select(0.0, 1.0, inside);
84
+ result.answered = counts.x;
85
+ result.escaped = select(0.0, counts.y / counts.x, counts.x > 0.0);
86
+ result.energy = vec3<f32>(0.0);
87
+ result.centre = vec3<f32>(0.0);
88
+ result.lean = vec3<f32>(0.0);
89
+ result.absorption = vec3<f32>(1.0);
90
+ result.mfp = 0.0;
91
+
92
+ if (!inside) {
93
+ let room = acoustic_room(counts, absorbed.xyz, acoustic_frame.air);
94
+
95
+ result.energy = room.energy;
96
+ result.centre = room.centre;
97
+ result.absorption = room.absorption;
98
+ result.mfp = select(0.0, 4.0 * counts.z / counts.w, counts.w > 0.0);
99
+ result.lean = select(vec3<f32>(0.0), lean.xyz / lean.w, lean.w > 0.0);
100
+ }
101
+
102
+ ${ACOUSTIC_PROBE_RESULT_DESCRIPTOR.marshalling_method_write}(&database, 0u, result);
103
+ }
104
+ `, [
105
+ chunk_workgroup_sum_vec4,
106
+ chunk_brick_clipmap_distance,
107
+ chunk_acoustic_room,
108
+ ACOUSTIC_PROBE_RESULT_DESCRIPTOR.chunk_read_rw,
109
+ ACOUSTIC_PROBE_RESULT_DESCRIPTOR.chunk_write,
110
+ ]),
111
+ });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The frame's heard sources, a workgroup a source of `source_list`, written at its row of `acoustic_direct`:
3
+ *
4
+ * - **Its direct path.** A cone from the listener over the source's disk, a lane a cell of it
5
+ * (`acoustic_direct_cone_cell`): the share of the cell each occluder leaves open, and what the walls let through of
6
+ * the rest; the mean over every cell, one that did not resolve passing nothing, and 1 in `answered` where any did.
7
+ * Where none did, the path stays as it was.
8
+ * - **Its reverberant energy at the listener**: its first-order reflections off the listener's hits
9
+ * (`shader_acoustic_coupling`'s chunks summed), and every order after as the room loses a share `α` a reflection and
10
+ * the air its share over a free path (row 0 of `acoustic_room`, written by the room pass before;
11
+ * `acoustic_reverb_orders`). As a ratio to the source's direct energy at 1 m; 0 where the listener's rays hit
12
+ * nothing.
13
+ *
14
+ * @type {ComputeShader}
15
+ */
16
+ export const shader_acoustic_source: ComputeShader;
17
+ import { ComputeShader } from "../shader/ComputeShader.js";
18
+ //# sourceMappingURL=shader_acoustic_source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shader_acoustic_source.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/acoustics/shader_acoustic_source.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;GAcG;AACH,qCAFU,aAAa,CAwEpB;8BAvH2B,4BAA4B"}
@@ -0,0 +1,130 @@
1
+ import {
2
+ BRICK_ATLAS_TEXTURE_RESOURCE,
3
+ BRICK_LEVELS_RESOURCE,
4
+ BRICK_MAP_TEXTURE_RESOURCE,
5
+ BRICK_OCCUPANCY_TEXTURE_RESOURCE,
6
+ BRICK_SAMPLER_RESOURCE
7
+ } from "../global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js";
8
+ import { chunk_folded_workgroup_index } from "../shader/chunk/grid/chunk_folded_workgroup_index.js";
9
+ import { chunk_workgroup_sum_vec4 } from "../shader/chunk/subgroup/chunk_workgroup_sum_vec4.js";
10
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
11
+ import { ComputeShader } from "../shader/ComputeShader.js";
12
+ import { ShaderResourceSetDescriptor } from "../shader/resource/ShaderResourceSetDescriptor.js";
13
+ import { u32 } from "../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
14
+ import { WebGPUArray } from "../shader/type/WebGPUArray.js";
15
+ import { WebGPUBufferType } from "../shader/type/WebGPUBufferType.js";
16
+ import { ACOUSTIC_FRAME_STRUCT } from "./ACOUSTIC_FRAME_STRUCT.js";
17
+ import {
18
+ ACOUSTIC_COUPLING_PARTIAL_VEC4S,
19
+ ACOUSTIC_COUPLING_PARTIALS_RESOURCE,
20
+ ACOUSTIC_LISTENER_GROUPS
21
+ } from "./ACOUSTIC_LISTENER_RESOURCES.js";
22
+ import { ACOUSTIC_DIRECT_DESCRIPTOR, ACOUSTIC_PROBE_RESULT_DESCRIPTOR, ACOUSTIC_SOURCE_DESCRIPTOR } from "./ACOUSTIC_PROBE_DATABASE_SPEC.js";
23
+ import { ACOUSTIC_CONE_CELLS, chunk_acoustic_direct_cone } from "./chunk_acoustic_direct_cone.js";
24
+ import { chunk_acoustic_room } from "./chunk_acoustic_listener.js";
25
+ import { BRICK_ACOUSTICS_RESOURCE } from "./chunk_brick_acoustics.js";
26
+
27
+ const resources = new ShaderResourceSetDescriptor();
28
+
29
+ resources.setImmediate("source_count", u32);
30
+
31
+ resources.createGroup()
32
+ .addUniform("acoustic_frame", ACOUSTIC_FRAME_STRUCT)
33
+ .addStorageBuffer("database", WebGPUBufferType.unsized, true)
34
+ .addStorageBuffer("source_list", WebGPUArray.from(u32), false)
35
+ .add(ACOUSTIC_COUPLING_PARTIALS_RESOURCE);
36
+
37
+ resources.createGroup()
38
+ .add(BRICK_LEVELS_RESOURCE)
39
+ .add(BRICK_MAP_TEXTURE_RESOURCE)
40
+ .add(BRICK_OCCUPANCY_TEXTURE_RESOURCE)
41
+ .add(BRICK_ATLAS_TEXTURE_RESOURCE)
42
+ .add(BRICK_SAMPLER_RESOURCE)
43
+ .add(BRICK_ACOUSTICS_RESOURCE);
44
+
45
+ /**
46
+ * The frame's heard sources, a workgroup a source of `source_list`, written at its row of `acoustic_direct`:
47
+ *
48
+ * - **Its direct path.** A cone from the listener over the source's disk, a lane a cell of it
49
+ * (`acoustic_direct_cone_cell`): the share of the cell each occluder leaves open, and what the walls let through of
50
+ * the rest; the mean over every cell, one that did not resolve passing nothing, and 1 in `answered` where any did.
51
+ * Where none did, the path stays as it was.
52
+ * - **Its reverberant energy at the listener**: its first-order reflections off the listener's hits
53
+ * (`shader_acoustic_coupling`'s chunks summed), and every order after as the room loses a share `α` a reflection and
54
+ * the air its share over a free path (row 0 of `acoustic_room`, written by the room pass before;
55
+ * `acoustic_reverb_orders`). As a ratio to the source's direct energy at 1 m; 0 where the listener's rays hit
56
+ * nothing.
57
+ *
58
+ * @type {ComputeShader}
59
+ */
60
+ export const shader_acoustic_source = ComputeShader.from({
61
+ label: "Acoustic Source",
62
+ resources,
63
+ body: CodeChunk.from(
64
+ //language=WGSL
65
+ `
66
+ @compute @workgroup_size(64)
67
+ fn main(
68
+ @builtin(workgroup_id) workgroup_id: vec3<u32>,
69
+ @builtin(local_invocation_index) lane: u32,
70
+ @builtin(subgroup_invocation_id) subgroup_lane: u32,
71
+ @builtin(subgroup_size) subgroup_size: u32,
72
+ ) {
73
+ let index = folded_workgroup_index(workgroup_id);
74
+
75
+ // the same for the whole workgroup: it leaves together, before the sums
76
+ if (index >= source_count) {
77
+ return;
78
+ }
79
+
80
+ let row = source_list[index];
81
+ let source = ${ACOUSTIC_SOURCE_DESCRIPTOR.marshalling_method_read_rw}(&database, row);
82
+
83
+ var direct = vec4<f32>(0.0);
84
+
85
+ if (lane < ${ACOUSTIC_CONE_CELLS}u) {
86
+ let cell = acoustic_direct_cone_cell(acoustic_frame.listener, source.position, source.radius, lane, acoustic_frame.fallback, acoustic_frame.cascade_count, acoustic_frame.atlas_shift);
87
+
88
+ direct = vec4<f32>(cell.w * cell.xyz, cell.w);
89
+ }
90
+
91
+ var first = vec4<f32>(0.0);
92
+
93
+ if (lane < ${ACOUSTIC_LISTENER_GROUPS}u) {
94
+ first = acoustic_coupling_partials[(index * ${ACOUSTIC_LISTENER_GROUPS}u + lane) * ${ACOUSTIC_COUPLING_PARTIAL_VEC4S}u];
95
+ }
96
+
97
+ let direct_sum = workgroup_sum_vec4(direct, lane, subgroup_lane, subgroup_size);
98
+ let first_sum = workgroup_sum_vec4(first, lane, subgroup_lane, subgroup_size);
99
+
100
+ if (lane != 0u) {
101
+ return;
102
+ }
103
+
104
+ var result = ${ACOUSTIC_DIRECT_DESCRIPTOR.marshalling_method_read_rw}(&database, row);
105
+
106
+ // the mean over every cell, a cell that did not resolve passing nothing: what is not known is lost, never assumed
107
+ if (direct_sum.w > 0.0) {
108
+ result.direct = direct_sum.xyz / f32(${ACOUSTIC_CONE_CELLS}u);
109
+ }
110
+
111
+ result.answered = select(0.0, 1.0, direct_sum.w > 0.0);
112
+
113
+ let room = ${ACOUSTIC_PROBE_RESULT_DESCRIPTOR.marshalling_method_read_rw}(&database, 0u);
114
+
115
+ result.reverb = first_sum.xyz * acoustic_reverb_orders(room.absorption, acoustic_frame.air, room.mfp);
116
+ result.reverb_rays = select(0.0, 1.0, first_sum.w > 0.0);
117
+
118
+ ${ACOUSTIC_DIRECT_DESCRIPTOR.marshalling_method_write}(&database, row, result);
119
+ }
120
+ `, [
121
+ chunk_folded_workgroup_index,
122
+ chunk_workgroup_sum_vec4,
123
+ chunk_acoustic_direct_cone,
124
+ chunk_acoustic_room,
125
+ ACOUSTIC_SOURCE_DESCRIPTOR.chunk_read_rw,
126
+ ACOUSTIC_PROBE_RESULT_DESCRIPTOR.chunk_read_rw,
127
+ ACOUSTIC_DIRECT_DESCRIPTOR.chunk_read_rw,
128
+ ACOUSTIC_DIRECT_DESCRIPTOR.chunk_write,
129
+ ]),
130
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_read_gBuffer_material.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_read_gBuffer_material.js"],"names":[],"mappings":"AAUA,oDAwDE;0BA3DwB,iCAAiC"}
1
+ {"version":3,"file":"chunk_read_gBuffer_material.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_read_gBuffer_material.js"],"names":[],"mappings":"AAWA,oDAyDE;0BA5DwB,iCAAiC"}
@@ -4,6 +4,7 @@ import { chunk_rgbe9995_decode } from "../shader/chunk/color/rgbe9995/chunk_rgbe
4
4
  import { chunk_decode_g_buffer_metalness } from "../shader/chunk/material/chunk_decode_g_buffer_metalness.js";
5
5
  import { chunk_decode_g_buffer_roughness } from "../shader/chunk/material/chunk_decode_g_buffer_roughness.js";
6
6
  import { chunk_metalness_to_specular_color } from "../shader/chunk/material/chunk_metalness_to_specular_color.js";
7
+ import { chunk_metalness_to_specular_F90 } from "../shader/chunk/material/chunk_metalness_to_specular_F90.js";
7
8
  import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
8
9
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
9
10
  import { GBUFFER_ALBEDO_RESOURCE, GBUFFER_EMISSIVE_RESOURCE, GBUFFER_PBR_RESOURCE } from "./GBUFFER_RESOURCES.js";
@@ -48,7 +49,7 @@ fn read_gBuffer_material(
48
49
  material.roughness = max(f_roughness, ${BSDF_ROUGHNESS_MINIMUM});
49
50
 
50
51
  material.specularF0 = metalness_to_specular_color(f_metalness, albedo);
51
- material.specularF90 = 1.0;
52
+ material.specularF90 = metalness_to_specular_F90(f_metalness, albedo);
52
53
  material.specularF0_dielectric = vec3(MIN_DIELECTRICS_F0);
53
54
  material.specularF0_metal = albedo;
54
55
 
@@ -59,6 +60,7 @@ fn read_gBuffer_material(
59
60
  `, [
60
61
  MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
61
62
  chunk_metalness_to_specular_color,
63
+ chunk_metalness_to_specular_F90,
62
64
  chunk_MIN_DIELECTRICS_F0,
63
65
  chunk_decode_g_buffer_roughness,
64
66
  chunk_decode_g_buffer_metalness,
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Every light that reaches a point: each occupied directional light, then every point and spot light of the froxel
3
+ * cluster the point falls in, each shadow-mapped at the point and handed to the including shader's lobe:
4
+ *
5
+ * ```wgsl
6
+ * fn shade_direct_lights(context: ptr<function, DirectLightContext>, position: vec3f, view_direction: vec3f,
7
+ * coord: vec2f, view_depth: f32)
8
+ * ```
9
+ *
10
+ * `coord` is the pixel and `view_depth` the planar view depth the cluster is looked up by. The lobe, its context and
11
+ * the normal the shadows are taken along are the including shader's, by name, as {@link chunk_shade_directional_lights}
12
+ * describes. A point or spot light that its shadow hides entirely is not handed on.
13
+ *
14
+ * **Every light the cell lists is handed on; there is no budget.** A surface's direct light changes at the pixel, and
15
+ * stopping part-way through the list would keep a different set in each of two neighbouring cells, which list
16
+ * different lights, and step at their shared edge. So the cost follows the scene: a point shades as many point and
17
+ * spot lights as its cell lists, each with its shadow map.
18
+ *
19
+ * @type {CodeChunk}
20
+ */
21
+ export const chunk_shade_direct_lights: CodeChunk;
22
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
23
+ //# sourceMappingURL=chunk_shade_direct_lights.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_shade_direct_lights.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_direct_lights.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wCAFU,SAAS,CA4EjB;0BAnGwB,iCAAiC"}
@@ -0,0 +1,111 @@
1
+ import { chunk_light_cluster_counts } from "../light/cluster/chunk_light_cluster_counts.js";
2
+ import { chunk_light_cluster_metadata_by_position } from "../light/cluster/chunk_light_cluster_metadata_by_position.js";
3
+ import { LIGHT_CLUSTER_DATA_RESOURCE } from "../light/cluster/LIGHT_CLUSTER_RESOURCES.js";
4
+ import { LIGHT_DATA_RESOURCE } from "../light/LIGHT_DATA_RESOURCE.js";
5
+ import { chunk_get_point_light_info_by_index } from "../shader/chunk/light/io/chunk_get_point_light_info_by_index.js";
6
+ import { chunk_get_spot_light_info_by_index } from "../shader/chunk/light/io/chunk_get_spot_light_info_by_index.js";
7
+ import { INCIDENT_LIGHT_STRUCT } from "../shader/chunk/light/INCIDENT_LIGHT_STRUCT.js";
8
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
9
+ import { chunk_shadowmap_get_light_visibility } from "../shadow/map/shader/chunk_shadowmap_get_light_visibility.js";
10
+ import { VIEW_RESOURCE } from "../view/VIEW_RESOURCE.js";
11
+ import { chunk_shade_directional_lights } from "./chunk_shade_directional_lights.js";
12
+
13
+ /**
14
+ * Every light that reaches a point: each occupied directional light, then every point and spot light of the froxel
15
+ * cluster the point falls in, each shadow-mapped at the point and handed to the including shader's lobe:
16
+ *
17
+ * ```wgsl
18
+ * fn shade_direct_lights(context: ptr<function, DirectLightContext>, position: vec3f, view_direction: vec3f,
19
+ * coord: vec2f, view_depth: f32)
20
+ * ```
21
+ *
22
+ * `coord` is the pixel and `view_depth` the planar view depth the cluster is looked up by. The lobe, its context and
23
+ * the normal the shadows are taken along are the including shader's, by name, as {@link chunk_shade_directional_lights}
24
+ * describes. A point or spot light that its shadow hides entirely is not handed on.
25
+ *
26
+ * **Every light the cell lists is handed on; there is no budget.** A surface's direct light changes at the pixel, and
27
+ * stopping part-way through the list would keep a different set in each of two neighbouring cells, which list
28
+ * different lights, and step at their shared edge. So the cost follows the scene: a point shades as many point and
29
+ * spot lights as its cell lists, each with its shadow map.
30
+ *
31
+ * @type {CodeChunk}
32
+ */
33
+ export const chunk_shade_direct_lights = CodeChunk.from(
34
+ //language=WGSL
35
+ `
36
+ fn shade_direct_lights(
37
+ context: ptr<function, DirectLightContext>,
38
+ position: vec3<f32>,
39
+ view_direction: vec3<f32>,
40
+ coord: vec2<f32>,
41
+ view_depth: f32,
42
+ ) {
43
+ shade_directional_lights(context, position, view_direction);
44
+
45
+ // Process local lights (point, then spot)
46
+ let cluster_metadata = light_cluster_metadata_by_position(
47
+ coord.xy,
48
+ view_depth,
49
+ vec2(view.width, view.height)
50
+ );
51
+
52
+ let cluster_offset = cluster_metadata.offset;
53
+ let point_count = light_cluster_count_point(cluster_metadata.counts);
54
+ let spot_count = light_cluster_count_spot(cluster_metadata.counts);
55
+
56
+ for (var i = 0u; i < point_count; i++) {
57
+ let light_index = cluster_data[cluster_offset + i];
58
+
59
+ var direct_light = get_point_light_info_by_index(&light_data, light_index, position);
60
+
61
+ let visibility = shadowmap_get_point_light_visibility(
62
+ &light_data,
63
+ light_index,
64
+ position,
65
+ direct_light_visibility_normal(context, direct_light)
66
+ );
67
+
68
+ direct_light.color *= visibility;
69
+
70
+ if (all(direct_light.color == vec3(0.0))) {
71
+ continue;
72
+ }
73
+
74
+ direct_light_lobe(context, direct_light);
75
+ }
76
+
77
+ for (var j = 0u; j < spot_count; j++) {
78
+ let light_index = cluster_data[cluster_offset + point_count + j];
79
+
80
+ var direct_light = get_spot_light_info_by_index(&light_data, light_index, position);
81
+
82
+ let visibility = shadowmap_get_spot_light_visibility(
83
+ &light_data,
84
+ light_index,
85
+ position,
86
+ direct_light_visibility_normal(context, direct_light)
87
+ );
88
+
89
+ direct_light.color *= visibility;
90
+
91
+ if (all(direct_light.color == vec3(0.0))) {
92
+ continue;
93
+ }
94
+
95
+ direct_light_lobe(context, direct_light);
96
+ }
97
+ }
98
+ `, [
99
+ INCIDENT_LIGHT_STRUCT.declaration_chunk,
100
+ chunk_shade_directional_lights,
101
+ chunk_light_cluster_metadata_by_position,
102
+ chunk_light_cluster_counts,
103
+ chunk_get_point_light_info_by_index,
104
+ chunk_get_spot_light_info_by_index,
105
+ chunk_shadowmap_get_light_visibility,
106
+ ]
107
+ );
108
+
109
+ chunk_shade_direct_lights.requireResource(LIGHT_CLUSTER_DATA_RESOURCE);
110
+ chunk_shade_direct_lights.requireResource(LIGHT_DATA_RESOURCE);
111
+ chunk_shade_direct_lights.requireResource(VIEW_RESOURCE);
@@ -1,11 +1,22 @@
1
1
  /**
2
- * Accumulate direct lighting from all occupied directional lights (max 32,
3
- * enforced by GPULightCollection) into `reflected_light`, using the CSM shadow
4
- * atlas for visibility.
2
+ * Every occupied directional light (at most 32, enforced by GPULightCollection), shadow-mapped at a point and
3
+ * handed to the including shader's lobe:
5
4
  *
6
- * Shared by the brute-force deferred shading path and the ReSTIR DI variant —
7
- * directional lights stay on the cascaded-shadow-map path in both, so the loop
8
- * lives here once.
5
+ * ```wgsl
6
+ * fn shade_directional_lights(context: ptr<function, DirectLightContext>, position: vec3f, view_direction: vec3f)
7
+ * ```
8
+ *
9
+ * The lobe is the including shader's, by name. It defines:
10
+ *
11
+ * - `struct DirectLightContext`, whatever the lobe reads and accumulates into;
12
+ * - `fn direct_light_lobe(context: ptr<function, DirectLightContext>, light: IncidentLight)`, given each light with
13
+ * its colour already multiplied by the light's shadow visibility at `position`;
14
+ * - `fn direct_light_visibility_normal(context: ptr<function, DirectLightContext>, light: IncidentLight) -> vec3f`,
15
+ * the normal the shadow lookup offsets along and culls back faces by: a light behind it is not visible. A lobe
16
+ * lit from every side (a strand) answers the light's own direction, which culls nothing and offsets nothing.
17
+ *
18
+ * Linked by the clustered and the ReSTIR direct shading alike, through {@link chunk_shade_direct_lights} for the
19
+ * former; the standard material's lobe is `chunk_standard_material_direct_light_lobe`.
9
20
  *
10
21
  * @type {CodeChunk}
11
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_shade_directional_lights.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_directional_lights.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AACH,6CAFU,SAAS,CAuCjB;0BApDwB,iCAAiC"}
1
+ {"version":3,"file":"chunk_shade_directional_lights.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_directional_lights.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,6CAFU,SAAS,CAoCjB;0BA5DwB,iCAAiC"}
@@ -4,22 +4,30 @@ import {
4
4
  import {
5
5
  chunk_get_directional_light_info_by_index
6
6
  } from "../shader/chunk/light/io/chunk_get_directional_light_info_by_index.js";
7
- import { REFLECTED_LIGHT_STRUCT } from "../shader/chunk/light/REFLECTED_LIGHT_STRUCT.js";
8
- import { chunk_re_direct_physical } from "../shader/chunk/material/chunk_re_direct_physical.js";
9
- import { GEOMETRIC_SHADING_INFO_STRUCT } from "../shader/chunk/material/GEOMETRIC_SHADING_INFO_STRUCT.js";
10
- import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
7
+ import { INCIDENT_LIGHT_STRUCT } from "../shader/chunk/light/INCIDENT_LIGHT_STRUCT.js";
11
8
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
12
9
  import { chunk_shadowmap_get_light_visibility } from "../shadow/map/shader/chunk_shadowmap_get_light_visibility.js";
13
10
  import { LIGHT_DATA_RESOURCE } from "../light/LIGHT_DATA_RESOURCE.js";
14
11
 
15
12
  /**
16
- * Accumulate direct lighting from all occupied directional lights (max 32,
17
- * enforced by GPULightCollection) into `reflected_light`, using the CSM shadow
18
- * atlas for visibility.
13
+ * Every occupied directional light (at most 32, enforced by GPULightCollection), shadow-mapped at a point and
14
+ * handed to the including shader's lobe:
19
15
  *
20
- * Shared by the brute-force deferred shading path and the ReSTIR DI variant —
21
- * directional lights stay on the cascaded-shadow-map path in both, so the loop
22
- * lives here once.
16
+ * ```wgsl
17
+ * fn shade_directional_lights(context: ptr<function, DirectLightContext>, position: vec3f, view_direction: vec3f)
18
+ * ```
19
+ *
20
+ * The lobe is the including shader's, by name. It defines:
21
+ *
22
+ * - `struct DirectLightContext`, whatever the lobe reads and accumulates into;
23
+ * - `fn direct_light_lobe(context: ptr<function, DirectLightContext>, light: IncidentLight)`, given each light with
24
+ * its colour already multiplied by the light's shadow visibility at `position`;
25
+ * - `fn direct_light_visibility_normal(context: ptr<function, DirectLightContext>, light: IncidentLight) -> vec3f`,
26
+ * the normal the shadow lookup offsets along and culls back faces by: a light behind it is not visible. A lobe
27
+ * lit from every side (a strand) answers the light's own direction, which culls nothing and offsets nothing.
28
+ *
29
+ * Linked by the clustered and the ReSTIR direct shading alike, through {@link chunk_shade_direct_lights} for the
30
+ * former; the standard material's lobe is `chunk_standard_material_direct_light_lobe`.
23
31
  *
24
32
  * @type {CodeChunk}
25
33
  */
@@ -27,9 +35,9 @@ export const chunk_shade_directional_lights = CodeChunk.from(
27
35
  //language=WGSL
28
36
  `
29
37
  fn shade_directional_lights(
30
- material: ${MATERIAL_SHADING_INFO_STRUCT.wgsl_ref},
31
- geometry: ${GEOMETRIC_SHADING_INFO_STRUCT.wgsl_ref},
32
- reflected_light: ptr<function, ${REFLECTED_LIGHT_STRUCT.wgsl_ref}>,
38
+ context: ptr<function, DirectLightContext>,
39
+ position: vec3<f32>,
40
+ view_direction: vec3<f32>,
33
41
  ) {
34
42
  var directional_bits = directional_lights_iteration_mask(&light_data);
35
43
  while (directional_bits != 0u) {
@@ -41,21 +49,18 @@ fn shade_directional_lights(
41
49
  let visibility = shadowmap_get_directional_light_visibility(
42
50
  &light_data,
43
51
  directional_index,
44
- geometry.position,
45
- geometry.view_direction,
46
- geometry.shading_normal
52
+ position,
53
+ view_direction,
54
+ direct_light_visibility_normal(context, direct_light)
47
55
  );
48
56
 
49
57
  direct_light.color *= visibility;
50
58
 
51
- re_direct_physical(direct_light, geometry, material, reflected_light);
59
+ direct_light_lobe(context, direct_light);
52
60
  }
53
61
  }
54
62
  `, [
55
- REFLECTED_LIGHT_STRUCT.declaration_chunk,
56
- GEOMETRIC_SHADING_INFO_STRUCT.declaration_chunk,
57
- MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
58
- chunk_re_direct_physical,
63
+ INCIDENT_LIGHT_STRUCT.declaration_chunk,
59
64
  chunk_get_directional_light_info_by_index,
60
65
  chunk_directional_lights_iteration_mask,
61
66
  chunk_shadowmap_get_light_visibility,
@@ -1,29 +1,19 @@
1
1
  /**
2
- * Brute-force direct shading of a standard material: every occupied directional light through the
3
- * shared CSM helper, then a per-pixel loop over every point and spot light in the froxel cluster, each
4
- * shadow-mapped.
2
+ * Brute-force direct shading of a standard material: every light that reaches the point
3
+ * ({@link chunk_shade_direct_lights}: each occupied directional light, then every point and spot light in the froxel
4
+ * cluster, each shadow-mapped) through the standard material's lobe, then the multiple-scattering compensation and
5
+ * the emission.
5
6
  *
6
- * **One chunk, linked by both the deferred and the forward paths.** `shader_deferred_main` links it
7
- * (through the `_heavy` alias next door) and so does
8
- * `chunk_forward_shade_standard_fragment`. It used to exist twice under this one
9
- * WGSL function name, with the cluster metadata lookup, the point loop, the spot loop and the
10
- * emissive sum character-identical between the two and only the directional half differing: this copy
11
- * re-inlined `chunk_shade_directional_lights`' body where the other called it. Two files one edit away
12
- * from shading the same scene differently depending on which of them the pass reached.
7
+ * **One chunk, linked by both the deferred and the forward paths.** `shader_deferred_main` links it (through the
8
+ * `_deferred` choice next door) and so does `chunk_forward_shade_standard_fragment`, so two passes one edit apart
9
+ * cannot shade the same scene differently.
13
10
  *
14
- * The ReSTIR DI variant ({@link chunk_shade_standard_material_direct_restir}) is a genuinely different
15
- * function — it replaces the cluster loop with one resampled, ray-traced sample — and stays separate.
16
- * The deferred pass links one of the two by a shader switch
17
- * (`chunk_shade_standard_material_direct_deferred`), not via a runtime branch.
11
+ * The ReSTIR DI variant ({@link chunk_shade_standard_material_direct_restir}) is a genuinely different function — it
12
+ * replaces the cluster loop with one resampled, ray-traced sample — and stays separate. The deferred pass links one
13
+ * of the two by a shader switch (`chunk_shade_standard_material_direct_deferred`), not via a runtime branch.
18
14
  *
19
- * **Every light the cell lists is shaded; there is no budget.** A surface's direct light changes at the
20
- * pixel, and stopping part-way through the list would keep a different set in each of two neighbouring
21
- * cells, which list different lights, and step at their shared edge. So the cost follows the scene: a
22
- * pixel shades as many point and spot lights as its cell lists, each with its shadow map.
23
- *
24
- * A note carried by the inlined copy, kept because it is still true and now has nowhere else to sit:
25
- * a screen-space ray-trace for directional visibility would be wanted on the deferred path only, and
26
- * adding it means splitting these paths again deliberately rather than by accident.
15
+ * A screen-space ray-trace for directional visibility would be wanted on the deferred path only, and adding it means
16
+ * splitting these paths again deliberately rather than by accident.
27
17
  *
28
18
  * @type {CodeChunk}
29
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_shade_standard_material_direct.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_standard_material_direct.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,mDAFU,SAAS,CA0FjB;0BA5HwB,iCAAiC"}
1
+ {"version":3,"file":"chunk_shade_standard_material_direct.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_standard_material_direct.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;GAkBG;AACH,mDAFU,SAAS,CAgCjB;0BArDwB,iCAAiC"}