@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
package/CHANGELOG.md CHANGED
@@ -14,6 +14,39 @@
14
14
  turns and compiled to a `WFCRuleTable`. `add_piece` makes a piece of several cells, joined edge to edge, that only
15
15
  ever appears whole; `compile().lint()` names a tile showing a socket nothing answers and tiles that can never share
16
16
  a result (`WFC_DESIGN.md` §13).
17
+ - **Added:** `GridTaskWaveFunctionCollapse` is laid on a `GridDataLayer`, named by `layer`, and leaves its result
18
+ there: each texel holds the value of the tile laid on it, written before any tile's action runs, so the stages
19
+ after it read what was laid as they read any layer. `GridWFCTileSet.add` and `add_piece` take that `value`; it is
20
+ the prototype's index unless given. At resolution `1/n` a tile stands for a block of `n` by `n` cells, for art that
21
+ size — a paving slab two cells across — and the layer has to be stretched. A restriction holds on a block when every
22
+ one of its cells matches, so a restriction and its negation never both hold on one; a tile's action runs once for
23
+ its block, written from the block's first cell and turned about the block's centre; a row or column of blocks the
24
+ grid cuts short holds no tile. At resolution 1 a tile is a cell.
25
+
26
+ ### Generation: a grid layer can be stretched over the grid
27
+
28
+ - **Added:** `GridDataLayer` `stretch` (`GridDataLayer.from(id, type, resolution, stretch)`). A stretched layer's
29
+ texel `t` covers the cells from `t / resolution` to `(t + 1) / resolution`, counted from the grid's first corner,
30
+ and the layer has as many texels as covering the grid takes, so a grid of any size will do: at resolution 0.25 a
31
+ ten-cell grid is three texels, the last reaching past its edge. Unstretched, as before, texel `t` is centred on
32
+ cell `t / resolution` and the grid must be a whole number of texels; at resolution ½ that leaves the last cell of
33
+ the grid past the last texel (`generation/COORDINATES.md`, `WFC_DESIGN.md` §13).
34
+ - **Changed:** `grid_to_texel` and `texel_to_grid` take the layer's `stretch` after its resolution, and every reader
35
+ and writer of a layer goes through them. `CellFilterSampleLayerLinear` and `CellFilterSampleLayerCubic` map by the
36
+ layer's resolution rather than by the ratio of its sampler to the grid, which is the same wherever the grid sized
37
+ the sampler. A write to a stretched layer finer than the grid fills every texel of its cell (`grid_to_texel_span`),
38
+ so a sampling filter at the cell reads back what was written.
39
+ - **Fixed:** `GridCellActionPlaceTags` and `GridTaskBuildSourceDistanceMap` honour a layer's resolution. Tags land
40
+ in the texels a writer at their cell would set, where `CellMatcherLayerBitMaskTest` reads them, and on a coarser
41
+ layer combine in the texel holding their cells. The distance map searches the layer's texels: on a coarser layer a
42
+ texel is a source if any of its cells is and passable if all of them are, so a wall one cell thick still stops it;
43
+ distances are in cells, counted in whole steps and converted to the layer's type once, at the end. Both assumed
44
+ resolution 1: tags landed on the texel numbered like their cell, and the distance map indexed the layer by cell.
45
+ - **Fixed:** a position off the grid neither matches `CellMatcherLayerBitMaskTest` nor is written by
46
+ `GridCellActionWriteFilterToLayer` or `GridCellActionPlaceTags`, even where a texel of a coarser layer reaches it;
47
+ the bounds are checked in grid space. At resolution 1 nothing changes.
48
+ - **Fixed:** a layer added to a grid of one cell gets its texel. A layer started out sized for one cell with an empty
49
+ sampler, so resizing it to one cell was skipped.
17
50
 
18
51
  ### Cloth: a cloth that slides is not pulled back to where it landed
19
52
 
@@ -344,11 +377,11 @@ Migrating:
344
377
  - **Added:** `ColorGrade`, as `renderer.tone_mapper.grade`, neutral by default and baked into the tone mapper's LUTs
345
378
  ahead of the operator, so it costs nothing per pixel. Any change bakes both LUTs again; a LUT the user supplies is
346
379
  not graded. In order:
347
- - white balance: Unreal's temperature white balance (`white_temperature`, `white_tint`), Planckian and daylight
380
+ - white balance: a temperature and tint white balance (`white_temperature`, `white_tint`), Planckian and daylight
348
381
  loci, Bradford to D65;
349
- - primaries: Unreal's `ColorCorrectAll` in AP1, saturation, contrast, gamma, gain and offset for `global`,
350
- `shadows`, `midtones` and `highlights` (`ColorGradeZone`, each a `Vector4` of RGB and master), blended by
351
- `shadows_max`, `highlights_min` and `highlights_max`. Values from an Unreal project give the same result;
382
+ - primaries in AP1: saturation, contrast, gamma, gain and offset for `global`, `shadows`, `midtones` and
383
+ `highlights` (`ColorGradeZone`, each a `Vector4` of RGB and master), blended by `shadows_max`, `highlights_min`
384
+ and `highlights_max`;
352
385
  - hue curves: `hue_shift` (degrees), `hue_saturation` (chroma multiplier) and `hue_lightness` (stops), each an
353
386
  `AnimationCurve` over the OkLCh hue in degrees. Lightness is exposure at the colour's chromaticity, weighted by
354
387
  its saturation against the Rec.709 gamut's edge at its hue, so greys never move.
@@ -366,11 +399,11 @@ Migrating:
366
399
  ### Tone mapping through a baked 3D LUT
367
400
 
368
401
  - **Added:** `ToneMapper`, owned by the renderer as `renderer.tone_mapper`, made by `initialize`. It bakes its
369
- `operator` into a 3D LUT per output, at `lut_resolution` (default 32, as in Unreal; at least 2, at most the
402
+ `operator` into a 3D LUT per output, at `lut_resolution` (default 32; at least 2, at most the
370
403
  device's `maxTextureDimension3D`), and draws every frame through one trilinear fetch. A LUT is baked again only
371
404
  when the operator, the resolution or, for HDR, the display's peak (`tone_mapper.display.peak_nits`) changes. A
372
405
  LUT maps the PQ signal of exposed scene-linear Rec.709 to the PQ signal of linear Rec.2020 display light, 1 at
373
- the paper white on both sides; scene colour past 10000 cd/m² (49.3 × SDR white) clamps there, as Unreal's does.
406
+ the paper white on both sides; scene colour past 10000 cd/m² (49.3 × SDR white) clamps there.
374
407
  - **Added:** `ToneMapOperator` (a `CodeChunk` defining `tone_map_operator(scene, peak_nits)`, plus `declare`
375
408
  and `bind` for bindings of its own), and the built-ins `TONE_MAP_OPERATOR_ACES` (the default),
376
409
  `TONE_MAP_OPERATOR_GT7`, `TONE_MAP_OPERATOR_PBR_NEUTRAL` and `TONE_MAP_OPERATOR_NONE`, unchanged in what
@@ -725,7 +758,7 @@ Migrating:
725
758
  it traces, just before it traces them; the 819 limit still bounds those, the path tracer and the
726
759
  bakers.
727
760
  - **Changed:** a probe ray's hit that no card sees, or on a row with no card set (virtual geometry, a
728
- pair still capturing), brings back no light, as in UE. It took the material's colour factor × its
761
+ pair still capturing), brings back no light. It took the material's colour factor × its
729
762
  textures' means. The colour factor alone, from the scene's table, was measured first and made Sponza's
730
763
  bounce-lit gallery 60% brighter on screen; black makes it 27% darker than the means (mean luma 29.3 →
731
764
  21.5) and the sunlit nave 1% darker. Virtual geometry has no cards yet, so its surfaces bounce no light.
@@ -1640,22 +1673,22 @@ Migrating:
1640
1673
  place of `joint_t_norms`, `joint_radii` and `joint_lengths`. A joint whose span holds no segment is rigid
1641
1674
  (compliance 0). `build_tree_wind_rig` returns `null` for a single joint: joint 0 is the anchored trunk base.
1642
1675
 
1643
- ### ACES, Unreal Engine's look, is the default tone mapping
1676
+ ### ACES is the default tone mapping
1644
1677
 
1645
1678
  - **Added:** `ShadeToneMappingMode.ACES`, and **Breaking:** it is the renderer's default, where GT7 was. Every
1646
1679
  default look changes. Set `renderer.tone_mapping_mode = ShadeToneMappingMode.GT7` to keep the previous one.
1647
- - SDR is Unreal's "Filmic" tone mapper at its default settings, with Expand Gamut
1648
- and Blue Correction around it, per pixel where UE bakes a LUT. An exposed 0.18 shows at 0.18 of SDR white, as
1680
+ - SDR is a filmic curve on ACES at fixed settings, with gamut expansion
1681
+ and blue correction around it, evaluated per pixel. An exposed 0.18 shows at 0.18 of SDR white, as
1649
1682
  with GT7, at a mid-tone contrast of 1.36 against GT7's 1.05. Shadows are deeper, highlights brighter, and
1650
1683
  saturation 12–15% higher on the volumetrics playground.
1651
- - HDR is what Unreal 5.8 does with Filmic past 100 cd/m². The SDR picture goes back through the inverse ACES 2.0
1684
+ - HDR keeps the SDR look past 100 cd/m². The SDR picture goes back through the inverse ACES 2.0
1652
1685
  output transform for an SDR display, then out through ACES 2.0 for the display's headroom over the paper white.
1653
1686
  Both are limited to Rec.709, the SDR picture's gamut, so as the headroom shrinks to none the HDR picture becomes
1654
1687
  the SDR one. Mid-grey rises with the peak, as ACES 2.0 is designed to: 0.26 of SDR white at 1000 cd/m².
1655
1688
  - The inverse is limited where OpenColorIO's is ill-conditioned. Its decompression is clamped at the estimated
1656
1689
  gamut boundary, held to a gain of 5, and faded out over the last unit of J before white. Without these limits, a
1657
- bright tinted highlight, whose SDR picture Filmic clips onto the gamut's surface, jumps by up to a quarter of SDR
1658
- white between neighbouring scene values.
1690
+ bright tinted highlight, whose SDR picture the filmic curve clips onto the gamut's surface, jumps by up to a
1691
+ quarter of SDR white between neighbouring scene values.
1659
1692
  - **New:** `TonemapAces2Tables`, the HDR pass's two ACES 2.0 output transforms. They are built on the first HDR frame
1660
1693
  and rebuilt only when the display's peak changes (7–13 ms).
1661
1694
  - **New:** `aces2_transform_block_write`, OpenColorIO 2.6.0's ACES 2.0 parameter and gamut-table setup, and the WGSL
@@ -109,7 +109,7 @@ export class NodeGraphView extends View {
109
109
  * Three gestures want that background — moving the view, pulling a selection box across it, and
110
110
  * asking for the add-node menu — and a canvas that guessed between them would keep getting it
111
111
  * wrong. They are told apart by which button began the gesture, the way graph editors of this
112
- * kind have long settled it (Unreal's Blueprint canvas among them):
112
+ * kind have long settled it:
113
113
  *
114
114
  * | gesture | what it does |
115
115
  * |--------------------------|-------------------------------------------------------|
@@ -858,7 +858,7 @@ export class NodeGraphView extends View {
858
858
  * Three gestures want that background — moving the view, pulling a selection box across it, and
859
859
  * asking for the add-node menu — and a canvas that guessed between them would keep getting it
860
860
  * wrong. They are told apart by which button began the gesture, the way graph editors of this
861
- * kind have long settled it (Unreal's Blueprint canvas among them):
861
+ * kind have long settled it:
862
862
  *
863
863
  * | gesture | what it does |
864
864
  * |--------------------------|-------------------------------------------------------|
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Advanced 3D game engine",
7
7
  "type": "module",
8
8
  "author": "Alexander Goldring",
9
- "version": "3.78.2",
9
+ "version": "3.78.4",
10
10
  "exports": {
11
11
  "./build/*": "./build/*",
12
12
  "./src/*": "./src/*",
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  *
3
- * Optimized variant (presented by Epic at SIGGRAPH '13)
3
+ * Optimized variant: the spherical Gaussian approximation of Schlick's Fresnel term, from Karis 2013,
4
+ * "Real Shading in Unreal Engine 4", SIGGRAPH 2013 course notes
4
5
  * https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf
5
6
  * @param {number} dotVH
6
7
  * @return {number}
@@ -1 +1 @@
1
- {"version":3,"file":"fresnel_Schlick_optimized.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/brdf/fresnel_Schlick_optimized.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,iDAHW,MAAM,GACL,MAAM,CAIjB"}
1
+ {"version":3,"file":"fresnel_Schlick_optimized.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/brdf/fresnel_Schlick_optimized.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,iDAHW,MAAM,GACL,MAAM,CAIjB"}
@@ -2,7 +2,8 @@ import { exp2 } from "../../exp2.js";
2
2
 
3
3
  /**
4
4
  *
5
- * Optimized variant (presented by Epic at SIGGRAPH '13)
5
+ * Optimized variant: the spherical Gaussian approximation of Schlick's Fresnel term, from Karis 2013,
6
+ * "Real Shading in Unreal Engine 4", SIGGRAPH 2013 course notes
6
7
  * https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf
7
8
  * @param {number} dotVH
8
9
  * @return {number}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `v`, or the whole number it lies within rounding error of.
3
+ *
4
+ * A product or quotient of two doubles, each within half an ulp of the number meant, lands within `Number.EPSILON` of
5
+ * the result meant, relative to it. So where that result is a whole number this gives it back exactly — `525 * (1/75)`
6
+ * is 7.000000000000001 and `1 / (1/93)` is 92.99999999999999 in doubles — and anything further from a whole number is
7
+ * returned as it is.
8
+ *
9
+ * @param {number} v
10
+ * @returns {number}
11
+ */
12
+ export function snap_to_integer(v: number): number;
13
+ //# sourceMappingURL=snap_to_integer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snap_to_integer.d.ts","sourceRoot":"","sources":["../../../../src/core/math/snap_to_integer.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,mCAHW,MAAM,GACJ,MAAM,CAUlB"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `v`, or the whole number it lies within rounding error of.
3
+ *
4
+ * A product or quotient of two doubles, each within half an ulp of the number meant, lands within `Number.EPSILON` of
5
+ * the result meant, relative to it. So where that result is a whole number this gives it back exactly — `525 * (1/75)`
6
+ * is 7.000000000000001 and `1 / (1/93)` is 92.99999999999999 in doubles — and anything further from a whole number is
7
+ * returned as it is.
8
+ *
9
+ * @param {number} v
10
+ * @returns {number}
11
+ */
12
+ export function snap_to_integer(v) {
13
+ const whole = Math.round(v);
14
+
15
+ if (Math.abs(v - whole) <= Math.abs(whole) * Number.EPSILON) {
16
+ return whole;
17
+ }
18
+
19
+ return v;
20
+ }
@@ -3,7 +3,6 @@
3
3
  * Notable contemporary examples include:
4
4
  * * SideFX Houdini
5
5
  * * Blender - geometry nodes, shaders
6
- * * Unreal Engine - blueprints
7
6
  * * Grasshopper
8
7
  * @see https://en.wikipedia.org/wiki/Node_graph_architecture
9
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/NodeGraph.js"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AACH;IAEI;;;;OAIG;IACH,uBAAmB;IAEnB;;;;;OAKG;IACH,6BAAyB;IAEzB;;;;;OAKG;IACH,4BAA0B;IAE1B;;;;;OAKG;IACH,kCAAgC;IAQhC;;;;OAIG;IACH,sBAEC;IAED;;;;;;;;;;;;;;OAcG;IACH;QACI;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;MAEL;IAEF;;OAEG;IACH,cAQC;IAED;;;OAGG;IACH,YAFW,SAAS,QAYnB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;;;OAMG;IACH,aAHW,SAAS,GACP;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAe5D;IAED;;;;;;;;;OASG;IACH;QAJmC,KAAK,EAA7B,YAAY,EAAE;QACS,WAAW,GAAlC,UAAU,EAAE;QACV;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAmF5D;IAED;;;;OAIG;IACH,8BAHoB,YAAY,+BAK/B;IAED;;;;OAIG;IACH,oCAHoB,UAAU,+BAK7B;IAED;;;;OAIG;IACH,YAFY,YAAY,EAAE,CAIzB;IAED;;;;OAIG;IACH,kBAFY,UAAU,EAAE,CAIvB;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAgBnB;IAED;;;;OAIG;IACH,qDAFa,YAAY,EAAE,CAsB1B;IAED;;;;OAIG;IACH,0DAFa,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,YAAY,GAAC,SAAS,CAkBlC;IAED;;;;;OAKG;IACH,gBAJW,MAAM,GACJ,YAAY,CAWxB;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,UAAU,GAAC,SAAS,CAgBhC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,WACN,MAAM,GACJ,4BAA0B,SAAS,CAY/C;IAED;;;;OAIG;IACH,mCAFa,MAAM,CAclB;IAED;;;OAGG;IACH,cAFW,YAAY,QAkBtB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CA8BnB;IAED;;;;;;;;OAQG;IACH,uCANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAqClB;IAED;;;;;;;;;;;;;OAaG;IACH,6BAZW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,OACN,MAAM,GAKJ,MAAM,CAqElB;IAED;;;;;;;OAOG;IACH,0BAHW,UAAU,GACR,MAAM,CA4BlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,OAAO,CA6BnB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,UACN,MAAM,EAAE,GACN,MAAM,CAyBlB;IAED,mBAEC;IAGL;;;;;;;;OAQG;IACH,sBAFU,OAAO,CAEc;;CAX9B;6BAjvB4B,wBAAwB;2BAD1B,iBAAiB"}
1
+ {"version":3,"file":"NodeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/NodeGraph.js"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH;IAEI;;;;OAIG;IACH,uBAAmB;IAEnB;;;;;OAKG;IACH,6BAAyB;IAEzB;;;;;OAKG;IACH,4BAA0B;IAE1B;;;;;OAKG;IACH,kCAAgC;IAQhC;;;;OAIG;IACH,sBAEC;IAED;;;;;;;;;;;;;;OAcG;IACH;QACI;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;MAEL;IAEF;;OAEG;IACH,cAQC;IAED;;;OAGG;IACH,YAFW,SAAS,QAYnB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;;;OAMG;IACH,aAHW,SAAS,GACP;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAe5D;IAED;;;;;;;;;OASG;IACH;QAJmC,KAAK,EAA7B,YAAY,EAAE;QACS,WAAW,GAAlC,UAAU,EAAE;QACV;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAmF5D;IAED;;;;OAIG;IACH,8BAHoB,YAAY,+BAK/B;IAED;;;;OAIG;IACH,oCAHoB,UAAU,+BAK7B;IAED;;;;OAIG;IACH,YAFY,YAAY,EAAE,CAIzB;IAED;;;;OAIG;IACH,kBAFY,UAAU,EAAE,CAIvB;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAgBnB;IAED;;;;OAIG;IACH,qDAFa,YAAY,EAAE,CAsB1B;IAED;;;;OAIG;IACH,0DAFa,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,YAAY,GAAC,SAAS,CAkBlC;IAED;;;;;OAKG;IACH,gBAJW,MAAM,GACJ,YAAY,CAWxB;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,UAAU,GAAC,SAAS,CAgBhC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,WACN,MAAM,GACJ,4BAA0B,SAAS,CAY/C;IAED;;;;OAIG;IACH,mCAFa,MAAM,CAclB;IAED;;;OAGG;IACH,cAFW,YAAY,QAkBtB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CA8BnB;IAED;;;;;;;;OAQG;IACH,uCANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAqClB;IAED;;;;;;;;;;;;;OAaG;IACH,6BAZW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,OACN,MAAM,GAKJ,MAAM,CAqElB;IAED;;;;;;;OAOG;IACH,0BAHW,UAAU,GACR,MAAM,CA4BlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,OAAO,CA6BnB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,UACN,MAAM,EAAE,GACN,MAAM,CAyBlB;IAED,mBAEC;IAGL;;;;;;;;OAQG;IACH,sBAFU,OAAO,CAEc;;CAX9B;6BAhvB4B,wBAAwB;2BAD1B,iBAAiB"}
@@ -12,7 +12,6 @@ import { PortDirection } from "./node/PortDirection.js";
12
12
  * Notable contemporary examples include:
13
13
  * * SideFX Houdini
14
14
  * * Blender - geometry nodes, shaders
15
- * * Unreal Engine - blueprints
16
15
  * * Grasshopper
17
16
  * @see https://en.wikipedia.org/wiki/Node_graph_architecture
18
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GroomAssetLoader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/asset/loaders/GroomAssetLoader.js"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,qCAHW,KAAK,GACH,WAAW,CAcvB;AAED;;;;;GAKG;AACH,sCAHW,WAAW,GACT,KAAK,CAsBjB;AA5DD;;;GAGG;AACH,+BAFU,MAAM,CAE2B;AA0D3C;;;;GAIG;AACH;;IAaI,8FAmBC;CACJ;sBA7GqB,8BAA8B;4BAOxB,kBAAkB;sBAHxB,aAAa"}
1
+ {"version":3,"file":"GroomAssetLoader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/asset/loaders/GroomAssetLoader.js"],"names":[],"mappings":"AA0BA;;;;;;GAMG;AACH,qCAHW,KAAK,GACH,WAAW,CAcvB;AAED;;;;;GAKG;AACH,sCAHW,WAAW,GACT,KAAK,CAsBjB;AA5DD;;;GAGG;AACH,+BAFU,MAAM,CAE2B;AA0D3C;;;;GAIG;AACH;;IAaI,8FAmBC;CACJ;sBA9GqB,8BAA8B;4BAQxB,kBAAkB;sBAHxB,aAAa"}
@@ -4,6 +4,7 @@ import { load_groom_usd } from "../../../shade/renderer/loader/usd/usd_groom_ext
4
4
  import { Groom } from "../../graphics/hair/Groom.js";
5
5
  import { GroomSerializationAdapter } from "../../graphics/hair/GroomSerializationAdapter.js";
6
6
  import { GroomSerializationUpgrader_0_1 } from "../../graphics/hair/GroomSerializationUpgrader_0_1.js";
7
+ import { GroomSerializationUpgrader_1_2 } from "../../graphics/hair/GroomSerializationUpgrader_1_2.js";
7
8
  import { executeBinaryClassUpgraderChain } from "../../ecs/storage/binary/executeBinaryClassUpgraderChain.js";
8
9
  import { Asset } from "../Asset.js";
9
10
  import { GameAssetType } from "../GameAssetType.js";
@@ -21,7 +22,7 @@ export const GROOM_FILE_MAGIC = 0x4D52474D;
21
22
  * `v` to `v + 1`.
22
23
  * @type {import("../../ecs/storage/binary/BinaryClassUpgrader.js").BinaryClassUpgrader[]}
23
24
  */
24
- const GROOM_UPGRADERS = [new GroomSerializationUpgrader_0_1()];
25
+ const GROOM_UPGRADERS = [new GroomSerializationUpgrader_0_1(), new GroomSerializationUpgrader_1_2()];
25
26
 
26
27
  /**
27
28
  * A {@link Groom} as a file: {@link GROOM_FILE_MAGIC}, the format's version (u32), then the groom
@@ -24,6 +24,17 @@ export const GROOM_POINT_COUNT_MAX: number;
24
24
  * @type {number}
25
25
  */
26
26
  export const GROOM_GUIDE_LIMIT: number;
27
+ /**
28
+ * Depths a guide's node has in {@link GroomGroup#guide_shelter}: toward +x, −x, +y, −y, +z and −z.
29
+ * @type {number}
30
+ */
31
+ export const GROOM_SHELTER_WORDS: number;
32
+ /**
33
+ * The depth that stands for hair nothing passes, and for anything solid. A fibre's drag coefficient is never under
34
+ * one, so no more than `e^(−depth / 2)` of a wind crosses a depth: past this, less than a float32 tells from none.
35
+ * @type {number}
36
+ */
37
+ export const GROOM_SHELTER_OPAQUE: number;
27
38
  /**
28
39
  * Strands of hair that share a point count, as they are at rest: a scalp, the brows, the lashes, a beard.
29
40
  *
@@ -106,6 +117,25 @@ export class GroomGroup {
106
117
  * @type {number}
107
118
  */
108
119
  guide_reach: number;
120
+ /**
121
+ * How much hair stands between each guide's node and the open air along each of the group's axes
122
+ * (`groom_bake_shelter`): {@link GROOM_SHELTER_WORDS} depths a node, a guide's nodes in turn, guide after guide.
123
+ * A depth is the fibres' frontal area along the way out over the area crossed, a pure number, never past
124
+ * {@link GROOM_SHELTER_OPAQUE}.
125
+ * @type {Float32Array}
126
+ */
127
+ guide_shelter: Float32Array;
128
+ /**
129
+ * The area the group's strands cover seen from a direction, averaged over every direction, square metres
130
+ * (`groom_bake_shelter`): what of a wind the group stands in the way of.
131
+ * @type {number}
132
+ */
133
+ silhouette: number;
134
+ /**
135
+ * The length of every strand of the group, summed, metres.
136
+ * @type {number}
137
+ */
138
+ fibre_length: number;
109
139
  /**
110
140
  * @returns {number} guides the group has
111
141
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Groom.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/hair/Groom.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,2CAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,sCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,oCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,gCAFU,MAAM,CAEyB;AAEzC;;;;;;;;;GASG;AACH;IACI;;OAEG;IACH,MAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;OAEG;IACH,cAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,QAFU,YAAY,CAEO;IAE7B;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;;OAIG;IACH,YAFU,MAAM,CAED;IAEf;;;;OAIG;IACH,cAFU,MAAM,CAEC;IAEjB;;;;OAIG;IACH,mBAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,cAFU,WAAW,CAEa;IAElC;;;OAGG;IACH,oBAFU,WAAW,CAEmB;IAExC;;;OAGG;IACH,gBAFU,YAAY,CAEe;IAErC;;;OAGG;IACH,cAFU,YAAY,CAEa;IAEnC;;;OAGG;IACH,cAFU,WAAW,CAEa;IAElC;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;OAEG;IACH,0BAEC;IAED;;;OAGG;IACH,QAFU,WAAW,CAEO;IAE5B;;;;OAIG;IACH,WAFU,UAAU,CAEU;IAE9B;;;;;OAKG;IACH,YAFU,YAAY,CAEW;IAEjC;;OAEG;IACH,0BAEC;IAED;;;;;;;OAOG;IACH,gBALW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,cAClC,MAAM,UACN,MAAM,SACN,MAAM,QAehB;IAED;;;;;;OAMG;IACH,mBAJW,MAAM,SACN,MAAM,GACJ,MAAM,CAMlB;CACJ;AAED;;;GAGG;AACH;IACI;;OAEG;IACH,QAFU,UAAU,EAAE,CAEV;IAEZ;;OAEG;IACH,2BAQC;IAED;;OAEG;IACH,0BAUC;IAED;;OAEG;IACH,WAFW,UAAU,QAOpB;CACJ"}
1
+ {"version":3,"file":"Groom.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/hair/Groom.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,2CAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,sCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,oCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,gCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;GAIG;AACH,mCAFU,MAAM,CAEuB;AAEvC;;;;;;;;;GASG;AACH;IACI;;OAEG;IACH,MAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;OAEG;IACH,cAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,QAFU,YAAY,CAEO;IAE7B;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;;OAIG;IACH,YAFU,MAAM,CAED;IAEf;;;;OAIG;IACH,cAFU,MAAM,CAEC;IAEjB;;;;OAIG;IACH,mBAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,cAFU,WAAW,CAEa;IAElC;;;OAGG;IACH,oBAFU,WAAW,CAEmB;IAExC;;;OAGG;IACH,gBAFU,YAAY,CAEe;IAErC;;;OAGG;IACH,cAFU,YAAY,CAEa;IAEnC;;;OAGG;IACH,cAFU,WAAW,CAEa;IAElC;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;;;OAMG;IACH,eAFU,YAAY,CAEc;IAEpC;;;;OAIG;IACH,YAFU,MAAM,CAED;IAEf;;;OAGG;IACH,cAFU,MAAM,CAEC;IAEjB;;OAEG;IACH,0BAEC;IAED;;;OAGG;IACH,QAFU,WAAW,CAEO;IAE5B;;;;OAIG;IACH,WAFU,UAAU,CAEU;IAE9B;;;;;OAKG;IACH,YAFU,YAAY,CAEW;IAEjC;;OAEG;IACH,0BAEC;IAED;;;;;;;OAOG;IACH,gBALW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,cAClC,MAAM,UACN,MAAM,SACN,MAAM,QAehB;IAED;;;;;;OAMG;IACH,mBAJW,MAAM,SACN,MAAM,GACJ,MAAM,CAMlB;CACJ;AAED;;;GAGG;AACH;IACI;;OAEG;IACH,QAFU,UAAU,EAAE,CAEV;IAEZ;;OAEG;IACH,2BAQC;IAED;;OAEG;IACH,0BAUC;IAED;;OAEG;IACH,WAFW,UAAU,QAOpB;CACJ"}
@@ -31,6 +31,19 @@ export const GROOM_POINT_COUNT_MAX = 129;
31
31
  */
32
32
  export const GROOM_GUIDE_LIMIT = 0x10000;
33
33
 
34
+ /**
35
+ * Depths a guide's node has in {@link GroomGroup#guide_shelter}: toward +x, −x, +y, −y, +z and −z.
36
+ * @type {number}
37
+ */
38
+ export const GROOM_SHELTER_WORDS = 6;
39
+
40
+ /**
41
+ * The depth that stands for hair nothing passes, and for anything solid. A fibre's drag coefficient is never under
42
+ * one, so no more than `e^(−depth / 2)` of a wind crosses a depth: past this, less than a float32 tells from none.
43
+ * @type {number}
44
+ */
45
+ export const GROOM_SHELTER_OPAQUE = 32;
46
+
34
47
  /**
35
48
  * Strands of hair that share a point count, as they are at rest: a scalp, the brows, the lashes, a beard.
36
49
  *
@@ -127,6 +140,28 @@ export class GroomGroup {
127
140
  */
128
141
  guide_reach = 0;
129
142
 
143
+ /**
144
+ * How much hair stands between each guide's node and the open air along each of the group's axes
145
+ * (`groom_bake_shelter`): {@link GROOM_SHELTER_WORDS} depths a node, a guide's nodes in turn, guide after guide.
146
+ * A depth is the fibres' frontal area along the way out over the area crossed, a pure number, never past
147
+ * {@link GROOM_SHELTER_OPAQUE}.
148
+ * @type {Float32Array}
149
+ */
150
+ guide_shelter = new Float32Array(0);
151
+
152
+ /**
153
+ * The area the group's strands cover seen from a direction, averaged over every direction, square metres
154
+ * (`groom_bake_shelter`): what of a wind the group stands in the way of.
155
+ * @type {number}
156
+ */
157
+ silhouette = 0;
158
+
159
+ /**
160
+ * The length of every strand of the group, summed, metres.
161
+ * @type {number}
162
+ */
163
+ fibre_length = 0;
164
+
130
165
  /**
131
166
  * @returns {number} guides the group has
132
167
  */
@@ -19,6 +19,20 @@ export function groom_write_group_v0(buffer: import("../../../core/binary/Binary
19
19
  * @param {GroomGroup} group
20
20
  */
21
21
  export function groom_write_guides(buffer: import("../../../core/binary/BinaryBuffer.js").BinaryBuffer, group: GroomGroup): void;
22
+ /**
23
+ * Write how a group shelters itself from the air, as version 2 follows its guides with it.
24
+ *
25
+ * @param {import("../../../core/binary/BinaryBuffer.js").BinaryBuffer} buffer
26
+ * @param {GroomGroup} group
27
+ */
28
+ export function groom_write_shelter(buffer: import("../../../core/binary/BinaryBuffer.js").BinaryBuffer, group: GroomGroup): void;
29
+ /**
30
+ * Read a group's guides, as version 1 follows its version 0 fields with them.
31
+ *
32
+ * @param {import("../../../core/binary/BinaryBuffer.js").BinaryBuffer} buffer
33
+ * @param {GroomGroup} group
34
+ */
35
+ export function groom_read_guides(buffer: import("../../../core/binary/BinaryBuffer.js").BinaryBuffer, group: GroomGroup): void;
22
36
  /**
23
37
  * A {@link Groom} as bytes: its groups, each as the renderer reads it, so a load is a copy and nothing is rebuilt.
24
38
  *
@@ -26,9 +40,11 @@ export function groom_write_guides(buffer: import("../../../core/binary/BinaryBu
26
40
  * the mean width (f32 each), the decimation table (a u8 count, then f32 each), the rest points (u32, `GROOM_POINT_WORDS`
27
41
  * a point) and the strands' variation bytes; then its guides: the node count and the guide count (u32 each), each
28
42
  * guide's strand and strand count (u32 each), wisp diameter and length (f32 each), each strand's guide (u16) and the
29
- * reach (f32). The group count (u32) leads.
43
+ * reach (f32); then how it shelters itself from the air: its silhouette and its fibres' length (f32 each) and its
44
+ * guides' depths (f32, `GROOM_SHELTER_WORDS` a node). The group count (u32) leads.
30
45
  *
31
- * Version 0 had no guides; `GroomSerializationUpgrader_0_1` gives its groups theirs.
46
+ * Version 0 had no guides; `GroomSerializationUpgrader_0_1` gives its groups theirs. Version 1 had no shelter;
47
+ * `GroomSerializationUpgrader_1_2` works it out, with nothing solid about the hair.
32
48
  */
33
49
  export class GroomSerializationAdapter extends BinaryClassSerializationAdapter<any> {
34
50
  constructor();
@@ -1 +1 @@
1
- {"version":3,"file":"GroomSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/hair/GroomSerializationAdapter.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,4CAHW,OAAO,sCAAsC,EAAE,YAAY,GACzD,UAAU,CAsBtB;AAED;;;;;GAKG;AACH,6CAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,UAAU,QAepB;AAED;;;;;GAKG;AACH,2CAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,UAAU,QAapB;AA6BD;;;;;;;;;;GAUG;AACH;;IACI,oBAAc;IAGd;;;OAGG;IACH,kBAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,KAAK,QAWf;IAED;;;OAGG;IACH,oBAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,KAAK,QAiBf;CACJ;2BApJoD,YAAY;gDADjB,6DAA6D;sBACxD,YAAY"}
1
+ {"version":3,"file":"GroomSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/hair/GroomSerializationAdapter.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,4CAHW,OAAO,sCAAsC,EAAE,YAAY,GACzD,UAAU,CAsBtB;AAED;;;;;GAKG;AACH,6CAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,UAAU,QAepB;AAED;;;;;GAKG;AACH,2CAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,UAAU,QAapB;AAED;;;;;GAKG;AACH,4CAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,UAAU,QAMpB;AAcD;;;;;GAKG;AACH,0CAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,UAAU,QAuBpB;AAED;;;;;;;;;;;;GAYG;AACH;;IACI,oBAAc;IAGd;;;OAGG;IACH,kBAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,KAAK,QAYf;IAED;;;OAGG;IACH,oBAHW,OAAO,sCAAsC,EAAE,YAAY,SAC3D,KAAK,QAkBf;CACJ;2BAlLyE,YAAY;gDADtC,6DAA6D;sBACnC,YAAY"}
@@ -1,5 +1,5 @@
1
1
  import { BinaryClassSerializationAdapter } from "../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
2
- import { GROOM_POINT_WORDS, Groom, GroomGroup } from "./Groom.js";
2
+ import { GROOM_POINT_WORDS, GROOM_SHELTER_WORDS, Groom, GroomGroup } from "./Groom.js";
3
3
  import { groom_root_spacing } from "./groom_root_spacing.js";
4
4
 
5
5
  /**
@@ -71,10 +71,36 @@ export function groom_write_guides(buffer, group) {
71
71
  }
72
72
 
73
73
  /**
74
+ * Write how a group shelters itself from the air, as version 2 follows its guides with it.
75
+ *
76
+ * @param {import("../../../core/binary/BinaryBuffer.js").BinaryBuffer} buffer
77
+ * @param {GroomGroup} group
78
+ */
79
+ export function groom_write_shelter(buffer, group) {
80
+ buffer.writeFloat32(group.silhouette);
81
+ buffer.writeFloat32(group.fibre_length);
82
+ buffer.writeFloat32Array(group.guide_shelter, 0, group.guide_count * group.guide_point_count * GROOM_SHELTER_WORDS);
83
+ }
84
+
85
+ /**
86
+ * @param {import("../../../core/binary/BinaryBuffer.js").BinaryBuffer} buffer
87
+ * @param {GroomGroup} group with its guides
88
+ */
89
+ function read_shelter(buffer, group) {
90
+ group.silhouette = buffer.readFloat32();
91
+ group.fibre_length = buffer.readFloat32();
92
+
93
+ group.guide_shelter = new Float32Array(group.guide_count * group.guide_point_count * GROOM_SHELTER_WORDS);
94
+ buffer.readFloat32Array(group.guide_shelter, 0, group.guide_shelter.length);
95
+ }
96
+
97
+ /**
98
+ * Read a group's guides, as version 1 follows its version 0 fields with them.
99
+ *
74
100
  * @param {import("../../../core/binary/BinaryBuffer.js").BinaryBuffer} buffer
75
101
  * @param {GroomGroup} group
76
102
  */
77
- function read_guides(buffer, group) {
103
+ export function groom_read_guides(buffer, group) {
78
104
  group.guide_point_count = buffer.readUint32();
79
105
 
80
106
  const count = buffer.readUint32();
@@ -104,13 +130,15 @@ function read_guides(buffer, group) {
104
130
  * the mean width (f32 each), the decimation table (a u8 count, then f32 each), the rest points (u32, `GROOM_POINT_WORDS`
105
131
  * a point) and the strands' variation bytes; then its guides: the node count and the guide count (u32 each), each
106
132
  * guide's strand and strand count (u32 each), wisp diameter and length (f32 each), each strand's guide (u16) and the
107
- * reach (f32). The group count (u32) leads.
133
+ * reach (f32); then how it shelters itself from the air: its silhouette and its fibres' length (f32 each) and its
134
+ * guides' depths (f32, `GROOM_SHELTER_WORDS` a node). The group count (u32) leads.
108
135
  *
109
- * Version 0 had no guides; `GroomSerializationUpgrader_0_1` gives its groups theirs.
136
+ * Version 0 had no guides; `GroomSerializationUpgrader_0_1` gives its groups theirs. Version 1 had no shelter;
137
+ * `GroomSerializationUpgrader_1_2` works it out, with nothing solid about the hair.
110
138
  */
111
139
  export class GroomSerializationAdapter extends BinaryClassSerializationAdapter {
112
140
  klass = Groom;
113
- version = 1;
141
+ version = 2;
114
142
 
115
143
  /**
116
144
  * @param {import("../../../core/binary/BinaryBuffer.js").BinaryBuffer} buffer
@@ -124,6 +152,7 @@ export class GroomSerializationAdapter extends BinaryClassSerializationAdapter {
124
152
  for (let g = 0; g < groups.length; g++) {
125
153
  groom_write_group_v0(buffer, groups[g]);
126
154
  groom_write_guides(buffer, groups[g]);
155
+ groom_write_shelter(buffer, groups[g]);
127
156
  }
128
157
  }
129
158
 
@@ -139,7 +168,8 @@ export class GroomSerializationAdapter extends BinaryClassSerializationAdapter {
139
168
  for (let g = 0; g < count; g++) {
140
169
  const group = groom_read_group_v0(buffer);
141
170
 
142
- read_guides(buffer, group);
171
+ groom_read_guides(buffer, group);
172
+ read_shelter(buffer, group);
143
173
 
144
174
  // derived from the roots, so not written
145
175
  group.root_spacing = groom_root_spacing(group);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A version 1 groom as version 2: each group and its guides as they were, followed by how it shelters itself from the
3
+ * air as `groom_bake_shelter` works it out with nothing solid about the hair.
4
+ */
5
+ export class GroomSerializationUpgrader_1_2 extends BinaryClassUpgrader {
6
+ }
7
+ import { BinaryClassUpgrader } from "../../ecs/storage/binary/BinaryClassUpgrader.js";
8
+ //# sourceMappingURL=GroomSerializationUpgrader_1_2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroomSerializationUpgrader_1_2.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/hair/GroomSerializationUpgrader_1_2.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;CA4BC;oCA3CmC,iDAAiD"}
@@ -0,0 +1,44 @@
1
+ import { BinaryClassUpgrader } from "../../ecs/storage/binary/BinaryClassUpgrader.js";
2
+ import { groom_bake_shelter } from "./groom_bake_shelter.js";
3
+ import { groom_root_spacing } from "./groom_root_spacing.js";
4
+ import {
5
+ groom_read_group_v0,
6
+ groom_read_guides,
7
+ groom_write_group_v0,
8
+ groom_write_guides,
9
+ groom_write_shelter
10
+ } from "./GroomSerializationAdapter.js";
11
+
12
+ /**
13
+ * A version 1 groom as version 2: each group and its guides as they were, followed by how it shelters itself from the
14
+ * air as `groom_bake_shelter` works it out with nothing solid about the hair.
15
+ */
16
+ export class GroomSerializationUpgrader_1_2 extends BinaryClassUpgrader {
17
+ __startVersion = 1;
18
+ __targetVersion = 2;
19
+
20
+ /**
21
+ * @param {import("../../../core/binary/BinaryBuffer.js").BinaryBuffer} source
22
+ * @param {import("../../../core/binary/BinaryBuffer.js").BinaryBuffer} target
23
+ */
24
+ upgrade(source, target) {
25
+ const count = source.readUint32();
26
+
27
+ target.writeUint32(count);
28
+
29
+ for (let g = 0; g < count; g++) {
30
+ const group = groom_read_group_v0(source);
31
+
32
+ groom_read_guides(source, group);
33
+
34
+ // not written, and what the bake takes its cells from
35
+ group.root_spacing = groom_root_spacing(group);
36
+
37
+ groom_bake_shelter(group, null);
38
+
39
+ groom_write_group_v0(target, group);
40
+ groom_write_guides(target, group);
41
+ groom_write_shelter(target, group);
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Work out how a group's hair shelters itself from the air, from its strands at rest: for every node of every guide,
3
+ * how much hair stands between it and the open air along each axis ({@link GroomGroup#guide_shelter}); and for the
4
+ * group, the area it stands in the wind's way with ({@link GroomGroup#silhouette}) and its fibres' length
5
+ * ({@link GroomGroup#fibre_length}). The guides are to be chosen already (`groom_build_guides`).
6
+ *
7
+ * **The hair as a density.** Every strand's frontal area, its length times the group's mean width, is laid into a
8
+ * grid a cell at a time, as frontal area a unit volume, and the grid is averaged with a 3 × 3 × 3 box so no one
9
+ * strand stands out of it. A cell is as wide as the wisp a guide stands for, the mean of the guides' diameters, or
10
+ * as the strands grow apart ({@link GroomGroup#root_spacing}) where that is wider, and wider still where the grid
11
+ * would pass {@link GROOM_SHELTER_CELL_LIMIT}.
12
+ *
13
+ * **A node's depths.** Air crossing hair is slowed by the fibres' drag: over a path whose frontal area a unit area
14
+ * crossed is `N`, a wind keeps `e^(−C_d N / 2)` of its speed, `C_d` a fibre's drag coefficient at that speed.
15
+ * A node keeps `N` along the way out toward each of +x, −x, +y, −y, +z and −z, from where it is to the grid's edge,
16
+ * and the wind's speed is applied by whoever reads them. A cell `solid` reaches into is one nothing passes
17
+ * (`shape3_voxelize_to_grid`), and a depth stops at {@link GROOM_SHELTER_OPAQUE}.
18
+ *
19
+ * **The silhouette.** The cells any strand passes through, seen along each axis, give three areas; the mean over
20
+ * every direction is taken of the ellipsoid with those three, whose area seen along a unit `n` is
21
+ * `√((A_x n_x)² + (A_y n_y)² + (A_z n_z)²)`.
22
+ *
23
+ * @param {import("./Groom.js").GroomGroup} group with its points and its guides
24
+ * @param {import("../../../core/geom/3d/shape/AbstractShape3D.js").AbstractShape3D|null} [solid] what the air does
25
+ * not pass, in the group's metres: the head the hair grows on
26
+ */
27
+ export function groom_bake_shelter(group: import("./Groom.js").GroomGroup, solid?: import("../../../core/geom/3d/shape/AbstractShape3D.js").AbstractShape3D | null): void;
28
+ /**
29
+ * The most cells the bake's grid has, a safety net: a group whose cells would be more takes larger ones.
30
+ * @type {number}
31
+ */
32
+ export const GROOM_SHELTER_CELL_LIMIT: number;
33
+ //# sourceMappingURL=groom_bake_shelter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groom_bake_shelter.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/hair/groom_bake_shelter.js"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,0CAJW,OAAO,YAAY,EAAE,UAAU,UAC/B,OAAO,gDAAgD,EAAE,eAAe,GAAC,IAAI,QA2NvF;AA1RD;;;GAGG;AACH,uCAFU,MAAM,CAEgC"}