@woosh/meep-engine 3.64.0 → 3.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/CHANGELOG.md +85 -0
  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/src/core/binary/BinaryBuffer.d.ts +5 -0
  6. package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
  7. package/src/core/binary/BinaryBuffer.js +39 -5
  8. package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.d.ts +65 -6
  9. package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.d.ts.map +1 -1
  10. package/src/core/geom/3d/topology/struct/binary/io/bt_boundary_loop.js +451 -101
  11. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +4 -2
  12. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -1
  13. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +4 -2
  14. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.d.ts +8 -1
  15. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.d.ts.map +1 -1
  16. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.js +45 -10
  17. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.d.ts.map +1 -1
  18. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.js +237 -119
  19. package/src/engine/graphics/ecs/grass/GrassSpecies.d.ts +143 -0
  20. package/src/engine/graphics/ecs/grass/GrassSpecies.d.ts.map +1 -0
  21. package/src/engine/graphics/ecs/grass/GrassSpecies.js +189 -0
  22. package/src/engine/graphics/ecs/grass/GrassSurface.d.ts +25 -0
  23. package/src/engine/graphics/ecs/grass/GrassSurface.d.ts.map +1 -0
  24. package/src/engine/graphics/ecs/grass/GrassSurface.js +32 -0
  25. package/src/engine/graphics/ecs/grass/GroundCover.d.ts +68 -0
  26. package/src/engine/graphics/ecs/grass/GroundCover.d.ts.map +1 -0
  27. package/src/engine/graphics/ecs/grass/GroundCover.js +85 -0
  28. package/src/engine/graphics/texture/sampler/exr_to_sampler2d.d.ts +27 -0
  29. package/src/engine/graphics/texture/sampler/exr_to_sampler2d.d.ts.map +1 -0
  30. package/src/engine/graphics/texture/sampler/exr_to_sampler2d.js +91 -0
  31. package/src/engine/graphics/texture/sampler/sampler2d_to_exr.d.ts +23 -0
  32. package/src/engine/graphics/texture/sampler/sampler2d_to_exr.d.ts.map +1 -0
  33. package/src/engine/graphics/texture/sampler/sampler2d_to_exr.js +64 -0
  34. package/src/engine/graphics3/GrassSurfaceSystem.d.ts +153 -0
  35. package/src/engine/graphics3/GrassSurfaceSystem.d.ts.map +1 -0
  36. package/src/engine/graphics3/GrassSurfaceSystem.js +1076 -0
  37. package/src/engine/graphics3/GroundCoverSystem.d.ts +33 -0
  38. package/src/engine/graphics3/GroundCoverSystem.d.ts.map +1 -0
  39. package/src/engine/graphics3/GroundCoverSystem.js +58 -0
  40. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  41. package/src/engine/network/NetworkSession.js +372 -110
  42. package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
  43. package/src/engine/network/orchestrator/NetworkPeer.js +6 -1
  44. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  45. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +9 -2
  46. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
  47. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +325 -140
  48. package/src/engine/network/sim/SimActionExecutor.d.ts +4 -1
  49. package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
  50. package/src/engine/network/sim/SimActionExecutor.js +65 -9
  51. package/src/engine/network/state/PredictionHistory.d.ts.map +1 -1
  52. package/src/engine/network/state/PredictionHistory.js +6 -1
  53. package/src/engine/network/time/AdaptiveRenderDelay.d.ts +25 -14
  54. package/src/engine/network/time/AdaptiveRenderDelay.d.ts.map +1 -1
  55. package/src/engine/network/time/AdaptiveRenderDelay.js +38 -20
  56. package/src/engine/network/time/RenderPlayout.d.ts +23 -3
  57. package/src/engine/network/time/RenderPlayout.d.ts.map +1 -1
  58. package/src/engine/network/time/RenderPlayout.js +40 -4
  59. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  60. package/src/engine/physics/fluid/obstacle/chunk_fluid_obstacle_record.d.ts +5 -1
  61. package/src/engine/physics/fluid/obstacle/chunk_fluid_obstacle_record.d.ts.map +1 -1
  62. package/src/engine/physics/fluid/obstacle/chunk_fluid_obstacle_record.js +27 -1
  63. package/src/format/image/exr/ExrCompression.d.ts +22 -0
  64. package/src/format/image/exr/ExrCompression.d.ts.map +1 -0
  65. package/src/format/image/exr/ExrCompression.js +27 -0
  66. package/src/format/image/exr/ExrImage.d.ts +32 -0
  67. package/src/format/image/exr/ExrImage.d.ts.map +1 -0
  68. package/src/format/image/exr/ExrImage.js +32 -0
  69. package/src/format/image/exr/ExrPixelType.d.ts +13 -0
  70. package/src/format/image/exr/ExrPixelType.d.ts.map +1 -0
  71. package/src/format/image/exr/ExrPixelType.js +18 -0
  72. package/src/format/image/exr/exr_compare_names.d.ts +16 -0
  73. package/src/format/image/exr/exr_compare_names.d.ts.map +1 -0
  74. package/src/format/image/exr/exr_compare_names.js +25 -0
  75. package/src/format/image/exr/exr_constants.d.ts +49 -0
  76. package/src/format/image/exr/exr_constants.d.ts.map +1 -0
  77. package/src/format/image/exr/exr_constants.js +56 -0
  78. package/src/format/image/exr/exr_read.d.ts +32 -0
  79. package/src/format/image/exr/exr_read.d.ts.map +1 -0
  80. package/src/format/image/exr/exr_read.js +531 -0
  81. package/src/format/image/exr/exr_sample_bits.d.ts +16 -0
  82. package/src/format/image/exr/exr_sample_bits.d.ts.map +1 -0
  83. package/src/format/image/exr/exr_sample_bits.js +21 -0
  84. package/src/format/image/exr/exr_scanlines_per_chunk.d.ts +17 -0
  85. package/src/format/image/exr/exr_scanlines_per_chunk.d.ts.map +1 -0
  86. package/src/format/image/exr/exr_scanlines_per_chunk.js +31 -0
  87. package/src/format/image/exr/exr_write.d.ts +27 -0
  88. package/src/format/image/exr/exr_write.d.ts.map +1 -0
  89. package/src/format/image/exr/exr_write.js +378 -0
  90. package/src/shade/device/shader/ShaderModuleCompiler.d.ts +2 -0
  91. package/src/shade/device/shader/ShaderModuleCompiler.d.ts.map +1 -1
  92. package/src/shade/device/shader/ShaderModuleCompiler.js +25 -2
  93. package/src/shade/playground/grass_surfaces/index.html +75 -0
  94. package/src/shade/playground/grass_surfaces/main.d.ts +2 -0
  95. package/src/shade/playground/grass_surfaces/main.d.ts.map +1 -0
  96. package/src/shade/playground/grass_surfaces/main.js +593 -0
  97. package/src/shade/playground/grass_surfaces/read_grass_surfaces.d.ts +62 -0
  98. package/src/shade/playground/grass_surfaces/read_grass_surfaces.d.ts.map +1 -0
  99. package/src/shade/playground/grass_surfaces/read_grass_surfaces.js +188 -0
  100. package/src/shade/playground/probe_clipmap/index.html +5 -0
  101. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  102. package/src/shade/playground/probe_clipmap/main.js +34 -1
  103. package/src/shade/playground/probe_clipmap_box/README.md +5 -1
  104. package/src/shade/playground/probe_clipmap_box/index.html +12 -0
  105. package/src/shade/playground/probe_clipmap_box/main.d.ts.map +1 -1
  106. package/src/shade/playground/probe_clipmap_box/main.js +15 -0
  107. package/src/shade/playground/probe_clipmap_box/scene.d.ts +8 -1
  108. package/src/shade/playground/probe_clipmap_box/scene.d.ts.map +1 -1
  109. package/src/shade/playground/probe_clipmap_box/scene.js +74 -6
  110. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  111. package/src/shade/renderer/Renderer.js +47 -43
  112. package/src/shade/renderer/extension/ViewTextures.d.ts +12 -5
  113. package/src/shade/renderer/extension/ViewTextures.d.ts.map +1 -1
  114. package/src/shade/renderer/extension/ViewTextures.js +19 -5
  115. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +3 -1
  116. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts.map +1 -1
  117. package/src/shade/renderer/fluid/GPUFluidCascadeStack.js +6 -1
  118. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -0
  119. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts.map +1 -1
  120. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.js +10 -0
  121. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +7 -1
  122. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  123. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +46 -15
  124. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts +3 -2
  125. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts.map +1 -1
  126. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.js +3 -2
  127. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_sort_morton.d.ts +22 -0
  128. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_sort_morton.d.ts.map +1 -0
  129. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_sort_morton.js +247 -0
  130. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +50 -0
  131. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  132. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +101 -0
  133. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +2 -1
  134. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  135. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +2 -1
  136. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +8 -0
  137. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  138. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +12 -0
  139. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +12 -6
  140. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  141. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +35 -29
  142. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_clipmap.d.ts.map +1 -1
  143. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_clipmap.js +4 -2
  144. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.d.ts.map +1 -1
  145. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.js +6 -4
  146. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -1
  147. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +2 -1
  148. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts +6 -5
  149. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts.map +1 -1
  150. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.js +15 -14
  151. package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.d.ts.map +1 -1
  152. package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.js +4 -2
  153. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +19 -2
  154. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  155. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +128 -10
  156. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +19 -13
  157. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
  158. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +27 -15
  159. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +19 -11
  160. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -1
  161. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +35 -11
  162. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +3 -3
  163. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
  164. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +18 -14
  165. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_box_cages.d.ts +40 -0
  166. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_box_cages.d.ts.map +1 -0
  167. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_box_cages.js +174 -0
  168. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.d.ts +4 -4
  169. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.js +10 -10
  170. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.d.ts +31 -0
  171. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.d.ts.map +1 -0
  172. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_parallax.js +54 -0
  173. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts +8 -4
  174. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
  175. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +10 -21
  176. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +7 -2
  177. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts.map +1 -1
  178. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +33 -29
  179. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts +28 -0
  180. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts.map +1 -0
  181. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.js +138 -0
  182. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +7 -3
  183. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
  184. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +28 -17
  185. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +13 -9
  186. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map +1 -1
  187. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +18 -11
  188. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +1 -1
  189. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +18 -18
  190. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
  191. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +44 -48
  192. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts.map +1 -1
  193. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +4 -2
  194. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts.map +1 -1
  195. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.js +2 -3
  196. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts +5 -3
  197. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts.map +1 -1
  198. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js +15 -30
  199. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +1 -1
  200. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
  201. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +4 -2
  202. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts +11 -0
  203. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
  204. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +29 -2
  205. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_late.d.ts +40 -0
  206. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_late.d.ts.map +1 -0
  207. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_late.js +126 -0
  208. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_meshlets.d.ts +36 -0
  209. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_meshlets.d.ts.map +1 -0
  210. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_meshlets.js +221 -0
  211. package/src/shade/renderer/gpu_primitive/age_eviction/chunk_age_eviction.d.ts +40 -0
  212. package/src/shade/renderer/gpu_primitive/age_eviction/chunk_age_eviction.d.ts.map +1 -0
  213. package/src/shade/renderer/gpu_primitive/age_eviction/chunk_age_eviction.js +86 -0
  214. package/src/shade/renderer/grass/blade/GPUGrassBlades.d.ts +135 -0
  215. package/src/shade/renderer/grass/blade/GPUGrassBlades.d.ts.map +1 -0
  216. package/src/shade/renderer/grass/blade/GPUGrassBlades.js +676 -0
  217. package/src/shade/renderer/grass/blade/GRASS_BLADE.d.ts +145 -0
  218. package/src/shade/renderer/grass/blade/GRASS_BLADE.d.ts.map +1 -0
  219. package/src/shade/renderer/grass/blade/GRASS_BLADE.js +179 -0
  220. package/src/shade/renderer/grass/blade/chunk_grass_blade.d.ts +63 -0
  221. package/src/shade/renderer/grass/blade/chunk_grass_blade.d.ts.map +1 -0
  222. package/src/shade/renderer/grass/blade/chunk_grass_blade.js +244 -0
  223. package/src/shade/renderer/grass/blade/chunk_grass_blade_wind.d.ts +58 -0
  224. package/src/shade/renderer/grass/blade/chunk_grass_blade_wind.d.ts.map +1 -0
  225. package/src/shade/renderer/grass/blade/chunk_grass_blade_wind.js +174 -0
  226. package/src/shade/renderer/grass/blade/grass_blade_id_draw.d.ts +25 -0
  227. package/src/shade/renderer/grass/blade/grass_blade_id_draw.d.ts.map +1 -0
  228. package/src/shade/renderer/grass/blade/grass_blade_id_draw.js +133 -0
  229. package/src/shade/renderer/grass/blade/grass_blade_mechanics.d.ts +80 -0
  230. package/src/shade/renderer/grass/blade/grass_blade_mechanics.d.ts.map +1 -0
  231. package/src/shade/renderer/grass/blade/grass_blade_mechanics.js +92 -0
  232. package/src/shade/renderer/grass/blade/grass_blade_resolve.d.ts +29 -0
  233. package/src/shade/renderer/grass/blade/grass_blade_resolve.d.ts.map +1 -0
  234. package/src/shade/renderer/grass/blade/grass_blade_resolve.js +175 -0
  235. package/src/shade/renderer/grass/blade/shader_grass_blade_draw_args.d.ts +14 -0
  236. package/src/shade/renderer/grass/blade/shader_grass_blade_draw_args.d.ts.map +1 -0
  237. package/src/shade/renderer/grass/blade/shader_grass_blade_draw_args.js +45 -0
  238. package/src/shade/renderer/grass/blade/shader_grass_blade_expand.d.ts +61 -0
  239. package/src/shade/renderer/grass/blade/shader_grass_blade_expand.d.ts.map +1 -0
  240. package/src/shade/renderer/grass/blade/shader_grass_blade_expand.js +340 -0
  241. package/src/shade/renderer/grass/blade/shader_grass_cell_count.d.ts +46 -0
  242. package/src/shade/renderer/grass/blade/shader_grass_cell_count.d.ts.map +1 -0
  243. package/src/shade/renderer/grass/blade/shader_grass_cell_count.js +280 -0
  244. package/src/shade/renderer/grass/population/chunk_grass_population.d.ts +60 -0
  245. package/src/shade/renderer/grass/population/chunk_grass_population.d.ts.map +1 -0
  246. package/src/shade/renderer/grass/population/chunk_grass_population.js +171 -0
  247. package/src/shade/renderer/grass/press/GPUGrassPress.d.ts +99 -0
  248. package/src/shade/renderer/grass/press/GPUGrassPress.d.ts.map +1 -0
  249. package/src/shade/renderer/grass/press/GPUGrassPress.js +436 -0
  250. package/src/shade/renderer/grass/press/GRASS_PRESS.d.ts +179 -0
  251. package/src/shade/renderer/grass/press/GRASS_PRESS.d.ts.map +1 -0
  252. package/src/shade/renderer/grass/press/GRASS_PRESS.js +217 -0
  253. package/src/shade/renderer/grass/press/chunk_grass_press.d.ts +65 -0
  254. package/src/shade/renderer/grass/press/chunk_grass_press.d.ts.map +1 -0
  255. package/src/shade/renderer/grass/press/chunk_grass_press.js +296 -0
  256. package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts +31 -0
  257. package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts.map +1 -0
  258. package/src/shade/renderer/grass/press/shader_grass_press_mark.js +169 -0
  259. package/src/shade/renderer/grass/press/shader_grass_press_stamp.d.ts +27 -0
  260. package/src/shade/renderer/grass/press/shader_grass_press_stamp.d.ts.map +1 -0
  261. package/src/shade/renderer/grass/press/shader_grass_press_stamp.js +183 -0
  262. package/src/shade/renderer/grass/surface/GPUGrassSurfaces.d.ts +193 -0
  263. package/src/shade/renderer/grass/surface/GPUGrassSurfaces.d.ts.map +1 -0
  264. package/src/shade/renderer/grass/surface/GPUGrassSurfaces.js +1253 -0
  265. package/src/shade/renderer/grass/surface/GRASS_SURFACE.d.ts +211 -0
  266. package/src/shade/renderer/grass/surface/GRASS_SURFACE.d.ts.map +1 -0
  267. package/src/shade/renderer/grass/surface/GRASS_SURFACE.js +241 -0
  268. package/src/shade/renderer/grass/surface/GRASS_SURFACE_VIEW.d.ts +82 -0
  269. package/src/shade/renderer/grass/surface/GRASS_SURFACE_VIEW.d.ts.map +1 -0
  270. package/src/shade/renderer/grass/surface/GRASS_SURFACE_VIEW.js +111 -0
  271. package/src/shade/renderer/grass/surface/chunk_grass_column_cross.d.ts +39 -0
  272. package/src/shade/renderer/grass/surface/chunk_grass_column_cross.d.ts.map +1 -0
  273. package/src/shade/renderer/grass/surface/chunk_grass_column_cross.js +85 -0
  274. package/src/shade/renderer/grass/surface/chunk_grass_directory.d.ts +29 -0
  275. package/src/shade/renderer/grass/surface/chunk_grass_directory.d.ts.map +1 -0
  276. package/src/shade/renderer/grass/surface/chunk_grass_directory.js +112 -0
  277. package/src/shade/renderer/grass/surface/chunk_grass_slot.d.ts +27 -0
  278. package/src/shade/renderer/grass/surface/chunk_grass_slot.d.ts.map +1 -0
  279. package/src/shade/renderer/grass/surface/chunk_grass_slot.js +50 -0
  280. package/src/shade/renderer/grass/surface/chunk_grass_surface_frame.d.ts +21 -0
  281. package/src/shade/renderer/grass/surface/chunk_grass_surface_frame.d.ts.map +1 -0
  282. package/src/shade/renderer/grass/surface/chunk_grass_surface_frame.js +41 -0
  283. package/src/shade/renderer/grass/surface/chunk_grass_surface_window.d.ts +32 -0
  284. package/src/shade/renderer/grass/surface/chunk_grass_surface_window.d.ts.map +1 -0
  285. package/src/shade/renderer/grass/surface/chunk_grass_surface_window.js +136 -0
  286. package/src/shade/renderer/grass/surface/chunk_grass_surfel.d.ts +37 -0
  287. package/src/shade/renderer/grass/surface/chunk_grass_surfel.d.ts.map +1 -0
  288. package/src/shade/renderer/grass/surface/chunk_grass_surfel.js +85 -0
  289. package/src/shade/renderer/grass/surface/chunk_grass_tile.d.ts +25 -0
  290. package/src/shade/renderer/grass/surface/chunk_grass_tile.d.ts.map +1 -0
  291. package/src/shade/renderer/grass/surface/chunk_grass_tile.js +52 -0
  292. package/src/shade/renderer/grass/surface/shader_grass_directory_fill.d.ts +23 -0
  293. package/src/shade/renderer/grass/surface/shader_grass_directory_fill.d.ts.map +1 -0
  294. package/src/shade/renderer/grass/surface/shader_grass_directory_fill.js +87 -0
  295. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.d.ts +43 -0
  296. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.d.ts.map +1 -0
  297. package/src/shade/renderer/grass/surface/shader_grass_surface_bake.js +265 -0
  298. package/src/shade/renderer/grass/surface/shader_grass_surface_bake_command.d.ts +13 -0
  299. package/src/shade/renderer/grass/surface/shader_grass_surface_bake_command.d.ts.map +1 -0
  300. package/src/shade/renderer/grass/surface/shader_grass_surface_bake_command.js +49 -0
  301. package/src/shade/renderer/grass/surface/shader_grass_surface_invalidate.d.ts +62 -0
  302. package/src/shade/renderer/grass/surface/shader_grass_surface_invalidate.d.ts.map +1 -0
  303. package/src/shade/renderer/grass/surface/shader_grass_surface_invalidate.js +162 -0
  304. package/src/shade/renderer/grass/surface/shader_grass_surface_retire.d.ts +40 -0
  305. package/src/shade/renderer/grass/surface/shader_grass_surface_retire.d.ts.map +1 -0
  306. package/src/shade/renderer/grass/surface/shader_grass_surface_retire.js +155 -0
  307. package/src/shade/renderer/grass/surface/shader_grass_surface_schedule.d.ts +19 -0
  308. package/src/shade/renderer/grass/surface/shader_grass_surface_schedule.d.ts.map +1 -0
  309. package/src/shade/renderer/grass/surface/shader_grass_surface_schedule.js +58 -0
  310. package/src/shade/renderer/grass/surface/shader_grass_surface_want.d.ts +30 -0
  311. package/src/shade/renderer/grass/surface/shader_grass_surface_want.d.ts.map +1 -0
  312. package/src/shade/renderer/grass/surface/shader_grass_surface_want.js +251 -0
  313. package/src/shade/renderer/grass/surface/shader_grass_surface_window_count.d.ts +21 -0
  314. package/src/shade/renderer/grass/surface/shader_grass_surface_window_count.d.ts.map +1 -0
  315. package/src/shade/renderer/grass/surface/shader_grass_surface_window_count.js +75 -0
  316. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts.map +1 -1
  317. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js +4 -23
  318. package/src/shade/renderer/postprocess/velocity/view_velocity_matrices.d.ts +12 -0
  319. package/src/shade/renderer/postprocess/velocity/view_velocity_matrices.d.ts.map +1 -0
  320. package/src/shade/renderer/postprocess/velocity/view_velocity_matrices.js +29 -0
  321. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  322. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +22 -0
  323. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  324. package/src/shade/renderer/scene/GPUSceneContext.js +3 -0
  325. package/src/shade/renderer/scene/GRASS_SURFACE_PARAMS_STRUCT.d.ts +27 -0
  326. package/src/shade/renderer/scene/GRASS_SURFACE_PARAMS_STRUCT.d.ts.map +1 -0
  327. package/src/shade/renderer/scene/GRASS_SURFACE_PARAMS_STRUCT.js +38 -0
  328. package/src/shade/renderer/scene/MESH_GROUND_COVER_STRUCT.d.ts +28 -0
  329. package/src/shade/renderer/scene/MESH_GROUND_COVER_STRUCT.d.ts.map +1 -0
  330. package/src/shade/renderer/scene/MESH_GROUND_COVER_STRUCT.js +58 -0
  331. package/src/shade/renderer/scene/SCENE_DATABASE_SPEC.d.ts.map +1 -1
  332. package/src/shade/renderer/scene/SCENE_DATABASE_SPEC.js +8 -0
  333. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +8 -0
  334. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
  335. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +21 -3
  336. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts +37 -0
  337. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts.map +1 -0
  338. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.js +148 -0
  339. package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_line_span.d.ts +20 -0
  340. package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_line_span.d.ts.map +1 -0
  341. package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_line_span.js +169 -0
  342. package/src/shade/renderer/texture/atlas/chunk_tile_atlas_slot_origin.d.ts +18 -0
  343. package/src/shade/renderer/texture/atlas/chunk_tile_atlas_slot_origin.d.ts.map +1 -1
  344. package/src/shade/renderer/texture/atlas/chunk_tile_atlas_slot_origin.js +28 -0
  345. package/src/shade/renderer/texture/atlas/tile_atlas_slot_shift.d.ts +13 -0
  346. package/src/shade/renderer/texture/atlas/tile_atlas_slot_shift.d.ts.map +1 -0
  347. package/src/shade/renderer/texture/atlas/tile_atlas_slot_shift.js +22 -0
  348. package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
  349. package/src/shade/renderer/water/GPUWaterRenderer.js +4 -0
  350. package/src/shade/renderer/wind/GPUSceneWind.d.ts +52 -5
  351. package/src/shade/renderer/wind/GPUSceneWind.d.ts.map +1 -1
  352. package/src/shade/renderer/wind/GPUSceneWind.js +164 -8
  353. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.d.ts +3 -1
  354. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.d.ts.map +1 -1
  355. package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.js +3 -1
  356. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +2 -1
  357. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
  358. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +18 -13
  359. package/src/shade/renderer/wind/chunk_wind_field_sample_previous.d.ts +13 -0
  360. package/src/shade/renderer/wind/chunk_wind_field_sample_previous.d.ts.map +1 -0
  361. package/src/shade/renderer/wind/chunk_wind_field_sample_previous.js +23 -0
  362. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.d.ts +1 -0
  363. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.d.ts.map +1 -1
  364. package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.js +6 -1
  365. package/src/shade/renderer/wind/wind_field_add_resources.d.ts +11 -0
  366. package/src/shade/renderer/wind/wind_field_add_resources.d.ts.map +1 -1
  367. package/src/shade/renderer/wind/wind_field_add_resources.js +15 -0
  368. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +1 -1
  369. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  370. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +2 -0
@@ -1,5 +1,6 @@
1
1
  import { chunk_quat_rotate_v3 } from "../../../../shade/renderer/shader/chunk/geometry/quaternion/chunk_v3_apply_quat.js";
2
2
  import { chunk_rigid_velocity_at_point } from "../../../../shade/renderer/shader/chunk/physics/kinematics/chunk_rigid_velocity_at_point.js";
3
+ import { chunk_shape_record_line_span } from "../../../../shade/renderer/shader/chunk/sdf/chunk_shape_record_line_span.js";
3
4
  import { chunk_shape_record_signed_distance } from "../../../../shade/renderer/shader/chunk/sdf/chunk_shape_record_signed_distance.js";
4
5
  import { CodeChunk } from "../../../../shade/renderer/shader/compiler/CodeChunk.js";
5
6
  import { FLUID_OBSTACLE_RECORD_STRUCT } from "./FLUID_OBSTACLE_RECORD_STRUCT.js";
@@ -10,7 +11,11 @@ import { FLUID_OBSTACLE_RECORD_STRUCT } from "./FLUID_OBSTACLE_RECORD_STRUCT.js"
10
11
  * - `fluid_obstacle_record_signed_distance(record, global, x) -> f32`: signed distance to its
11
12
  * surface, negative inside; the point is solid when it is at most `record.inflation`;
12
13
  * - `fluid_obstacle_record_wall_velocity(record, global, x) -> vec3<f32>`: the wall's velocity there,
13
- * `rigid_velocity_at_point(v, ω, t, x)` with `t` the node's translation.
14
+ * `rigid_velocity_at_point(v, ω, t, x)` with `t` the node's translation;
15
+ * - `fluid_obstacle_record_line_span(record, global, origin, direction) -> vec2<f32>`: the part of the
16
+ * world line `origin + t · direction` (`direction` unit) inside its surface, as the `t` it enters at
17
+ * and the `t` it leaves at, the first greater than the second for a line that misses
18
+ * (`shape_record_line_span`). The inflation is not part of it.
14
19
  *
15
20
  * The node poses the record rigidly: its translation, and its matrix's rotation with each column
16
21
  * normalised, scale ignored, as the physics narrowphase and the CPU fluid pose a collider; then the
@@ -47,6 +52,26 @@ fn fluid_obstacle_record_signed_distance(
47
52
  return shape_record_signed_distance(record.shape_kind, record.shape_parameters, local);
48
53
  }
49
54
 
55
+ fn fluid_obstacle_record_line_span(
56
+ record: ${FLUID_OBSTACLE_RECORD_STRUCT.wgsl_ref}, global: mat4x4<f32>, origin: vec3<f32>, direction: vec3<f32>
57
+ ) -> vec2<f32> {
58
+ // the node's rotation: its columns normalised, so its scale is ignored
59
+ let r0 = global[0].xyz * (1.0 / length(global[0].xyz));
60
+ let r1 = global[1].xyz * (1.0 / length(global[1].xyz));
61
+ let r2 = global[2].xyz * (1.0 / length(global[2].xyz));
62
+
63
+ let offset = origin - global[3].xyz;
64
+
65
+ // the record's own pose within the collider, inverted
66
+ let q = record.pose_rotation;
67
+ let inverse = vec4<f32>(-q.xyz, q.w);
68
+
69
+ let local_origin = quat_rotate_v3(inverse, vec3<f32>(dot(r0, offset), dot(r1, offset), dot(r2, offset)) - record.pose_translation);
70
+ let local_direction = quat_rotate_v3(inverse, vec3<f32>(dot(r0, direction), dot(r1, direction), dot(r2, direction)));
71
+
72
+ return shape_record_line_span(record.shape_kind, record.shape_parameters, local_origin, local_direction);
73
+ }
74
+
50
75
  fn fluid_obstacle_record_wall_velocity(
51
76
  record: ${FLUID_OBSTACLE_RECORD_STRUCT.wgsl_ref}, global: mat4x4<f32>, x: vec3<f32>
52
77
  ) -> vec3<f32> {
@@ -57,5 +82,6 @@ fn fluid_obstacle_record_wall_velocity(
57
82
  chunk_quat_rotate_v3,
58
83
  chunk_rigid_velocity_at_point,
59
84
  chunk_shape_record_signed_distance,
85
+ chunk_shape_record_line_span,
60
86
  ]
61
87
  );
@@ -0,0 +1,22 @@
1
+ /**
2
+ * How the pixel data of an OpenEXR file is compressed, by the value its `compression` attribute holds.
3
+ *
4
+ * {@link exr_read } and {@link exr_write } handle {@link None }, {@link ZIPS } and {@link ZIP }. The other
5
+ * methods are listed so that a refusal can name the one a file uses.
6
+ */
7
+ export type ExrCompression = number;
8
+ export namespace ExrCompression {
9
+ let None: number;
10
+ let RLE: number;
11
+ let ZIPS: number;
12
+ let ZIP: number;
13
+ let PIZ: number;
14
+ let PXR24: number;
15
+ let B44: number;
16
+ let B44A: number;
17
+ let DWAA: number;
18
+ let DWAB: number;
19
+ let HTJ2K256: number;
20
+ let HTJ2K32: number;
21
+ }
22
+ //# sourceMappingURL=ExrCompression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExrCompression.d.ts","sourceRoot":"","sources":["../../../../../src/format/image/exr/ExrCompression.js"],"names":[],"mappings":";;;;;;6BAQU,MAAM"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * How the pixel data of an OpenEXR file is compressed, by the value its `compression` attribute holds.
3
+ *
4
+ * {@link exr_read} and {@link exr_write} handle {@link None}, {@link ZIPS} and {@link ZIP}. The other
5
+ * methods are listed so that a refusal can name the one a file uses.
6
+ *
7
+ * @see https://openexr.com/en/latest/OpenEXRFileLayout.html#compression-methods
8
+ * @readonly
9
+ * @enum {number}
10
+ */
11
+ export const ExrCompression = {
12
+ /** the chunk bytes are the pixel bytes, one scanline per chunk */
13
+ None: 0,
14
+ RLE: 1,
15
+ /** zlib, one scanline per chunk */
16
+ ZIPS: 2,
17
+ /** zlib, sixteen scanlines per chunk */
18
+ ZIP: 3,
19
+ PIZ: 4,
20
+ PXR24: 5,
21
+ B44: 6,
22
+ B44A: 7,
23
+ DWAA: 8,
24
+ DWAB: 9,
25
+ HTJ2K256: 10,
26
+ HTJ2K32: 11,
27
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * One channel of an {@link ExrImage }.
3
+ *
4
+ * The array's class is the channel's pixel type: `Float16Array` is HALF, `Float32Array` is FLOAT and
5
+ * `Uint32Array` is UINT, the three types OpenEXR has. It holds one sample per pixel, row by row, top row
6
+ * first.
7
+ */
8
+ type ExrChannel = {
9
+ name: string;
10
+ /**
11
+ * `width * height` samples
12
+ */
13
+ data: Float16Array | Float32Array | Uint32Array;
14
+ };
15
+ /**
16
+ * The pixels of a scanline OpenEXR image, one plane per channel — what {@link exr_read } returns and
17
+ * {@link exr_write } takes.
18
+ *
19
+ * `width` and `height` are those of the file's data window. Where that window sits, and the display window
20
+ * around it, are not part of the record: {@link exr_read } drops them and {@link exr_write } puts both windows
21
+ * at the origin, exactly covering the pixels.
22
+ *
23
+ * {@link exr_read } returns channels in the order OpenEXR keeps them, sorted by the bytes of their names
24
+ * (see {@link exr_compare_names }), which is the order a file's pixel data holds them in whatever order its
25
+ * channel list names them. {@link exr_write } takes them in any order.
26
+ */
27
+ type ExrImage = {
28
+ width: number;
29
+ height: number;
30
+ channels: ExrChannel[];
31
+ };
32
+ //# sourceMappingURL=ExrImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExrImage.d.ts","sourceRoot":"","sources":["../../../../../src/format/image/exr/ExrImage.js"],"names":[],"mappings":";;;;;;;;UAQc,MAAM;;;;UACN,eAAa,YAAY,GAAC,WAAW;;;;;;;;;;;;;;;WAgBrC,MAAM;YACN,MAAM;cACN,UAAU,EAAE"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * One channel of an {@link ExrImage}.
3
+ *
4
+ * The array's class is the channel's pixel type: `Float16Array` is HALF, `Float32Array` is FLOAT and
5
+ * `Uint32Array` is UINT, the three types OpenEXR has. It holds one sample per pixel, row by row, top row
6
+ * first.
7
+ *
8
+ * @typedef {object} ExrChannel
9
+ * @property {string} name
10
+ * @property {Float16Array|Float32Array|Uint32Array} data `width * height` samples
11
+ */
12
+
13
+ /**
14
+ * The pixels of a scanline OpenEXR image, one plane per channel — what {@link exr_read} returns and
15
+ * {@link exr_write} takes.
16
+ *
17
+ * `width` and `height` are those of the file's data window. Where that window sits, and the display window
18
+ * around it, are not part of the record: {@link exr_read} drops them and {@link exr_write} puts both windows
19
+ * at the origin, exactly covering the pixels.
20
+ *
21
+ * {@link exr_read} returns channels in the order OpenEXR keeps them, sorted by the bytes of their names
22
+ * (see {@link exr_compare_names}), which is the order a file's pixel data holds them in whatever order its
23
+ * channel list names them. {@link exr_write} takes them in any order.
24
+ *
25
+ * @typedef {object} ExrImage
26
+ * @property {number} width
27
+ * @property {number} height
28
+ * @property {ExrChannel[]} channels
29
+ *
30
+ * @author Alex Goldring
31
+ * @copyright Company Named Limited (c) 2026
32
+ */
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The type of a channel's samples, by the value an OpenEXR channel list stores.
3
+ *
4
+ * In an {@link ExrImage } the type is the class of the channel's array: `Uint32Array`, `Float16Array` or
5
+ * `Float32Array`.
6
+ */
7
+ export type ExrPixelType = number;
8
+ export namespace ExrPixelType {
9
+ let UINT: number;
10
+ let HALF: number;
11
+ let FLOAT: number;
12
+ }
13
+ //# sourceMappingURL=ExrPixelType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExrPixelType.d.ts","sourceRoot":"","sources":["../../../../../src/format/image/exr/ExrPixelType.js"],"names":[],"mappings":";;;;;;2BAQU,MAAM"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The type of a channel's samples, by the value an OpenEXR channel list stores.
3
+ *
4
+ * In an {@link ExrImage} the type is the class of the channel's array: `Uint32Array`, `Float16Array` or
5
+ * `Float32Array`.
6
+ *
7
+ * @see https://openexr.com/en/latest/OpenEXRFileLayout.html#channel-list
8
+ * @readonly
9
+ * @enum {number}
10
+ */
11
+ export const ExrPixelType = {
12
+ /** 32-bit unsigned integer */
13
+ UINT: 0,
14
+ /** IEEE 754 binary16 */
15
+ HALF: 1,
16
+ /** IEEE 754 binary32 */
17
+ FLOAT: 2,
18
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Order two names the way OpenEXR orders channels: byte by byte, as `strcmp` compares them.
3
+ *
4
+ * A file's pixel data holds its channels in this order whatever order its channel list is in, so this is
5
+ * the order {@link exr_read} lays samples out in and {@link exr_write} writes them in. On UTF-8 bytes it is
6
+ * code point order, which JavaScript's own string comparison is not past U+FFFF.
7
+ *
8
+ * @param {Uint8Array} a a name's bytes, without its terminator
9
+ * @param {Uint8Array} b
10
+ * @returns {number} negative when `a` comes first, positive when `b` does, 0 for the same name
11
+ *
12
+ * @author Alex Goldring
13
+ * @copyright Company Named Limited (c) 2026
14
+ */
15
+ export function exr_compare_names(a: Uint8Array, b: Uint8Array): number;
16
+ //# sourceMappingURL=exr_compare_names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exr_compare_names.d.ts","sourceRoot":"","sources":["../../../../../src/format/image/exr/exr_compare_names.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,qCAPW,UAAU,KACV,UAAU,GACR,MAAM,CAelB"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Order two names the way OpenEXR orders channels: byte by byte, as `strcmp` compares them.
3
+ *
4
+ * A file's pixel data holds its channels in this order whatever order its channel list is in, so this is
5
+ * the order {@link exr_read} lays samples out in and {@link exr_write} writes them in. On UTF-8 bytes it is
6
+ * code point order, which JavaScript's own string comparison is not past U+FFFF.
7
+ *
8
+ * @param {Uint8Array} a a name's bytes, without its terminator
9
+ * @param {Uint8Array} b
10
+ * @returns {number} negative when `a` comes first, positive when `b` does, 0 for the same name
11
+ *
12
+ * @author Alex Goldring
13
+ * @copyright Company Named Limited (c) 2026
14
+ */
15
+ export function exr_compare_names(a, b) {
16
+ const length = Math.min(a.length, b.length);
17
+
18
+ for (let i = 0; i < length; i++) {
19
+ if (a[i] !== b[i]) {
20
+ return a[i] - b[i];
21
+ }
22
+ }
23
+
24
+ return a.length - b.length;
25
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Numbers fixed by the OpenEXR file layout that both {@link exr_read} and {@link exr_write} need.
3
+ *
4
+ * @see https://openexr.com/en/latest/OpenEXRFileLayout.html
5
+ * @author Alex Goldring
6
+ * @copyright Company Named Limited (c) 2026
7
+ */
8
+ /**
9
+ * The first four bytes of every OpenEXR file, read as a little-endian integer.
10
+ * @type {number}
11
+ */
12
+ export const EXR_MAGIC: number;
13
+ /**
14
+ * The file format version, which is the low byte of the version field.
15
+ * @type {number}
16
+ */
17
+ export const EXR_VERSION: number;
18
+ /**
19
+ * Version field flag: the file holds a single tiled part.
20
+ * @type {number}
21
+ */
22
+ export const EXR_FLAG_TILED: number;
23
+ /**
24
+ * Version field flag: attribute names, attribute type names and channel names may be up to
25
+ * {@link EXR_LONG_NAME_BYTES} long rather than {@link EXR_SHORT_NAME_BYTES}.
26
+ * @type {number}
27
+ */
28
+ export const EXR_FLAG_LONG_NAMES: number;
29
+ /**
30
+ * Version field flag: the file holds deep data.
31
+ * @type {number}
32
+ */
33
+ export const EXR_FLAG_NON_IMAGE: number;
34
+ /**
35
+ * Version field flag: the file holds more than one part.
36
+ * @type {number}
37
+ */
38
+ export const EXR_FLAG_MULTI_PART: number;
39
+ /**
40
+ * Longest name, in bytes and without its terminator, a file without {@link EXR_FLAG_LONG_NAMES} may carry.
41
+ * @type {number}
42
+ */
43
+ export const EXR_SHORT_NAME_BYTES: number;
44
+ /**
45
+ * Longest name, in bytes and without its terminator, any file may carry.
46
+ * @type {number}
47
+ */
48
+ export const EXR_LONG_NAME_BYTES: number;
49
+ //# sourceMappingURL=exr_constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exr_constants.d.ts","sourceRoot":"","sources":["../../../../../src/format/image/exr/exr_constants.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,wBAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,0BAFU,MAAM,CAEa;AAE7B;;;GAGG;AACH,6BAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,kCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,iCAFU,MAAM,CAEwB;AAExC;;;GAGG;AACH,kCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,mCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,kCAFU,MAAM,CAEuB"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Numbers fixed by the OpenEXR file layout that both {@link exr_read} and {@link exr_write} need.
3
+ *
4
+ * @see https://openexr.com/en/latest/OpenEXRFileLayout.html
5
+ * @author Alex Goldring
6
+ * @copyright Company Named Limited (c) 2026
7
+ */
8
+
9
+ /**
10
+ * The first four bytes of every OpenEXR file, read as a little-endian integer.
11
+ * @type {number}
12
+ */
13
+ export const EXR_MAGIC = 20000630;
14
+
15
+ /**
16
+ * The file format version, which is the low byte of the version field.
17
+ * @type {number}
18
+ */
19
+ export const EXR_VERSION = 2;
20
+
21
+ /**
22
+ * Version field flag: the file holds a single tiled part.
23
+ * @type {number}
24
+ */
25
+ export const EXR_FLAG_TILED = 0x200;
26
+
27
+ /**
28
+ * Version field flag: attribute names, attribute type names and channel names may be up to
29
+ * {@link EXR_LONG_NAME_BYTES} long rather than {@link EXR_SHORT_NAME_BYTES}.
30
+ * @type {number}
31
+ */
32
+ export const EXR_FLAG_LONG_NAMES = 0x400;
33
+
34
+ /**
35
+ * Version field flag: the file holds deep data.
36
+ * @type {number}
37
+ */
38
+ export const EXR_FLAG_NON_IMAGE = 0x800;
39
+
40
+ /**
41
+ * Version field flag: the file holds more than one part.
42
+ * @type {number}
43
+ */
44
+ export const EXR_FLAG_MULTI_PART = 0x1000;
45
+
46
+ /**
47
+ * Longest name, in bytes and without its terminator, a file without {@link EXR_FLAG_LONG_NAMES} may carry.
48
+ * @type {number}
49
+ */
50
+ export const EXR_SHORT_NAME_BYTES = 31;
51
+
52
+ /**
53
+ * Longest name, in bytes and without its terminator, any file may carry.
54
+ * @type {number}
55
+ */
56
+ export const EXR_LONG_NAME_BYTES = 255;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Read a scanline OpenEXR file.
3
+ *
4
+ * **What it reads**: a single-part scanline image with full-resolution channels, compressed with
5
+ * {@link ExrCompression.None}, {@link ExrCompression.ZIPS} or {@link ExrCompression.ZIP}, in any of
6
+ * OpenEXR's three pixel types, mixed freely between channels. Samples come back as they are stored — a
7
+ * HALF channel is a `Float16Array` holding the file's exact bits — so reading converts nothing. Chunks are
8
+ * found through the offset table, so the file's line order does not matter.
9
+ *
10
+ * Of the header, only what decoding depends on is read: the channel list, the compression method and the
11
+ * data window. OpenEXR requires five more attributes — display window, line order, pixel aspect ratio,
12
+ * screen window centre and width — and its own reader fills in a default for any a file leaves out;
13
+ * nothing here would use them, so they are skipped like every other attribute.
14
+ *
15
+ * **What it refuses**, by name: tiled, multi-part and deep files; every other compression method;
16
+ * subsampled channels; a header without the channel list, compression or data window, or with one of
17
+ * them of the wrong type; and a file whose chunks do not add up — an offset outside the file, a chunk
18
+ * holding other scanlines than its place in the table says, a chunk whose stored or inflated size
19
+ * disagrees with the scanlines it holds. Every chunk is checked before anything is allocated for the
20
+ * pixels — against its place, its scanline, and what deflate could inflate its stored bytes to — so a file
21
+ * cannot claim more pixel data than its own chunks could hold.
22
+ *
23
+ * @param {ArrayBuffer} bytes the whole file; keep unchanged until the promise settles
24
+ * @returns {Promise<ExrImage>}
25
+ * @throws {Error} naming what is unsupported or malformed
26
+ *
27
+ * @see https://openexr.com/en/latest/OpenEXRFileLayout.html
28
+ * @author Alex Goldring
29
+ * @copyright Company Named Limited (c) 2026
30
+ */
31
+ export function exr_read(bytes: ArrayBuffer): Promise<ExrImage>;
32
+ //# sourceMappingURL=exr_read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exr_read.d.ts","sourceRoot":"","sources":["../../../../../src/format/image/exr/exr_read.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,gCARW,WAAW,GACT,QAAQ,QAAQ,CAAC,CAqL7B"}