@woosh/meep-engine 3.79.0 → 3.80.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 (309) hide show
  1. package/CHANGELOG.md +62 -3
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts +45 -0
  5. package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts.map +1 -0
  6. package/src/format/image/webp/vp8/VP8BoolDecoder.js +137 -0
  7. package/src/format/image/webp/vp8/vp8_decode.d.ts +21 -0
  8. package/src/format/image/webp/vp8/vp8_decode.d.ts.map +1 -0
  9. package/src/format/image/webp/vp8/vp8_decode.js +756 -0
  10. package/src/format/image/webp/vp8/vp8_loop_filter.d.ts +31 -0
  11. package/src/format/image/webp/vp8/vp8_loop_filter.d.ts.map +1 -0
  12. package/src/format/image/webp/vp8/vp8_loop_filter.js +189 -0
  13. package/src/format/image/webp/vp8/vp8_predict.d.ts +48 -0
  14. package/src/format/image/webp/vp8/vp8_predict.d.ts.map +1 -0
  15. package/src/format/image/webp/vp8/vp8_predict.js +290 -0
  16. package/src/format/image/webp/vp8/vp8_tables.d.ts +34 -0
  17. package/src/format/image/webp/vp8/vp8_tables.d.ts.map +1 -0
  18. package/src/format/image/webp/vp8/vp8_tables.js +350 -0
  19. package/src/format/image/webp/vp8/vp8_transform.d.ts +22 -0
  20. package/src/format/image/webp/vp8/vp8_transform.d.ts.map +1 -0
  21. package/src/format/image/webp/vp8/vp8_transform.js +114 -0
  22. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts +23 -0
  23. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts.map +1 -0
  24. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.js +133 -0
  25. package/src/format/image/webp/vp8l/VP8LBitReader.d.ts +47 -0
  26. package/src/format/image/webp/vp8l/VP8LBitReader.d.ts.map +1 -0
  27. package/src/format/image/webp/vp8l/VP8LBitReader.js +84 -0
  28. package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts +27 -0
  29. package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts.map +1 -0
  30. package/src/format/image/webp/vp8l/VP8LPrefixCode.js +184 -0
  31. package/src/format/image/webp/vp8l/vp8l_decode.d.ts +28 -0
  32. package/src/format/image/webp/vp8l/vp8l_decode.d.ts.map +1 -0
  33. package/src/format/image/webp/vp8l/vp8l_decode.js +261 -0
  34. package/src/format/image/webp/vp8l/vp8l_distance.d.ts +22 -0
  35. package/src/format/image/webp/vp8l/vp8l_distance.d.ts.map +1 -0
  36. package/src/format/image/webp/vp8l/vp8l_distance.js +62 -0
  37. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts +50 -0
  38. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts.map +1 -0
  39. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.js +267 -0
  40. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts +14 -0
  41. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts.map +1 -0
  42. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.js +99 -0
  43. package/src/format/image/webp/webp_decode.d.ts +23 -0
  44. package/src/format/image/webp/webp_decode.d.ts.map +1 -0
  45. package/src/format/image/webp/webp_decode.js +179 -0
  46. package/src/format/image/webp/webp_decode_alpha.d.ts +18 -0
  47. package/src/format/image/webp/webp_decode_alpha.d.ts.map +1 -0
  48. package/src/format/image/webp/webp_decode_alpha.js +84 -0
  49. package/src/format/texture/{basis → astc}/astc_block.d.ts +41 -0
  50. package/src/format/texture/astc/astc_block.d.ts.map +1 -0
  51. package/src/format/texture/{basis → astc}/astc_block.js +284 -164
  52. package/src/format/texture/astc/astc_decode_block.d.ts +68 -0
  53. package/src/format/texture/astc/astc_decode_block.d.ts.map +1 -0
  54. package/src/format/texture/astc/astc_decode_block.js +1119 -0
  55. package/src/format/texture/astc/astc_encode_block_4x4.d.ts +32 -0
  56. package/src/format/texture/astc/astc_encode_block_4x4.d.ts.map +1 -0
  57. package/src/format/texture/astc/astc_encode_block_4x4.js +181 -0
  58. package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts +32 -0
  59. package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts.map +1 -0
  60. package/src/format/texture/astc/astc_encode_block_4x4_rgba.js +337 -0
  61. package/src/format/texture/astc/astc_integer_sequence.d.ts.map +1 -0
  62. package/src/format/texture/{basis → astc}/astc_integer_sequence.js +251 -251
  63. package/src/format/texture/astc/astc_partition.d.ts.map +1 -0
  64. package/src/format/texture/{basis → astc}/astc_partition.js +199 -199
  65. package/src/format/texture/basis/transcode/etc1s_to_astc.js +329 -329
  66. package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -1
  67. package/src/format/texture/basis/transcode/etc1s_to_etc2.js +305 -332
  68. package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -1
  69. package/src/format/texture/basis/transcode/fit_endpoints.js +14 -27
  70. package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts +66 -0
  71. package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts.map +1 -0
  72. package/src/format/texture/basis/uastc/uastc_bc7_tables.js +148 -0
  73. package/src/format/texture/basis/uastc/uastc_decode_block.js +463 -463
  74. package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -421
  75. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +1 -6
  76. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -1
  77. package/src/format/texture/basis/uastc/uastc_to_bc5.js +48 -115
  78. package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -1
  79. package/src/format/texture/basis/uastc/uastc_to_bc7.js +604 -602
  80. package/src/format/texture/bc/bc1_decode_block.d.ts +19 -0
  81. package/src/format/texture/bc/bc1_decode_block.d.ts.map +1 -0
  82. package/src/format/texture/bc/bc1_decode_block.js +22 -0
  83. package/src/format/texture/bc/bc1_decode_colors.d.ts +27 -0
  84. package/src/format/texture/bc/bc1_decode_colors.d.ts.map +1 -0
  85. package/src/format/texture/bc/bc1_decode_colors.js +100 -0
  86. package/src/format/texture/bc/bc2_decode_block.d.ts +18 -0
  87. package/src/format/texture/bc/bc2_decode_block.d.ts.map +1 -0
  88. package/src/format/texture/bc/bc2_decode_block.js +28 -0
  89. package/src/format/texture/bc/bc3_decode_block.d.ts +18 -0
  90. package/src/format/texture/bc/bc3_decode_block.d.ts.map +1 -0
  91. package/src/format/texture/bc/bc3_decode_block.js +23 -0
  92. package/src/format/texture/bc/bc4_decode_channel.d.ts +56 -0
  93. package/src/format/texture/bc/bc4_decode_channel.d.ts.map +1 -0
  94. package/src/format/texture/bc/bc4_decode_channel.js +138 -0
  95. package/src/format/texture/bc/bc4_encode_block.d.ts +43 -0
  96. package/src/format/texture/bc/bc4_encode_block.d.ts.map +1 -0
  97. package/src/format/texture/bc/bc4_encode_block.js +324 -0
  98. package/src/format/texture/bc/bc4_snorm_decode_block.d.ts +18 -0
  99. package/src/format/texture/bc/bc4_snorm_decode_block.d.ts.map +1 -0
  100. package/src/format/texture/bc/bc4_snorm_decode_block.js +27 -0
  101. package/src/format/texture/bc/bc4_unorm_decode_block.d.ts +17 -0
  102. package/src/format/texture/bc/bc4_unorm_decode_block.d.ts.map +1 -0
  103. package/src/format/texture/bc/bc4_unorm_decode_block.js +26 -0
  104. package/src/format/texture/bc/bc5_encode_block.d.ts +25 -0
  105. package/src/format/texture/bc/bc5_encode_block.d.ts.map +1 -0
  106. package/src/format/texture/bc/bc5_encode_block.js +34 -0
  107. package/src/format/texture/bc/bc5_snorm_decode_block.d.ts +18 -0
  108. package/src/format/texture/bc/bc5_snorm_decode_block.d.ts.map +1 -0
  109. package/src/format/texture/bc/bc5_snorm_decode_block.js +27 -0
  110. package/src/format/texture/bc/bc5_unorm_decode_block.d.ts +17 -0
  111. package/src/format/texture/bc/bc5_unorm_decode_block.d.ts.map +1 -0
  112. package/src/format/texture/bc/bc5_unorm_decode_block.js +26 -0
  113. package/src/format/texture/bc/bc6h_decode_texels.d.ts +30 -0
  114. package/src/format/texture/bc/bc6h_decode_texels.d.ts.map +1 -0
  115. package/src/format/texture/bc/bc6h_decode_texels.js +430 -0
  116. package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts +20 -0
  117. package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts.map +1 -0
  118. package/src/format/texture/bc/bc6h_sfloat_decode_block.js +23 -0
  119. package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts +18 -0
  120. package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts.map +1 -0
  121. package/src/format/texture/bc/bc6h_ufloat_decode_block.js +21 -0
  122. package/src/format/texture/bc/bc7_decode_block.d.ts +30 -0
  123. package/src/format/texture/bc/bc7_decode_block.d.ts.map +1 -0
  124. package/src/format/texture/bc/bc7_decode_block.js +232 -0
  125. package/src/format/texture/bc/bc7_encode_block.d.ts +39 -0
  126. package/src/format/texture/bc/bc7_encode_block.d.ts.map +1 -0
  127. package/src/format/texture/bc/bc7_encode_block.js +423 -0
  128. package/src/format/texture/bc/bc7_tables.d.ts +126 -0
  129. package/src/format/texture/bc/bc7_tables.d.ts.map +1 -0
  130. package/src/format/texture/{basis/uastc → bc}/bc7_tables.js +225 -276
  131. package/src/format/texture/bc/bc7_write_block.d.ts +65 -0
  132. package/src/format/texture/bc/bc7_write_block.d.ts.map +1 -0
  133. package/src/format/texture/{basis/uastc → bc}/bc7_write_block.js +185 -227
  134. package/src/format/texture/etc/eac_decode_channel.d.ts +50 -0
  135. package/src/format/texture/etc/eac_decode_channel.d.ts.map +1 -0
  136. package/src/format/texture/etc/eac_decode_channel.js +142 -0
  137. package/src/format/texture/etc/eac_modifiers.d.ts +15 -0
  138. package/src/format/texture/etc/eac_modifiers.d.ts.map +1 -0
  139. package/src/format/texture/etc/eac_modifiers.js +31 -0
  140. package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts +21 -0
  141. package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts.map +1 -0
  142. package/src/format/texture/etc/eac_r11_snorm_decode_block.js +30 -0
  143. package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts +20 -0
  144. package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts.map +1 -0
  145. package/src/format/texture/etc/eac_r11_unorm_decode_block.js +29 -0
  146. package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts +19 -0
  147. package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts.map +1 -0
  148. package/src/format/texture/etc/eac_rg11_snorm_decode_block.js +28 -0
  149. package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts +19 -0
  150. package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts.map +1 -0
  151. package/src/format/texture/etc/eac_rg11_unorm_decode_block.js +28 -0
  152. package/src/format/texture/etc/etc2_decode_color.d.ts +25 -0
  153. package/src/format/texture/etc/etc2_decode_color.d.ts.map +1 -0
  154. package/src/format/texture/etc/etc2_decode_color.js +370 -0
  155. package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts +18 -0
  156. package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts.map +1 -0
  157. package/src/format/texture/etc/etc2_rgb8_decode_block.js +21 -0
  158. package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts +21 -0
  159. package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts.map +1 -0
  160. package/src/format/texture/etc/etc2_rgb8a1_decode_block.js +24 -0
  161. package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts +18 -0
  162. package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts.map +1 -0
  163. package/src/format/texture/etc/etc2_rgba8_decode_block.js +24 -0
  164. package/src/format/texture/fit/fit_line.d.ts +23 -0
  165. package/src/format/texture/fit/fit_line.d.ts.map +1 -0
  166. package/src/format/texture/fit/fit_line.js +123 -0
  167. package/src/format/texture/fit/fit_line_refine.d.ts +21 -0
  168. package/src/format/texture/fit/fit_line_refine.d.ts.map +1 -0
  169. package/src/format/texture/fit/fit_line_refine.js +69 -0
  170. package/src/format/texture/fit/fit_line_solve.d.ts +23 -0
  171. package/src/format/texture/fit/fit_line_solve.d.ts.map +1 -0
  172. package/src/format/texture/fit/fit_line_solve.js +71 -0
  173. package/src/format/texture/texel_decode_image.d.ts +44 -0
  174. package/src/format/texture/texel_decode_image.d.ts.map +1 -0
  175. package/src/format/texture/texel_decode_image.js +251 -0
  176. package/src/format/texture/texel_encode_image.d.ts +77 -0
  177. package/src/format/texture/texel_encode_image.d.ts.map +1 -0
  178. package/src/format/texture/texel_encode_image.js +187 -0
  179. package/src/shade/renderer/ShadeIndirectLightingMode.js +2 -0
  180. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  181. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  182. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +1 -0
  183. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -1
  184. package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +102 -28
  185. package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts +19 -0
  186. package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts.map +1 -0
  187. package/src/shade/renderer/loader/mtf/mtf_replace_textures.js +60 -0
  188. package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -1
  189. package/src/shade/renderer/loader/mtf/mtf_write.js +7 -31
  190. package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts +23 -0
  191. package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts.map +1 -0
  192. package/src/shade/renderer/loader/mtf/mtf_write_collection.js +36 -0
  193. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts +13 -0
  194. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts.map +1 -0
  195. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.js +39 -0
  196. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +3 -2
  197. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  198. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +6 -21
  199. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts +42 -0
  200. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts.map +1 -0
  201. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.js +612 -0
  202. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +5 -4
  203. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  204. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +8 -25
  205. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  206. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +3 -19
  207. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +14 -4
  208. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -1
  209. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +65 -54
  210. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +2 -2
  211. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  212. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +5 -22
  213. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +1 -1
  214. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts +27 -0
  215. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts.map +1 -0
  216. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.js +147 -0
  217. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +3 -4
  218. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -1
  219. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +6 -13
  220. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts +13 -0
  221. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts.map +1 -0
  222. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.js +66 -0
  223. package/src/shade/renderer/texture/encode/texture_encode.d.ts +28 -1
  224. package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -1
  225. package/src/shade/renderer/texture/encode/texture_encode.js +202 -168
  226. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +13 -1
  227. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -1
  228. package/src/shade/renderer/texture/encode/texture_encode_shader.js +146 -108
  229. package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts +20 -0
  230. package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts.map +1 -0
  231. package/src/shade/renderer/texture/format/texture_formats_to_build.js +98 -0
  232. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.d.ts.map +1 -1
  233. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +4 -23
  234. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts +53 -0
  235. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts.map +1 -0
  236. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.js +76 -0
  237. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts +40 -0
  238. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts.map +1 -0
  239. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.js +43 -0
  240. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts +17 -0
  241. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts.map +1 -0
  242. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.js +29 -0
  243. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts +21 -0
  244. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts.map +1 -0
  245. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.js +91 -0
  246. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts +32 -0
  247. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts.map +1 -0
  248. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.js +216 -0
  249. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts +30 -0
  250. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts.map +1 -0
  251. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.js +134 -0
  252. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts +16 -0
  253. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts.map +1 -0
  254. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.js +33 -0
  255. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts +18 -0
  256. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts.map +1 -0
  257. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.js +71 -0
  258. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts +20 -0
  259. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts.map +1 -0
  260. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.js +57 -0
  261. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts +18 -0
  262. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts.map +1 -0
  263. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.js +111 -0
  264. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts +16 -0
  265. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts.map +1 -0
  266. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.js +33 -0
  267. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts +18 -0
  268. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts.map +1 -0
  269. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.js +128 -0
  270. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts +21 -0
  271. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts.map +1 -0
  272. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.js +169 -0
  273. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts +21 -0
  274. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts.map +1 -0
  275. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.js +119 -0
  276. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts +16 -0
  277. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts.map +1 -0
  278. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.js +19 -0
  279. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts +24 -0
  280. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts.map +1 -0
  281. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.js +41 -0
  282. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts +24 -0
  283. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts.map +1 -0
  284. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.js +140 -0
  285. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts +21 -0
  286. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts.map +1 -0
  287. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.js +35 -0
  288. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts +19 -0
  289. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts.map +1 -0
  290. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.js +27 -0
  291. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_catmull_rom.js +4 -4
  292. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts +13 -0
  293. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts.map +1 -1
  294. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js +54 -4
  295. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mitchell.js +4 -4
  296. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.d.ts.map +1 -1
  297. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js +9 -13
  298. package/src/shade/renderer/texture/texture_block_encodings.d.ts +33 -0
  299. package/src/shade/renderer/texture/texture_block_encodings.d.ts.map +1 -0
  300. package/src/shade/renderer/texture/texture_block_encodings.js +89 -0
  301. package/src/format/texture/basis/astc_block.d.ts.map +0 -1
  302. package/src/format/texture/basis/astc_integer_sequence.d.ts.map +0 -1
  303. package/src/format/texture/basis/astc_partition.d.ts.map +0 -1
  304. package/src/format/texture/basis/uastc/bc7_tables.d.ts +0 -111
  305. package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +0 -1
  306. package/src/format/texture/basis/uastc/bc7_write_block.d.ts +0 -124
  307. package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +0 -1
  308. /package/src/format/texture/{basis → astc}/astc_integer_sequence.d.ts +0 -0
  309. /package/src/format/texture/{basis → astc}/astc_partition.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -17,7 +17,8 @@
17
17
  - **Added:** `mtf_write(bundle, texture_variants)` and `mtf_texture_write(texel_data)`, and over them
18
18
  `mtf_export({ bundle, name, optimize, encode_texture })`, which returns every file of a model by its path.
19
19
  `optimize` runs `scene_optimize` on the bundle first. `encode_texture` builds a texture's files; the default
20
- writes an AVIF fallback for decoded pixels, a texture file for texels every device samples, and no block formats.
20
+ writes each texture's fallback (an AVIF of decoded pixels, or texels every device samples as they are) and a
21
+ texture file in each block format the texture's role is built in.
21
22
  - **Added:** `StandardShadeMaterialSerializationAdapter`, `SceneNodeSerializationAdapter`,
22
23
  `SkinSerializationAdapter` and `ShadeAnimationClipSerializationAdapter`. A clip's record holds each curve once
23
24
  and its channels name curves by index, so curves shared between components stay shared.
@@ -33,8 +34,66 @@
33
34
  - **Added:** `@woosh/gltf2mtf`, a package of its own beside the engine (`packages/gltf2mtf`): a command that
34
35
  converts glTF and GLB models to MTF, `npx @woosh/gltf2mtf <models> --out <folder>`. The textures of every model
35
36
  go to one folder the packages share, a file named by a digest of what it holds, so models that use the same image
36
- share one file, in one run and across runs. Images are written as AVIF on every core but one, or copied with
37
- `--images copy`. The scene optimizer runs over each model first, unless `--no-optimize` is given.
37
+ share one file, in one run and across runs. Each texture is written in its role's block formats and as a fallback,
38
+ an AVIF or with `--images copy` the image as it is, on every core but one. The scene optimizer runs over each
39
+ model first, unless `--no-optimize` is given.
40
+ - **Added:** CPU decoders for every block-compressed format WebGPU names: BC1 to BC7 (`format/texture/bc/`), ETC2
41
+ and EAC (`format/texture/etc/`), and ASTC in the LDR profile at every footprint (`format/texture/astc/`). One
42
+ function per format variant, `(source, offset, out)`, writing a block's texels as RGBA. Over them
43
+ `texel_decode_image(format, width, height, bytes)`, which reads those and the eight-bit texel formats to a
44
+ `Sampler2D`. BC6H and BC7 decode exactly as an NVIDIA GPU's hardware does on every mode.
45
+ - **Added:** CPU block encoders, taking a block's sixteen texels as bytes: `bc4_unorm_encode_block`,
46
+ `bc4_snorm_encode_block`, `bc5_unorm_encode_block`, `bc5_snorm_encode_block`, `bc7_encode_block` (modes 6 and 1,
47
+ chosen by actual error) and `astc_encode_block_4x4`, and over them `texel_encode_image(format, image)`. Each
48
+ decodes at least as close to a picture as the GPU encoder for its format, on that encoder's own fixtures.
49
+ - **Added:** `format/texture/fit/`: `fit_line` (a set of points' principal line, by the symmetric eigen solvers in
50
+ `core`, and their distance from it), `fit_line_solve` (a line's ends by least squares, given each point's weight)
51
+ and `fit_line_refine`. The BC7 and ASTC encoders fit with them, and the ETC1S transcoder's endpoint solve is
52
+ `fit_line_solve`.
53
+ - **Changed:** `BC7_MODES` is in `bc7_tables.js`, complete — modes 0 and 4 and the index selection bit included —
54
+ beside `bc7_weights` and `bc7_interpolate`; the writer, the decoder and the encoder all read them.
55
+ `bc7_write_block` writes all sixteen bytes of its block (it used to OR its bits into whatever was there), writes
56
+ modes 0 and 4, and allocates nothing. `astc_write_block` allocates nothing either.
57
+ - **Added:** `bc4_unorm_palette` and `bc4_snorm_palette`, the values a BC4 block's codes decode to.
58
+ - **Changed:** the UASTC to BC5 transcoder encodes each channel with `bc4_unorm_encode_channel`, rather than with
59
+ the channel's bounding line.
60
+ - **Changed:** the ASTC 4x4 encoders keep alpha, on the GPU (`texture_encode` to `astc-4x4-unorm`) and on the CPU
61
+ (`astc_encode_block_4x4`). A block whose alpha is not opaque is written in colour endpoint mode 12, as one line
62
+ through four channels or with alpha on a second plane of weights, whichever decodes nearer; an opaque block is
63
+ written as before. So a colour texture with alpha, a cut-out, gets an ASTC file beside its BC7 one, and
64
+ `texel_encode_stores_alpha` answers `true` for ASTC 4x4.
65
+ - **Added:** `astc_write_block_rgba`, the writer of those mode-12 blocks, and `astc_unquantize_endpoint` and
66
+ `astc_unquantize_weight`, the decoder's own unquantization tables. `astc_encode_block_4x4_rgb` is the mode-8
67
+ encoder alone, which reads no alpha: what `texel_encode_image_rgb` writes ASTC 4x4 with.
68
+ - **Added:** `mipmap_chain_cpu(base, filter, srgb)`: on the CPU, the chain `WebGPUMipmapGenerator` builds, with
69
+ every filter it supports, level for level.
70
+ - **Added:** `texture_formats_to_build(role)`: the block formats every device WebGPU allows would choose from
71
+ `texture_format_preference` for a role, and nothing else — BC7 or BC5, and ASTC 4x4. And
72
+ `texture_block_encodings(levels, role, generate, filter, srgb)`: a texture's pixels in each of them, with its
73
+ chain, as `ShadeTexelData`.
74
+ - **Changed:** `mtf_encode_texture` reads a texture that brings block-compressed texels, rather than refusing it:
75
+ their pixels make the fallback and the other formats, and their own format is written as it is. Texels that
76
+ decode to no eight-bit picture (BC6H, the snorm formats) are refused.
77
+ - **Changed:** the GPU BC7 encoder keeps an alpha that is the same throughout a block exactly: an opaque block
78
+ decodes opaque, a clear one clear. Its mode 6 used to give opaque blocks alpha 254 wherever the colour preferred
79
+ the other parity.
80
+ - **Fixed:** the GPU block encoders' line fit (BC1, BC6H mode 11, BC7, BC7 mode 6, ASTC 4x4) found a block's
81
+ principal axis by power iteration from one starting direction, which some blocks are orthogonal to: pure red
82
+ against pure blue decoded as their mean, and in BC7 a channel varying apart from a stronger joint direction kept
83
+ the line. `chunk_scatter_principal_axis` iterates from every channel at once.
84
+ - **Added:** `texture_encode_rgb(cmd, options)` and `texture_encode_shader_rgb(format)`: the GPU block encoder for a
85
+ texture whose alpha nobody reads. BC7 goes through `bc7_encode_block_rgb` (`chunk_bc7_encode_block`,
86
+ `shader_texture_encode_bc7_rgb`), which fits the colour alone: the parity bits an opaque alpha would take serve the
87
+ colour, and alpha decodes 254 or 255. Every other target encodes as `texture_encode` does.
88
+ - **Added:** `bc7_encode_block_rgb(texels, out, offset)` and `texel_encode_image_rgb(format, image)`: the CPU encoders
89
+ for a texture whose alpha nobody reads, the colour fitted alone and alpha decoding 254 or 255 in BC7.
90
+ `texture_block_encodings` writes every role but albedo that way rather than forcing its alpha opaque: Sponza's
91
+ ORM textures gain 1 dB on average and up to 4.3 dB in BC7.
92
+ - **Fixed:** the ETC1S to ETC2 RGBA transcoder fitted alpha against two wrong rows (1 and 5) of EAC's modifier
93
+ table. It now uses `EAC_MODIFIERS` (`format/texture/etc/eac_modifiers.js`), the specification's table.
94
+ - **Changed:** `format/texture/basis/uastc/bc7_write_block.js` and BC7's partition and anchor tables moved to
95
+ `format/texture/bc/`, and `format/texture/basis/astc_*.js` to `format/texture/astc/`; UASTC's mapping onto BC7's
96
+ partitions is `format/texture/basis/uastc/uastc_bc7_tables.js`.
38
97
 
39
98
  ### Generation: wave function collapse over a grid
40
99
 
package/README.md CHANGED
@@ -57,7 +57,7 @@ rendering controls and custom passes.
57
57
  pathfinding, behaviour trees, blackboards and [Monte-Carlo tree search](https://meep.company-named.com/docs/ai-and-simulation/).
58
58
  * **[Procedural generation](https://meep.company-named.com/docs/generation/overview/).** Rule-driven
59
59
  grids, entity placement and reusable themes, composed as generation tasks.
60
- * **Assets.** glTF with meshopt compression, asset streaming, PNG/JPEG/AVIF decoding and versioned
60
+ * **Assets.** glTF with meshopt compression, asset streaming, PNG/JPEG/WebP/AVIF decoding and versioned
61
61
  binary serialization.
62
62
  * **Tools.** An editor for live scenes, per-pass GPU profiling, and a software WebGPU implementation
63
63
  for shader and pipeline testing.
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Advanced 3D game engine",
7
7
  "type": "module",
8
8
  "author": "Alexander Goldring",
9
- "version": "3.79.0",
9
+ "version": "3.80.1",
10
10
  "exports": {
11
11
  "./build/*": "./build/*",
12
12
  "./src/*": "./src/*",
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The boolean entropy decoder of a VP8 frame (RFC 6386 §7): each call reads one bit whose probability of being 0 is
3
+ * `probability / 256`.
4
+ *
5
+ * Reading past the end of its bytes reads zeros, as the reference decoder does.
6
+ *
7
+ * @author Alex Goldring
8
+ * @copyright Company Named Limited (c) 2026
9
+ */
10
+ export class VP8BoolDecoder {
11
+ /**
12
+ * @param {Uint8Array} bytes
13
+ * @param {number} start first byte of the partition
14
+ * @param {number} end one past its last
15
+ */
16
+ constructor(bytes: Uint8Array, start: number, end: number);
17
+ /**
18
+ * @param {number} probability of a 0, out of 256
19
+ * @returns {number} 0 or 1
20
+ */
21
+ bit(probability: number): number;
22
+ /**
23
+ * An unsigned value of `count` bits, each even odds, most significant first.
24
+ *
25
+ * @param {number} count
26
+ * @returns {number}
27
+ */
28
+ literal(count: number): number;
29
+ /**
30
+ * A magnitude of `count` bits then a sign bit, as frame headers write their signed fields.
31
+ *
32
+ * @param {number} count
33
+ * @returns {number}
34
+ */
35
+ signed_literal(count: number): number;
36
+ /**
37
+ * A field that is present only when a flag bit before it says so, else 0.
38
+ *
39
+ * @param {number} count
40
+ * @returns {number}
41
+ */
42
+ optional_signed_literal(count: number): number;
43
+ #private;
44
+ }
45
+ //# sourceMappingURL=VP8BoolDecoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VP8BoolDecoder.d.ts","sourceRoot":"","sources":["../../../../../../src/format/image/webp/vp8/VP8BoolDecoder.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH;IAuCI;;;;OAIG;IACH,mBAJW,UAAU,SACV,MAAM,OACN,MAAM,EAOhB;IASD;;;OAGG;IACH,iBAHW,MAAM,GACJ,MAAM,CA4BlB;IAED;;;;;OAKG;IACH,eAHW,MAAM,GACJ,MAAM,CAUlB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;;;OAKG;IACH,+BAHW,MAAM,GACJ,MAAM,CAIlB;;CACJ"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * The boolean entropy decoder of a VP8 frame (RFC 6386 §7): each call reads one bit whose probability of being 0 is
3
+ * `probability / 256`.
4
+ *
5
+ * Reading past the end of its bytes reads zeros, as the reference decoder does.
6
+ *
7
+ * @author Alex Goldring
8
+ * @copyright Company Named Limited (c) 2026
9
+ */
10
+ export class VP8BoolDecoder {
11
+ /**
12
+ * @type {Uint8Array}
13
+ */
14
+ #bytes;
15
+
16
+ /**
17
+ * The next byte to shift in.
18
+ *
19
+ * @type {number}
20
+ */
21
+ #position;
22
+
23
+ /**
24
+ * One past the last byte of this decoder's partition.
25
+ *
26
+ * @type {number}
27
+ */
28
+ #end;
29
+
30
+ /**
31
+ * Two bytes of the arithmetic code, the top one being compared against the split.
32
+ *
33
+ * @type {number}
34
+ */
35
+ #value;
36
+
37
+ /**
38
+ * @type {number}
39
+ */
40
+ #range = 255;
41
+
42
+ /**
43
+ * Bits shifted out of the low byte of {@link #value} since a byte was last shifted in.
44
+ *
45
+ * @type {number}
46
+ */
47
+ #bit_count = 0;
48
+
49
+ /**
50
+ * @param {Uint8Array} bytes
51
+ * @param {number} start first byte of the partition
52
+ * @param {number} end one past its last
53
+ */
54
+ constructor(bytes, start, end) {
55
+ this.#bytes = bytes;
56
+ this.#end = Math.min(end, bytes.length);
57
+ this.#position = start;
58
+ this.#value = (this.#next_byte() << 8) | this.#next_byte();
59
+ }
60
+
61
+ /**
62
+ * @returns {number}
63
+ */
64
+ #next_byte() {
65
+ return this.#position < this.#end ? this.#bytes[this.#position++] : 0;
66
+ }
67
+
68
+ /**
69
+ * @param {number} probability of a 0, out of 256
70
+ * @returns {number} 0 or 1
71
+ */
72
+ bit(probability) {
73
+ const split = 1 + (((this.#range - 1) * probability) >> 8);
74
+ const split_high = split << 8;
75
+
76
+ let bit;
77
+
78
+ if (this.#value >= split_high) {
79
+ bit = 1;
80
+ this.#range -= split;
81
+ this.#value -= split_high;
82
+ } else {
83
+ bit = 0;
84
+ this.#range = split;
85
+ }
86
+
87
+ while (this.#range < 128) {
88
+ this.#value <<= 1;
89
+ this.#range <<= 1;
90
+
91
+ if (++this.#bit_count === 8) {
92
+ this.#bit_count = 0;
93
+ this.#value |= this.#next_byte();
94
+ }
95
+ }
96
+
97
+ return bit;
98
+ }
99
+
100
+ /**
101
+ * An unsigned value of `count` bits, each even odds, most significant first.
102
+ *
103
+ * @param {number} count
104
+ * @returns {number}
105
+ */
106
+ literal(count) {
107
+ let value = 0;
108
+
109
+ while (count-- > 0) {
110
+ value = (value << 1) | this.bit(128);
111
+ }
112
+
113
+ return value;
114
+ }
115
+
116
+ /**
117
+ * A magnitude of `count` bits then a sign bit, as frame headers write their signed fields.
118
+ *
119
+ * @param {number} count
120
+ * @returns {number}
121
+ */
122
+ signed_literal(count) {
123
+ const magnitude = this.literal(count);
124
+
125
+ return this.bit(128) === 1 ? -magnitude : magnitude;
126
+ }
127
+
128
+ /**
129
+ * A field that is present only when a flag bit before it says so, else 0.
130
+ *
131
+ * @param {number} count
132
+ * @returns {number}
133
+ */
134
+ optional_signed_literal(count) {
135
+ return this.bit(128) === 1 ? this.signed_literal(count) : 0;
136
+ }
137
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A VP8 key frame, the payload of a `VP8 ` chunk (RFC 6386), decoded to RGBA as libwebp decodes it.
3
+ *
4
+ * The frame header, the intra modes and the DCT tokens are read; every macroblock is predicted and its residual added
5
+ * in raster order, prediction reading samples before any filtering; then the loop filter runs over the whole frame,
6
+ * macroblock by macroblock; then the picture is cropped out of the macroblock grid and converted.
7
+ *
8
+ * @param {Uint8Array} bytes
9
+ * @returns {{width: number, height: number, data: Uint8Array}} opaque RGBA
10
+ * @throws {Error} for an inter frame, and for a frame whose partitions do not fit its bytes. A partition whose data
11
+ * ends early reads zeros past its end, as the boolean decoder does anywhere
12
+ *
13
+ * @author Alex Goldring
14
+ * @copyright Company Named Limited (c) 2026
15
+ */
16
+ export function vp8_decode(bytes: Uint8Array): {
17
+ width: number;
18
+ height: number;
19
+ data: Uint8Array;
20
+ };
21
+ //# sourceMappingURL=vp8_decode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vp8_decode.d.ts","sourceRoot":"","sources":["../../../../../../src/format/image/webp/vp8/vp8_decode.js"],"names":[],"mappings":"AAoKA;;;;;;;;;;;;;;GAcG;AACH,kCARW,UAAU,GACR;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAC,CA2a7D"}