@woosh/meep-engine 2.164.0 → 2.165.1

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 (451) hide show
  1. package/README.md +137 -108
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/build/bundle-worker-terrain.js +1 -1
  4. package/package.json +1 -1
  5. package/samples/generation/SampleGenerator0.js +3 -3
  6. package/samples/generation/filters/SampleGroundMoistureFilter.js +63 -56
  7. package/samples/generation/filters/SampleNoise20_0.js +6 -1
  8. package/samples/generation/themes/SampleTheme0.js +47 -47
  9. package/src/core/binary/BitImage2.d.ts +91 -0
  10. package/src/core/binary/BitImage2.d.ts.map +1 -0
  11. package/src/core/binary/BitImage2.js +242 -0
  12. package/src/core/color/YCoCg/rgb_to_ycocg.d.ts +17 -0
  13. package/src/core/color/YCoCg/rgb_to_ycocg.d.ts.map +1 -0
  14. package/src/core/color/YCoCg/rgb_to_ycocg.js +20 -0
  15. package/src/core/color/YCoCg/ycocg_to_rgb.d.ts +14 -0
  16. package/src/core/color/YCoCg/ycocg_to_rgb.d.ts.map +1 -0
  17. package/src/core/color/YCoCg/ycocg_to_rgb.js +17 -0
  18. package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts +22 -0
  19. package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts.map +1 -0
  20. package/src/core/geom/2d/oriented-box/min_area_rect_2d.js +69 -0
  21. package/src/core/geom/2d/packing/skyline.d.ts +116 -0
  22. package/src/core/geom/2d/packing/skyline.d.ts.map +1 -0
  23. package/src/core/geom/2d/packing/skyline.js +258 -0
  24. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts +18 -0
  25. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts.map +1 -0
  26. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.js +86 -0
  27. package/src/core/geom/3d/atlas/ATLAS_PORT_PLAN.md +486 -0
  28. package/src/core/geom/3d/atlas/BFF_PLAN.md +174 -0
  29. package/src/core/geom/3d/atlas/Chart.d.ts +58 -0
  30. package/src/core/geom/3d/atlas/Chart.d.ts.map +1 -0
  31. package/src/core/geom/3d/atlas/Chart.js +77 -0
  32. package/src/core/geom/3d/atlas/REVIEW_02.md +392 -0
  33. package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts +73 -0
  34. package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts.map +1 -0
  35. package/src/core/geom/3d/atlas/atlas_bench_lib.js +315 -0
  36. package/src/core/geom/3d/atlas/atlas_chart_type.d.ts +17 -0
  37. package/src/core/geom/3d/atlas/atlas_chart_type.d.ts.map +1 -0
  38. package/src/core/geom/3d/atlas/atlas_chart_type.js +16 -0
  39. package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts +25 -0
  40. package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts.map +1 -0
  41. package/src/core/geom/3d/atlas/atlas_compute_charts.js +188 -0
  42. package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts +17 -0
  43. package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts.map +1 -0
  44. package/src/core/geom/3d/atlas/atlas_extract_chart.js +107 -0
  45. package/src/core/geom/3d/atlas/atlas_generate.d.ts +39 -0
  46. package/src/core/geom/3d/atlas/atlas_generate.d.ts.map +1 -0
  47. package/src/core/geom/3d/atlas/atlas_generate.js +43 -0
  48. package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts +84 -0
  49. package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts.map +1 -0
  50. package/src/core/geom/3d/atlas/atlas_test_fixtures.js +266 -0
  51. package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts +25 -0
  52. package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts.map +1 -0
  53. package/src/core/geom/3d/atlas/atlas_write_chart_uvs.js +36 -0
  54. package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts +22 -0
  55. package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts.map +1 -0
  56. package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.js +62 -0
  57. package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts +9 -0
  58. package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts.map +1 -0
  59. package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.js +33 -0
  60. package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts +9 -0
  61. package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts.map +1 -0
  62. package/src/core/geom/3d/atlas/data/atlas_build_face_areas.js +50 -0
  63. package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts +27 -0
  64. package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts.map +1 -0
  65. package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.js +39 -0
  66. package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts +22 -0
  67. package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts.map +1 -0
  68. package/src/core/geom/3d/atlas/io/bt_loop_uv.js +57 -0
  69. package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts +36 -0
  70. package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts.map +1 -0
  71. package/src/core/geom/3d/atlas/pack/ChartPlacement.js +46 -0
  72. package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts +62 -0
  73. package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts.map +1 -0
  74. package/src/core/geom/3d/atlas/pack/atlas_pack_charts.js +551 -0
  75. package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts +22 -0
  76. package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts.map +1 -0
  77. package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.js +73 -0
  78. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts +37 -0
  79. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts.map +1 -0
  80. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.js +270 -0
  81. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts +23 -0
  82. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts.map +1 -0
  83. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.js +224 -0
  84. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts +14 -0
  85. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts.map +1 -0
  86. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.js +38 -0
  87. package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts +22 -0
  88. package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts.map +1 -0
  89. package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.js +86 -0
  90. package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts +20 -0
  91. package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts.map +1 -0
  92. package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.js +183 -0
  93. package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts +27 -0
  94. package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts.map +1 -0
  95. package/src/core/geom/3d/atlas/param/fit_plane_basis.js +66 -0
  96. package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts +31 -0
  97. package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts.map +1 -0
  98. package/src/core/geom/3d/atlas/segment/RegionGraph.js +40 -0
  99. package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts +23 -0
  100. package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts.map +1 -0
  101. package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.js +136 -0
  102. package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts +24 -0
  103. package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts.map +1 -0
  104. package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.js +77 -0
  105. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts +27 -0
  106. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts.map +1 -0
  107. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.js +113 -0
  108. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts +44 -0
  109. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts.map +1 -0
  110. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.js +275 -0
  111. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts +22 -0
  112. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts.map +1 -0
  113. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.js +199 -0
  114. package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts +32 -0
  115. package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts.map +1 -0
  116. package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.js +64 -0
  117. package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts +20 -0
  118. package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts.map +1 -0
  119. package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.js +66 -0
  120. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
  121. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +13 -11
  122. package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.d.ts.map +1 -1
  123. package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.js +4 -3
  124. package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.d.ts.map +1 -1
  125. package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +4 -3
  126. package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.d.ts.map +1 -1
  127. package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.js +4 -3
  128. package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.d.ts.map +1 -1
  129. package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.js +10 -6
  130. package/src/core/geom/3d/topology/struct/TopoMesh.js +2 -2
  131. package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts +0 -2
  132. package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts.map +1 -1
  133. package/src/core/geom/3d/topology/struct/TopoTriangle.js +2 -2
  134. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.d.ts.map +1 -1
  135. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.js +8 -27
  136. package/src/core/geom/vec3/v3_cotangent.d.ts +20 -0
  137. package/src/core/geom/vec3/v3_cotangent.d.ts.map +1 -0
  138. package/src/core/geom/vec3/v3_cotangent.js +29 -0
  139. package/src/core/geom/vec3/v3_matrix3_multiply.d.ts +19 -0
  140. package/src/core/geom/vec3/v3_matrix3_multiply.d.ts.map +1 -0
  141. package/src/core/geom/vec3/v3_matrix3_multiply.js +30 -0
  142. package/src/core/geom/vec3/v3_multiply.d.ts +16 -0
  143. package/src/core/geom/vec3/v3_multiply.d.ts.map +1 -0
  144. package/src/core/geom/vec3/v3_multiply.js +19 -0
  145. package/src/core/math/linalg/cg/cg_solve.d.ts +24 -0
  146. package/src/core/math/linalg/cg/cg_solve.d.ts.map +1 -0
  147. package/src/core/math/linalg/cg/cg_solve.js +106 -0
  148. package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts +21 -0
  149. package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts.map +1 -0
  150. package/src/core/math/linalg/cg/cg_solve_normal_equations.js +59 -0
  151. package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts +19 -0
  152. package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts.map +1 -0
  153. package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.js +117 -0
  154. package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts +50 -0
  155. package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts.map +1 -0
  156. package/src/core/math/linalg/sparse/SparseMatrixCSR.js +88 -0
  157. package/src/core/math/linalg/sparse/spm_matvec.d.ts +9 -0
  158. package/src/core/math/linalg/sparse/spm_matvec.d.ts.map +1 -0
  159. package/src/core/math/linalg/sparse/spm_matvec.js +22 -0
  160. package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts +12 -0
  161. package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts.map +1 -0
  162. package/src/core/math/linalg/sparse/spm_matvec_transpose.js +29 -0
  163. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.d.ts +39 -0
  164. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.js +22 -1
  165. package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.d.ts.map +1 -1
  166. package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.js +32 -9
  167. package/src/core/math/physics/mie/compute_mie_phase.d.ts +2 -3
  168. package/src/core/math/physics/mie/compute_mie_phase.d.ts.map +1 -1
  169. package/src/core/math/physics/mie/compute_mie_phase.js +1 -3
  170. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +0 -1
  171. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
  172. package/src/core/math/physics/mie/lorenz_mie_coefs.js +0 -7
  173. package/src/engine/REVIEW_2026_07_03.md +211 -0
  174. package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts.map +1 -1
  175. package/src/engine/animation/curve/actionProcessorOperations/curveActions.js +3 -2
  176. package/src/engine/animation/curve/compression/sample_animation_curve_to_float_array.js +1 -1
  177. package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts.map +1 -1
  178. package/src/engine/animation/keyed2/AnimationTrackPlayback.js +3 -1
  179. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +2 -2
  180. package/src/engine/asset/preloader/AssetPreloader.d.ts.map +1 -1
  181. package/src/engine/asset/preloader/AssetPreloader.js +6 -0
  182. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
  183. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +5 -2
  184. package/src/engine/ecs/Entity.js +1 -1
  185. package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
  186. package/src/engine/ecs/EntityComponentDataset.js +1 -0
  187. package/src/engine/ecs/EntityManager.js +1 -1
  188. package/src/engine/ecs/EntityObserver.js +1 -1
  189. package/src/engine/ecs/animation/AnimationClip.js +1 -1
  190. package/src/engine/ecs/attachment/AttachmentSystem.js +2 -2
  191. package/src/engine/ecs/attachment/TransformAttachmentBinding.d.ts.map +1 -1
  192. package/src/engine/ecs/attachment/TransformAttachmentBinding.js +14 -3
  193. package/src/engine/ecs/fow/FogOfWar.js +2 -2
  194. package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.d.ts.map +1 -1
  195. package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js +8 -0
  196. package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +3 -3
  197. package/src/engine/ecs/gui/position/ViewportPosition.d.ts +3 -1
  198. package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
  199. package/src/engine/ecs/gui/position/ViewportPosition.js +4 -1
  200. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +10 -0
  201. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts.map +1 -1
  202. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +43 -0
  203. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts +93 -0
  204. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts.map +1 -0
  205. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.js +315 -0
  206. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts +48 -0
  207. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts.map +1 -0
  208. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.js +331 -0
  209. package/src/engine/ecs/storage/binary/object-v2/DESIGN.md +199 -0
  210. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts +53 -0
  211. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts.map +1 -0
  212. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.js +57 -0
  213. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts +53 -0
  214. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts.map +1 -0
  215. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.js +56 -0
  216. package/src/engine/ecs/storage/binary/object-v2/README.md +110 -0
  217. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts +13 -0
  218. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts.map +1 -0
  219. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.js +48 -0
  220. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +29 -0
  221. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +1 -0
  222. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.js +44 -0
  223. package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
  224. package/src/engine/ecs/terrain/ecs/Terrain.js +4 -3
  225. package/src/engine/ecs/terrain/tiles/TerrainTile.js +2 -2
  226. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
  227. package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +9 -8
  228. package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
  229. package/src/engine/graphics/GraphicsEngine.js +2 -1
  230. package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts.map +1 -1
  231. package/src/engine/graphics/camera/makeScreenScissorFrustum.js +11 -10
  232. package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.d.ts.map +1 -1
  233. package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.js +3 -1
  234. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts +1 -1
  235. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts.map +1 -1
  236. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.js +2 -2
  237. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.d.ts.map +1 -1
  238. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.js +2 -0
  239. package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
  240. package/src/engine/graphics/ecs/camera/Camera.js +4 -0
  241. package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.d.ts.map +1 -1
  242. package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.js +7 -2
  243. package/src/engine/graphics/ecs/camera/set_camera_aspect_ratio.js +1 -1
  244. package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +2 -2
  245. package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +2 -2
  246. package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts.map +1 -1
  247. package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.js +4 -1
  248. package/src/engine/graphics/ecs/light/binding/LightBinding.js +2 -2
  249. package/src/engine/graphics/ecs/mesh/MeshSystem.js +1 -1
  250. package/src/engine/graphics/ecs/mesh/SkeletonUtils.js +1 -1
  251. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +2 -2
  252. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
  253. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +0 -1
  254. package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.js +1 -1
  255. package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.d.ts.map +1 -1
  256. package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.js +8 -7
  257. package/src/engine/graphics/ecs/water/WaterSystem.d.ts +6 -0
  258. package/src/engine/graphics/ecs/water/WaterSystem.d.ts.map +1 -1
  259. package/src/engine/graphics/ecs/water/WaterSystem.js +12 -1
  260. package/src/engine/graphics/geometry/MikkT/AvgTSpace.d.ts.map +1 -1
  261. package/src/engine/graphics/geometry/MikkT/AvgTSpace.js +11 -6
  262. package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.d.ts.map +1 -1
  263. package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.js +2 -3
  264. package/src/engine/graphics/geometry/MikkT/CalcTexArea.d.ts.map +1 -1
  265. package/src/engine/graphics/geometry/MikkT/CalcTexArea.js +3 -4
  266. package/src/engine/graphics/geometry/MikkT/DegenEpilogue.js +4 -4
  267. package/src/engine/graphics/geometry/MikkT/EvalTspace.d.ts.map +1 -1
  268. package/src/engine/graphics/geometry/MikkT/EvalTspace.js +11 -8
  269. package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.d.ts.map +1 -1
  270. package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.js +7 -8
  271. package/src/engine/graphics/geometry/MikkT/GenerateTSpaces.js +8 -8
  272. package/src/engine/graphics/geometry/MikkT/InitTriInfo.d.ts.map +1 -1
  273. package/src/engine/graphics/geometry/MikkT/InitTriInfo.js +30 -25
  274. package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +7 -7
  275. package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts +0 -1
  276. package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts.map +1 -1
  277. package/src/engine/graphics/geometry/MikkT/NormalizeSafe.js +6 -4
  278. package/src/engine/graphics/geometry/MikkT/STSpace.d.ts +0 -2
  279. package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
  280. package/src/engine/graphics/geometry/MikkT/STSpace.js +3 -3
  281. package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts +0 -2
  282. package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts.map +1 -1
  283. package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.js +0 -1
  284. package/src/engine/graphics/geometry/buffered/ensureGeometryBoundingSphere.js +1 -1
  285. package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.d.ts.map +1 -1
  286. package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.js +0 -15
  287. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +10 -10
  288. package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -1
  289. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts +0 -2
  290. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
  291. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +4 -3
  292. package/src/engine/graphics/impostors/octahedral/grid/HemiOctahedralUvEncoder.js +2 -2
  293. package/src/engine/graphics/impostors/octahedral/grid/UvEncoder.d.ts +17 -7
  294. package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +2 -2
  295. package/src/engine/graphics/material/SplatMaterial.js +1 -1
  296. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
  297. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +3 -2
  298. package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +1 -1
  299. package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.js +3 -3
  300. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +4 -3
  301. package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts.map +1 -1
  302. package/src/engine/graphics/particles/particular/group/ParticleGroup.js +3 -2
  303. package/src/engine/graphics/render/forward_plus/LightManager.js +2 -2
  304. package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +0 -2
  305. package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
  306. package/src/engine/graphics/render/forward_plus/model/Decal.js +3 -3
  307. package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +1 -1
  308. package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +4 -3
  309. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +6 -4
  310. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts +1 -8
  311. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -1
  312. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +2 -14
  313. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts +9 -0
  314. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts.map +1 -0
  315. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.js +14 -0
  316. package/src/engine/graphics/sh3/lightmap/ARTIFACTS_PLAN.md +146 -0
  317. package/src/engine/graphics/sh3/lightmap/CODE_REVIEW.md +121 -0
  318. package/src/engine/graphics/sh3/lightmap/LIGHTMAPPER_REVIEW.md +183 -0
  319. package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts +90 -0
  320. package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts.map +1 -0
  321. package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.js +681 -0
  322. package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts +32 -0
  323. package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts.map +1 -0
  324. package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.js +155 -0
  325. package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts +49 -0
  326. package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts.map +1 -0
  327. package/src/engine/graphics/sh3/lightmap/lightmap_denoise.js +136 -0
  328. package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts +19 -0
  329. package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts.map +1 -0
  330. package/src/engine/graphics/sh3/lightmap/lightmap_dilate.js +89 -0
  331. package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts +54 -0
  332. package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts.map +1 -0
  333. package/src/engine/graphics/sh3/lightmap/lightmap_gather.js +168 -0
  334. package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts +30 -0
  335. package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts.map +1 -0
  336. package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.js +145 -0
  337. package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts +38 -0
  338. package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts.map +1 -0
  339. package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.js +152 -0
  340. package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts +2 -0
  341. package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts.map +1 -0
  342. package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.js +186 -0
  343. package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts +69 -0
  344. package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts.map +1 -0
  345. package/src/engine/graphics/sh3/lpg/LightProbeGrid.js +173 -0
  346. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts +24 -0
  347. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts.map +1 -0
  348. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.js +88 -0
  349. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts +20 -0
  350. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts.map +1 -0
  351. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.js +79 -0
  352. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts +11 -0
  353. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts.map +1 -0
  354. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.js +84 -0
  355. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts +29 -0
  356. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts.map +1 -0
  357. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.js +160 -0
  358. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts +23 -0
  359. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts.map +1 -0
  360. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.js +228 -0
  361. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts +2 -0
  362. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts.map +1 -0
  363. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.js +24 -0
  364. package/src/engine/graphics/sh3/lpg/material/common.d.ts +3 -0
  365. package/src/engine/graphics/sh3/lpg/material/common.d.ts.map +1 -0
  366. package/src/engine/graphics/sh3/lpg/material/common.js +73 -0
  367. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts +6 -0
  368. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts.map +1 -0
  369. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.js +42 -0
  370. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts +6 -0
  371. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts.map +1 -0
  372. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.js +49 -0
  373. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts +9 -0
  374. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts.map +1 -0
  375. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.js +12 -0
  376. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts +6 -0
  377. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts.map +1 -0
  378. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.js +30 -0
  379. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts +6 -0
  380. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts.map +1 -0
  381. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.js +41 -0
  382. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts +3 -0
  383. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts.map +1 -0
  384. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.js +15 -0
  385. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts +3 -0
  386. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts.map +1 -0
  387. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.js +9 -0
  388. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts +9 -0
  389. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts.map +1 -0
  390. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.js +12 -0
  391. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts +20 -0
  392. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts.map +1 -0
  393. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.js +59 -0
  394. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts.map +1 -1
  395. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +2 -2
  396. package/src/engine/graphics/sh3/path_tracer/PathTracer.js +2 -2
  397. package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.d.ts.map +1 -1
  398. package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js +8 -0
  399. package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.d.ts.map +1 -1
  400. package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js +6 -4
  401. package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +3 -3
  402. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts.map +1 -1
  403. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +5 -4
  404. package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts +2 -0
  405. package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts.map +1 -0
  406. package/src/engine/graphics/sh3/prototypeLightProbeGrid.js +170 -0
  407. package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.js +2 -2
  408. package/src/engine/graphics/texture/atlas/AtlasLookupTexture.js +1 -1
  409. package/src/engine/graphics/texture/atlas/CachingTextureAtlas.js +1 -1
  410. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.js +1 -1
  411. package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.js +3 -3
  412. package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
  413. package/src/engine/graphics/util/build_max_height_pyramid.js +5 -2
  414. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +1 -1
  415. package/src/engine/input/devices/KeyboardDevice.d.ts +61 -14
  416. package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
  417. package/src/engine/input/devices/KeyboardDevice.js +41 -15
  418. package/src/engine/input/devices/isHTMLElementFocusable.d.ts.map +1 -1
  419. package/src/engine/input/devices/isHTMLElementFocusable.js +2 -9
  420. package/src/engine/input/ecs/components/InputBinding.d.ts +7 -1
  421. package/src/engine/input/ecs/components/InputBinding.d.ts.map +1 -1
  422. package/src/engine/input/ecs/components/InputBinding.js +8 -1
  423. package/src/engine/input/ecs/systems/InputControllerSystem.js +1 -1
  424. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +2 -1
  425. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -1
  426. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js +6 -2
  427. package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
  428. package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
  429. package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +2 -4
  430. package/src/engine/logging/elastic/ElasticSearchLogger.d.ts +1 -2
  431. package/src/engine/logging/elastic/ElasticSearchLogger.d.ts.map +1 -1
  432. package/src/engine/logging/elastic/ElasticSearchLogger.js +14 -10
  433. package/src/engine/navigation/ecs/path_following/PathFollower.js +1 -1
  434. package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
  435. package/src/engine/navigation/grid/find_path_on_grid_astar.js +5 -2
  436. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
  437. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
  438. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +17 -0
  439. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  440. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
  441. package/src/engine/scene/SceneManager.d.ts.map +1 -1
  442. package/src/engine/scene/SceneManager.js +4 -2
  443. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  444. package/src/engine/simulation/Ticker.js +9 -0
  445. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
  446. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +6 -1
  447. package/src/engine/sound/material/concrete/json/serializeSoundMaterialToJSON.js +1 -1
  448. package/src/engine/sound/simulation/prototypeAcousticSolver.js +261 -143
  449. package/src/generation/theme/ThemeEngine.d.ts +9 -0
  450. package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
  451. package/src/generation/theme/ThemeEngine.js +37 -2
@@ -0,0 +1,42 @@
1
+ import { insert_after } from "../../../../../../core/primitives/strings/insert_after.js";
2
+ import PREAMBLE_COMMON from "../common.js";
3
+
4
+ //language=GLSL
5
+ const PREAMBLE = `
6
+ #ifndef LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT
7
+ #define LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT
8
+
9
+ varying vec3 lpg_v_world_position;
10
+
11
+ uniform float lpg_f_intensity;
12
+
13
+ #endif
14
+ `;
15
+
16
+ //language=GLSL
17
+ const ACCUMULATION = `
18
+ {
19
+
20
+ vec3 lpg_world_normal = normalize( inverseTransformDirection( geometry.normal, viewMatrix ) );
21
+
22
+ irradiance += lpg_sample_irradiance( lpg_v_world_position, lpg_world_normal ) * lpg_f_intensity;
23
+
24
+ }
25
+ `;
26
+
27
+ /**
28
+ *
29
+ * @param {string} source
30
+ */
31
+ export function build_fragment_shader(source) {
32
+
33
+ let result = PREAMBLE + PREAMBLE_COMMON + source;
34
+
35
+ result = insert_after(
36
+ result,
37
+ '#include <lights_fragment_begin>',
38
+ ACCUMULATION
39
+ );
40
+
41
+ return result;
42
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ * @param {string} source
4
+ */
5
+ export function build_vertex_shader(source: string): string;
6
+ //# sourceMappingURL=build_vertex_shader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build_vertex_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.js"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,4CAFW,MAAM,UAahB"}
@@ -0,0 +1,49 @@
1
+ import { insert_after } from "../../../../../../core/primitives/strings/insert_after.js";
2
+
3
+ //language=GLSL
4
+ const PREAMBLE = `
5
+ #ifndef LPG_SHADER_CHUNK_PREAMBLE_VERTEX
6
+ #define LPG_SHADER_CHUNK_PREAMBLE_VERTEX
7
+
8
+ varying vec3 lpg_v_world_position;
9
+
10
+ #endif
11
+ `;
12
+
13
+ /*
14
+ World position is computed from the raw 'position' attribute rather than three's 'worldPosition' (only declared
15
+ when shadow maps / env maps / transmission are enabled) or 'transformed' (only declared once <begin_vertex> has
16
+ run). 'position' is present on every non-raw shader that exposes the <fog_vertex> anchor. Probe GI is
17
+ low-frequency, so skipping morph/skin displacement in the lookup position is inconsequential.
18
+ */
19
+ //language=GLSL
20
+ const CAPTURE_WORLD_POSITION = `
21
+ {
22
+ vec4 lpg_world_position = vec4( position, 1.0 );
23
+
24
+ #ifdef USE_INSTANCING
25
+ lpg_world_position = instanceMatrix * lpg_world_position;
26
+ #endif
27
+
28
+ lpg_world_position = modelMatrix * lpg_world_position;
29
+
30
+ lpg_v_world_position = lpg_world_position.xyz;
31
+ }
32
+ `;
33
+
34
+ /**
35
+ *
36
+ * @param {string} source
37
+ */
38
+ export function build_vertex_shader(source) {
39
+
40
+ let result = PREAMBLE + source;
41
+
42
+ result = insert_after(
43
+ result,
44
+ '#include <fog_vertex>',
45
+ CAPTURE_WORLD_POSITION
46
+ );
47
+
48
+ return result;
49
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Probe field is sampled per-fragment
3
+ * @param {{vertexShader, fragmentShader}} shader
4
+ */
5
+ export function space_fragment_transform_shader(shader: {
6
+ vertexShader;
7
+ fragmentShader;
8
+ }): void;
9
+ //# sourceMappingURL=space_fragment_transform_shader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"space_fragment_transform_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wDAFW;IAAC,YAAY,CAAC;IAAC,cAAc,CAAA;CAAC,QAMxC"}
@@ -0,0 +1,12 @@
1
+ import { build_fragment_shader } from "./build_fragment_shader.js";
2
+ import { build_vertex_shader } from "./build_vertex_shader.js";
3
+
4
+ /**
5
+ * Probe field is sampled per-fragment
6
+ * @param {{vertexShader, fragmentShader}} shader
7
+ */
8
+ export function space_fragment_transform_shader(shader) {
9
+
10
+ shader.vertexShader = build_vertex_shader(shader.vertexShader);
11
+ shader.fragmentShader = build_fragment_shader(shader.fragmentShader);
12
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ * @param {string} source
4
+ */
5
+ export function build_fragment_shader(source: string): string;
6
+ //# sourceMappingURL=build_fragment_shader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build_fragment_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.js"],"names":[],"mappings":"AAcA;;;GAGG;AACH,8CAFW,MAAM,UAahB"}
@@ -0,0 +1,30 @@
1
+ import { insert_after } from "../../../../../../core/primitives/strings/insert_after.js";
2
+ import PREAMBLE from "./preamble.frag.js";
3
+
4
+ //language=GLSL
5
+ const ACCUMULATION = `
6
+ {
7
+
8
+ vec3 lpg_world_normal = normalize( inverseTransformDirection( geometry.normal, viewMatrix ) );
9
+
10
+ irradiance += lpg_get_irradiance_at( lpg_world_normal, lpg_values ) * lpg_f_intensity;
11
+
12
+ }
13
+ `;
14
+
15
+ /**
16
+ *
17
+ * @param {string} source
18
+ */
19
+ export function build_fragment_shader(source) {
20
+
21
+ let result = PREAMBLE + source;
22
+
23
+ result = insert_after(
24
+ result,
25
+ '#include <lights_fragment_begin>',
26
+ ACCUMULATION
27
+ );
28
+
29
+ return result;
30
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ * @param {string} source
4
+ */
5
+ export function build_vertex_shader(source: string): string;
6
+ //# sourceMappingURL=build_vertex_shader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build_vertex_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.js"],"names":[],"mappings":"AAyBA;;;GAGG;AACH,4CAFW,MAAM,UAahB"}
@@ -0,0 +1,41 @@
1
+ import { insert_after } from "../../../../../../core/primitives/strings/insert_after.js";
2
+ import PREAMBLE_COMMON from "../common.js";
3
+ import PREAMBLE from "./preamble.vert.js";
4
+
5
+ /*
6
+ World position is computed from the raw 'position' attribute rather than three's 'worldPosition' (only declared
7
+ when shadow maps / env maps / transmission are enabled) or 'transformed' (only declared once <begin_vertex> has
8
+ run). 'position' is present on every non-raw shader that exposes the <fog_vertex> anchor. Probe GI is
9
+ low-frequency, so skipping morph/skin displacement in the lookup position is inconsequential.
10
+ */
11
+ //language=GLSL
12
+ const SHADER_CHUNK_ACCUMULATION = `
13
+ {
14
+ vec4 lpg_world_position = vec4( position, 1.0 );
15
+
16
+ #ifdef USE_INSTANCING
17
+ lpg_world_position = instanceMatrix * lpg_world_position;
18
+ #endif
19
+
20
+ lpg_world_position = modelMatrix * lpg_world_position;
21
+
22
+ lpg_values = lpg_fetch_sh( lpg_world_position.xyz );
23
+ }
24
+ `;
25
+
26
+ /**
27
+ *
28
+ * @param {string} source
29
+ */
30
+ export function build_vertex_shader(source) {
31
+
32
+ let result = PREAMBLE + PREAMBLE_COMMON + source;
33
+
34
+ result = insert_after(
35
+ result,
36
+ '#include <fog_vertex>',
37
+ SHADER_CHUNK_ACCUMULATION
38
+ );
39
+
40
+ return result;
41
+ }
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n#ifndef LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT\n#define LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT\n\nuniform float lpg_f_intensity;\n\nvarying vec3[4] lpg_values;\n\n\n#ifndef LPG_CHUNK_GET_IRRADIANCE_AT\n#define LPG_CHUNK_GET_IRRADIANCE_AT\n\nvec3 lpg_get_irradiance_at(in vec3 normal, in vec3 shCoefficients[4]) {\n // normal is assumed to have unit length\n\n // band 0\n vec3 result = shCoefficients[0] * 0.8862269254527579;\n\n // band 1\n result += shCoefficients[1] * 1.0233267079464885 * normal.y;\n result += shCoefficients[2] * 1.0233267079464885 * normal.z;\n result += shCoefficients[3] * 1.0233267079464885 * normal.x;\n\n return result;\n}\n\n#endif\n\n\n#endif\n";
2
+ export default _default;
3
+ //# sourceMappingURL=preamble.frag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preamble.frag.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.js"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { chunk_lpg_get_irradiance_at } from "../chunk_lpg_get_irradiance_at.js";
2
+
3
+ //language=GLSL
4
+ export default `
5
+ #ifndef LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT
6
+ #define LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT
7
+
8
+ uniform float lpg_f_intensity;
9
+
10
+ varying vec3[4] lpg_values;
11
+
12
+ ${ chunk_lpg_get_irradiance_at }
13
+
14
+ #endif
15
+ `
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n#ifndef LPG_SHADER_CHUNK_PREAMBLE_VERTEX\n#define LPG_SHADER_CHUNK_PREAMBLE_VERTEX\n\nvarying vec3[4] lpg_values;\n\n#endif\n";
2
+ export default _default;
3
+ //# sourceMappingURL=preamble.vert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preamble.vert.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.js"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ //language=GLSL
2
+ export default `
3
+ #ifndef LPG_SHADER_CHUNK_PREAMBLE_VERTEX
4
+ #define LPG_SHADER_CHUNK_PREAMBLE_VERTEX
5
+
6
+ varying vec3[4] lpg_values;
7
+
8
+ #endif
9
+ `
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Probe field is sampled per-vertex, interpolated SH coefficients are evaluated against the per-fragment normal
3
+ * @param {{vertexShader, fragmentShader}} shader
4
+ */
5
+ export function space_vertex_transform_shader(shader: {
6
+ vertexShader;
7
+ fragmentShader;
8
+ }): void;
9
+ //# sourceMappingURL=space_vertex_transform_shader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"space_vertex_transform_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,sDAFW;IAAC,YAAY,CAAC;IAAC,cAAc,CAAA;CAAC,QAMxC"}
@@ -0,0 +1,12 @@
1
+ import { build_fragment_shader } from "./build_fragment_shader.js";
2
+ import { build_vertex_shader } from "./build_vertex_shader.js";
3
+
4
+ /**
5
+ * Probe field is sampled per-vertex, interpolated SH coefficients are evaluated against the per-fragment normal
6
+ * @param {{vertexShader, fragmentShader}} shader
7
+ */
8
+ export function space_vertex_transform_shader(shader) {
9
+
10
+ shader.vertexShader = build_vertex_shader(shader.vertexShader);
11
+ shader.fragmentShader = build_fragment_shader(shader.fragmentShader);
12
+ }
@@ -0,0 +1,20 @@
1
+ export class LightProbeGridSerializationAdapter extends BinaryClassSerializationAdapter<any> {
2
+ constructor();
3
+ klass: typeof LightProbeGrid;
4
+ version: number;
5
+ /**
6
+ *
7
+ * @param buffer
8
+ * @param {LightProbeGrid} value must be built, see {@link LightProbeGrid#build}
9
+ */
10
+ serialize(buffer: any, value: LightProbeGrid): void;
11
+ /**
12
+ *
13
+ * @param buffer
14
+ * @param {LightProbeGrid} value
15
+ */
16
+ deserialize(buffer: any, value: LightProbeGrid): void;
17
+ }
18
+ import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
19
+ import { LightProbeGrid } from "../LightProbeGrid.js";
20
+ //# sourceMappingURL=LightProbeGridSerializationAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LightProbeGridSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.js"],"names":[],"mappings":"AAMA;;IAEI,6BAAsB;IACtB,gBAAW;IAEX;;;;OAIG;IACH,8BAFW,cAAc,QAiBxB;IAED;;;;OAIG;IACH,gCAFW,cAAc,QAqBxB;CACJ;gDAzD+C,mEAAmE;+BACpF,sBAAsB"}
@@ -0,0 +1,59 @@
1
+ import { AABB3 } from "../../../../../core/geom/3d/aabb/AABB3.js";
2
+ import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
3
+ import { LightProbeGrid } from "../LightProbeGrid.js";
4
+
5
+ const __bounds = new AABB3(0, 0, 0, 0, 0, 0);
6
+
7
+ export class LightProbeGridSerializationAdapter extends BinaryClassSerializationAdapter {
8
+
9
+ klass = LightProbeGrid
10
+ version = 0
11
+
12
+ /**
13
+ *
14
+ * @param buffer
15
+ * @param {LightProbeGrid} value must be built, see {@link LightProbeGrid#build}
16
+ */
17
+ serialize(buffer, value) {
18
+ const bounds = value.bounds;
19
+
20
+ buffer.writeFloat64(bounds.x0);
21
+ buffer.writeFloat64(bounds.y0);
22
+ buffer.writeFloat64(bounds.z0);
23
+ buffer.writeFloat64(bounds.x1);
24
+ buffer.writeFloat64(bounds.y1);
25
+ buffer.writeFloat64(bounds.z1);
26
+
27
+ buffer.writeUint32(value.resolution_x);
28
+ buffer.writeUint32(value.resolution_y);
29
+ buffer.writeUint32(value.resolution_z);
30
+
31
+ buffer.writeFloat32Array(value.harmonics, 0, value.count * 12);
32
+ }
33
+
34
+ /**
35
+ *
36
+ * @param buffer
37
+ * @param {LightProbeGrid} value
38
+ */
39
+ deserialize(buffer, value) {
40
+ const x0 = buffer.readFloat64();
41
+ const y0 = buffer.readFloat64();
42
+ const z0 = buffer.readFloat64();
43
+ const x1 = buffer.readFloat64();
44
+ const y1 = buffer.readFloat64();
45
+ const z1 = buffer.readFloat64();
46
+
47
+ __bounds.setBounds(x0, y0, z0, x1, y1, z1);
48
+
49
+ const resolution_x = buffer.readUint32();
50
+ const resolution_y = buffer.readUint32();
51
+ const resolution_z = buffer.readUint32();
52
+
53
+ value.build(__bounds, resolution_x, resolution_y, resolution_z);
54
+
55
+ buffer.readFloat32Array(value.harmonics, 0, value.count * 12);
56
+
57
+ value.incrementVersion();
58
+ }
59
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"PathTracedMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/PathTracedMesh.js"],"names":[],"mappings":"AAgBA;IACI;;;OAGG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,MAFU,KAAK,CAEI;IAEnB;;;OAGG;IACH,KAFU,sBAAoB,IAAI,CAEvB;IAGX;;;OAGG;IACH,UAFU,MAAM,cAAc,GAAC,IAAI,CAEnB;IAEhB;;;OAGG;IACH,UAFU,mBAAiB,IAAI,CAEf;IAYhB,sCAEC;IAED,kCAEC;IAED,2BAqBC;IAED,sBAGC;IAED,iCAUC;IAED,8BAEC;IAED;;;;OAIG;IACH,cAHW,IAAI,GACF,OAAO,CAWnB;IAED;;;;;;OAMG;IACH,SALW,MAAM,EAAE,OACR,MAAM,EAAE,GAAC,IAAI,aACb,MAAM,GACJ,MAAM,CA4BlB;;CACJ;sBA9JqB,wCAAwC;qBAKzC,sCAAsC"}
1
+ {"version":3,"file":"PathTracedMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/PathTracedMesh.js"],"names":[],"mappings":"AAgBA;IACI;;;OAGG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,MAFU,KAAK,CAEI;IAEnB;;;OAGG;IACH,KAFU,sBAAoB,IAAI,CAEvB;IAGX;;;OAGG;IACH,UAFU,MAAM,cAAc,GAAC,IAAI,CAEnB;IAEhB;;;OAGG;IACH,UAFU,mBAAiB,IAAI,CAEf;IAYhB,sCAEC;IAED,kCAEC;IAED,2BAqBC;IAED,sBAGC;IAED,iCAUC;IAED,8BAEC;IAED;;;;OAIG;IACH,cAHW,IAAI,GACF,OAAO,CAWnB;IAED;;;;;;OAMG;IACH,SALW,MAAM,EAAE,OACR,MAAM,EAAE,GAAC,IAAI,aACb,MAAM,GACJ,MAAM,CA4BlB;;CACJ;sBA/JqB,wCAAwC;qBAMzC,sCAAsC"}
@@ -1,10 +1,10 @@
1
- import { mat4 } from "gl-matrix";
2
1
  import { array_copy } from "../../../../core/collection/array/array_copy.js";
3
2
  import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
4
3
  import { aabb3_from_v3_array_transformed } from "../../../../core/geom/3d/aabb/aabb3_from_v3_array_transformed.js";
5
4
  import { m4_allocate } from "../../../../core/geom/3d/mat4/m4_allocate.js";
6
5
  import { m4_decompose } from "../../../../core/geom/3d/mat4/m4_decompose.js";
7
6
  import { m4_normal_matrix3 } from "../../../../core/geom/3d/mat4/m4_normal_matrix3.js";
7
+ import { m4_invert } from "../../../../core/geom/3d/mat4/m4_invert.js";
8
8
  import { Ray3 } from "../../../../core/geom/3d/ray/Ray3.js";
9
9
  import Quaternion from "../../../../core/geom/Quaternion.js";
10
10
  import { v3_distance } from "../../../../core/geom/vec3/v3_distance.js";
@@ -95,7 +95,7 @@ export class PathTracedMesh {
95
95
  set transform(m) {
96
96
  array_copy(m, 0, this.#transform, 0, 16);
97
97
 
98
- mat4.invert(this.#transform_inverse, m);
98
+ m4_invert(this.#transform_inverse, m);
99
99
 
100
100
  m4_normal_matrix3(this.#normal_matrix, this.#transform);
101
101
 
@@ -1,5 +1,5 @@
1
- import { vec3 } from "gl-matrix";
2
1
  import { array_copy } from "../../../../core/collection/array/array_copy.js";
2
+ import { v3_multiply } from "../../../../core/geom/vec3/v3_multiply.js";
3
3
  import { Ray3 } from "../../../../core/geom/3d/ray/Ray3.js";
4
4
  import { getBiasedNormalSample } from "./sampling/getBiasedNormalSample.js";
5
5
 
@@ -112,7 +112,7 @@ export class PathTracer {
112
112
  irradiance[2] += color_mask[2] * tmp_0[8];
113
113
 
114
114
  // fold the surface albedo into the path throughput
115
- vec3.multiply(color_mask, color_mask, tmp_0);
115
+ v3_multiply(color_mask, 0, color_mask[0], color_mask[1], color_mask[2], tmp_0[0], tmp_0[1], tmp_0[2]);
116
116
 
117
117
  // construct new ray, aligned on the normal of the contact
118
118
  array_copy(tmp_0, 3, _ray_0, 3, 3); // copy surface normal into the direction slot (read by sample_lights)
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialConverter.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js"],"names":[],"mappings":"AA+BA;IA+BI;;;;OAIG;IACH,kBAHW,MAAM,QAAQ,GACZ,gBAAgB,CA6C5B;;CAEJ;iCA3GgC,uBAAuB"}
1
+ {"version":3,"file":"MaterialConverter.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js"],"names":[],"mappings":"AA+BA;IAuCI;;;;OAIG;IACH,kBAHW,MAAM,QAAQ,GACZ,gBAAgB,CA6C5B;;CAEJ;iCAnHgC,uBAAuB"}
@@ -52,6 +52,14 @@ export class MaterialConverter {
52
52
 
53
53
  const st = StandardTexture.from(sampler2D);
54
54
 
55
+ // carry the source texture's addressing/filtering across; the TextureWrapping
56
+ // and TextureFilter enums mirror three's constant values, so otherwise tiled
57
+ // (RepeatWrapping) surfaces would be sampled as ClampToEdge and stretch a
58
+ // single edge texel across the whole surface.
59
+ st.wrapS = texture.wrapS;
60
+ st.wrapT = texture.wrapT;
61
+ st.magFilter = texture.magFilter;
62
+
55
63
  // base-color/emissive maps are sRGB-authored and must be decoded to linear at sample time
56
64
  st.decode_sRGB = texture.encoding === sRGBEncoding;
57
65
 
@@ -1 +1 @@
1
- {"version":3,"file":"prepare_scene_gltf.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js"],"names":[],"mappings":"AAaA;;;;;qBAyBC;AAaD;;;;;;;;;;GAUG;AACH,mHAFY,QAAQ,IAAI,CAAC,CA8CxB;oBAnGmB,kCAAkC;iCAErB,qDAAqD"}
1
+ {"version":3,"file":"prepare_scene_gltf.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js"],"names":[],"mappings":"AAeA;;;;;qBAyBC;AAaD;;;;;;;;;;GAUG;AACH,mHAFY,QAAQ,IAAI,CAAC,CA8CxB;oBAnGmB,kCAAkC;iCAErB,qDAAqD"}
@@ -1,9 +1,11 @@
1
- import { vec3 } from "gl-matrix";
2
1
  import { Box3, MeshStandardMaterial, PlaneBufferGeometry, Sphere } from "three";
2
+ import { v3_length } from "../../../../core/geom/vec3/v3_length.js";
3
+ import { v3_scale } from "../../../../core/geom/vec3/v3_scale.js";
3
4
  import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
4
5
  import { Color } from "../../../../core/color/Color.js";
5
6
  import { kelvin_to_rgb } from "../../../../core/color/kelvin/kelvin_to_rgb.js";
6
7
  import { noop } from "../../../../core/function/noop.js";
8
+ import { v3_multiply } from "../../../../core/geom/vec3/v3_multiply.js";
7
9
  import Quaternion from "../../../../core/geom/Quaternion.js";
8
10
  import Vector3 from "../../../../core/geom/Vector3.js";
9
11
  import { Transform } from "../../../ecs/transform/Transform.js";
@@ -25,10 +27,10 @@ export function make_sun({
25
27
  const light = new DirectionalLight();
26
28
 
27
29
  light.color.parse(color);
28
- vec3.multiply(light.color, light.color, temp_c);
30
+ v3_multiply(light.color, 0, light.color[0], light.color[1], light.color[2], temp_c[0], temp_c[1], temp_c[2]);
29
31
 
30
- const n = vec3.length(light.color);
31
- vec3.scale(light.color, light.color, 1 / n); // normalize color vector
32
+ const n = v3_length(light.color[0], light.color[1], light.color[2]);
33
+ v3_scale(light.color, 0, light.color[0], light.color[1], light.color[2], 1 / n); // normalize color vector
32
34
 
33
35
  light.intensity.set(intensity * n);
34
36
  light.direction.copy(direction);
@@ -1,4 +1,4 @@
1
- import { mat4 } from "gl-matrix";
1
+ import { m4_from_rotation_translation_scale } from "../../../../core/geom/3d/mat4/m4_from_rotation_translation_scale.js";
2
2
  import { MeshStandardMaterial, OctahedronBufferGeometry, PerspectiveCamera, PlaneBufferGeometry } from "three";
3
3
  import { PLYLoader } from "three/examples/jsm/loaders/PLYLoader.js";
4
4
 
@@ -313,7 +313,7 @@ async function prepare_scene_rtiow(pt, camera) {
313
313
  function add_sphere(center, radius, material) {
314
314
 
315
315
  const mat = new Float32Array(16);
316
- mat4.fromRotationTranslationScale(mat, [0, 0, 0, 1], center, [radius, radius, radius])
316
+ m4_from_rotation_translation_scale(mat, [0, 0, 0, 1], center, [radius, radius, radius])
317
317
 
318
318
  scene.createMesh(sphere_geo, material, mat);
319
319
 
@@ -357,7 +357,7 @@ async function prepare_scene_rtiow(pt, camera) {
357
357
 
358
358
 
359
359
  const mat = new Float32Array(16);
360
- mat4.fromRotationTranslationScale(mat, [0, 0, 0, 1], center, [radius, radius, radius])
360
+ m4_from_rotation_translation_scale(mat, [0, 0, 0, 1], center, [radius, radius, radius])
361
361
 
362
362
  const material = new MeshStandardMaterial({
363
363
  color: Color.fromHSV(random(), 0.9, 0.9).toHex()
@@ -1 +1 @@
1
- {"version":3,"file":"sample_material.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/texture/sample_material.js"],"names":[],"mappings":"AA6CA;;;;;;;GAOG;AACH,qCANW,MAAM,EAAE,sCAER,MAAM,KACN,MAAM,KACN,MAAM,QA4FhB"}
1
+ {"version":3,"file":"sample_material.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/texture/sample_material.js"],"names":[],"mappings":"AA8CA;;;;;;;GAOG;AACH,qCANW,MAAM,EAAE,sCAER,MAAM,KACN,MAAM,KACN,MAAM,QA4FhB"}
@@ -1,6 +1,7 @@
1
- import { vec3 } from "gl-matrix";
2
1
  import { compute_binary_data_type_from_typed_array } from "../../../../../core/collection/array/typed/compute_binary_data_type_from_typed_array.js";
3
2
  import { v3_distance_sqr } from "../../../../../core/geom/vec3/v3_distance_sqr.js";
3
+ import { v3_multiply } from "../../../../../core/geom/vec3/v3_multiply.js";
4
+ import { v3_normalize_array } from "../../../../../core/geom/vec3/v3_normalize_array.js";
4
5
  import { v3_matrix3_rotate } from "../../../../../core/geom/vec3/v3_matrix3_rotate.js";
5
6
  import { decode_attribute_value } from "../../../geometry/decode_attribute_value.js";
6
7
  import { geometry_construct_triangle_normal } from "../../../geometry/geometry_construct_triangle_normal.js";
@@ -111,7 +112,7 @@ export function sample_material(
111
112
  normal[1] = normal[1] * 2 - 1;
112
113
  normal[2] = normal[2] * 2 - 1;
113
114
 
114
- vec3.normalize(normal, normal);
115
+ v3_normalize_array(normal, 0, normal, 0);
115
116
 
116
117
  // needs transform
117
118
  v3_orthonormal_matrix_from_normal(scratch_m3, 0, out[3], out[4], out[5]);
@@ -126,13 +127,13 @@ export function sample_material(
126
127
  if (color_attribute !== undefined) {
127
128
  sample_color_attribute(color, color_attribute, index_0, index_1, index_2, u, v);
128
129
 
129
- vec3.multiply(out, out, color);
130
+ v3_multiply(out, 0, out[0], out[1], out[2], color[0], color[1], color[2]);
130
131
  }
131
132
 
132
133
 
133
134
  material.diffuse.sample(color, texture_uv[0], texture_uv[1]);
134
135
 
135
- vec3.multiply(out, out, color);
136
+ v3_multiply(out, 0, out[0], out[1], out[2], color[0], color[1], color[2]);
136
137
 
137
138
  // emissive radiance emitted by this surface
138
139
  material.emissive.sample(emissive, texture_uv[0], texture_uv[1]);
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=prototypeLightProbeGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prototypeLightProbeGrid.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/sh3/prototypeLightProbeGrid.js"],"names":[],"mappings":""}