@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,102 @@
1
+ /**
2
+ * The words and bits the hair passes share.
3
+ *
4
+ * **A frame's deformed points** are one buffer of `vec4<u32>`, two halves of `point capacity` each: in the first,
5
+ * a point as it is now (x, y, z in f32 bits, then half its drawn width, f32 bits, negative for a point drawn at no
6
+ * width); in the second, at the same index
7
+ * plus the capacity, where it was a frame ago (x, y, z in f32 bits) and its tag: the row of its instance in the
8
+ * low {@link HAIR_ROW_BITS} bits, its strand's variation byte above them. A strand's points are consecutive, root
9
+ * first; the index of a strand's first point is its **slot**.
10
+ *
11
+ * **A draw list entry** is a strand: its slot, with its point class above {@link HAIR_CLASS_SHIFT}. A strand of
12
+ * class `c` has `2^c` segments.
13
+ *
14
+ * **An instance's density volume** is a box of voxels around its strands, cubes of one edge, in the frame's voxel
15
+ * buffer (`u32`) from its LOD record's `voxel_base`: {@link HAIR_VOLUME_MIPS} levels one after another, x fastest,
16
+ * then y, then z, each level half the last's size rounded up. A voxel holds how many strands a ray crosses along one
17
+ * edge of a full-resolution voxel, `(pi / 4) λ d h` for strand length `λ` a unit volume of drawn width `d`, as
18
+ * 16.16 fixed point ({@link HAIR_VOLUME_FIXED_ONE}); a coarser level holds the mean of the voxels under it.
19
+ *
20
+ * **A hair id**, a pixel of the id target, is `((segment slot + 1) << HAIR_ID_ALONG_BITS) | along`, the segment
21
+ * slot being the slot of the point the segment starts at, and `along` how far along the segment the pixel is,
22
+ * from 0 to all ones. {@link HAIR_ID_NONE}, zero, is no hair.
23
+ */
24
+ /**
25
+ * @type {GPUTextureFormat}
26
+ */
27
+ export const HAIR_ID_FORMAT: GPUTextureFormat;
28
+ /**
29
+ * The hair id of a pixel no strand covers.
30
+ * @type {number}
31
+ */
32
+ export const HAIR_ID_NONE: number;
33
+ /**
34
+ * Bits of a hair id that say how far along its segment a pixel is.
35
+ * @type {number}
36
+ */
37
+ export const HAIR_ID_ALONG_BITS: number;
38
+ /**
39
+ * Where a draw list entry's point class starts.
40
+ * @type {number}
41
+ */
42
+ export const HAIR_CLASS_SHIFT: number;
43
+ /**
44
+ * Point classes: a strand of class `c` is drawn as `2^c` segments, `c` from 0 to 7.
45
+ * @type {number}
46
+ */
47
+ export const HAIR_CLASS_COUNT: number;
48
+ /**
49
+ * The most points a frame deforms: a slot, and a slot plus one in a hair id, fit {@link HAIR_CLASS_SHIFT} bits.
50
+ * @type {number}
51
+ */
52
+ export const HAIR_POINT_CAPACITY_LIMIT: number;
53
+ /**
54
+ * Bits of a point's tag that hold its instance's row.
55
+ * @type {number}
56
+ */
57
+ export const HAIR_ROW_BITS: number;
58
+ /**
59
+ * Words of an instance's level of detail for the frame, by row (`HAIR_LOD_STRUCT`).
60
+ *
61
+ * @type {number}
62
+ */
63
+ export const HAIR_LOD_WORDS: number;
64
+ /**
65
+ * One strand crossed, in a voxel: the volume's 16.16 fixed point.
66
+ * @type {number}
67
+ */
68
+ export const HAIR_VOLUME_FIXED_ONE: number;
69
+ /**
70
+ * Levels of an instance's density volume: the voxels, and two coarser.
71
+ * @type {number}
72
+ */
73
+ export const HAIR_VOLUME_MIPS: number;
74
+ /**
75
+ * The most voxels a volume has along an axis.
76
+ * @type {number}
77
+ */
78
+ export const HAIR_VOLUME_DIMENSION_LIMIT: number;
79
+ /**
80
+ * Words of the frame's counters (`u32`), cleared when made:
81
+ *
82
+ * ```
83
+ * 0 .. 7 strands each point class can be asked to hold: the sum of its instances' prefixes
84
+ * 8 points asked for
85
+ * 9 voxels asked for, every level of every volume
86
+ * 16 .. 23 where each class's region of the draw list starts
87
+ * 24 .. 31 each class's append cursor, from its region's start
88
+ * ```
89
+ *
90
+ * @type {number}
91
+ */
92
+ export const HAIR_COUNTER_WORDS: number;
93
+ export const HAIR_COUNTER_POINTS: 8;
94
+ export const HAIR_COUNTER_VOXELS: 9;
95
+ export const HAIR_COUNTER_BASES: 16;
96
+ export const HAIR_COUNTER_CURSORS: 24;
97
+ /**
98
+ * Words of one indirect draw: vertex count, instance count, first vertex, first instance.
99
+ * @type {number}
100
+ */
101
+ export const HAIR_DRAW_ARGS_WORDS: number;
102
+ //# sourceMappingURL=HAIR.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HAIR.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HAIR.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AACH,8CAAwC;AAExC;;;GAGG;AACH,2BAFU,MAAM,CAEc;AAE9B;;;GAGG;AACH,iCAFU,MAAM,CAEoB;AAEpC;;;GAGG;AACH,+BAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,wCAFU,MAAM,CAEmD;AAEnE;;;GAGG;AACH,4BAFU,MAAM,CAEgB;AAEhC;;;;GAIG;AACH,6BAFU,MAAM,CAEiB;AAEjC;;;GAGG;AACH,oCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,0CAFU,MAAM,CAE+B;AAE/C;;;;;;;;;;;;GAYG;AACH,iCAFU,MAAM,CAEqB;AAErC,oCAAqC;AACrC,oCAAqC;AACrC,oCAAqC;AACrC,sCAAuC;AAEvC;;;GAGG;AACH,mCAFU,MAAM,CAEsB"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * The words and bits the hair passes share.
3
+ *
4
+ * **A frame's deformed points** are one buffer of `vec4<u32>`, two halves of `point capacity` each: in the first,
5
+ * a point as it is now (x, y, z in f32 bits, then half its drawn width, f32 bits, negative for a point drawn at no
6
+ * width); in the second, at the same index
7
+ * plus the capacity, where it was a frame ago (x, y, z in f32 bits) and its tag: the row of its instance in the
8
+ * low {@link HAIR_ROW_BITS} bits, its strand's variation byte above them. A strand's points are consecutive, root
9
+ * first; the index of a strand's first point is its **slot**.
10
+ *
11
+ * **A draw list entry** is a strand: its slot, with its point class above {@link HAIR_CLASS_SHIFT}. A strand of
12
+ * class `c` has `2^c` segments.
13
+ *
14
+ * **An instance's density volume** is a box of voxels around its strands, cubes of one edge, in the frame's voxel
15
+ * buffer (`u32`) from its LOD record's `voxel_base`: {@link HAIR_VOLUME_MIPS} levels one after another, x fastest,
16
+ * then y, then z, each level half the last's size rounded up. A voxel holds how many strands a ray crosses along one
17
+ * edge of a full-resolution voxel, `(pi / 4) λ d h` for strand length `λ` a unit volume of drawn width `d`, as
18
+ * 16.16 fixed point ({@link HAIR_VOLUME_FIXED_ONE}); a coarser level holds the mean of the voxels under it.
19
+ *
20
+ * **A hair id**, a pixel of the id target, is `((segment slot + 1) << HAIR_ID_ALONG_BITS) | along`, the segment
21
+ * slot being the slot of the point the segment starts at, and `along` how far along the segment the pixel is,
22
+ * from 0 to all ones. {@link HAIR_ID_NONE}, zero, is no hair.
23
+ */
24
+
25
+ /**
26
+ * @type {GPUTextureFormat}
27
+ */
28
+ export const HAIR_ID_FORMAT = "r32uint";
29
+
30
+ /**
31
+ * The hair id of a pixel no strand covers.
32
+ * @type {number}
33
+ */
34
+ export const HAIR_ID_NONE = 0;
35
+
36
+ /**
37
+ * Bits of a hair id that say how far along its segment a pixel is.
38
+ * @type {number}
39
+ */
40
+ export const HAIR_ID_ALONG_BITS = 7;
41
+
42
+ /**
43
+ * Where a draw list entry's point class starts.
44
+ * @type {number}
45
+ */
46
+ export const HAIR_CLASS_SHIFT = 25;
47
+
48
+ /**
49
+ * Point classes: a strand of class `c` is drawn as `2^c` segments, `c` from 0 to 7.
50
+ * @type {number}
51
+ */
52
+ export const HAIR_CLASS_COUNT = 8;
53
+
54
+ /**
55
+ * The most points a frame deforms: a slot, and a slot plus one in a hair id, fit {@link HAIR_CLASS_SHIFT} bits.
56
+ * @type {number}
57
+ */
58
+ export const HAIR_POINT_CAPACITY_LIMIT = 2 ** HAIR_CLASS_SHIFT - 1;
59
+
60
+ /**
61
+ * Bits of a point's tag that hold its instance's row.
62
+ * @type {number}
63
+ */
64
+ export const HAIR_ROW_BITS = 24;
65
+
66
+ /**
67
+ * Words of an instance's level of detail for the frame, by row (`HAIR_LOD_STRUCT`).
68
+ *
69
+ * @type {number}
70
+ */
71
+ export const HAIR_LOD_WORDS = 16;
72
+
73
+ /**
74
+ * One strand crossed, in a voxel: the volume's 16.16 fixed point.
75
+ * @type {number}
76
+ */
77
+ export const HAIR_VOLUME_FIXED_ONE = 65536;
78
+
79
+ /**
80
+ * Levels of an instance's density volume: the voxels, and two coarser.
81
+ * @type {number}
82
+ */
83
+ export const HAIR_VOLUME_MIPS = 3;
84
+
85
+ /**
86
+ * The most voxels a volume has along an axis.
87
+ * @type {number}
88
+ */
89
+ export const HAIR_VOLUME_DIMENSION_LIMIT = 128;
90
+
91
+ /**
92
+ * Words of the frame's counters (`u32`), cleared when made:
93
+ *
94
+ * ```
95
+ * 0 .. 7 strands each point class can be asked to hold: the sum of its instances' prefixes
96
+ * 8 points asked for
97
+ * 9 voxels asked for, every level of every volume
98
+ * 16 .. 23 where each class's region of the draw list starts
99
+ * 24 .. 31 each class's append cursor, from its region's start
100
+ * ```
101
+ *
102
+ * @type {number}
103
+ */
104
+ export const HAIR_COUNTER_WORDS = 32;
105
+
106
+ export const HAIR_COUNTER_POINTS = 8;
107
+ export const HAIR_COUNTER_VOXELS = 9;
108
+ export const HAIR_COUNTER_BASES = 16;
109
+ export const HAIR_COUNTER_CURSORS = 24;
110
+
111
+ /**
112
+ * Words of one indirect draw: vertex count, instance count, first vertex, first instance.
113
+ * @type {number}
114
+ */
115
+ export const HAIR_DRAW_ARGS_WORDS = 4;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * One group of one groom an entity wears, as the CPU stages it: where its rest points are in the groom pool, what
3
+ * the level of detail needs of its asset, and the colour it is given. The GPU never writes it.
4
+ */
5
+ export const HAIR_INSTANCE_STRUCT: WebGPUStruct;
6
+ export const HAIR_PAGE_SIZE: number;
7
+ export const HAIR_DATABASE_INITIAL_SIZE: number;
8
+ export const HAIR_INSTANCE_TABLE: "hair_instances";
9
+ /**
10
+ * The hair a scene context draws: a row a group of a groom an entity wears. Rows are handed out densely by the
11
+ * runtime, not keyed by entity.
12
+ */
13
+ export const HAIR_DATABASE_SPEC: GPUDatabaseDefinition;
14
+ export const HAIR_INSTANCE_DESCRIPTOR: import("../buffer/table/GPUTypedTableDescriptor.js").GPUTypedTableDescriptor;
15
+ import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
16
+ import { GPUDatabaseDefinition } from "../buffer/table/GPUDatabaseDefinition.js";
17
+ //# sourceMappingURL=HAIR_DATABASE_SPEC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HAIR_DATABASE_SPEC.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HAIR_DATABASE_SPEC.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,gDAkC0B;AAE1B,oCAA4C;AAE5C,gDAAwD;AAExD,mDAAoD;AAEpD;;;GAGG;AACH,uDAEmB;AAYnB,oHAAoF;6BAlEvD,gCAAgC;sCAHvB,0CAA0C"}
@@ -0,0 +1,71 @@
1
+ import { KILOBYTE } from "../../../core/science/units/memory/KILOBYTE.js";
2
+ import { GPUDatabaseDefinition } from "../buffer/table/GPUDatabaseDefinition.js";
3
+ import { SCENE_DATABASE_SPEC } from "../scene/SCENE_DATABASE_SPEC.js";
4
+ import { f32, u32, vec3f, vec4f } from "../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
5
+ import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
6
+
7
+ /**
8
+ * One group of one groom an entity wears, as the CPU stages it: where its rest points are in the groom pool, what
9
+ * the level of detail needs of its asset, and the colour it is given. The GPU never writes it.
10
+ */
11
+ export const HAIR_INSTANCE_STRUCT = WebGPUStruct.from({
12
+ /** the `transforms` row of the entity, whose world matrix the strands ride */
13
+ node: u32,
14
+ /** the group's first rest point in the groom pool, in words */
15
+ points: u32,
16
+ /** the group's first strand word in the groom pool, in words: its variation byte, low */
17
+ strands: u32,
18
+ strand_count: u32,
19
+ /** points a strand, `2^k + 1` */
20
+ point_count: u32,
21
+ /** `k + 1`: entries of the decimation table */
22
+ level_count: u32,
23
+ /** how much more melanin a strand's variation byte gives it: the strand's is `melanin + (byte - 128) / 255` */
24
+ melanin: f32,
25
+ /** of the melanin, the share that is pheomelanin */
26
+ redness: f32,
27
+ /** the quantization box's corner, groom metres */
28
+ bounds_min: vec3f,
29
+ /** the widest a point is, groom metres */
30
+ width_max: f32,
31
+ /** the quantization box's size, groom metres */
32
+ bounds_extent: vec3f,
33
+ /** the mean width of the group's points, groom metres */
34
+ width_mean: f32,
35
+ /** the decimation table's first four entries, groom metres */
36
+ decimation_low: vec4f,
37
+ /** its next four; past `level_count` unread */
38
+ decimation_high: vec4f,
39
+ /** the dye's colour, linear; white is none */
40
+ dye: vec3f,
41
+ /** longitudinal roughness of the fibre, 0 to 1 */
42
+ roughness: f32,
43
+ /** how far apart the strands grow, groom metres (`GroomGroup#root_spacing`) */
44
+ root_spacing: f32,
45
+ }, "HairInstance").pack();
46
+
47
+ export const HAIR_PAGE_SIZE = 16 * KILOBYTE;
48
+
49
+ export const HAIR_DATABASE_INITIAL_SIZE = 64 * KILOBYTE;
50
+
51
+ export const HAIR_INSTANCE_TABLE = "hair_instances";
52
+
53
+ /**
54
+ * The hair a scene context draws: a row a group of a groom an entity wears. Rows are handed out densely by the
55
+ * runtime, not keyed by entity.
56
+ */
57
+ export const HAIR_DATABASE_SPEC = GPUDatabaseDefinition.from({
58
+ [HAIR_INSTANCE_TABLE]: HAIR_INSTANCE_STRUCT,
59
+ }, HAIR_PAGE_SIZE);
60
+
61
+ // held through the scene's rows by the hair system; not this database's to free
62
+ HAIR_DATABASE_SPEC.add_link({
63
+ table: HAIR_INSTANCE_TABLE,
64
+ field: 'node',
65
+ target_database: SCENE_DATABASE_SPEC,
66
+ target_table: 'transforms',
67
+ nullable: false,
68
+ owning: false,
69
+ });
70
+
71
+ export const HAIR_INSTANCE_DESCRIPTOR = HAIR_DATABASE_SPEC.get(HAIR_INSTANCE_TABLE);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * An instance's level of detail for the frame, by row (`HAIR_LOD_WORDS`).
3
+ */
4
+ export const HAIR_LOD_STRUCT: WebGPUStruct;
5
+ /**
6
+ * What every hair pass of a view reads of it: its internal size, the narrowest a strand is drawn, the frame's
7
+ * point capacity (where the deformed points' second half starts) and the rows the instance passes draw.
8
+ */
9
+ export const HAIR_VIEW_STRUCT: WebGPUStruct;
10
+ import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
11
+ //# sourceMappingURL=HAIR_FRAME_STRUCTS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HAIR_FRAME_STRUCTS.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HAIR_FRAME_STRUCTS.js"],"names":[],"mappings":"AAKA;;GAEG;AACH,2CAwBc;AAId;;;GAGG;AACH,4CAOe;6BA7Cc,gCAAgC"}
@@ -0,0 +1,48 @@
1
+ import { assert } from "../../../core/assert.js";
2
+ import { f32, u32, vec2f, vec3f, vec3u } from "../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
3
+ import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
4
+ import { HAIR_LOD_WORDS } from "./HAIR.js";
5
+
6
+ /**
7
+ * An instance's level of detail for the frame, by row (`HAIR_LOD_WORDS`).
8
+ */
9
+ export const HAIR_LOD_STRUCT = WebGPUStruct.from({
10
+ /** strands drawn this frame, at most: the first `prefix` in rank order */
11
+ prefix: u32,
12
+ /** points kept are every `2^level`-th */
13
+ level: u32,
14
+ /** log2 of the segments a strand is drawn with */
15
+ point_class: u32,
16
+ /** the frame's slot of its first strand's first point */
17
+ point_base: u32,
18
+ /** world metres a metre of the groom: the most the instance's matrix stretches */
19
+ scale: f32,
20
+ /** the instance's screen rectangle, pixels, `x | y << 16` */
21
+ rect_min: u32,
22
+ /** exclusive; no larger than `rect_min` on either axis where the instance is off screen */
23
+ rect_max: u32,
24
+ /** the volume's first voxel in the frame's voxels */
25
+ voxel_base: u32,
26
+ /** the volume's corner, world metres */
27
+ volume_origin: vec3f,
28
+ /** a voxel's edge, world metres; 0 where the instance has no volume this frame */
29
+ voxel_size: f32,
30
+ /** voxels along each axis, at most `HAIR_VOLUME_DIMENSION_LIMIT` */
31
+ volume_dims: vec3u,
32
+ unused: u32,
33
+ }, "HairLod");
34
+
35
+ assert.equal(HAIR_LOD_STRUCT.size, HAIR_LOD_WORDS * 4, "HAIR_LOD_STRUCT is the size HAIR_LOD_WORDS says");
36
+
37
+ /**
38
+ * What every hair pass of a view reads of it: its internal size, the narrowest a strand is drawn, the frame's
39
+ * point capacity (where the deformed points' second half starts) and the rows the instance passes draw.
40
+ */
41
+ export const HAIR_VIEW_STRUCT = WebGPUStruct.from({
42
+ /** the view's internal size, pixels */
43
+ resolution: vec2f,
44
+ /** the narrowest a strand is drawn, pixels */
45
+ pixel_floor: f32,
46
+ /** the frame's deformed point capacity */
47
+ point_capacity: u32,
48
+ }, "HairView");
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The hair a frame drew into its G-buffer, for the pass that lights it: the hair id target, the frame's deformed
3
+ * points (`HAIR.js`), each instance's level of detail, by row, and the frame's density volumes. Created at {@link FramePhase.AfterGBuffer} by the
4
+ * pass that draws the strands, read at {@link FramePhase.AfterLighting}; a frame that drew no hair carries none.
5
+ */
6
+ export class HairFrame extends FrameRecord {
7
+ static is_present_at(phase: any): boolean;
8
+ static is_writable_at(phase: any): boolean;
9
+ set ids(handle: number);
10
+ /**
11
+ * The hair id target (`HAIR_ID_FORMAT`): a graph handle of a texture at the frame's internal resolution.
12
+ *
13
+ * @returns {number}
14
+ */
15
+ get ids(): number;
16
+ set points(handle: number);
17
+ /**
18
+ * The frame's deformed points, both halves: a graph handle of a storage buffer of `vec4<u32>`.
19
+ *
20
+ * @returns {number}
21
+ */
22
+ get points(): number;
23
+ set lod(handle: number);
24
+ /**
25
+ * Each instance's level of detail for the frame, `HAIR_LOD_STRUCT` a row: a graph handle of a storage buffer.
26
+ *
27
+ * @returns {number}
28
+ */
29
+ get lod(): number;
30
+ set volume(handle: number);
31
+ /**
32
+ * The frame's density volumes, every level of every instance's (`HAIR.js`): a graph handle of a storage buffer of
33
+ * `u32`.
34
+ *
35
+ * @returns {number}
36
+ */
37
+ get volume(): number;
38
+ #private;
39
+ }
40
+ import { FrameRecord } from "../extension/FrameRecord.js";
41
+ //# sourceMappingURL=HairFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HairFrame.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HairFrame.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IAMI,0CAGC;IAED,2CAEC;IAWD,wBAEC;IAXD;;;;OAIG;IACH,kBAEC;IAeD,2BAEC;IAXD;;;;OAIG;IACH,qBAEC;IAeD,wBAEC;IAXD;;;;OAIG;IACH,kBAEC;IAgBD,2BAEC;IAZD;;;;;OAKG;IACH,qBAEC;;CAKJ;4BA3E2B,6BAA6B"}
@@ -0,0 +1,76 @@
1
+ import { FrameRecord } from "../extension/FrameRecord.js";
2
+ import { FramePhase } from "../extension/FramePhase.js";
3
+
4
+ /**
5
+ * The hair a frame drew into its G-buffer, for the pass that lights it: the hair id target, the frame's deformed
6
+ * points (`HAIR.js`), each instance's level of detail, by row, and the frame's density volumes. Created at {@link FramePhase.AfterGBuffer} by the
7
+ * pass that draws the strands, read at {@link FramePhase.AfterLighting}; a frame that drew no hair carries none.
8
+ */
9
+ export class HairFrame extends FrameRecord {
10
+ #ids = -1;
11
+ #points = -1;
12
+ #lod = -1;
13
+ #volume = -1;
14
+
15
+ static is_present_at(phase) {
16
+ return phase === FramePhase.AfterGBuffer
17
+ || phase === FramePhase.AfterLighting;
18
+ }
19
+
20
+ static is_writable_at(phase) {
21
+ return phase === FramePhase.AfterGBuffer;
22
+ }
23
+
24
+ /**
25
+ * The hair id target (`HAIR_ID_FORMAT`): a graph handle of a texture at the frame's internal resolution.
26
+ *
27
+ * @returns {number}
28
+ */
29
+ get ids() {
30
+ return this.read(this.#ids);
31
+ }
32
+
33
+ set ids(handle) {
34
+ this.#ids = this.publish(handle);
35
+ }
36
+
37
+ /**
38
+ * The frame's deformed points, both halves: a graph handle of a storage buffer of `vec4<u32>`.
39
+ *
40
+ * @returns {number}
41
+ */
42
+ get points() {
43
+ return this.read(this.#points);
44
+ }
45
+
46
+ set points(handle) {
47
+ this.#points = this.publish(handle);
48
+ }
49
+
50
+ /**
51
+ * Each instance's level of detail for the frame, `HAIR_LOD_STRUCT` a row: a graph handle of a storage buffer.
52
+ *
53
+ * @returns {number}
54
+ */
55
+ get lod() {
56
+ return this.read(this.#lod);
57
+ }
58
+
59
+ set lod(handle) {
60
+ this.#lod = this.publish(handle);
61
+ }
62
+
63
+ /**
64
+ * The frame's density volumes, every level of every instance's (`HAIR.js`): a graph handle of a storage buffer of
65
+ * `u32`.
66
+ *
67
+ * @returns {number}
68
+ */
69
+ get volume() {
70
+ return this.read(this.#volume);
71
+ }
72
+
73
+ set volume(handle) {
74
+ this.#volume = this.publish(handle);
75
+ }
76
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The colour of hair, as absorption inside the fibre (Chiang et al. 2016, "A Practical and Controllable Hair and Fur
3
+ * Model for Production Path Tracing"; d'Eon et al. 2011 for the pigments):
4
+ *
5
+ * ```wgsl
6
+ * fn hair_absorption(melanin: f32, redness: f32, dye: vec3<f32>) -> vec3<f32>
7
+ * fn hair_color_to_absorption(color: vec3<f32>) -> vec3<f32>
8
+ * fn hair_absorption_to_color(absorption: vec3<f32>) -> vec3<f32>
9
+ * ```
10
+ *
11
+ * `melanin` from 0 (none) to 1 (black), `redness` the share of it that is pheomelanin, `dye` a colour whose
12
+ * absorption adds to the pigments' (white adds none). The two mappings are each other's inverse: the colour is what
13
+ * the hair looks after multiple scattering, at {@link B}. Unreal's `GetHairColorFromMelanin`, kept as absorption.
14
+ *
15
+ * @type {CodeChunk}
16
+ */
17
+ export const chunk_hair_absorption: CodeChunk;
18
+ /**
19
+ * Light scattered by a hair fibre, single scattering: Unreal 5.4's `HairShading` (HairBsdf.ush), Marschner et al.'s
20
+ * three lobes in Karis's closed forms (Marschner et al. 2003; Pekelis et al. 2015 for the shapes):
21
+ *
22
+ * ```wgsl
23
+ * fn hair_shading(l: vec3<f32>, v: vec3<f32>, t: vec3<f32>, absorption: vec3<f32>, roughness: f32,
24
+ * backlit: f32, area: f32) -> vec3<f32>
25
+ * ```
26
+ *
27
+ * `l` towards the light, `v` towards the eye, `t` along the fibre **towards its root**, all unit. `roughness` is the
28
+ * longitudinal roughness; `area` widens every lobe, for light from a solid angle (0 for a point light); `backlit`
29
+ * scales the transmission and the back of the reflection, 1 for a light behind the hair to show through it.
30
+ *
31
+ * R reflects at the cuticle, its shift the cuticle's tilt and its azimuthal width separable (Unreal's strands);
32
+ * TT passes through the fibre, attenuated by `absorption` over its path; TRT reflects once inside. The result is what
33
+ * multiplies a light's radiance: no cosine is left to apply. Never negative.
34
+ *
35
+ * Unreal's Kajiya-Kay diffuse term, its own "hack approximation for multiple scattering", is not here: multiple
36
+ * scattering is dual scattering's to add.
37
+ *
38
+ * @type {CodeChunk}
39
+ */
40
+ export const chunk_hair_shading: CodeChunk;
41
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
42
+ //# sourceMappingURL=chunk_hair_bsdf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_hair_bsdf.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/chunk_hair_bsdf.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;GAeG;AACH,oCAFU,SAAS,CAyBhB;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iCAFU,SAAS,CA8FS;0BAzKF,iCAAiC"}