@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
@@ -1,45 +1,27 @@
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 { chunk_get_point_light_info_by_index } from "../shader/chunk/light/io/chunk_get_point_light_info_by_index.js";
4
- import { chunk_get_spot_light_info_by_index } from "../shader/chunk/light/io/chunk_get_spot_light_info_by_index.js";
5
1
  import { REFLECTED_LIGHT_STRUCT } from "../shader/chunk/light/REFLECTED_LIGHT_STRUCT.js";
6
2
  import { chunk_re_direct_multiscatter } from "../shader/chunk/material/chunk_re_direct_multiscatter.js";
7
- import { chunk_re_direct_physical } from "../shader/chunk/material/chunk_re_direct_physical.js";
8
3
  import { GEOMETRIC_SHADING_INFO_STRUCT } from "../shader/chunk/material/GEOMETRIC_SHADING_INFO_STRUCT.js";
9
4
  import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
10
5
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
11
- import { chunk_shadowmap_get_light_visibility } from "../shadow/map/shader/chunk_shadowmap_get_light_visibility.js";
12
- import { chunk_shade_directional_lights } from "./chunk_shade_directional_lights.js";
13
- import { LIGHT_CLUSTER_DATA_RESOURCE } from "../light/cluster/LIGHT_CLUSTER_RESOURCES.js";
14
- import { LIGHT_DATA_RESOURCE } from "../light/LIGHT_DATA_RESOURCE.js";
15
- import { VIEW_RESOURCE } from "../view/VIEW_RESOURCE.js";
6
+ import { chunk_shade_direct_lights } from "./chunk_shade_direct_lights.js";
7
+ import { chunk_standard_material_direct_light_lobe } from "./chunk_standard_material_direct_light_lobe.js";
16
8
 
17
9
  /**
18
- * Brute-force direct shading of a standard material: every occupied directional light through the
19
- * shared CSM helper, then a per-pixel loop over every point and spot light in the froxel cluster, each
20
- * shadow-mapped.
10
+ * Brute-force direct shading of a standard material: every light that reaches the point
11
+ * ({@link chunk_shade_direct_lights}: each occupied directional light, then every point and spot light in the froxel
12
+ * cluster, each shadow-mapped) through the standard material's lobe, then the multiple-scattering compensation and
13
+ * the emission.
21
14
  *
22
- * **One chunk, linked by both the deferred and the forward paths.** `shader_deferred_main` links it
23
- * (through the `_heavy` alias next door) and so does
24
- * `chunk_forward_shade_standard_fragment`. It used to exist twice under this one
25
- * WGSL function name, with the cluster metadata lookup, the point loop, the spot loop and the
26
- * emissive sum character-identical between the two and only the directional half differing: this copy
27
- * re-inlined `chunk_shade_directional_lights`' body where the other called it. Two files one edit away
28
- * from shading the same scene differently depending on which of them the pass reached.
15
+ * **One chunk, linked by both the deferred and the forward paths.** `shader_deferred_main` links it (through the
16
+ * `_deferred` choice next door) and so does `chunk_forward_shade_standard_fragment`, so two passes one edit apart
17
+ * cannot shade the same scene differently.
29
18
  *
30
- * The ReSTIR DI variant ({@link chunk_shade_standard_material_direct_restir}) is a genuinely different
31
- * function — it replaces the cluster loop with one resampled, ray-traced sample — and stays separate.
32
- * The deferred pass links one of the two by a shader switch
33
- * (`chunk_shade_standard_material_direct_deferred`), not via a runtime branch.
19
+ * The ReSTIR DI variant ({@link chunk_shade_standard_material_direct_restir}) is a genuinely different function — it
20
+ * replaces the cluster loop with one resampled, ray-traced sample — and stays separate. The deferred pass links one
21
+ * of the two by a shader switch (`chunk_shade_standard_material_direct_deferred`), not via a runtime branch.
34
22
  *
35
- * **Every light the cell lists is shaded; there is no budget.** A surface's direct light changes at the
36
- * pixel, and stopping part-way through the list would keep a different set in each of two neighbouring
37
- * cells, which list different lights, and step at their shared edge. So the cost follows the scene: a
38
- * pixel shades as many point and spot lights as its cell lists, each with its shadow map.
39
- *
40
- * A note carried by the inlined copy, kept because it is still true and now has nowhere else to sit:
41
- * a screen-space ray-trace for directional visibility would be wanted on the deferred path only, and
42
- * adding it means splitting these paths again deliberately rather than by accident.
23
+ * A screen-space ray-trace for directional visibility would be wanted on the deferred path only, and adding it means
24
+ * splitting these paths again deliberately rather than by accident.
43
25
  *
44
26
  * @type {CodeChunk}
45
27
  */
@@ -53,68 +35,15 @@ fn shade_standard_material_direct(
53
35
  view_depth: f32,
54
36
  ) -> vec3<f32>{
55
37
 
56
- var reflected_light : ${REFLECTED_LIGHT_STRUCT.wgsl_ref};
57
-
58
- shade_directional_lights(material, geometry, &reflected_light);
59
-
60
- // Process local lights (point, then spot)
61
- let cluster_metadata = light_cluster_metadata_by_position(
62
- coord.xy,
63
- view_depth,
64
- vec2(view.width, view.height)
65
- );
66
-
67
- let cluster_offset = cluster_metadata.offset;
68
- let point_count = light_cluster_count_point(cluster_metadata.counts);
69
- let spot_count = light_cluster_count_spot(cluster_metadata.counts);
70
-
71
- for (var i = 0u; i < point_count; i++) {
72
- let light_index = cluster_data[cluster_offset + i];
73
-
74
- var direct_light = get_point_light_info_by_index(&light_data, light_index, geometry.position);
75
-
76
- let visibility = shadowmap_get_point_light_visibility(
77
- &light_data,
78
- light_index,
79
- geometry.position,
80
- geometry.shading_normal
81
- );
82
-
83
- direct_light.color *= visibility;
38
+ var context = DirectLightContext(material, geometry, ${REFLECTED_LIGHT_STRUCT.wgsl_ref}());
84
39
 
85
- if (all(direct_light.color == vec3(0.0))) {
86
- continue;
87
- }
40
+ shade_direct_lights(&context, geometry.position, geometry.view_direction, coord, view_depth);
88
41
 
89
- re_direct_physical(direct_light, geometry, material, &reflected_light);
90
- }
91
-
92
- for (var j = 0u; j < spot_count; j++) {
93
- let light_index = cluster_data[cluster_offset + point_count + j];
94
-
95
- var direct_light = get_spot_light_info_by_index(&light_data, light_index, geometry.position);
96
-
97
- let visibility = shadowmap_get_spot_light_visibility(
98
- &light_data,
99
- light_index,
100
- geometry.position,
101
- geometry.shading_normal
102
- );
103
-
104
- direct_light.color *= visibility;
105
-
106
- if (all(direct_light.color == vec3(0.0))) {
107
- continue;
108
- }
109
-
110
- re_direct_physical(direct_light, geometry, material, &reflected_light);
111
- }
112
-
113
- re_direct_multiscatter(geometry, material, &reflected_light);
42
+ re_direct_multiscatter(geometry, material, &context.reflected);
114
43
 
115
44
  var total_emissive_radiance = vec3(material.emissive);
116
45
 
117
- let outgoing_light = reflected_light.diffuse + reflected_light.specular + total_emissive_radiance;
46
+ let outgoing_light = context.reflected.diffuse + context.reflected.specular + total_emissive_radiance;
118
47
 
119
48
  return outgoing_light;
120
49
  }
@@ -122,17 +51,8 @@ fn shade_standard_material_direct(
122
51
  REFLECTED_LIGHT_STRUCT.declaration_chunk,
123
52
  GEOMETRIC_SHADING_INFO_STRUCT.declaration_chunk,
124
53
  MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
125
- chunk_re_direct_physical,
54
+ chunk_standard_material_direct_light_lobe,
55
+ chunk_shade_direct_lights,
126
56
  chunk_re_direct_multiscatter,
127
- chunk_light_cluster_metadata_by_position,
128
- chunk_light_cluster_counts,
129
- chunk_get_point_light_info_by_index,
130
- chunk_get_spot_light_info_by_index,
131
- chunk_shade_directional_lights,
132
- chunk_shadowmap_get_light_visibility,
133
57
  ]
134
58
  );
135
-
136
- chunk_shade_standard_material_direct.requireResource(LIGHT_CLUSTER_DATA_RESOURCE);
137
- chunk_shade_standard_material_direct.requireResource(LIGHT_DATA_RESOURCE);
138
- chunk_shade_standard_material_direct.requireResource(VIEW_RESOURCE);
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_shade_standard_material_direct_restir.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;GAYG;AACH,0DAFU,SAAS,CAgCjB;0BA/CwB,iCAAiC"}
1
+ {"version":3,"file":"chunk_shade_standard_material_direct_restir.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;GAYG;AACH,0DAFU,SAAS,CAiCjB;0BAjDwB,iCAAiC"}
@@ -4,6 +4,7 @@ import { GEOMETRIC_SHADING_INFO_STRUCT } from "../shader/chunk/material/GEOMETRI
4
4
  import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
5
5
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
6
6
  import { chunk_shade_directional_lights } from "./chunk_shade_directional_lights.js";
7
+ import { chunk_standard_material_direct_light_lobe } from "./chunk_standard_material_direct_light_lobe.js";
7
8
  import { RESTIR_RADIANCE_RESOURCE } from "../restir/di/RESTIR_RADIANCE_RESOURCE.js";
8
9
 
9
10
  /**
@@ -29,23 +30,24 @@ fn shade_standard_material_direct(
29
30
  view_depth: f32,
30
31
  ) -> vec3<f32>{
31
32
 
32
- var reflected_light : ${REFLECTED_LIGHT_STRUCT.wgsl_ref};
33
+ var context = DirectLightContext(material, geometry, ${REFLECTED_LIGHT_STRUCT.wgsl_ref}());
33
34
 
34
- shade_directional_lights(material, geometry, &reflected_light);
35
+ shade_directional_lights(&context, geometry.position, geometry.view_direction);
35
36
 
36
- re_direct_multiscatter(geometry, material, &reflected_light);
37
+ re_direct_multiscatter(geometry, material, &context.reflected);
37
38
 
38
39
  // ReSTIR-resolved point + spot direct lighting (already visibility-tested).
39
40
  let restir_radiance = textureLoad(tRestirRadiance, vec2<u32>(coord), 0).rgb;
40
41
 
41
42
  let total_emissive_radiance = vec3(material.emissive);
42
43
 
43
- return reflected_light.diffuse + reflected_light.specular + total_emissive_radiance + restir_radiance;
44
+ return context.reflected.diffuse + context.reflected.specular + total_emissive_radiance + restir_radiance;
44
45
  }
45
46
  `, [
46
47
  REFLECTED_LIGHT_STRUCT.declaration_chunk,
47
48
  GEOMETRIC_SHADING_INFO_STRUCT.declaration_chunk,
48
49
  MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
50
+ chunk_standard_material_direct_light_lobe,
49
51
  chunk_shade_directional_lights,
50
52
  chunk_re_direct_multiscatter,
51
53
  ]
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The standard material's lobe for the direct-light loops ({@link chunk_shade_direct_lights},
3
+ * `chunk_shade_directional_lights`): its context carries the material and the geometry at the shaded point and
4
+ * accumulates the reflected light, and each light goes through `re_direct_physical`. Shadows are taken along the
5
+ * shading normal.
6
+ *
7
+ * ```wgsl
8
+ * struct DirectLightContext { material: MaterialShadingInfo, geometry: GeometricShadingInfo, reflected: ReflectedLight }
9
+ * ```
10
+ *
11
+ * @type {CodeChunk}
12
+ */
13
+ export const chunk_standard_material_direct_light_lobe: CodeChunk;
14
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
15
+ //# sourceMappingURL=chunk_standard_material_direct_light_lobe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_standard_material_direct_light_lobe.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,wDAFU,SAAS,CAyBjB;0BAtCwB,iCAAiC"}
@@ -0,0 +1,47 @@
1
+ import { INCIDENT_LIGHT_STRUCT } from "../shader/chunk/light/INCIDENT_LIGHT_STRUCT.js";
2
+ import { REFLECTED_LIGHT_STRUCT } from "../shader/chunk/light/REFLECTED_LIGHT_STRUCT.js";
3
+ import { chunk_re_direct_physical } from "../shader/chunk/material/chunk_re_direct_physical.js";
4
+ import { GEOMETRIC_SHADING_INFO_STRUCT } from "../shader/chunk/material/GEOMETRIC_SHADING_INFO_STRUCT.js";
5
+ import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
6
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
7
+ import { UNRESTRICTED_POINTER_PARAMETERS_EXTENSION } from "../shader/resource/BUFFER_VIEW.js";
8
+
9
+ /**
10
+ * The standard material's lobe for the direct-light loops ({@link chunk_shade_direct_lights},
11
+ * `chunk_shade_directional_lights`): its context carries the material and the geometry at the shaded point and
12
+ * accumulates the reflected light, and each light goes through `re_direct_physical`. Shadows are taken along the
13
+ * shading normal.
14
+ *
15
+ * ```wgsl
16
+ * struct DirectLightContext { material: MaterialShadingInfo, geometry: GeometricShadingInfo, reflected: ReflectedLight }
17
+ * ```
18
+ *
19
+ * @type {CodeChunk}
20
+ */
21
+ export const chunk_standard_material_direct_light_lobe = CodeChunk.from(
22
+ //language=WGSL
23
+ `
24
+ struct DirectLightContext {
25
+ material: ${MATERIAL_SHADING_INFO_STRUCT.wgsl_ref},
26
+ geometry: ${GEOMETRIC_SHADING_INFO_STRUCT.wgsl_ref},
27
+ reflected: ${REFLECTED_LIGHT_STRUCT.wgsl_ref},
28
+ }
29
+
30
+ fn direct_light_lobe(context: ptr<function, DirectLightContext>, light: ${INCIDENT_LIGHT_STRUCT.wgsl_ref}) {
31
+ re_direct_physical(light, (*context).geometry, (*context).material, &(*context).reflected);
32
+ }
33
+
34
+ fn direct_light_visibility_normal(context: ptr<function, DirectLightContext>, light: ${INCIDENT_LIGHT_STRUCT.wgsl_ref}) -> vec3<f32> {
35
+ return (*context).geometry.shading_normal;
36
+ }
37
+ `, [
38
+ INCIDENT_LIGHT_STRUCT.declaration_chunk,
39
+ REFLECTED_LIGHT_STRUCT.declaration_chunk,
40
+ GEOMETRIC_SHADING_INFO_STRUCT.declaration_chunk,
41
+ MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
42
+ chunk_re_direct_physical,
43
+ ]
44
+ );
45
+
46
+ // the reflected light accumulates through a pointer to a member of the context
47
+ chunk_standard_material_direct_light_lobe.addLanguageExtension(UNRESTRICTED_POINTER_PARAMETERS_EXTENSION);
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @typedef {import("../shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet} ShaderSwitchSet
3
+ * @typedef {import("../global_illumination/probe_clipmap/GPUProbeClipmapGI.js").GPUProbeClipmapGI} GPUProbeClipmapGI
4
+ */
5
+ /**
6
+ * What the frame lights a surface with, for an extension that shades samples of its own: this frame's light
7
+ * clusters, the shadow atlas, the volumetrics' look-up table and its metadata (the fog a surface is seen through),
8
+ * the renderer's shader switches (the shadow technique and the indirect lighting mode among them) and the probe
9
+ * clipmap GI, whose probes a pass that can read indirect light binds in every mode. The transparent surfaces are lit
10
+ * by exactly these.
11
+ *
12
+ * The light records, the environment and the shadow tables are the scene's and are reached through the view
13
+ * (`frame.view.scene.lights`, `frame.view.scene.shadow_context`); this record carries what only the frame has.
14
+ *
15
+ * Carried at {@link FramePhase.AfterLighting} and {@link FramePhase.AfterTransparency}, and **frozen at both**: the
16
+ * renderer states it once, and nothing an extension publishes into it would reach a pass that lights anything.
17
+ */
18
+ export class ViewLighting extends FrameRecord {
19
+ static is_present_at(phase: any): boolean;
20
+ static is_writable_at(phase: any): boolean;
21
+ /**
22
+ * The light clusters' depth curve: a graph handle of a uniform buffer, `LIGHT_CLUSTER_PARAMETERS_RESOURCE`.
23
+ *
24
+ * @returns {number}
25
+ */
26
+ get light_cluster_parameters(): number;
27
+ /**
28
+ * The light clusters' per-cell counts and offsets: a graph handle of a storage buffer,
29
+ * `LIGHT_CLUSTER_LOOKUP_RESOURCE`.
30
+ *
31
+ * @returns {number}
32
+ */
33
+ get light_cluster_lookup(): number;
34
+ /**
35
+ * The light clusters' light indices: a graph handle of a storage buffer, `LIGHT_CLUSTER_DATA_RESOURCE`.
36
+ *
37
+ * @returns {number}
38
+ */
39
+ get light_cluster_data(): number;
40
+ /**
41
+ * The shadow atlas every shadow-casting light samples: a graph handle of a depth texture.
42
+ *
43
+ * @returns {number}
44
+ */
45
+ get shadowmap_atlas(): number;
46
+ /**
47
+ * The volumetrics' resolved look-up table, the in-scatter and transmittance a point is seen through:
48
+ * a graph handle of a 3D texture. Reads as no fog when the scene has none.
49
+ *
50
+ * @returns {number}
51
+ */
52
+ get volumetrics_lut(): number;
53
+ /**
54
+ * How {@link volumetrics_lut} is addressed: a graph handle of a uniform buffer, `VOLUMETRICS_METADATA_STRUCT`.
55
+ *
56
+ * @returns {number}
57
+ */
58
+ get volumetrics_metadata(): number;
59
+ /**
60
+ * The renderer's shader switches, which pick the shadow technique and the indirect lighting a lit pass links.
61
+ *
62
+ * @returns {ShaderSwitchSet}
63
+ */
64
+ get shader_switches(): import("../shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet;
65
+ /**
66
+ * The renderer's probe clipmap GI. A pass that can read indirect light binds its probes in every mode
67
+ * (`GPUProbeClipmapGI#write_sampling_bindings`); while it has no probes it is a clipmap of no cascade.
68
+ *
69
+ * @returns {GPUProbeClipmapGI}
70
+ */
71
+ get probes(): import("../global_illumination/probe_clipmap/GPUProbeClipmapGI.js").GPUProbeClipmapGI;
72
+ /**
73
+ * State what the frame lights with. The renderer's, once, as the record is created; not an extension's.
74
+ *
75
+ * @param {{
76
+ * light_cluster_parameters: number,
77
+ * light_cluster_lookup: number,
78
+ * light_cluster_data: number,
79
+ * shadowmap_atlas: number,
80
+ * volumetrics_lut: number,
81
+ * volumetrics_metadata: number,
82
+ * shader_switches: ShaderSwitchSet,
83
+ * probes: GPUProbeClipmapGI,
84
+ * }} lighting
85
+ */
86
+ state(lighting: {
87
+ light_cluster_parameters: number;
88
+ light_cluster_lookup: number;
89
+ light_cluster_data: number;
90
+ shadowmap_atlas: number;
91
+ volumetrics_lut: number;
92
+ volumetrics_metadata: number;
93
+ shader_switches: ShaderSwitchSet;
94
+ probes: GPUProbeClipmapGI;
95
+ }): void;
96
+ #private;
97
+ }
98
+ export type ShaderSwitchSet = import("../shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet;
99
+ export type GPUProbeClipmapGI = import("../global_illumination/probe_clipmap/GPUProbeClipmapGI.js").GPUProbeClipmapGI;
100
+ import { FrameRecord } from "./FrameRecord.js";
101
+ //# sourceMappingURL=ViewLighting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewLighting.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/extension/ViewLighting.js"],"names":[],"mappings":"AAIA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AACH;IAkBI,0CAGC;IAED,2CAEC;IAED;;;;OAIG;IACH,uCAEC;IAED;;;;;OAKG;IACH,mCAEC;IAED;;;;OAIG;IACH,iCAEC;IAED;;;;OAIG;IACH,8BAEC;IAED;;;;;OAKG;IACH,8BAEC;IAED;;;;OAIG;IACH,mCAEC;IAED;;;;OAIG;IACH,uFAEC;IAED;;;;;OAKG;IACH,oGAEC;IAED;;;;;;;;;;;;;OAaG;IACH,gBAXW;QACV,wBAA8B,EAAE,MAAM,CAAC;QACvC,oBAA0B,EAAE,MAAM,CAAC;QACnC,kBAAwB,EAAE,MAAM,CAAC;QACjC,eAAqB,EAAE,MAAM,CAAC;QAC9B,eAAqB,EAAE,MAAM,CAAC;QAC9B,oBAA0B,EAAE,MAAM,CAAC;QACnC,eAAqB,EAAE,eAAe,CAAC;QACvC,MAAY,EAAE,iBAAiB,CAAC;KAC7B,QAcH;;CAiBJ;8BAlKY,OAAO,uCAAuC,EAAE,eAAe;gCAC/D,OAAO,2DAA2D,EAAE,iBAAiB;4BAJtE,kBAAkB"}
@@ -0,0 +1,168 @@
1
+ import { assert } from "../../../core/assert.js";
2
+ import { FramePhase } from "./FramePhase.js";
3
+ import { FrameRecord } from "./FrameRecord.js";
4
+
5
+ /**
6
+ * @typedef {import("../shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet} ShaderSwitchSet
7
+ * @typedef {import("../global_illumination/probe_clipmap/GPUProbeClipmapGI.js").GPUProbeClipmapGI} GPUProbeClipmapGI
8
+ */
9
+
10
+ /**
11
+ * What the frame lights a surface with, for an extension that shades samples of its own: this frame's light
12
+ * clusters, the shadow atlas, the volumetrics' look-up table and its metadata (the fog a surface is seen through),
13
+ * the renderer's shader switches (the shadow technique and the indirect lighting mode among them) and the probe
14
+ * clipmap GI, whose probes a pass that can read indirect light binds in every mode. The transparent surfaces are lit
15
+ * by exactly these.
16
+ *
17
+ * The light records, the environment and the shadow tables are the scene's and are reached through the view
18
+ * (`frame.view.scene.lights`, `frame.view.scene.shadow_context`); this record carries what only the frame has.
19
+ *
20
+ * Carried at {@link FramePhase.AfterLighting} and {@link FramePhase.AfterTransparency}, and **frozen at both**: the
21
+ * renderer states it once, and nothing an extension publishes into it would reach a pass that lights anything.
22
+ */
23
+ export class ViewLighting extends FrameRecord {
24
+ #light_cluster_parameters = -1;
25
+ #light_cluster_lookup = -1;
26
+ #light_cluster_data = -1;
27
+ #shadowmap_atlas = -1;
28
+ #volumetrics_lut = -1;
29
+ #volumetrics_metadata = -1;
30
+
31
+ /**
32
+ * @type {ShaderSwitchSet|null}
33
+ */
34
+ #shader_switches = null;
35
+
36
+ /**
37
+ * @type {GPUProbeClipmapGI|null}
38
+ */
39
+ #probes = null;
40
+
41
+ static is_present_at(phase) {
42
+ return phase === FramePhase.AfterLighting
43
+ || phase === FramePhase.AfterTransparency;
44
+ }
45
+
46
+ static is_writable_at(phase) {
47
+ return false;
48
+ }
49
+
50
+ /**
51
+ * The light clusters' depth curve: a graph handle of a uniform buffer, `LIGHT_CLUSTER_PARAMETERS_RESOURCE`.
52
+ *
53
+ * @returns {number}
54
+ */
55
+ get light_cluster_parameters() {
56
+ return this.read(this.#light_cluster_parameters);
57
+ }
58
+
59
+ /**
60
+ * The light clusters' per-cell counts and offsets: a graph handle of a storage buffer,
61
+ * `LIGHT_CLUSTER_LOOKUP_RESOURCE`.
62
+ *
63
+ * @returns {number}
64
+ */
65
+ get light_cluster_lookup() {
66
+ return this.read(this.#light_cluster_lookup);
67
+ }
68
+
69
+ /**
70
+ * The light clusters' light indices: a graph handle of a storage buffer, `LIGHT_CLUSTER_DATA_RESOURCE`.
71
+ *
72
+ * @returns {number}
73
+ */
74
+ get light_cluster_data() {
75
+ return this.read(this.#light_cluster_data);
76
+ }
77
+
78
+ /**
79
+ * The shadow atlas every shadow-casting light samples: a graph handle of a depth texture.
80
+ *
81
+ * @returns {number}
82
+ */
83
+ get shadowmap_atlas() {
84
+ return this.read(this.#shadowmap_atlas);
85
+ }
86
+
87
+ /**
88
+ * The volumetrics' resolved look-up table, the in-scatter and transmittance a point is seen through:
89
+ * a graph handle of a 3D texture. Reads as no fog when the scene has none.
90
+ *
91
+ * @returns {number}
92
+ */
93
+ get volumetrics_lut() {
94
+ return this.read(this.#volumetrics_lut);
95
+ }
96
+
97
+ /**
98
+ * How {@link volumetrics_lut} is addressed: a graph handle of a uniform buffer, `VOLUMETRICS_METADATA_STRUCT`.
99
+ *
100
+ * @returns {number}
101
+ */
102
+ get volumetrics_metadata() {
103
+ return this.read(this.#volumetrics_metadata);
104
+ }
105
+
106
+ /**
107
+ * The renderer's shader switches, which pick the shadow technique and the indirect lighting a lit pass links.
108
+ *
109
+ * @returns {ShaderSwitchSet}
110
+ */
111
+ get shader_switches() {
112
+ return this.#read_object(this.#shader_switches, 'shader_switches');
113
+ }
114
+
115
+ /**
116
+ * The renderer's probe clipmap GI. A pass that can read indirect light binds its probes in every mode
117
+ * (`GPUProbeClipmapGI#write_sampling_bindings`); while it has no probes it is a clipmap of no cascade.
118
+ *
119
+ * @returns {GPUProbeClipmapGI}
120
+ */
121
+ get probes() {
122
+ return this.#read_object(this.#probes, 'probes');
123
+ }
124
+
125
+ /**
126
+ * State what the frame lights with. The renderer's, once, as the record is created; not an extension's.
127
+ *
128
+ * @param {{
129
+ * light_cluster_parameters: number,
130
+ * light_cluster_lookup: number,
131
+ * light_cluster_data: number,
132
+ * shadowmap_atlas: number,
133
+ * volumetrics_lut: number,
134
+ * volumetrics_metadata: number,
135
+ * shader_switches: ShaderSwitchSet,
136
+ * probes: GPUProbeClipmapGI,
137
+ * }} lighting
138
+ */
139
+ state(lighting) {
140
+ assert.defined(lighting.shader_switches, 'shader_switches');
141
+ assert.defined(lighting.probes, 'probes');
142
+
143
+ this.#light_cluster_parameters = this.republish(lighting.light_cluster_parameters);
144
+ this.#light_cluster_lookup = this.republish(lighting.light_cluster_lookup);
145
+ this.#light_cluster_data = this.republish(lighting.light_cluster_data);
146
+ this.#shadowmap_atlas = this.republish(lighting.shadowmap_atlas);
147
+ this.#volumetrics_lut = this.republish(lighting.volumetrics_lut);
148
+ this.#volumetrics_metadata = this.republish(lighting.volumetrics_metadata);
149
+ this.#shader_switches = lighting.shader_switches;
150
+ this.#probes = lighting.probes;
151
+ }
152
+
153
+ /**
154
+ * @template T
155
+ * @param {T|null} value
156
+ * @param {string} name
157
+ * @returns {T}
158
+ */
159
+ #read_object(value, name) {
160
+ const frame = this.frame;
161
+
162
+ assert.notNull(frame, `ViewLighting was read without belonging to a frame`);
163
+ assert.equal(frame.is_open, true, `ViewLighting belongs to a frame that has finished`);
164
+ assert.notNull(value, `ViewLighting.${name} read before the renderer stated it`);
165
+
166
+ return value;
167
+ }
168
+ }
@@ -145,7 +145,7 @@ export class GPUFluidCascade {
145
145
  * @param {*} _resources
146
146
  * @param {{encoder: ShadeGPUCommandContext}} context
147
147
  */
148
- static "__#291@#execute_restrict"(record: object, _resources: any, context: {
148
+ static "__#296@#execute_restrict"(record: object, _resources: any, context: {
149
149
  encoder: ShadeGPUCommandContext;
150
150
  }): void;
151
151
  /**
@@ -153,7 +153,7 @@ export class GPUFluidCascade {
153
153
  * @param {*} _resources
154
154
  * @param {{encoder: ShadeGPUCommandContext}} context
155
155
  */
156
- static "__#291@#execute_fill"(record: object, _resources: any, context: {
156
+ static "__#296@#execute_fill"(record: object, _resources: any, context: {
157
157
  encoder: ShadeGPUCommandContext;
158
158
  }): void;
159
159
  /**
@@ -161,7 +161,7 @@ export class GPUFluidCascade {
161
161
  * @param {import("../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources} resources
162
162
  * @param {{encoder: ShadeGPUCommandContext}} context
163
163
  */
164
- static "__#291@#execute"(record: object, resources: import("../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources, context: {
164
+ static "__#296@#execute"(record: object, resources: import("../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources, context: {
165
165
  encoder: ShadeGPUCommandContext;
166
166
  }): void;
167
167
  /**
@@ -65,7 +65,7 @@ export class GPUFluidCascadeStack {
65
65
  * @param {*} _resources
66
66
  * @param {{encoder: import("../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext}} context
67
67
  */
68
- static "__#293@#execute_publish"(pass: object, _resources: any, context: {
68
+ static "__#298@#execute_publish"(pass: object, _resources: any, context: {
69
69
  encoder: import("../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext;
70
70
  }): void;
71
71
  /**
@@ -86,7 +86,7 @@ export class GPUFluidForcing {
86
86
  * @param {FluidObstacleRecord} record
87
87
  * @returns {number} metres
88
88
  */
89
- static "__#294@#resolved_extent"(record: FluidObstacleRecord): number;
89
+ static "__#299@#resolved_extent"(record: FluidObstacleRecord): number;
90
90
  /**
91
91
  * The descriptor of a transient of `role`, `size` bytes, from `kept` (by role): the one kept for
92
92
  * the role while its size holds, a new one when it moves. A role's usage and clear range never
@@ -99,19 +99,19 @@ export class GPUFluidForcing {
99
99
  * @param {number} clear_size bytes cleared from 0 when the pool reuses the buffer
100
100
  * @returns {BufferResourceDescriptor}
101
101
  */
102
- static "__#294@#descriptor"(kept: BufferResourceDescriptor[], role: number, size: number, usage: number, clear_size: number): BufferResourceDescriptor;
102
+ static "__#299@#descriptor"(kept: BufferResourceDescriptor[], role: number, size: number, usage: number, clear_size: number): BufferResourceDescriptor;
103
103
  /**
104
104
  * @param {object} record
105
105
  * @param {FramePassResources} resources
106
106
  * @param {{encoder: ShadeGPUCommandContext}} context
107
107
  */
108
- static "__#294@#execute_extract"(record: object, resources: FramePassResources, context: {
108
+ static "__#299@#execute_extract"(record: object, resources: FramePassResources, context: {
109
109
  encoder: ShadeGPUCommandContext;
110
110
  }): void;
111
- static "__#294@#execute_clear"(record: any, _resources: any, context: any): void;
112
- static "__#294@#execute_query"(record: any, resources: any, context: any): void;
113
- static "__#294@#execute_command"(record: any, resources: any, context: any): void;
114
- static "__#294@#execute_apply"(record: any, resources: any, context: any): void;
111
+ static "__#299@#execute_clear"(record: any, _resources: any, context: any): void;
112
+ static "__#299@#execute_query"(record: any, resources: any, context: any): void;
113
+ static "__#299@#execute_command"(record: any, resources: any, context: any): void;
114
+ static "__#299@#execute_apply"(record: any, resources: any, context: any): void;
115
115
  /**
116
116
  * @param {object} options
117
117
  * @param {GPUDevice} options.device
@@ -41,7 +41,7 @@ export class GPUFluidPressureSolve {
41
41
  * @param {*} _resources
42
42
  * @param {{encoder: ShadeGPUCommandContext}} context
43
43
  */
44
- static "__#290@#execute"(data: {
44
+ static "__#295@#execute"(data: {
45
45
  solve: GPUFluidPressureSolve;
46
46
  arm: number;
47
47
  count: number;
@@ -49,7 +49,7 @@ export class GPUFluidQueries {
49
49
  * @param {import("../../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources} resources
50
50
  * @param {{encoder: import("../../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext}} context
51
51
  */
52
- static "__#295@#execute"(pass: object, resources: import("../../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources, context: {
52
+ static "__#300@#execute"(pass: object, resources: import("../../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources, context: {
53
53
  encoder: import("../../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext;
54
54
  }): void;
55
55
  /**
@@ -78,8 +78,8 @@ export class VGeoFrontier {
78
78
  vertex_cluster_counts: Uint32Array;
79
79
  /**
80
80
  * Optional per-vertex mask (`1` = pinned) for coincident inter-primitive glTF material borders
81
- * so separate per-material DAGs stay crack-free across mixed LOD cuts. Ignored only in the
82
- * residual convergence fallback if seam locks alone prevent reaching a single root cluster.
81
+ * so separate per-material DAGs stay crack-free across mixed LOD cuts. Ignored by a group whose
82
+ * pins leave it no way to reach its triangle target, and by the residual convergence fallback.
83
83
  * @type {Uint8Array|null}
84
84
  */
85
85
  seam_locked_vertices: Uint8Array | null;