@woosh/meep-engine 3.78.3 → 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 (248) 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/graphics/hair/groom_bind_to_mesh.d.ts +1 -1
  15. package/src/engine/graphics/hair/groom_bind_to_mesh.js +1 -1
  16. package/src/engine/graphics/hair/groom_build_guides.d.ts +1 -1
  17. package/src/engine/graphics/hair/groom_build_guides.js +1 -1
  18. package/src/engine/graphics/impostors/voxel/README.md +11 -11
  19. package/src/engine/physics/cloth/collider/ClothColliderKind.js +1 -1
  20. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +1 -1
  21. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +1 -1
  22. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts +2 -3
  23. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts.map +1 -1
  24. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js +2 -3
  25. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts +0 -2
  26. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts.map +1 -1
  27. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +0 -5
  28. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.d.ts.map +1 -1
  29. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.js +5 -3
  30. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.d.ts.map +1 -1
  31. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js +5 -3
  32. package/src/generation/grid/coords/grid_to_texel.d.ts +7 -1
  33. package/src/generation/grid/coords/grid_to_texel.d.ts.map +1 -1
  34. package/src/generation/grid/coords/grid_to_texel.js +11 -1
  35. package/src/generation/grid/coords/grid_to_texel_span.d.ts +15 -0
  36. package/src/generation/grid/coords/grid_to_texel_span.d.ts.map +1 -0
  37. package/src/generation/grid/coords/grid_to_texel_span.js +38 -0
  38. package/src/generation/grid/coords/texel_to_grid.d.ts +2 -1
  39. package/src/generation/grid/coords/texel_to_grid.d.ts.map +1 -1
  40. package/src/generation/grid/coords/texel_to_grid.js +6 -1
  41. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts +32 -1
  42. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts.map +1 -1
  43. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.js +114 -9
  44. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts +8 -0
  45. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
  46. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +91 -29
  47. package/src/generation/grid/layers/GridDataLayer.d.ts +21 -2
  48. package/src/generation/grid/layers/GridDataLayer.d.ts.map +1 -1
  49. package/src/generation/grid/layers/GridDataLayer.js +43 -4
  50. package/src/generation/placement/action/GridCellActionPlaceTags.d.ts +7 -1
  51. package/src/generation/placement/action/GridCellActionPlaceTags.d.ts.map +1 -1
  52. package/src/generation/placement/action/GridCellActionPlaceTags.js +42 -16
  53. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts +5 -0
  54. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts.map +1 -1
  55. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +32 -9
  56. package/src/generation/rules/CellMatcherLayerBitMaskTest.d.ts.map +1 -1
  57. package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -2
  58. package/src/generation/wfc/GridWFCCompiledTileSet.d.ts +4 -2
  59. package/src/generation/wfc/GridWFCCompiledTileSet.d.ts.map +1 -1
  60. package/src/generation/wfc/GridWFCCompiledTileSet.js +2 -2
  61. package/src/generation/wfc/GridWFCTileSet.d.ts +16 -7
  62. package/src/generation/wfc/GridWFCTileSet.d.ts.map +1 -1
  63. package/src/generation/wfc/GridWFCTileSet.js +32 -8
  64. package/src/shade/playground/contact_shadows/shader_contact_lab_composite.js +2 -2
  65. package/src/shade/playground/particle_editor/README.md +2 -2
  66. package/src/shade/playground/probe_clipmap/index.html +1 -1
  67. package/src/shade/playground/screen_probes/README.md +5 -5
  68. package/src/shade/playground/screen_probes/main.js +1 -1
  69. package/src/shade/playground/tonemap_sdr/README.md +3 -2
  70. package/src/shade/playground/vgeo_scene/README.md +1 -3
  71. package/src/shade/playground/vgeo_scene/main.js +3 -3
  72. package/src/shade/renderer/Renderer.d.ts +3 -3
  73. package/src/shade/renderer/Renderer.js +4 -4
  74. package/src/shade/renderer/ShadeIndirectLightingMode.js +1 -1
  75. package/src/shade/renderer/camera/PerspectiveCamera.js +1 -1
  76. package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts +11 -13
  77. package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -1
  78. package/src/shade/renderer/deferred/tonemap/ColorGrade.js +11 -13
  79. package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.d.ts.map +1 -1
  80. package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.js +6 -7
  81. package/src/shade/renderer/deferred/tonemap/ToneMapper.d.ts +1 -1
  82. package/src/shade/renderer/deferred/tonemap/ToneMapper.js +1 -1
  83. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts +6 -8
  84. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts.map +1 -1
  85. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.js +7 -10
  86. package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts +1 -1
  87. package/src/shade/renderer/geometry/sdf/MESH_SDF.js +1 -1
  88. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts +1 -1
  89. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +1 -1
  90. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts +1 -1
  91. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +1 -1
  92. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts +1 -2
  93. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
  94. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +1 -2
  95. package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.d.ts.map +1 -1
  96. package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.js +2 -1
  97. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts +1 -1
  98. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.js +1 -1
  99. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_cluster_graph.js +1 -1
  100. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts +2 -2
  101. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.js +2 -2
  102. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts +2 -2
  103. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js +4 -4
  104. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.d.ts +1 -1
  105. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.js +1 -1
  106. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +1 -1
  107. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts +3 -3
  108. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js +3 -3
  109. package/src/shade/renderer/global_illumination/brick4/README.md +2 -1
  110. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +4 -6
  111. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  112. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +4 -6
  113. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.d.ts +1 -1
  114. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.js +1 -1
  115. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -1
  116. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +2 -2
  117. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +1 -1
  118. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +1 -1
  119. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +1 -1
  120. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +1 -1
  121. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +28 -35
  122. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
  123. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +28 -35
  124. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +21 -24
  125. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  126. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +21 -24
  127. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts +8 -8
  128. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +8 -8
  129. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.d.ts +4 -4
  130. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.js +4 -4
  131. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts +3 -5
  132. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts.map +1 -1
  133. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.js +3 -5
  134. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.d.ts +4 -4
  135. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.js +4 -4
  136. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +2 -3
  137. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -1
  138. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +2 -3
  139. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.d.ts +4 -4
  140. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.js +4 -4
  141. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts +2 -4
  142. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts.map +1 -1
  143. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.js +2 -4
  144. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts +2 -4
  145. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts.map +1 -1
  146. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.js +2 -4
  147. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +13 -17
  148. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
  149. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +13 -17
  150. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts +11 -14
  151. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts.map +1 -1
  152. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.js +11 -14
  153. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.d.ts +2 -2
  154. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.js +2 -2
  155. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.d.ts +9 -9
  156. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.js +9 -9
  157. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +15 -18
  158. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
  159. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +16 -19
  160. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts +10 -11
  161. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts.map +1 -1
  162. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.js +11 -12
  163. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +9 -8
  164. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -1
  165. package/src/shade/renderer/hair/chunk_hair_bsdf.js +10 -9
  166. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +5 -6
  167. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -1
  168. package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +5 -6
  169. package/src/shade/renderer/hair/hair_lighting.d.ts +3 -3
  170. package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -1
  171. package/src/shade/renderer/hair/hair_lighting.js +4 -5
  172. package/src/shade/renderer/hair/hair_scattering_lut.d.ts +5 -5
  173. package/src/shade/renderer/hair/hair_scattering_lut.js +5 -5
  174. package/src/shade/renderer/hair/shader_hair_roots.d.ts +2 -2
  175. package/src/shade/renderer/hair/shader_hair_roots.js +2 -2
  176. package/src/shade/renderer/light/environment/DEFINES.d.ts +1 -1
  177. package/src/shade/renderer/light/environment/DEFINES.js +1 -1
  178. package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_blurred.js +2 -2
  179. package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts +1 -2
  180. package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts.map +1 -1
  181. package/src/shade/renderer/material/dispatch/MaterialDispatch.js +1 -2
  182. package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
  183. package/src/shade/renderer/material/standard/fragment_gbuffer.js +2 -1
  184. package/src/shade/renderer/material/util/dielectric_specular_color.d.ts +1 -1
  185. package/src/shade/renderer/material/util/dielectric_specular_color.js +1 -1
  186. package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.d.ts +1 -1
  187. package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.js +1 -1
  188. package/src/shade/renderer/postprocess/dof/gather/DOF2_PRESETS.js +1 -1
  189. package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.d.ts +1 -1
  190. package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.js +1 -1
  191. package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.d.ts +1 -1
  192. package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.js +1 -1
  193. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +3 -4
  194. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
  195. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +3 -4
  196. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +1 -1
  197. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +1 -1
  198. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts +1 -1
  199. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +1 -1
  200. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
  201. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +2 -3
  202. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts +1 -2
  203. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts.map +1 -1
  204. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.js +1 -2
  205. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts +2 -3
  206. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts.map +1 -1
  207. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.js +2 -3
  208. package/src/shade/renderer/postprocess/taa/filter_blackman_harris.d.ts +1 -1
  209. package/src/shade/renderer/postprocess/taa/filter_blackman_harris.js +1 -1
  210. package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.d.ts +1 -1
  211. package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.js +1 -1
  212. package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.js +1 -1
  213. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +3 -3
  214. package/src/shade/renderer/restir/di/ReSTIRDI.js +3 -3
  215. package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.d.ts +1 -1
  216. package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.js +1 -1
  217. package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.d.ts +1 -1
  218. package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.js +1 -1
  219. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +1 -2
  220. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
  221. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +1 -2
  222. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts +4 -5
  223. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts.map +1 -1
  224. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.js +4 -5
  225. package/src/shade/renderer/shader/chunk/color/grade/chunk_color_grade.js +2 -2
  226. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts +2 -2
  227. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.js +2 -2
  228. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts +14 -17
  229. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts.map +1 -1
  230. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js +18 -21
  231. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.d.ts +1 -1
  232. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.js +1 -1
  233. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.d.ts +1 -1
  234. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.js +1 -1
  235. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +3 -4
  236. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
  237. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +3 -4
  238. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.d.ts +1 -1
  239. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +1 -1
  240. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +3 -3
  241. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts +6 -8
  242. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts.map +1 -1
  243. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.js +8 -10
  244. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts +5 -7
  245. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts.map +1 -1
  246. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.js +5 -7
  247. package/src/shade/renderer/texture/virtual/README.md +257 -257
  248. 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.3",
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
  */
@@ -19,7 +19,7 @@
19
19
  export function groom_mesh_binder(geometry: import("../../../shade/renderer/geometry/MeshletGeometry.js").MeshletGeometry): GroomMeshBinder;
20
20
  /**
21
21
  * Bind each strand of a group to the nearest triangle of a mesh at its bind pose: the triangle, the root's
22
- * barycentrics on it, and the triangle's frame (Unreal's: the tangent along the first edge, the normal of the face,
22
+ * barycentrics on it, and the triangle's frame (the tangent along the first edge, the normal of the face,
23
23
  * the bitangent between them) with the root's point as its origin. Every frame the same triangle of the deformed
24
24
  * mesh gives the frame again, and the strand rides the turn and the move from the rest frame to it.
25
25
  *
@@ -98,7 +98,7 @@ export function groom_mesh_binder(geometry) {
98
98
 
99
99
  /**
100
100
  * Bind each strand of a group to the nearest triangle of a mesh at its bind pose: the triangle, the root's
101
- * barycentrics on it, and the triangle's frame (Unreal's: the tangent along the first edge, the normal of the face,
101
+ * barycentrics on it, and the triangle's frame (the tangent along the first edge, the normal of the face,
102
102
  * the bitangent between them) with the root's point as its origin. Every frame the same triangle of the deformed
103
103
  * mesh gives the frame again, and the strand rides the turn and the move from the rest frame to it.
104
104
  *
@@ -36,7 +36,7 @@ export function groom_build_guides(group: import("./Groom.js").GroomGroup, toler
36
36
  /**
37
37
  * The wisp tolerance an import gives its groups when it is given none, metres: strands that stay within a centimetre
38
38
  * of one another along their whole length move as one wisp. On the test scalp, whose strands each wave on their own,
39
- * a fifth of the strands guide; Unreal makes a tenth of them guides by default.
39
+ * a fifth of the strands guide.
40
40
  * @type {number}
41
41
  */
42
42
  export const GROOM_GUIDE_DEFAULT_TOLERANCE: number;
@@ -4,7 +4,7 @@ import { GROOM_GUIDE_LIMIT } from "./Groom.js";
4
4
  /**
5
5
  * The wisp tolerance an import gives its groups when it is given none, metres: strands that stay within a centimetre
6
6
  * of one another along their whole length move as one wisp. On the test scalp, whose strands each wave on their own,
7
- * a fifth of the strands guide; Unreal makes a tenth of them guides by default.
7
+ * a fifth of the strands guide.
8
8
  * @type {number}
9
9
  */
10
10
  export const GROOM_GUIDE_DEFAULT_TOLERANCE = 0.01;
@@ -1,15 +1,15 @@
1
1
  # Voxel Impostor system
2
2
 
3
- Point-based ("voxel" / surfel) impostor inspired by the **Nanite Voxels**
4
- representation Epic and CD Projekt RED showed in the Witcher 4 / Unreal
5
- Engine 5 tech demo (Unreal Fest Stockholm 2025). At distance, dense
6
- alpha-tested foliage cards stop scaling cleanly — the new technique
7
- replaces them with a cloud of near-pixel-sized splats, each carrying a
8
- full G-buffer slice, so the LOD never has to fall back to a flat card.
3
+ Point-based ("voxel" / surfel) impostor. At distance, dense alpha-tested
4
+ foliage cards stop scaling cleanly — this technique replaces them with a
5
+ cloud of near-pixel-sized splats, each carrying a full G-buffer slice, so
6
+ the LOD never has to fall back to a flat card. A voxel representation of
7
+ distant foliage was presented publicly in the Witcher 4 tech demo talk
8
+ at Unreal Fest Stockholm 2025 (see References).
9
9
 
10
- This implementation is much simpler than UE's production system (we
11
- don't do streaming, meshlet hierarchy, or front-to-back depth binning),
12
- but the data model and rendering approach are the same:
10
+ This implementation is deliberately simple (no streaming, meshlet
11
+ hierarchy, or front-to-back depth binning). Its data model and rendering
12
+ approach:
13
13
 
14
14
  - Each "voxel" is a single splat with the same world-space size.
15
15
  - Per-splat attributes: position, normal, albedo, ORM (occlusion,
@@ -95,8 +95,8 @@ Shader set:
95
95
  | `VoxelImpostorShaderViewportDepthV0` | Debug — viewport depth as grayscale. |
96
96
 
97
97
  A `uDiscMask` uniform toggles between square and circular splats; the
98
- prototype harness uses square for slot 0 (matches the Witcher 4 "voxel"
99
- look) and disc for slot 1 (clearer view of the point distribution).
98
+ prototype harness uses square for slot 0 (the blocky "voxel" look) and
99
+ disc for slot 1 (clearer view of the point distribution).
100
100
 
101
101
  ---
102
102
 
@@ -4,7 +4,7 @@ import { ShapeRecordKind } from "../../../../core/geom/3d/shape/record/ShapeReco
4
4
  * The shapes cloth collides against.
5
5
  *
6
6
  * §8.2: analytic primitives only, which is universal in shipping cloth systems
7
- * — MagicaCloth2 offers sphere, capsule and plane; Chaos Cloth adds tapered
7
+ * — MagicaCloth2 offers sphere, capsule and plane; others add tapered
8
8
  * capsules and convex hulls — and is what makes the inner loop a handful of
9
9
  * arithmetic instead of a BVH descent. A `Collider` carrying a mesh or a
10
10
  * heightmap is skipped with one warning naming the entity, and the documented
@@ -15,7 +15,7 @@ export function cloth_edge_incidence(node_count: number, edge: Int32Array): {
15
15
  * edges, and which source that is.
16
16
  *
17
17
  * A node marked in `blocked` can be reached but is never passed through.
18
- * That is Chaos Cloth's rule for its long-range attachments:
18
+ * That is the rule for long-range attachments:
19
19
  * a path from one island of held particles does not run through another, because
20
20
  * the far side of another island is that island's business.
21
21
  *
@@ -66,7 +66,7 @@ export function cloth_edge_incidence(node_count, edge) {
66
66
  * edges, and which source that is.
67
67
  *
68
68
  * A node marked in `blocked` can be reached but is never passed through.
69
- * That is Chaos Cloth's rule for its long-range attachments:
69
+ * That is the rule for long-range attachments:
70
70
  * a path from one island of held particles does not run through another, because
71
71
  * the far side of another island is that island's business.
72
72
  *
@@ -16,9 +16,8 @@
16
16
  * without adding geometry: the plane is anchored to the particle's own
17
17
  * *animated* position and its own surface normal, both of which the garment
18
18
  * already knows, so it is a bound the mesh carries with it rather than a shape
19
- * somebody has to author. Chaos Cloth ships the same thing under the same name
20
- * and for the same reason (§15), and §7 P3 leans on it as one of the three
21
- * layers that stop a garment tunnelling through a character.
19
+ * somebody has to author. §7 P3 leans on it as one of the three layers that
20
+ * stop a garment tunnelling through a character.
22
21
  *
23
22
  * It is deliberately **not** a substitute for collision. A backstop is a plane
24
23
  * per particle: it knows which way is out and nothing about what is actually
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_backstop_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH;;;;;;;;;;;GAWG;AACH,kDANW,YAAY,GAAC,MAAM,EAAE,mBACrB,MAAM,0BAEN,MAAM,GACJ,MAAM,CAuBlB;AAED;;;;;;GAMG;AACH,uDAJW,YAAY,+BAEZ,MAAM,QA8EhB;AAED;;;;;;;;;;GAUG;AACH,oEANW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,QAuChB;AAED;;;;;;;GAOG;AACH,oEAJW,MAAM,eACN,MAAM,qBACN,MAAM,QA2ChB"}
1
+ {"version":3,"file":"cloth_backstop_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH;;;;;;;;;;;GAWG;AACH,kDANW,YAAY,GAAC,MAAM,EAAE,mBACrB,MAAM,0BAEN,MAAM,GACJ,MAAM,CAuBlB;AAED;;;;;;GAMG;AACH,uDAJW,YAAY,+BAEZ,MAAM,QA8EhB;AAED;;;;;;;;;;GAUG;AACH,oEANW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,QAuChB;AAED;;;;;;;GAOG;AACH,oEAJW,MAAM,eACN,MAAM,qBACN,MAAM,QA2ChB"}
@@ -28,9 +28,8 @@ import {
28
28
  * without adding geometry: the plane is anchored to the particle's own
29
29
  * *animated* position and its own surface normal, both of which the garment
30
30
  * already knows, so it is a bound the mesh carries with it rather than a shape
31
- * somebody has to author. Chaos Cloth ships the same thing under the same name
32
- * and for the same reason (§15), and §7 P3 leans on it as one of the three
33
- * layers that stop a garment tunnelling through a character.
31
+ * somebody has to author. §7 P3 leans on it as one of the three layers that
32
+ * stop a garment tunnelling through a character.
34
33
  *
35
34
  * It is deliberately **not** a substitute for collision. A backstop is a plane
36
35
  * per particle: it knows which way is out and nothing about what is actually
@@ -10,8 +10,6 @@ export class AbstractCellFilterSampleGridLayer extends CellFilter {
10
10
  * @private
11
11
  */
12
12
  private __layer;
13
- __u_scale: number;
14
- __v_scale: number;
15
13
  /**
16
14
  *
17
15
  * @type {Sampler2D}
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractCellFilterSampleGridLayer.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js"],"names":[],"mappings":"AAEA;IAGI;;;OAGG;IACH,SAFU,MAAM,CAED;IAEf;;;;OAIG;IACH,gBAAe;IAEf,kBAAc;IACd,kBAAc;IACd;;;;OAIG;IACH,kBAAiB;IAGjB,uCAgBC;CAEJ;2BA9C0B,qBAAqB"}
1
+ {"version":3,"file":"AbstractCellFilterSampleGridLayer.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js"],"names":[],"mappings":"AAEA;IAGI;;;OAGG;IACH,SAFU,MAAM,CAED;IAEf;;;;OAIG;IACH,gBAAe;IAEf;;;;OAIG;IACH,kBAAiB;IAGjB,uCAaC;CAEJ;2BAzC0B,qBAAqB"}
@@ -16,8 +16,6 @@ export class AbstractCellFilterSampleGridLayer extends CellFilter {
16
16
  */
17
17
  __layer = null;
18
18
 
19
- __u_scale = 0;
20
- __v_scale = 0;
21
19
  /**
22
20
  *
23
21
  * @type {Sampler2D}
@@ -39,9 +37,6 @@ export class AbstractCellFilterSampleGridLayer extends CellFilter {
39
37
 
40
38
  // cache required values
41
39
  this.__sampler = this.__layer.sampler;
42
-
43
- this.__u_scale = this.__sampler.width / grid.width;
44
- this.__v_scale = this.__sampler.height / grid.height;
45
40
  }
46
41
 
47
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CellFilterSampleLayerCubic.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.js"],"names":[],"mappings":"AAGA;IAEI;;;;OAIG;IACH,mBAHW,MAAM,GACJ,0BAA0B,CAUtC;IAED,uDAcC;CACJ;kDAlCiD,wCAAwC"}
1
+ {"version":3,"file":"CellFilterSampleLayerCubic.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.js"],"names":[],"mappings":"AAIA;IAEI;;;;OAIG;IACH,mBAHW,MAAM,GACJ,0BAA0B,CAUtC;IAED,uDAeC;CACJ;kDAnCiD,wCAAwC"}
@@ -1,4 +1,5 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
+ import { grid_to_texel } from "../../../grid/coords/grid_to_texel.js";
2
3
  import { AbstractCellFilterSampleGridLayer } from "./AbstractCellFilterSampleGridLayer.js";
3
4
 
4
5
  export class CellFilterSampleLayerCubic extends AbstractCellFilterSampleGridLayer {
@@ -20,9 +21,10 @@ export class CellFilterSampleLayerCubic extends AbstractCellFilterSampleGridLaye
20
21
 
21
22
  execute(grid, x, y, rotation) {
22
23
 
23
- //convert to UV
24
- const sampler_x = x * this.__u_scale;
25
- const sampler_y = y * this.__v_scale;
24
+ const layer = this.__layer;
25
+
26
+ const sampler_x = grid_to_texel(x, layer.resolution, layer.stretch);
27
+ const sampler_y = grid_to_texel(y, layer.resolution, layer.stretch);
26
28
 
27
29
 
28
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CellFilterSampleLayerLinear.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js"],"names":[],"mappings":"AAGA;IAEI;;;;OAIG;IACH,mBAHW,MAAM,GACJ,2BAA2B,CAUvC;IAED,uDAkBC;CACJ;kDAtCiD,wCAAwC"}
1
+ {"version":3,"file":"CellFilterSampleLayerLinear.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js"],"names":[],"mappings":"AAIA;IAEI;;;;OAIG;IACH,mBAHW,MAAM,GACJ,2BAA2B,CAUvC;IAED,uDAmBC;CACJ;kDAvCiD,wCAAwC"}
@@ -1,4 +1,5 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
+ import { grid_to_texel } from "../../../grid/coords/grid_to_texel.js";
2
3
  import { AbstractCellFilterSampleGridLayer } from "./AbstractCellFilterSampleGridLayer.js";
3
4
 
4
5
  export class CellFilterSampleLayerLinear extends AbstractCellFilterSampleGridLayer {
@@ -20,9 +21,10 @@ export class CellFilterSampleLayerLinear extends AbstractCellFilterSampleGridLay
20
21
 
21
22
  execute(grid, x, y, rotation) {
22
23
 
23
- //convert to UV
24
- const sampler_x = x * this.__u_scale;
25
- const sampler_y = y * this.__v_scale;
24
+ const layer = this.__layer;
25
+
26
+ const sampler_x = grid_to_texel(x, layer.resolution, layer.stretch);
27
+ const sampler_y = grid_to_texel(y, layer.resolution, layer.stretch);
26
28
 
27
29
 
28
30
  /**
@@ -1,9 +1,15 @@
1
1
  /**
2
2
  * Canonical grid → layer-texel mapping (see generation/COORDINATES.md).
3
3
  * Integer grid coordinates are cell centers, integer texel coordinates are texel centers.
4
+ *
5
+ * Unstretched, texel `t` is centred on grid `t / resolution`, so texel 0 sits on cell 0. Stretched, the layer is laid
6
+ * over the grid from its first corner and texel `t` covers cells `t / resolution` up to `(t + 1) / resolution`. At
7
+ * resolution 1 both are the identity.
8
+ *
4
9
  * @param {number} v grid coordinate
5
10
  * @param {number} resolution texels per grid cell ({@link GridDataLayer#resolution})
11
+ * @param {boolean} stretch {@link GridDataLayer#stretch}
6
12
  * @returns {number} texel coordinate
7
13
  */
8
- export function grid_to_texel(v: number, resolution: number): number;
14
+ export function grid_to_texel(v: number, resolution: number, stretch: boolean): number;
9
15
  //# sourceMappingURL=grid_to_texel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid_to_texel.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/coords/grid_to_texel.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,iCAJW,MAAM,cACN,MAAM,GACJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"grid_to_texel.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/coords/grid_to_texel.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,iCALW,MAAM,cACN,MAAM,WACN,OAAO,GACL,MAAM,CAQlB"}
@@ -1,10 +1,20 @@
1
1
  /**
2
2
  * Canonical grid → layer-texel mapping (see generation/COORDINATES.md).
3
3
  * Integer grid coordinates are cell centers, integer texel coordinates are texel centers.
4
+ *
5
+ * Unstretched, texel `t` is centred on grid `t / resolution`, so texel 0 sits on cell 0. Stretched, the layer is laid
6
+ * over the grid from its first corner and texel `t` covers cells `t / resolution` up to `(t + 1) / resolution`. At
7
+ * resolution 1 both are the identity.
8
+ *
4
9
  * @param {number} v grid coordinate
5
10
  * @param {number} resolution texels per grid cell ({@link GridDataLayer#resolution})
11
+ * @param {boolean} stretch {@link GridDataLayer#stretch}
6
12
  * @returns {number} texel coordinate
7
13
  */
8
- export function grid_to_texel(v, resolution) {
14
+ export function grid_to_texel(v, resolution, stretch) {
15
+ if (stretch) {
16
+ return (v + 0.5) * resolution - 0.5;
17
+ }
18
+
9
19
  return v * resolution;
10
20
  }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The texels along one axis that a write at grid coordinate `v` sets, as `[first, last]` in `result`.
3
+ *
4
+ * Unstretched, the texel nearest `v`. Stretched, every texel whose centre lies in the cell holding `v`: on a layer
5
+ * finer than the grid, all of that cell's texels, so the cell reads back what was written wherever a reader samples
6
+ * it; on a coarser one, where a cell holds no texel centre, the texel holding the cell. At resolution 1 both are the
7
+ * texel of the cell. The span may reach outside the layer; bounding it is the caller's.
8
+ *
9
+ * @param {number[]|Int32Array} result
10
+ * @param {number} v grid coordinate
11
+ * @param {number} resolution texels per grid cell ({@link GridDataLayer#resolution})
12
+ * @param {boolean} stretch {@link GridDataLayer#stretch}
13
+ */
14
+ export function grid_to_texel_span(result: number[] | Int32Array, v: number, resolution: number, stretch: boolean): void;
15
+ //# sourceMappingURL=grid_to_texel_span.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid_to_texel_span.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/coords/grid_to_texel_span.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,2CALW,MAAM,EAAE,GAAC,UAAU,KACnB,MAAM,cACN,MAAM,WACN,OAAO,QAwBjB"}
@@ -0,0 +1,38 @@
1
+ import { grid_to_texel } from "./grid_to_texel.js";
2
+
3
+ /**
4
+ * The texels along one axis that a write at grid coordinate `v` sets, as `[first, last]` in `result`.
5
+ *
6
+ * Unstretched, the texel nearest `v`. Stretched, every texel whose centre lies in the cell holding `v`: on a layer
7
+ * finer than the grid, all of that cell's texels, so the cell reads back what was written wherever a reader samples
8
+ * it; on a coarser one, where a cell holds no texel centre, the texel holding the cell. At resolution 1 both are the
9
+ * texel of the cell. The span may reach outside the layer; bounding it is the caller's.
10
+ *
11
+ * @param {number[]|Int32Array} result
12
+ * @param {number} v grid coordinate
13
+ * @param {number} resolution texels per grid cell ({@link GridDataLayer#resolution})
14
+ * @param {boolean} stretch {@link GridDataLayer#stretch}
15
+ */
16
+ export function grid_to_texel_span(result, v, resolution, stretch) {
17
+ if (stretch) {
18
+ const cell = Math.round(v);
19
+
20
+ // texel t is centred at grid (t + 1/2) / resolution - 1/2, inside the cell from cell - 1/2 to cell + 1/2
21
+ const first = Math.ceil(cell * resolution - 0.5);
22
+ const last = Math.ceil((cell + 1) * resolution - 0.5) - 1;
23
+
24
+ if (first <= last) {
25
+ result[0] = first;
26
+ result[1] = last;
27
+
28
+ return;
29
+ }
30
+
31
+ v = cell;
32
+ }
33
+
34
+ const nearest = Math.round(grid_to_texel(v, resolution, stretch));
35
+
36
+ result[0] = nearest;
37
+ result[1] = nearest;
38
+ }
@@ -3,7 +3,8 @@
3
3
  * Inverse of {@link grid_to_texel}.
4
4
  * @param {number} v texel coordinate
5
5
  * @param {number} resolution texels per grid cell ({@link GridDataLayer#resolution})
6
+ * @param {boolean} stretch {@link GridDataLayer#stretch}
6
7
  * @returns {number} grid coordinate
7
8
  */
8
- export function texel_to_grid(v: number, resolution: number): number;
9
+ export function texel_to_grid(v: number, resolution: number, stretch: boolean): number;
9
10
  //# sourceMappingURL=texel_to_grid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"texel_to_grid.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/coords/texel_to_grid.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,iCAJW,MAAM,cACN,MAAM,GACJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"texel_to_grid.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/coords/texel_to_grid.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,iCALW,MAAM,cACN,MAAM,WACN,OAAO,GACL,MAAM,CAQlB"}
@@ -3,8 +3,13 @@
3
3
  * Inverse of {@link grid_to_texel}.
4
4
  * @param {number} v texel coordinate
5
5
  * @param {number} resolution texels per grid cell ({@link GridDataLayer#resolution})
6
+ * @param {boolean} stretch {@link GridDataLayer#stretch}
6
7
  * @returns {number} grid coordinate
7
8
  */
8
- export function texel_to_grid(v, resolution) {
9
+ export function texel_to_grid(v, resolution, stretch) {
10
+ if (stretch) {
11
+ return (v + 0.5) / resolution - 0.5;
12
+ }
13
+
9
14
  return v / resolution;
10
15
  }