@woosh/meep-engine 3.78.2 → 3.78.4

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 (278) hide show
  1. package/CHANGELOG.md +46 -13
  2. package/editor/view/node-graph/NodeGraphView.d.ts +1 -1
  3. package/editor/view/node-graph/NodeGraphView.js +1 -1
  4. package/package.json +1 -1
  5. package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts +2 -1
  6. package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts.map +1 -1
  7. package/src/core/math/physics/brdf/fresnel_Schlick_optimized.js +2 -1
  8. package/src/core/math/snap_to_integer.d.ts +13 -0
  9. package/src/core/math/snap_to_integer.d.ts.map +1 -0
  10. package/src/core/math/snap_to_integer.js +20 -0
  11. package/src/core/model/node-graph/NodeGraph.d.ts +0 -1
  12. package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
  13. package/src/core/model/node-graph/NodeGraph.js +0 -1
  14. package/src/engine/asset/loaders/GroomAssetLoader.d.ts.map +1 -1
  15. package/src/engine/asset/loaders/GroomAssetLoader.js +2 -1
  16. package/src/engine/graphics/hair/Groom.d.ts +30 -0
  17. package/src/engine/graphics/hair/Groom.d.ts.map +1 -1
  18. package/src/engine/graphics/hair/Groom.js +35 -0
  19. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts +18 -2
  20. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts.map +1 -1
  21. package/src/engine/graphics/hair/GroomSerializationAdapter.js +36 -6
  22. package/src/engine/graphics/hair/GroomSerializationUpgrader_1_2.d.ts +8 -0
  23. package/src/engine/graphics/hair/GroomSerializationUpgrader_1_2.d.ts.map +1 -0
  24. package/src/engine/graphics/hair/GroomSerializationUpgrader_1_2.js +44 -0
  25. package/src/engine/graphics/hair/groom_bake_shelter.d.ts +33 -0
  26. package/src/engine/graphics/hair/groom_bake_shelter.d.ts.map +1 -0
  27. package/src/engine/graphics/hair/groom_bake_shelter.js +288 -0
  28. package/src/engine/graphics/hair/groom_bind_to_mesh.d.ts +1 -1
  29. package/src/engine/graphics/hair/groom_bind_to_mesh.js +1 -1
  30. package/src/engine/graphics/hair/groom_build_group.d.ts +10 -2
  31. package/src/engine/graphics/hair/groom_build_group.d.ts.map +1 -1
  32. package/src/engine/graphics/hair/groom_build_group.js +8 -2
  33. package/src/engine/graphics/hair/groom_build_guides.d.ts +1 -1
  34. package/src/engine/graphics/hair/groom_build_guides.js +1 -1
  35. package/src/engine/graphics/impostors/voxel/README.md +11 -11
  36. package/src/engine/physics/cloth/collider/ClothColliderKind.js +1 -1
  37. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +1 -1
  38. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +1 -1
  39. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts +2 -3
  40. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts.map +1 -1
  41. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js +2 -3
  42. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts +0 -2
  43. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts.map +1 -1
  44. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +0 -5
  45. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.d.ts.map +1 -1
  46. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.js +5 -3
  47. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.d.ts.map +1 -1
  48. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js +5 -3
  49. package/src/generation/grid/coords/grid_to_texel.d.ts +7 -1
  50. package/src/generation/grid/coords/grid_to_texel.d.ts.map +1 -1
  51. package/src/generation/grid/coords/grid_to_texel.js +11 -1
  52. package/src/generation/grid/coords/grid_to_texel_span.d.ts +15 -0
  53. package/src/generation/grid/coords/grid_to_texel_span.d.ts.map +1 -0
  54. package/src/generation/grid/coords/grid_to_texel_span.js +38 -0
  55. package/src/generation/grid/coords/texel_to_grid.d.ts +2 -1
  56. package/src/generation/grid/coords/texel_to_grid.d.ts.map +1 -1
  57. package/src/generation/grid/coords/texel_to_grid.js +6 -1
  58. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts +32 -1
  59. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts.map +1 -1
  60. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.js +114 -9
  61. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts +8 -0
  62. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
  63. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +91 -29
  64. package/src/generation/grid/layers/GridDataLayer.d.ts +21 -2
  65. package/src/generation/grid/layers/GridDataLayer.d.ts.map +1 -1
  66. package/src/generation/grid/layers/GridDataLayer.js +43 -4
  67. package/src/generation/placement/action/GridCellActionPlaceTags.d.ts +7 -1
  68. package/src/generation/placement/action/GridCellActionPlaceTags.d.ts.map +1 -1
  69. package/src/generation/placement/action/GridCellActionPlaceTags.js +42 -16
  70. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts +5 -0
  71. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts.map +1 -1
  72. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +32 -9
  73. package/src/generation/rules/CellMatcherLayerBitMaskTest.d.ts.map +1 -1
  74. package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -2
  75. package/src/generation/wfc/GridWFCCompiledTileSet.d.ts +4 -2
  76. package/src/generation/wfc/GridWFCCompiledTileSet.d.ts.map +1 -1
  77. package/src/generation/wfc/GridWFCCompiledTileSet.js +2 -2
  78. package/src/generation/wfc/GridWFCTileSet.d.ts +16 -7
  79. package/src/generation/wfc/GridWFCTileSet.d.ts.map +1 -1
  80. package/src/generation/wfc/GridWFCTileSet.js +32 -8
  81. package/src/shade/playground/contact_shadows/shader_contact_lab_composite.js +2 -2
  82. package/src/shade/playground/particle_editor/README.md +2 -2
  83. package/src/shade/playground/probe_clipmap/index.html +1 -1
  84. package/src/shade/playground/screen_probes/README.md +5 -5
  85. package/src/shade/playground/screen_probes/main.js +1 -1
  86. package/src/shade/playground/tonemap_sdr/README.md +3 -2
  87. package/src/shade/playground/vgeo_scene/README.md +1 -3
  88. package/src/shade/playground/vgeo_scene/main.js +3 -3
  89. package/src/shade/renderer/Renderer.d.ts +3 -3
  90. package/src/shade/renderer/Renderer.js +4 -4
  91. package/src/shade/renderer/ShadeIndirectLightingMode.js +1 -1
  92. package/src/shade/renderer/camera/PerspectiveCamera.js +1 -1
  93. package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts +11 -13
  94. package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -1
  95. package/src/shade/renderer/deferred/tonemap/ColorGrade.js +11 -13
  96. package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.d.ts.map +1 -1
  97. package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.js +6 -7
  98. package/src/shade/renderer/deferred/tonemap/ToneMapper.d.ts +1 -1
  99. package/src/shade/renderer/deferred/tonemap/ToneMapper.js +1 -1
  100. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts +6 -8
  101. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts.map +1 -1
  102. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.js +7 -10
  103. package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts +1 -1
  104. package/src/shade/renderer/geometry/sdf/MESH_SDF.js +1 -1
  105. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts +1 -1
  106. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +1 -1
  107. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts +1 -1
  108. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +1 -1
  109. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts +1 -2
  110. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
  111. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +1 -2
  112. package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.d.ts.map +1 -1
  113. package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.js +2 -1
  114. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts +1 -1
  115. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.js +1 -1
  116. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_cluster_graph.js +1 -1
  117. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts +2 -2
  118. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.js +2 -2
  119. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts +2 -2
  120. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js +4 -4
  121. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.d.ts +1 -1
  122. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.js +1 -1
  123. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +1 -1
  124. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts +3 -3
  125. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js +3 -3
  126. package/src/shade/renderer/global_illumination/brick4/README.md +2 -1
  127. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +4 -6
  128. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  129. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +4 -6
  130. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.d.ts +1 -1
  131. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.js +1 -1
  132. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -1
  133. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +2 -2
  134. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +1 -1
  135. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +1 -1
  136. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +1 -1
  137. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +1 -1
  138. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +28 -35
  139. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
  140. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +28 -35
  141. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +21 -24
  142. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  143. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +21 -24
  144. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts +8 -8
  145. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +8 -8
  146. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.d.ts +4 -4
  147. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.js +4 -4
  148. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts +3 -5
  149. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts.map +1 -1
  150. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.js +3 -5
  151. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.d.ts +4 -4
  152. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.js +4 -4
  153. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +2 -3
  154. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -1
  155. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +2 -3
  156. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.d.ts +4 -4
  157. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.js +4 -4
  158. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts +2 -4
  159. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts.map +1 -1
  160. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.js +2 -4
  161. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts +2 -4
  162. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts.map +1 -1
  163. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.js +2 -4
  164. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +13 -17
  165. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
  166. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +13 -17
  167. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts +11 -14
  168. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts.map +1 -1
  169. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.js +11 -14
  170. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.d.ts +2 -2
  171. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.js +2 -2
  172. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.d.ts +9 -9
  173. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.js +9 -9
  174. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +15 -18
  175. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
  176. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +16 -19
  177. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts +10 -11
  178. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts.map +1 -1
  179. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.js +11 -12
  180. package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -1
  181. package/src/shade/renderer/hair/GPUHairSystem.js +27 -2
  182. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts.map +1 -1
  183. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.js +4 -0
  184. package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts +27 -6
  185. package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts.map +1 -1
  186. package/src/shade/renderer/hair/HAIR_SIMULATION.js +33 -6
  187. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +9 -8
  188. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -1
  189. package/src/shade/renderer/hair/chunk_hair_bsdf.js +10 -9
  190. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +5 -6
  191. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -1
  192. package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +5 -6
  193. package/src/shade/renderer/hair/chunk_hair_guide.d.ts +9 -2
  194. package/src/shade/renderer/hair/chunk_hair_guide.d.ts.map +1 -1
  195. package/src/shade/renderer/hair/chunk_hair_guide.js +30 -2
  196. package/src/shade/renderer/hair/hair_lighting.d.ts +3 -3
  197. package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -1
  198. package/src/shade/renderer/hair/hair_lighting.js +4 -5
  199. package/src/shade/renderer/hair/hair_scattering_lut.d.ts +5 -5
  200. package/src/shade/renderer/hair/hair_scattering_lut.js +5 -5
  201. package/src/shade/renderer/hair/shader_hair_roots.d.ts +2 -2
  202. package/src/shade/renderer/hair/shader_hair_roots.js +2 -2
  203. package/src/shade/renderer/hair/shader_hair_simulate.d.ts +5 -2
  204. package/src/shade/renderer/hair/shader_hair_simulate.d.ts.map +1 -1
  205. package/src/shade/renderer/hair/shader_hair_simulate.js +23 -5
  206. package/src/shade/renderer/light/environment/DEFINES.d.ts +1 -1
  207. package/src/shade/renderer/light/environment/DEFINES.js +1 -1
  208. package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_blurred.js +2 -2
  209. package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts +1 -2
  210. package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts.map +1 -1
  211. package/src/shade/renderer/material/dispatch/MaterialDispatch.js +1 -2
  212. package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
  213. package/src/shade/renderer/material/standard/fragment_gbuffer.js +2 -1
  214. package/src/shade/renderer/material/util/dielectric_specular_color.d.ts +1 -1
  215. package/src/shade/renderer/material/util/dielectric_specular_color.js +1 -1
  216. package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.d.ts +1 -1
  217. package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.js +1 -1
  218. package/src/shade/renderer/postprocess/dof/gather/DOF2_PRESETS.js +1 -1
  219. package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.d.ts +1 -1
  220. package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.js +1 -1
  221. package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.d.ts +1 -1
  222. package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.js +1 -1
  223. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +3 -4
  224. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
  225. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +3 -4
  226. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +1 -1
  227. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +1 -1
  228. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts +1 -1
  229. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +1 -1
  230. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
  231. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +2 -3
  232. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts +1 -2
  233. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts.map +1 -1
  234. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.js +1 -2
  235. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts +2 -3
  236. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts.map +1 -1
  237. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.js +2 -3
  238. package/src/shade/renderer/postprocess/taa/filter_blackman_harris.d.ts +1 -1
  239. package/src/shade/renderer/postprocess/taa/filter_blackman_harris.js +1 -1
  240. package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.d.ts +1 -1
  241. package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.js +1 -1
  242. package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.js +1 -1
  243. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +3 -3
  244. package/src/shade/renderer/restir/di/ReSTIRDI.js +3 -3
  245. package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.d.ts +1 -1
  246. package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.js +1 -1
  247. package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.d.ts +1 -1
  248. package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.js +1 -1
  249. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +1 -2
  250. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
  251. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +1 -2
  252. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts +4 -5
  253. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts.map +1 -1
  254. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.js +4 -5
  255. package/src/shade/renderer/shader/chunk/color/grade/chunk_color_grade.js +2 -2
  256. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts +2 -2
  257. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.js +2 -2
  258. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts +14 -17
  259. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts.map +1 -1
  260. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js +18 -21
  261. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.d.ts +1 -1
  262. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.js +1 -1
  263. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.d.ts +1 -1
  264. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.js +1 -1
  265. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +3 -4
  266. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
  267. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +3 -4
  268. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.d.ts +1 -1
  269. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +1 -1
  270. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +3 -3
  271. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts +6 -8
  272. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts.map +1 -1
  273. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.js +8 -10
  274. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts +5 -7
  275. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts.map +1 -1
  276. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.js +5 -7
  277. package/src/shade/renderer/texture/virtual/README.md +257 -257
  278. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +2 -2
@@ -109,13 +109,11 @@ integrate_resources.createGroup()
109
109
  .add(SCREEN_PROBE_INTEGRATED_SPECULAR_WRITE_RESOURCE);
110
110
 
111
111
  /**
112
- * Each pixel's diffuse light from the probes (Lumen's `ScreenProbeIntegrateCS`, its SH3 diffuse), and its rough
113
- * specular: a thread a pixel.
112
+ * Each pixel's diffuse light from the probes' SH3, and its rough specular: a thread a pixel.
114
113
  *
115
- * - **The lookup's jitter**: by the frame's blue noise at the pixel, up to a tile's width each way, Lumen's
116
- * `FullResolutionJitterWidth` of one, kept only where the pixel it lands on is coplanar with this one (plane weight at
117
- * `SCREEN_PROBE_JITTER_PLANE_WEIGHT_SCALE` past 0.01), so the probes' grid dissolves into noise the temporal filter
118
- * averages without crossing an edge.
114
+ * - **The lookup's jitter**: by the frame's blue noise at the pixel, up to a tile's width each way, kept only where the
115
+ * pixel it lands on is coplanar with this one (plane weight at `SCREEN_PROBE_JITTER_PLANE_WEIGHT_SCALE` past 0.01),
116
+ * so the probes' grid dissolves into noise the temporal filter averages without crossing an edge.
119
117
  * - **The probes**: `screen_probe_interpolate` from the pixel's surface point, view depth and face normal; the weights
120
118
  * normalised by their sum, held to `SCREEN_PROBE_WEIGHT_EPSILON` from below.
121
119
  * - **The light**: the probes' SH3 blended by the weights (each probe by name), E at the pixel's bent normal
@@ -132,11 +130,11 @@ integrate_resources.createGroup()
132
130
  * - **Alpha**: the probes' moving shares by the same weights, held to 0.001 from below; negative where the weights do
133
131
  * not cover the pixel (`screen_probe_covers`), whose light is then zero and the temporal filter's to fill.
134
132
  * - **The rough specular** (`chunk_screen_probe_rough_specular`), with `rough_specular` on: the probes' irradiance over
135
- * π, as Lumen's default takes it, mixed by the sampled share into the radiance along the pixel's GGX lobe at its
136
- * shading normal, read from one of its probes picked by the weights with the frame's blue noise at the pixel (16 past
137
- * the frame), as Lumen's stochastic interpolation picks one; both over the exposure; with the world probes' share in
138
- * alpha. A smooth surface (world share 1) and a pixel no probe covers sample nothing; the latter's light is zero, the
139
- * temporal filter's to fill. Off, every pixel is the world probes' whole: (0, 0, 0, 1).
133
+ * π, mixed by the sampled share into the radiance along the pixel's GGX lobe at its shading normal, read from one of
134
+ * its probes picked by the weights with the frame's blue noise at the pixel (16 past the frame); both over the
135
+ * exposure; with the world probes' share in alpha. A smooth surface (world share 1) and a pixel no probe covers
136
+ * sample nothing; the latter's light is zero, the temporal filter's to fill. Off, every pixel is the world probes'
137
+ * whole: (0, 0, 0, 1).
140
138
  * - A pixel of the sky is zero, its specular the world probes'.
141
139
  *
142
140
  * @type {ComputeShader}
@@ -302,15 +300,14 @@ temporal_resources.createGroup()
302
300
  .add(SCREEN_PROBE_FRAMES_WRITE_RESOURCE);
303
301
 
304
302
  /**
305
- * The temporal filter (Lumen's `ScreenProbeTemporalReprojectionCS`): a thread a pixel, blending its integrated light
306
- * into its history.
303
+ * The temporal filter: a thread a pixel, blending its integrated light into its history.
307
304
  *
308
305
  * - **Reprojection**: the pixel's place last frame by its velocity; its four bilinear neighbours there, each kept
309
- * where last frame's depth at it is the depth this pixel's point had then by its velocity (Lumen's history depth),
310
- * within `SCREEN_PROBE_TEMPORAL_DISTANCE` of it, the threshold dithered over ×½ to ×1½ (a blue-noise draw half the
311
- * noise's period from the integration's jitter, so the two do not move together) and divided by the cosine between
312
- * the face normal and the view (held to 0.1), the depth a grazing surface spans between jittered frames; and on the
313
- * screen. Each texel's history by its bilinear weight among those kept.
306
+ * where last frame's depth at it is the depth this pixel's point had then by its velocity, within
307
+ * `SCREEN_PROBE_TEMPORAL_DISTANCE` of it, the threshold dithered over ×½ to ×1½ (a blue-noise draw half the noise's
308
+ * period from the integration's jitter, so the two do not move together) and divided by the cosine between the face
309
+ * normal and the view (held to 0.1), the depth a grazing surface spans between jittered frames; and on the screen.
310
+ * Each texel's history by its bilinear weight among those kept.
314
311
  * - **Frames**: each kept neighbour's count plus one, held to `temporal_frames`, by the same weights.
315
312
  * - **Fast update**: the pixel's moving share over `SCREEN_PROBE_FAST_UPDATE_MOVING`, less 0.2 over 0.8, held to
316
313
  * `SCREEN_PROBE_FAST_UPDATE_LIMIT`, and no less than the history's: the frames are held to (1 − it) of the most.
@@ -461,7 +458,7 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
461
458
  }
462
459
  }
463
460
 
464
- // this frame's share of moving light, as Lumen's fast update maps it
461
+ // this frame's share of moving light, as the fast update maps it
465
462
  let fast_own = saturate(min((saturate(moving / ${SCREEN_PROBE_FAST_UPDATE_MOVING}) - 0.2) / 0.8, ${SCREEN_PROBE_FAST_UPDATE_LIMIT}));
466
463
 
467
464
  var out = light;
@@ -8,23 +8,22 @@ export const SCREEN_PROBE_OCCLUSION_RESOURCE: ShaderResourceDescriptor;
8
8
  */
9
9
  export const SCREEN_PROBE_TRACE_SCREEN_SETTINGS: WebGPUStruct;
10
10
  /**
11
- * The screen trace (Lumen's `ScreenProbeTraceScreenTexturesCS`): a thread a ray of the frame's probes, through the
12
- * thread-a-ray command; a ray finds its probe and slot from its index, and its direction from its info and its probe's
13
- * jitter (`screen_probe_ray_direction`).
11
+ * The screen trace: a thread a ray of the frame's probes, through the thread-a-ray command; a ray finds its probe and
12
+ * slot from its index, and its direction from its info and its probe's jitter (`screen_probe_ray_direction`).
14
13
  *
15
14
  * - **Origin**: the probe's surface point, lifted along its face normal by twice the depth half a pixel's offset makes
16
- * along it (Lumen's normal bias): the depth buffer's texels stand proud of the plane they sample. An origin the lift
17
- * moves off the screen traces nothing in it.
15
+ * along it (a normal bias): the depth buffer's texels stand proud of the plane they sample. An origin the lift moves
16
+ * off the screen traces nothing in it.
18
17
  * - **Reach**: the march covers the probe's reach (`screen_probe_picks`), cut short of the camera's plane, 0.99 of the
19
- * way, for a ray heading toward it, as Lumen's `TraceScreen` cuts it.
18
+ * way, for a ray heading toward it.
20
19
  * - **March**: the depth buffer's hierarchy from the full-resolution level, `ffx_sssr_hierarchical_raymarch`, the
21
20
  * engine's HZB traversal (SSR's), `SCREEN_PROBE_SCREEN_TRACE_STEPS` steps at most; past the reach's end it is a miss.
22
21
  * - **A hit** stands at most `SCREEN_PROBE_SCREEN_THICKNESS` of the surface's depth behind it, on a surface the ray
23
- * meets from its front (its face normal against the ray), and holds when two dithered tests pass, as Lumen's: the
24
- * screen-edge fade at the hit (`SCREEN_PROBE_SCREEN_EDGE`) and the TAA's confidence in the hit pixel's history, so
25
- * last frame's colour is that surface's. Its radiance is last frame's lit colour of the opaque surfaces at the hit
26
- * pixel's place last frame (its velocity), a bounce more each frame, pre-exposed (`screen_probe_exposure`). It is moving when its speed and the probe's
27
- * differ by `SCREEN_PROBE_MOVING_SPEED` of the probe's depth, held to a metre from below.
22
+ * meets from its front (its face normal against the ray), and holds when two dithered tests pass: the screen-edge
23
+ * fade at the hit (`SCREEN_PROBE_SCREEN_EDGE`) and the TAA's confidence in the hit pixel's history, so last frame's
24
+ * colour is that surface's. Its radiance is last frame's lit colour of the opaque surfaces at the hit pixel's place
25
+ * last frame (its velocity), a bounce more each frame, pre-exposed (`screen_probe_exposure`). It is moving when its
26
+ * speed and the probe's differ by `SCREEN_PROBE_MOVING_SPEED` of the probe's depth, held to a metre from below.
28
27
  * - **Anything else** is left to the bricks, appended to their list (one atomic a subgroup) with how far the screen
29
28
  * showed it clear: to the end of the march, or to a hit the tests refused, so the bricks resume in front of that
30
29
  * surface. A ray of a probe on no surface ends here, NONE.
@@ -1 +1 @@
1
- {"version":3,"file":"shader_screen_probe_trace_screen.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.js"],"names":[],"mappings":"AA0DA,uIAAuI;AACvI,kDAD2G,wBAAwB,CACK;AAExI,qHAAqH;AACrH,8CADyF,wBAAwB,CACG;AAEpH;;;GAGG;AACH,iDAFU,YAAY,CAKe;AA6BrC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,+CAFU,aAAa,CAsJpB;yCA9PsC,mDAAmD;6BAG/D,mCAAmC;8BAJlC,+BAA+B"}
1
+ {"version":3,"file":"shader_screen_probe_trace_screen.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.js"],"names":[],"mappings":"AA0DA,uIAAuI;AACvI,kDAD2G,wBAAwB,CACK;AAExI,qHAAqH;AACrH,8CADyF,wBAAwB,CACG;AAEpH;;;GAGG;AACH,iDAFU,YAAY,CAKe;AA6BrC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,+CAFU,aAAa,CAsJpB;yCA7PsC,mDAAmD;6BAG/D,mCAAmC;8BAJlC,+BAA+B"}
@@ -99,23 +99,22 @@ resources.createGroup()
99
99
  .add(SCREEN_PROBE_TRACE_HIT_WRITE_RESOURCE);
100
100
 
101
101
  /**
102
- * The screen trace (Lumen's `ScreenProbeTraceScreenTexturesCS`): a thread a ray of the frame's probes, through the
103
- * thread-a-ray command; a ray finds its probe and slot from its index, and its direction from its info and its probe's
104
- * jitter (`screen_probe_ray_direction`).
102
+ * The screen trace: a thread a ray of the frame's probes, through the thread-a-ray command; a ray finds its probe and
103
+ * slot from its index, and its direction from its info and its probe's jitter (`screen_probe_ray_direction`).
105
104
  *
106
105
  * - **Origin**: the probe's surface point, lifted along its face normal by twice the depth half a pixel's offset makes
107
- * along it (Lumen's normal bias): the depth buffer's texels stand proud of the plane they sample. An origin the lift
108
- * moves off the screen traces nothing in it.
106
+ * along it (a normal bias): the depth buffer's texels stand proud of the plane they sample. An origin the lift moves
107
+ * off the screen traces nothing in it.
109
108
  * - **Reach**: the march covers the probe's reach (`screen_probe_picks`), cut short of the camera's plane, 0.99 of the
110
- * way, for a ray heading toward it, as Lumen's `TraceScreen` cuts it.
109
+ * way, for a ray heading toward it.
111
110
  * - **March**: the depth buffer's hierarchy from the full-resolution level, `ffx_sssr_hierarchical_raymarch`, the
112
111
  * engine's HZB traversal (SSR's), `SCREEN_PROBE_SCREEN_TRACE_STEPS` steps at most; past the reach's end it is a miss.
113
112
  * - **A hit** stands at most `SCREEN_PROBE_SCREEN_THICKNESS` of the surface's depth behind it, on a surface the ray
114
- * meets from its front (its face normal against the ray), and holds when two dithered tests pass, as Lumen's: the
115
- * screen-edge fade at the hit (`SCREEN_PROBE_SCREEN_EDGE`) and the TAA's confidence in the hit pixel's history, so
116
- * last frame's colour is that surface's. Its radiance is last frame's lit colour of the opaque surfaces at the hit
117
- * pixel's place last frame (its velocity), a bounce more each frame, pre-exposed (`screen_probe_exposure`). It is moving when its speed and the probe's
118
- * differ by `SCREEN_PROBE_MOVING_SPEED` of the probe's depth, held to a metre from below.
113
+ * meets from its front (its face normal against the ray), and holds when two dithered tests pass: the screen-edge
114
+ * fade at the hit (`SCREEN_PROBE_SCREEN_EDGE`) and the TAA's confidence in the hit pixel's history, so last frame's
115
+ * colour is that surface's. Its radiance is last frame's lit colour of the opaque surfaces at the hit pixel's place
116
+ * last frame (its velocity), a bounce more each frame, pre-exposed (`screen_probe_exposure`). It is moving when its
117
+ * speed and the probe's differ by `SCREEN_PROBE_MOVING_SPEED` of the probe's depth, held to a metre from below.
119
118
  * - **Anything else** is left to the bricks, appended to their list (one atomic a subgroup) with how far the screen
120
119
  * showed it clear: to the end of the march, or to a hit the tests refused, so the bricks resume in front of that
121
120
  * surface. A ray of a probe on no surface ends here, NONE.
@@ -130,7 +129,7 @@ export const shader_screen_probe_trace_screen = ComputeShader.from({
130
129
  body: CodeChunk.from(
131
130
  //language=WGSL
132
131
  `
133
- // the dithered fade toward the screen's edges at a screen position in [-1, 1], Lumen's ComputeHitVignetteFromScreenPos
132
+ // the dithered fade toward the screen's edges at a screen position in [-1, 1]
134
133
  fn screen_probe_edge_fade(ndc: vec2<f32>) -> f32 {
135
134
  let v = saturate((abs(ndc) - ${1 - SCREEN_PROBE_SCREEN_EDGE}) / ${SCREEN_PROBE_SCREEN_EDGE});
136
135
 
@@ -1 +1 @@
1
- {"version":3,"file":"GPUHairSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/GPUHairSystem.js"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"GPUHairSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/GPUHairSystem.js"],"names":[],"mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  import { assert } from "../../../core/assert.js";
2
2
  import { ALLOCATOR_NO_SPACE } from "../../../core/binary/allocator/OffsetAllocator.js";
3
3
  import { groom_bind_to_mesh, groom_mesh_binder } from "../../../engine/graphics/hair/groom_bind_to_mesh.js";
4
- import { GROOM_POINT_WORDS } from "../../../engine/graphics/hair/Groom.js";
4
+ import { GROOM_POINT_WORDS, GROOM_SHELTER_WORDS } from "../../../engine/graphics/hair/Groom.js";
5
5
  import { TextureViewDescriptor } from "../../descriptor/texture/TextureViewDescriptor.js";
6
6
  import { BufferResourceDescriptor } from "../../device/graph/BufferResourceDescriptor.js";
7
7
  import { TextureResourceDescriptor } from "../../device/graph/TextureResourceDescriptor.js";
@@ -56,6 +56,7 @@ import {
56
56
  HAIR_BINDING_NONE,
57
57
  HAIR_COLLIDER_LIMIT,
58
58
  HAIR_COLLIDER_WORDS,
59
+ HAIR_FIBRE_DENSITY,
59
60
  hair_frame_steps,
60
61
  HAIR_FRAME_STEPS_BLEND,
61
62
  HAIR_FRAME_STEPS_COUNT,
@@ -523,6 +524,8 @@ export class GPUHairSystem {
523
524
  meshlet_base: 0,
524
525
  bindings: 0,
525
526
  roots: 0,
527
+ body_diameter: 0,
528
+ body_mass: 0,
526
529
  };
527
530
 
528
531
  #view_words = new ArrayBuffer(HAIR_VIEW_STRUCT.size);
@@ -1778,6 +1781,14 @@ export class GPUHairSystem {
1778
1781
 
1779
1782
  record.guide_length_max = length_max;
1780
1783
 
1784
+ // the group as one body in the wind's way: a cylinder across the disc of its silhouette, with its fibres' mass
1785
+ const silhouette = group.silhouette;
1786
+ const body_diameter = Math.sqrt(4 * silhouette / Math.PI);
1787
+ const fibre_mass = HAIR_FIBRE_DENSITY * Math.PI / 4 * group.width_mean * group.width_mean * group.fibre_length;
1788
+
1789
+ record.body_diameter = body_diameter;
1790
+ record.body_mass = silhouette > 0 ? fibre_mass * body_diameter / silhouette : 0;
1791
+
1781
1792
  const dynamics = context.dynamics;
1782
1793
  const state = dynamics === null ? null : context.states[g];
1783
1794
 
@@ -1822,8 +1833,13 @@ export class GPUHairSystem {
1822
1833
  for (let g = 0; g < groups.length; g++) {
1823
1834
  const group = groups[g];
1824
1835
 
1836
+ assert.equal(
1837
+ group.guide_shelter.length, group.guide_count * group.guide_point_count * GROOM_SHELTER_WORDS,
1838
+ 'the group carries its shelter (groom_bake_shelter)'
1839
+ );
1840
+
1825
1841
  words += group.strand_count * group.point_count * GROOM_POINT_WORDS + group.strand_count
1826
- + group.guide_count * HAIR_GUIDE_RECORD_WORDS;
1842
+ + group.guide_count * HAIR_GUIDE_RECORD_WORDS + group.guide_shelter.length;
1827
1843
  }
1828
1844
 
1829
1845
  const run = this.#pool.allocate(words);
@@ -1874,6 +1890,15 @@ export class GPUHairSystem {
1874
1890
  }
1875
1891
 
1876
1892
  at += guides.length;
1893
+
1894
+ // the guides' shelter follows their records
1895
+ const shelter = group.guide_shelter;
1896
+
1897
+ if (shelter.length > 0) {
1898
+ this.#pool.write(at, new Uint32Array(shelter.buffer, shelter.byteOffset, shelter.length), shelter.length);
1899
+ }
1900
+
1901
+ at += shelter.length;
1877
1902
  }
1878
1903
 
1879
1904
  this.#grooms.set(groom, entry);
@@ -1 +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,gDAmE0B;AAE1B,oCAA4C;AAE5C,gDAAwD;AAExD,mDAAoD;AAEpD;;;GAGG;AACH,uDAEmB;AAYnB,oHAAoF;6BAnGvD,gCAAgC;sCAHvB,0CAA0C"}
1
+ {"version":3,"file":"HAIR_DATABASE_SPEC.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HAIR_DATABASE_SPEC.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,gDAuE0B;AAE1B,oCAA4C;AAE5C,gDAAwD;AAExD,mDAAoD;AAEpD;;;GAGG;AACH,uDAEmB;AAYnB,oHAAoF;6BAvGvD,gCAAgC;sCAHvB,0CAA0C"}
@@ -75,6 +75,10 @@ export const HAIR_INSTANCE_STRUCT = WebGPUStruct.from({
75
75
  bindings: u32,
76
76
  /** the instance's first root frame in the guide state pool, `HAIR_ROOT_FRAME_VECTORS` a strand */
77
77
  roots: u32,
78
+ /** the group as one body in the wind's way: the diameter of the disc of its silhouette, groom metres */
79
+ body_diameter: f32,
80
+ /** that body's mass a unit length as a cylinder across the wind: its fibres' mass over its diameter, kg a metre */
81
+ body_mass: f32,
78
82
  }, "HairInstance").pack();
79
83
 
80
84
  export const HAIR_PAGE_SIZE = 16 * KILOBYTE;
@@ -12,11 +12,24 @@
12
12
  */
13
13
  export function hair_frame_steps(result: Float64Array | number[], owed: number, seconds: number): void;
14
14
  /**
15
- * The rate a node's velocity relaxes toward the air's by drag, per second: the drag of the wisp its guide stands for,
16
- * a cylinder of diameter `diameter` across the flow at relative speed `speed`, over the wisp's mass a unit length,
17
- * `k = ½ ρ C_d(Re) D |w| / μ`. The cylinder's drag coefficient is White's correlation, `C_d = 1 + 10 Re^(-2/3)`
18
- * (good to ±10% for `1 < Re < 2·10⁵`), so `k = (½ ρ D / μ)(|w| + 10 |w|^(1/3) (ρ D / μ_air)^(-2/3))`, which goes to
19
- * zero with the speed. The WGSL `hair_drag_rate` is its twin.
15
+ * The drag coefficient of a cylinder of diameter `diameter` across a flow of speed `speed`: White's correlation,
16
+ * `C_d = 1 + 10 Re^(-2/3)`, good to ±10% for `1 < Re < 2·10⁵`, and held under `Re = 1` at its value there, so that
17
+ * still air's is a number. The WGSL `hair_drag_coefficient` is its twin.
18
+ *
19
+ * @param {number} speed metres a second
20
+ * @param {number} diameter metres
21
+ * @returns {number}
22
+ */
23
+ export function hair_drag_coefficient(speed: number, diameter: number): number;
24
+ /**
25
+ * The rate a body's velocity relaxes toward the air's by drag, per second: the drag of a cylinder of diameter
26
+ * `diameter` across the flow at relative speed `speed`, over its mass a unit length, `k = ½ ρ C_d(Re) D |w| / m`.
27
+ * The cylinder's drag coefficient is White's correlation, `C_d = 1 + 10 Re^(-2/3)` (good to ±10% for
28
+ * `1 < Re < 2·10⁵`), so `k = (½ ρ D / m)(|w| + 10 |w|^(1/3) (ρ D / μ_air)^(-2/3))`, which goes to zero with the
29
+ * speed. The WGSL `hair_drag_rate` is its twin.
30
+ *
31
+ * A guide's node takes it twice (`shader_hair_simulate.js`): for a fibre of its group alone in open air, and for the
32
+ * group as one body in the wind's way, a cylinder across the disc of its silhouette with the mass of all its fibres.
20
33
  *
21
34
  * @param {number} speed metres a second
22
35
  * @param {number} diameter metres
@@ -101,7 +114,9 @@ export const HAIR_STATE_PREVIOUS_POSITION: 7;
101
114
  export const HAIR_STATE_PREVIOUS_ROTATION: 8;
102
115
  /**
103
116
  * Words of a guide's record in the groom pool: its strand's rank, its wisp's strand count, its wisp's diameter and
104
- * its length (f32 bits each, groom metres).
117
+ * its length (f32 bits each, groom metres). A group's guide records are followed by its guides' shelter
118
+ * (`GroomGroup#guide_shelter`): `GROOM_SHELTER_WORDS` depths a node (f32 bits), a guide's nodes in turn, guide after
119
+ * guide.
105
120
  * @type {number}
106
121
  */
107
122
  export const HAIR_GUIDE_RECORD_WORDS: number;
@@ -142,6 +157,12 @@ export const HAIR_AIR_VISCOSITY: number;
142
157
  * @type {number}
143
158
  */
144
159
  export const HAIR_FIBRE_DENSITY: number;
160
+ /**
161
+ * The most of its own drag in open air a fibre of a groom takes, where nothing stands between it and the wind: the
162
+ * hair about it still shares its load. A chosen value, not a derived one.
163
+ * @type {number}
164
+ */
165
+ export const HAIR_EXPOSED_DRAG_SHARE: number;
145
166
  /**
146
167
  * The share of a node's follow-the-leader correction taken back out of its parent's velocity (Müller et al. 2012's
147
168
  * `s`), which keeps the correction from feeding the velocity it was made to undo.
@@ -1 +1 @@
1
- {"version":3,"file":"HAIR_SIMULATION.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HAIR_SIMULATION.js"],"names":[],"mappings":"AA+GA;;;;;;;;;;;GAWG;AACH,yCAJW,YAAY,GAAC,MAAM,EAAE,QACrB,MAAM,WACN,MAAM,QAehB;AAkED;;;;;;;;;;;GAWG;AACH,sCALW,MAAM,YACN,MAAM,mBACN,MAAM,GACJ,MAAM,CAOlB;AA3ND;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;GAGG;AACH,8BAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,gCAFU,MAAM,CAE4B;AAE5C;;;;GAIG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC,oCAAqC;AACrC,oCAAqC;AACrC,iCAAkC;AAClC,yCAA0C;AAC1C,sCAAuC;AACvC,2CAA4C;AAC5C,2CAA4C;AAC5C,6CAA8C;AAC9C,6CAA8C;AAE9C;;;;GAIG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;;GAIG;AACH,wBAFU,MAAM,CAEgB;AAEhC,8EAA8E;AAC9E,uCAAwC;AAExC,wHAAwH;AACxH,sCAAuC;AAEvC,oGAAoG;AACpG,uCAAwC;AAExC,oGAAoG;AACpG,wCAAyC;AAEzC,wHAAwH;AACxH,uCAAwC;AA6BxC;;;;GAIG;AACH,kCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,+BAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,iCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,iCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,6CAFU,MAAM,CAEkC;AAElD;;;GAGG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;;;GAKG;AACH,sCAFU,MAAM,CAEyB"}
1
+ {"version":3,"file":"HAIR_SIMULATION.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HAIR_SIMULATION.js"],"names":[],"mappings":"AAiHA;;;;;;;;;;;GAWG;AACH,yCAJW,YAAY,GAAC,MAAM,EAAE,QACrB,MAAM,WACN,MAAM,QAehB;AAyED;;;;;;;;GAQG;AACH,6CAJW,MAAM,YACN,MAAM,GACJ,MAAM,CAMlB;AAED;;;;;;;;;;;;;;GAcG;AACH,sCALW,MAAM,YACN,MAAM,mBACN,MAAM,GACJ,MAAM,CAOlB;AAtPD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;GAGG;AACH,8BAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,gCAFU,MAAM,CAE4B;AAE5C;;;;GAIG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC,oCAAqC;AACrC,oCAAqC;AACrC,iCAAkC;AAClC,yCAA0C;AAC1C,sCAAuC;AACvC,2CAA4C;AAC5C,2CAA4C;AAC5C,6CAA8C;AAC9C,6CAA8C;AAE9C;;;;;;GAMG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;;GAIG;AACH,wBAFU,MAAM,CAEgB;AAEhC,8EAA8E;AAC9E,uCAAwC;AAExC,wHAAwH;AACxH,sCAAuC;AAEvC,oGAAoG;AACpG,uCAAwC;AAExC,oGAAoG;AACpG,wCAAyC;AAEzC,wHAAwH;AACxH,uCAAwC;AA6BxC;;;;GAIG;AACH,kCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,+BAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,iCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,iCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,sCAFU,MAAM,CAE2B;AAE3C;;;;GAIG;AACH,6CAFU,MAAM,CAEkC;AAElD;;;GAGG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;;;GAKG;AACH,sCAFU,MAAM,CAEyB"}
@@ -82,7 +82,9 @@ export const HAIR_STATE_PREVIOUS_ROTATION = 8;
82
82
 
83
83
  /**
84
84
  * Words of a guide's record in the groom pool: its strand's rank, its wisp's strand count, its wisp's diameter and
85
- * its length (f32 bits each, groom metres).
85
+ * its length (f32 bits each, groom metres). A group's guide records are followed by its guides' shelter
86
+ * (`GroomGroup#guide_shelter`): `GROOM_SHELTER_WORDS` depths a node (f32 bits), a guide's nodes in turn, guide after
87
+ * guide.
86
88
  * @type {number}
87
89
  */
88
90
  export const HAIR_GUIDE_RECORD_WORDS = 4;
@@ -161,6 +163,13 @@ export const HAIR_AIR_VISCOSITY = 1.81e-5;
161
163
  */
162
164
  export const HAIR_FIBRE_DENSITY = 1300;
163
165
 
166
+ /**
167
+ * The most of its own drag in open air a fibre of a groom takes, where nothing stands between it and the wind: the
168
+ * hair about it still shares its load. A chosen value, not a derived one.
169
+ * @type {number}
170
+ */
171
+ export const HAIR_EXPOSED_DRAG_SHARE = 0.3;
172
+
164
173
  /**
165
174
  * The share of a node's follow-the-leader correction taken back out of its parent's velocity (Müller et al. 2012's
166
175
  * `s`), which keeps the correction from feeding the velocity it was made to undo.
@@ -201,11 +210,29 @@ export const HAIR_COLLIDER_WORDS = 24;
201
210
  export const HAIR_GUIDE_BOUNDS_WORDS = 8;
202
211
 
203
212
  /**
204
- * The rate a node's velocity relaxes toward the air's by drag, per second: the drag of the wisp its guide stands for,
205
- * a cylinder of diameter `diameter` across the flow at relative speed `speed`, over the wisp's mass a unit length,
206
- * `k = ½ ρ C_d(Re) D |w| / μ`. The cylinder's drag coefficient is White's correlation, `C_d = 1 + 10 Re^(-2/3)`
207
- * (good to ±10% for `1 < Re < 2·10⁵`), so `k = (½ ρ D / μ)(|w| + 10 |w|^(1/3) (ρ D / μ_air)^(-2/3))`, which goes to
208
- * zero with the speed. The WGSL `hair_drag_rate` is its twin.
213
+ * The drag coefficient of a cylinder of diameter `diameter` across a flow of speed `speed`: White's correlation,
214
+ * `C_d = 1 + 10 Re^(-2/3)`, good to ±10% for `1 < Re < 2·10⁵`, and held under `Re = 1` at its value there, so that
215
+ * still air's is a number. The WGSL `hair_drag_coefficient` is its twin.
216
+ *
217
+ * @param {number} speed metres a second
218
+ * @param {number} diameter metres
219
+ * @returns {number}
220
+ */
221
+ export function hair_drag_coefficient(speed, diameter) {
222
+ const reynolds = HAIR_AIR_DENSITY * speed * diameter / HAIR_AIR_VISCOSITY;
223
+
224
+ return 1 + 10 * Math.pow(Math.max(reynolds, 1), -2 / 3);
225
+ }
226
+
227
+ /**
228
+ * The rate a body's velocity relaxes toward the air's by drag, per second: the drag of a cylinder of diameter
229
+ * `diameter` across the flow at relative speed `speed`, over its mass a unit length, `k = ½ ρ C_d(Re) D |w| / m`.
230
+ * The cylinder's drag coefficient is White's correlation, `C_d = 1 + 10 Re^(-2/3)` (good to ±10% for
231
+ * `1 < Re < 2·10⁵`), so `k = (½ ρ D / m)(|w| + 10 |w|^(1/3) (ρ D / μ_air)^(-2/3))`, which goes to zero with the
232
+ * speed. The WGSL `hair_drag_rate` is its twin.
233
+ *
234
+ * A guide's node takes it twice (`shader_hair_simulate.js`): for a fibre of its group alone in open air, and for the
235
+ * group as one body in the wind's way, a cylinder across the disc of its silhouette with the mass of all its fibres.
209
236
  *
210
237
  * @param {number} speed metres a second
211
238
  * @param {number} diameter metres
@@ -10,14 +10,16 @@
10
10
  *
11
11
  * `melanin` from 0 (none) to 1 (black), `redness` the share of it that is pheomelanin, `dye` a colour whose
12
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.
13
+ * the hair looks after multiple scattering, at {@link B}. `hair_absorption` gives the pigments' absorption, not
14
+ * the colour it maps to.
14
15
  *
15
16
  * @type {CodeChunk}
16
17
  */
17
18
  export const chunk_hair_absorption: CodeChunk;
18
19
  /**
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):
20
+ * Light scattered by a hair fibre, single scattering: Marschner et al.'s three lobes in Karis's closed forms
21
+ * (Marschner et al. 2003; Karis 2016, "Physically Based Hair Shading in Unreal", SIGGRAPH course notes; Pekelis et
22
+ * al. 2015 for the shapes):
21
23
  *
22
24
  * ```wgsl
23
25
  * fn hair_shading(l: vec3<f32>, v: vec3<f32>, t: vec3<f32>, absorption: vec3<f32>, roughness: f32,
@@ -28,12 +30,11 @@ export const chunk_hair_absorption: CodeChunk;
28
30
  * longitudinal roughness; `area` widens every lobe, for light from a solid angle (0 for a point light); `backlit`
29
31
  * scales the transmission and the back of the reflection, 1 for a light behind the hair to show through it.
30
32
  *
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.
33
+ * R reflects at the cuticle, its shift the cuticle's tilt and its azimuthal width separable; TT passes through the
34
+ * fibre, attenuated by `absorption` over its path; TRT reflects once inside. The result is what multiplies a light's
35
+ * radiance: no cosine is left to apply. Never negative.
34
36
  *
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
+ * No Kajiya-Kay diffuse term stands in for multiple scattering: multiple scattering is dual scattering's to add.
37
38
  *
38
39
  * @type {CodeChunk}
39
40
  */
@@ -1 +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"}
1
+ {"version":3,"file":"chunk_hair_bsdf.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/chunk_hair_bsdf.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;GAgBG;AACH,oCAFU,SAAS,CAyBhB;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iCAFU,SAAS,CA8FS;0BA1KF,iCAAiC"}
@@ -1,7 +1,7 @@
1
1
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
2
2
 
3
3
  /**
4
- * `B` of Chiang et al.'s colour mapping, the azimuthal roughness it is fitted at; Unreal's default.
4
+ * `B` of Chiang et al.'s colour mapping, the azimuthal roughness it is fitted at.
5
5
  * @type {number}
6
6
  */
7
7
  const B = 0.3;
@@ -24,7 +24,8 @@ const D = 5.969 - 0.215 * B + 2.532 * B ** 2 - 10.73 * B ** 3 + 5.574 * B ** 4 +
24
24
  *
25
25
  * `melanin` from 0 (none) to 1 (black), `redness` the share of it that is pheomelanin, `dye` a colour whose
26
26
  * absorption adds to the pigments' (white adds none). The two mappings are each other's inverse: the colour is what
27
- * the hair looks after multiple scattering, at {@link B}. Unreal's `GetHairColorFromMelanin`, kept as absorption.
27
+ * the hair looks after multiple scattering, at {@link B}. `hair_absorption` gives the pigments' absorption, not
28
+ * the colour it maps to.
28
29
  *
29
30
  * @type {CodeChunk}
30
31
  */
@@ -54,8 +55,9 @@ fn hair_absorption(melanin: f32, redness: f32, dye: vec3<f32>) -> vec3<f32> {
54
55
  `);
55
56
 
56
57
  /**
57
- * Light scattered by a hair fibre, single scattering: Unreal 5.4's `HairShading` (HairBsdf.ush), Marschner et al.'s
58
- * three lobes in Karis's closed forms (Marschner et al. 2003; Pekelis et al. 2015 for the shapes):
58
+ * Light scattered by a hair fibre, single scattering: Marschner et al.'s three lobes in Karis's closed forms
59
+ * (Marschner et al. 2003; Karis 2016, "Physically Based Hair Shading in Unreal", SIGGRAPH course notes; Pekelis et
60
+ * al. 2015 for the shapes):
59
61
  *
60
62
  * ```wgsl
61
63
  * fn hair_shading(l: vec3<f32>, v: vec3<f32>, t: vec3<f32>, absorption: vec3<f32>, roughness: f32,
@@ -66,12 +68,11 @@ fn hair_absorption(melanin: f32, redness: f32, dye: vec3<f32>) -> vec3<f32> {
66
68
  * longitudinal roughness; `area` widens every lobe, for light from a solid angle (0 for a point light); `backlit`
67
69
  * scales the transmission and the back of the reflection, 1 for a light behind the hair to show through it.
68
70
  *
69
- * R reflects at the cuticle, its shift the cuticle's tilt and its azimuthal width separable (Unreal's strands);
70
- * TT passes through the fibre, attenuated by `absorption` over its path; TRT reflects once inside. The result is what
71
- * multiplies a light's radiance: no cosine is left to apply. Never negative.
71
+ * R reflects at the cuticle, its shift the cuticle's tilt and its azimuthal width separable; TT passes through the
72
+ * fibre, attenuated by `absorption` over its path; TRT reflects once inside. The result is what multiplies a light's
73
+ * radiance: no cosine is left to apply. Never negative.
72
74
  *
73
- * Unreal's Kajiya-Kay diffuse term, its own "hack approximation for multiple scattering", is not here: multiple
74
- * scattering is dual scattering's to add.
75
+ * No Kajiya-Kay diffuse term stands in for multiple scattering: multiple scattering is dual scattering's to add.
75
76
  *
76
77
  * @type {CodeChunk}
77
78
  */
@@ -7,8 +7,7 @@
7
7
  export const HAIR_SCATTERING_LUT_RESOURCE: ShaderResourceDescriptor;
8
8
  /**
9
9
  * Light scattered by hair with multiple scattering: dual scattering (Zinke et al. 2008) over the single-scattering
10
- * BSDF, as Unreal 5.4 composes it (ComputeDualScatteringTerms, HairStrandsDeepTransmittanceDualScattering.ush, and
11
- * HairShading's `GlobalScattering * (Fs + LocalScattering)`):
10
+ * BSDF, composed as `global * (single + local)`:
12
11
  *
13
12
  * ```wgsl
14
13
  * fn hair_scattering(l: vec3<f32>, v: vec3<f32>, t: vec3<f32>, absorption: vec3<f32>, roughness: f32,
@@ -21,10 +20,10 @@ export const HAIR_SCATTERING_LUT_RESOURCE: ShaderResourceDescriptor;
21
20
  * off it for the strand's own. The global term passes the light through them, attenuated by the average front
22
21
  * scattering to the power of their count and spread by their roughness; the local term adds what scatters back
23
22
  * from the strands around the point. The average scatterings come from the table at the light's angle to the fibre,
24
- * the roughness and the colour. As in Unreal, the table is read at the fibre's roughness and the lobes' spreads take
25
- * it clamped to [0.18, 0.6]: the spreads are Gaussians, and a narrower one would let a single smooth strand in front
26
- * block all but the light along its own cone (at roughness 0.1 one strand passes a fortieth of what the clamp passes).
27
- * Unreal's Kajiya-Kay term is not taken: this is the multiple scattering it stands in for.
23
+ * the roughness and the colour. The table is read at the fibre's roughness and the lobes' spreads take it clamped to
24
+ * [0.18, 0.6]: the spreads are Gaussians, and a narrower one would let a single smooth strand in front block all but
25
+ * the light along its own cone (at roughness 0.1 one strand passes a fortieth of what the clamp passes).
26
+ * No Kajiya-Kay term is added: this is the multiple scattering such a term stands in for.
28
27
  *
29
28
  * `hair_forward_transmittance` is the global term's energy alone, the average front scattering to the power of the
30
29
  * strands passed: what reaches the point from a source as wide as the sky, over which the spread integrates to one.
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_hair_dual_scattering.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/chunk_hair_dual_scattering.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,2CAFU,wBAAwB,CAE6E;AAE/G;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,yCAFU,SAAS,CAqHhB;yCAzJsC,gDAAgD;0BAD/D,iCAAiC"}
1
+ {"version":3,"file":"chunk_hair_dual_scattering.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/chunk_hair_dual_scattering.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,2CAFU,wBAAwB,CAE6E;AAE/G;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,yCAFU,SAAS,CAqHhB;yCAxJsC,gDAAgD;0BAD/D,iCAAiC"}
@@ -13,8 +13,7 @@ export const HAIR_SCATTERING_LUT_RESOURCE = ShaderResourceDescriptor.texture("tH
13
13
 
14
14
  /**
15
15
  * Light scattered by hair with multiple scattering: dual scattering (Zinke et al. 2008) over the single-scattering
16
- * BSDF, as Unreal 5.4 composes it (ComputeDualScatteringTerms, HairStrandsDeepTransmittanceDualScattering.ush, and
17
- * HairShading's `GlobalScattering * (Fs + LocalScattering)`):
16
+ * BSDF, composed as `global * (single + local)`:
18
17
  *
19
18
  * ```wgsl
20
19
  * fn hair_scattering(l: vec3<f32>, v: vec3<f32>, t: vec3<f32>, absorption: vec3<f32>, roughness: f32,
@@ -27,10 +26,10 @@ export const HAIR_SCATTERING_LUT_RESOURCE = ShaderResourceDescriptor.texture("tH
27
26
  * off it for the strand's own. The global term passes the light through them, attenuated by the average front
28
27
  * scattering to the power of their count and spread by their roughness; the local term adds what scatters back
29
28
  * from the strands around the point. The average scatterings come from the table at the light's angle to the fibre,
30
- * the roughness and the colour. As in Unreal, the table is read at the fibre's roughness and the lobes' spreads take
31
- * it clamped to [0.18, 0.6]: the spreads are Gaussians, and a narrower one would let a single smooth strand in front
32
- * block all but the light along its own cone (at roughness 0.1 one strand passes a fortieth of what the clamp passes).
33
- * Unreal's Kajiya-Kay term is not taken: this is the multiple scattering it stands in for.
29
+ * the roughness and the colour. The table is read at the fibre's roughness and the lobes' spreads take it clamped to
30
+ * [0.18, 0.6]: the spreads are Gaussians, and a narrower one would let a single smooth strand in front block all but
31
+ * the light along its own cone (at roughness 0.1 one strand passes a fortieth of what the clamp passes).
32
+ * No Kajiya-Kay term is added: this is the multiple scattering such a term stands in for.
34
33
  *
35
34
  * `hair_forward_transmittance` is the global term's energy alone, the average front scattering to the power of the
36
35
  * strands passed: what reaches the point from a source as wide as the sky, over which the spread integrates to one.
@@ -18,7 +18,9 @@ export const HAIR_GUIDE_STATE_RESOURCE: ShaderResourceDescriptor;
18
18
  * fn hair_state_index(instance: HairInstance, plane: u32, node: u32, guide: u32) -> u32
19
19
  * fn hair_guide_record(instance: HairInstance, guide: u32) -> vec4<u32>
20
20
  * fn hair_quat_nlerp(a: vec4<f32>, b: vec4<f32>, t: f32) -> vec4<f32>
21
+ * fn hair_drag_coefficient(speed: f32, diameter: f32) -> f32
21
22
  * fn hair_drag_rate(speed: f32, diameter: f32, mass_per_length: f32) -> f32
23
+ * fn hair_guide_reach(instance: HairInstance, node: u32, guide: u32, upwind: vec3<f32>, half_drag: f32) -> f32
22
24
  * ```
23
25
  *
24
26
  * `hair_strand_frame` is what carries a strand's rest points into the world: its root frame (`shader_hair_roots.js`)
@@ -27,8 +29,13 @@ export const HAIR_GUIDE_STATE_RESOURCE: ShaderResourceDescriptor;
27
29
  * frame's step holds another tenant's nodes, or none, and its strands ride the entity until the next step lays it.
28
30
  * Reads the state's header. `hair_state_index` is a vector of the state pool, node-interleaved. `hair_guide_record` is a guide's four words in
29
31
  * the groom pool: its strand's rank, its wisp's strand count, its wisp's diameter and its length (f32 bits).
30
- * `hair_quat_nlerp` blends two unit quaternions along the shorter arc. `hair_drag_rate` is `hair_drag_rate`'s twin
31
- * (`HAIR_SIMULATION.js`): the rate a node's velocity relaxes toward the air's.
32
+ * `hair_quat_nlerp` blends two unit quaternions along the shorter arc. `hair_drag_coefficient` and `hair_drag_rate`
33
+ * are their namesakes' twins (`HAIR_SIMULATION.js`): a cylinder's drag coefficient, and the rate its velocity relaxes
34
+ * toward the air's. `hair_guide_reach` is the share of a wind that reaches a guide's node through the hair of its
35
+ * group, from the node's shelter (`GroomGroup#guide_shelter`): `upwind` is where the wind comes from, a unit vector
36
+ * in the groom's rest space, and `half_drag` half a fibre's drag coefficient at the wind's speed. Each axis gives
37
+ * `e^(−half_drag · depth)` for the depth on the side the wind comes from, and the three are weighed by the squares of
38
+ * `upwind`'s parts; an `upwind` of no length gives none.
32
39
  *
33
40
  * @type {CodeChunk}
34
41
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_hair_guide.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/chunk_hair_guide.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,8BAFU,MAAM,CAEwB;AAExC;;;;GAIG;AACH,wCAFU,wBAAwB,CAE2F;AAE7H;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,+BAFU,SAAS,CAwDhB;AAKH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sCAFU,SAAS,CAyChB;yCA7KsC,gDAAgD;0BAD/D,iCAAiC"}
1
+ {"version":3,"file":"chunk_hair_guide.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/chunk_hair_guide.js"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,8BAFU,MAAM,CAEwB;AAExC;;;;GAIG;AACH,wCAFU,wBAAwB,CAE2F;AAE7H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,+BAFU,SAAS,CA4EhB;AAKH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sCAFU,SAAS,CAyChB;yCAxMsC,gDAAgD;0BAD/D,iCAAiC"}