@woosh/meep-engine 3.14.2 → 3.14.3

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 (1178) hide show
  1. package/editor/prototypeEditorShell.js +6 -0
  2. package/package.json +1 -1
  3. package/src/CODEC_LAYOUT_VERIFICATION.md +420 -0
  4. package/src/core/binary/zstd/ZstdReverseBitReader.d.ts +76 -0
  5. package/src/core/binary/zstd/ZstdReverseBitReader.d.ts.map +1 -0
  6. package/src/core/binary/zstd/ZstdReverseBitReader.js +223 -0
  7. package/src/core/binary/zstd/zstd_decompress.d.ts +31 -0
  8. package/src/core/binary/zstd/zstd_decompress.d.ts.map +1 -0
  9. package/src/core/binary/zstd/zstd_decompress.js +628 -0
  10. package/src/core/binary/zstd/zstd_fse.d.ts +83 -0
  11. package/src/core/binary/zstd/zstd_fse.d.ts.map +1 -0
  12. package/src/core/binary/zstd/zstd_fse.js +265 -0
  13. package/src/core/binary/zstd/zstd_huffman.d.ts +56 -0
  14. package/src/core/binary/zstd/zstd_huffman.d.ts.map +1 -0
  15. package/src/core/binary/zstd/zstd_huffman.js +244 -0
  16. package/src/core/binary/zstd/zstd_sequence_tables.d.ts +62 -0
  17. package/src/core/binary/zstd/zstd_sequence_tables.d.ts.map +1 -0
  18. package/src/core/binary/zstd/zstd_sequence_tables.js +98 -0
  19. package/src/core/color/COLOR_REVIEW_2026_08_28.md +1 -1
  20. package/src/core/color/PQ/PQ_constants.d.ts +1 -1
  21. package/src/core/color/PQ/PQ_constants.js +1 -1
  22. package/src/engine/asset/GameAssetType.d.ts +1 -0
  23. package/src/engine/asset/GameAssetType.js +8 -0
  24. package/src/engine/asset/codec/DecodedImage.d.ts +39 -0
  25. package/src/engine/asset/codec/DecodedImage.d.ts.map +1 -0
  26. package/src/engine/asset/codec/DecodedImage.js +26 -0
  27. package/src/engine/asset/guessAssetType.d.ts.map +1 -1
  28. package/src/engine/asset/guessAssetType.js +10 -0
  29. package/src/engine/asset/load_model_scene_bundle.d.ts +1 -1
  30. package/src/engine/asset/load_model_scene_bundle.d.ts.map +1 -1
  31. package/src/engine/asset/load_model_scene_bundle.js +6 -2
  32. package/src/engine/asset/loaders/USDSceneBundleAssetLoader.d.ts +37 -0
  33. package/src/engine/asset/loaders/USDSceneBundleAssetLoader.d.ts.map +1 -0
  34. package/src/engine/asset/loaders/USDSceneBundleAssetLoader.js +104 -0
  35. package/src/engine/asset/loaders/image/IMAGE_CODEC_REVIEW_2026_08_28.md +83 -71
  36. package/src/engine/asset/loaders/image/ImageDecoderWorker.js +2 -2
  37. package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts +8 -9
  38. package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts.map +1 -1
  39. package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +12 -3
  40. package/src/engine/asset/loaders/image/avif/encode_image_source.d.ts +70 -0
  41. package/src/engine/asset/loaders/image/avif/encode_image_source.d.ts.map +1 -0
  42. package/src/engine/asset/loaders/image/avif/encode_image_source.js +117 -0
  43. package/src/engine/asset/loaders/image/avif/encoder_worker.d.ts.map +1 -0
  44. package/src/engine/asset/loaders/image/avif/threaded_image_encoder.d.ts.map +1 -0
  45. package/src/engine/asset/loaders/image/codec/AvifCodec.d.ts +34 -0
  46. package/src/engine/asset/loaders/image/codec/AvifCodec.d.ts.map +1 -0
  47. package/src/engine/asset/loaders/image/codec/AvifCodec.js +85 -0
  48. package/src/engine/asset/loaders/image/codec/JpegCodec.d.ts +26 -0
  49. package/src/engine/asset/loaders/image/codec/JpegCodec.d.ts.map +1 -0
  50. package/src/engine/asset/loaders/image/codec/JpegCodec.js +66 -0
  51. package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts +4 -16
  52. package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts.map +1 -1
  53. package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +2 -2
  54. package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts +21 -1
  55. package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts.map +1 -1
  56. package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js +21 -1
  57. package/src/engine/asset/loaders/image/prototypePNG.d.ts.map +1 -0
  58. package/src/engine/asset/loaders/image/prototypePNG.js +37 -0
  59. package/src/engine/asset/preloader/extractAssetListFromManager.d.ts.map +1 -1
  60. package/src/engine/asset/preloader/extractAssetListFromManager.js +2 -1
  61. package/src/engine/graphics/ecs/mesh/assetTypeByPath.d.ts.map +1 -1
  62. package/src/engine/graphics/ecs/mesh/assetTypeByPath.js +6 -0
  63. package/src/engine/graphics/texture/sampler/avif_to_sampler2d.d.ts +25 -0
  64. package/src/engine/graphics/texture/sampler/avif_to_sampler2d.d.ts.map +1 -0
  65. package/src/engine/graphics/texture/sampler/avif_to_sampler2d.js +42 -0
  66. package/src/engine/graphics/texture/sampler/compare/sampler2d_compare.d.ts.map +1 -0
  67. package/src/engine/graphics/texture/sampler/compare/sampler2d_compare.js +94 -0
  68. package/src/engine/graphics/texture/sampler/compare/sampler2d_max_absolute_difference.d.ts +19 -0
  69. package/src/engine/graphics/texture/sampler/compare/sampler2d_max_absolute_difference.d.ts.map +1 -0
  70. package/src/engine/graphics/texture/sampler/compare/sampler2d_max_absolute_difference.js +62 -0
  71. package/src/engine/graphics/texture/sampler/compare/sampler2d_psnr.d.ts +30 -0
  72. package/src/engine/graphics/texture/sampler/compare/sampler2d_psnr.d.ts.map +1 -0
  73. package/src/engine/graphics/texture/sampler/compare/sampler2d_psnr.js +115 -0
  74. package/src/engine/graphics/texture/sampler/sampler2d_to_avif.d.ts.map +1 -0
  75. package/src/engine/graphics/texture/sampler/sampler2d_to_avif.js +108 -0
  76. package/src/engine/graphics/texture/sampler/sampler2d_to_f16.d.ts +7 -1
  77. package/src/engine/graphics/texture/sampler/sampler2d_to_f16.d.ts.map +1 -1
  78. package/src/engine/graphics/texture/sampler/sampler2d_to_f16.js +28 -21
  79. package/src/engine/graphics/texture/sampler/sampler2d_to_uint8_RGBA.d.ts.map +1 -1
  80. package/src/engine/graphics/texture/sampler/sampler2d_to_uint8_RGBA.js +3 -0
  81. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  82. package/src/format/image/avif/DECISIONS.md +545 -0
  83. package/src/format/image/avif/api/AvifDecoder.d.ts.map +1 -0
  84. package/src/format/image/avif/api/apply_transformations.d.ts.map +1 -0
  85. package/src/format/image/avif/api/convert_to_rgba.d.ts.map +1 -0
  86. package/src/format/image/avif/api/convert_to_rgba.js +204 -0
  87. package/src/format/image/avif/api/decode_avif.d.ts.map +1 -0
  88. package/src/format/image/avif/api/decode_image_item.d.ts.map +1 -0
  89. package/src/format/image/avif/api/encode_avif.d.ts.map +1 -0
  90. package/src/format/image/avif/av1/decode/Av1FrameContext.d.ts.map +1 -0
  91. package/src/format/image/avif/av1/decode/block_decoded.d.ts.map +1 -0
  92. package/src/format/image/avif/av1/decode/decode_av1_still.d.ts.map +1 -0
  93. package/src/format/image/avif/av1/decode/decode_coefficients.d.ts.map +1 -0
  94. package/src/format/image/avif/av1/decode/decode_palette.d.ts.map +1 -0
  95. package/src/format/image/avif/av1/decode/decode_palette.js +442 -0
  96. package/src/format/image/avif/av1/decode/decode_tile.d.ts.map +1 -0
  97. package/src/format/image/avif/av1/decode/decode_tile.js +1213 -0
  98. package/src/format/image/avif/av1/decode/get_scan.d.ts.map +1 -0
  99. package/src/format/image/avif/av1/decode/read_lr.d.ts.map +1 -0
  100. package/src/format/image/avif/av1/decode/read_lr.js +277 -0
  101. package/src/format/image/avif/av1/decode/read_transform_type.d.ts.map +1 -0
  102. package/src/format/image/avif/av1/decode/read_transform_type.js +92 -0
  103. package/src/format/image/avif/av1/decode/reconstruct.d.ts.map +1 -0
  104. package/src/format/image/avif/av1/decode/reconstruct.js +241 -0
  105. package/src/format/image/avif/av1/decode/transform_type.d.ts.map +1 -0
  106. package/src/format/image/avif/av1/encode/Av1BlockSnapshot.d.ts.map +1 -0
  107. package/src/format/image/avif/av1/encode/Av1EncodeContext.d.ts.map +1 -0
  108. package/src/format/image/avif/av1/encode/build_headers.d.ts.map +1 -0
  109. package/src/format/image/avif/av1/encode/choose_chroma_alpha.d.ts.map +1 -0
  110. package/src/format/image/avif/av1/encode/choose_filters.d.ts.map +1 -0
  111. package/src/format/image/avif/av1/encode/choose_restoration.d.ts.map +1 -0
  112. package/src/format/image/avif/av1/encode/choose_restoration.js +616 -0
  113. package/src/format/image/avif/av1/encode/decode_effort.d.ts.map +1 -0
  114. package/src/format/image/avif/av1/encode/encode_av1_still.d.ts.map +1 -0
  115. package/src/format/image/avif/av1/encode/encode_effort.d.ts.map +1 -0
  116. package/src/format/image/avif/av1/encode/encode_tile.d.ts.map +1 -0
  117. package/src/format/image/avif/av1/encode/encode_tile.js +2331 -0
  118. package/src/format/image/avif/av1/encode/quantise.d.ts.map +1 -0
  119. package/src/format/image/avif/av1/encode/write_coefficients.d.ts.map +1 -0
  120. package/src/format/image/avif/av1/encode/write_lr.d.ts.map +1 -0
  121. package/src/format/image/avif/av1/encode/write_transform_type.d.ts.map +1 -0
  122. package/src/format/image/avif/av1/entropy/CdfContext.d.ts.map +1 -0
  123. package/src/format/image/avif/av1/entropy/SymbolReader.d.ts.map +1 -0
  124. package/src/format/image/avif/av1/entropy/SymbolWriter.d.ts.map +1 -0
  125. package/src/format/image/avif/av1/entropy/coefficient_context.d.ts.map +1 -0
  126. package/src/format/image/avif/av1/entropy/partition_cdf.d.ts.map +1 -0
  127. package/src/format/image/avif/av1/entropy/symbol_cost.d.ts.map +1 -0
  128. package/src/format/image/avif/av1/filter/cdef.d.ts.map +1 -0
  129. package/src/format/image/avif/av1/filter/cdef.js +313 -0
  130. package/src/format/image/avif/av1/filter/loop_filter.d.ts.map +1 -0
  131. package/src/format/image/avif/av1/filter/loop_filter.js +377 -0
  132. package/src/format/image/avif/av1/filter/loop_restoration.d.ts.map +1 -0
  133. package/src/format/image/avif/av1/filter/loop_restoration.js +451 -0
  134. package/src/format/image/avif/av1/filter/superres.d.ts.map +1 -0
  135. package/src/format/image/avif/av1/filter/superres.js +86 -0
  136. package/src/format/image/avif/av1/grain/FilmGrainState.d.ts.map +1 -0
  137. package/src/format/image/avif/av1/grain/film_grain.d.ts.map +1 -0
  138. package/src/format/image/avif/av1/grain/film_grain.js +623 -0
  139. package/src/format/image/avif/av1/obu/FrameHeader.d.ts.map +1 -0
  140. package/src/format/image/avif/av1/obu/ObuHeader.d.ts.map +1 -0
  141. package/src/format/image/avif/av1/obu/SequenceHeader.d.ts.map +1 -0
  142. package/src/format/image/avif/av1/obu/for_each_obu.d.ts.map +1 -0
  143. package/src/format/image/avif/av1/obu/parse_frame_header.d.ts.map +1 -0
  144. package/src/format/image/avif/av1/obu/parse_frame_header.js +841 -0
  145. package/src/format/image/avif/av1/obu/parse_obu_header.d.ts.map +1 -0
  146. package/src/format/image/avif/av1/obu/parse_sequence_header.d.ts.map +1 -0
  147. package/src/format/image/avif/av1/obu/write_frame_header.d.ts.map +1 -0
  148. package/src/format/image/avif/av1/obu/write_sequence_header.d.ts.map +1 -0
  149. package/src/format/image/avif/av1/predict/IntraPredictionState.d.ts.map +1 -0
  150. package/src/format/image/avif/av1/predict/intra_filter_type.d.ts.map +1 -0
  151. package/src/format/image/avif/av1/predict/predict_chroma_from_luma.d.ts.map +1 -0
  152. package/src/format/image/avif/av1/predict/predict_chroma_from_luma.js +153 -0
  153. package/src/format/image/avif/av1/predict/predict_intra.d.ts.map +1 -0
  154. package/src/format/image/avif/av1/predict/predict_intra.js +803 -0
  155. package/src/format/image/avif/av1/predict/predict_palette.d.ts.map +1 -0
  156. package/src/format/image/avif/av1/tables/av1_symbols.d.ts.map +1 -0
  157. package/src/format/image/avif/av1/tables/av1_symbols.js +419 -0
  158. package/src/format/image/avif/av1/tables/block_tables.d.ts.map +1 -0
  159. package/src/format/image/avif/av1/tables/block_tables.js +270 -0
  160. package/src/format/image/avif/av1/tables/cdf_tables.d.ts.map +1 -0
  161. package/src/format/image/avif/av1/tables/cdf_tables.js +1893 -0
  162. package/src/format/image/avif/av1/tables/coefficient_tables.d.ts.map +1 -0
  163. package/src/format/image/avif/av1/tables/coefficient_tables.js +82 -0
  164. package/src/format/image/avif/av1/tables/derived_block_tables.d.ts.map +1 -0
  165. package/src/format/image/avif/av1/tables/filter_tables.d.ts.map +1 -0
  166. package/src/format/image/avif/av1/tables/filter_tables.js +313 -0
  167. package/src/format/image/avif/av1/tables/grain_tables.d.ts.map +1 -0
  168. package/src/format/image/avif/av1/tables/grain_tables.js +190 -0
  169. package/src/format/image/avif/av1/tables/prediction_tables.d.ts.map +1 -0
  170. package/src/format/image/avif/av1/tables/prediction_tables.js +223 -0
  171. package/src/format/image/avif/av1/tables/quantizer_matrix_tables.d.ts.map +1 -0
  172. package/src/format/image/avif/av1/tables/quantizer_matrix_tables.js +38 -0
  173. package/src/format/image/avif/av1/tables/quantizer_tables.d.ts.map +1 -0
  174. package/src/format/image/avif/av1/tables/quantizer_tables.js +160 -0
  175. package/src/format/image/avif/av1/tables/scan_tables.d.ts.map +1 -0
  176. package/src/format/image/avif/av1/tables/scan_tables.js +727 -0
  177. package/src/format/image/avif/av1/tables/segmentation_tables.d.ts.map +1 -0
  178. package/src/format/image/avif/av1/tables/segmentation_tables.js +48 -0
  179. package/src/format/image/avif/av1/tables/transform_tables.d.ts.map +1 -0
  180. package/src/format/image/avif/av1/tables/transform_tables.js +140 -0
  181. package/src/format/image/avif/av1/tables/unpack_table.d.ts.map +1 -0
  182. package/src/format/image/avif/av1/tables/unpack_table.js +73 -0
  183. package/src/format/image/avif/av1/transform/forward_transform_2d.d.ts.map +1 -0
  184. package/src/format/image/avif/av1/transform/inverse_transform_1d.d.ts.map +1 -0
  185. package/src/format/image/avif/av1/transform/inverse_transform_1d.js +590 -0
  186. package/src/format/image/avif/av1/transform/inverse_transform_2d.d.ts.map +1 -0
  187. package/src/format/image/avif/av1/transform/inverse_transform_2d.js +180 -0
  188. package/src/format/image/avif/av1/util/ceil_log2.d.ts.map +1 -0
  189. package/src/format/image/avif/av1/util/floor_log2.d.ts +20 -0
  190. package/src/format/image/avif/av1/util/floor_log2.d.ts.map +1 -0
  191. package/src/format/image/avif/av1/util/floor_log2.js +20 -0
  192. package/src/format/image/avif/av1/util/round2.d.ts.map +1 -0
  193. package/src/format/image/avif/av1/util/round2_signed.d.ts.map +1 -0
  194. package/src/format/image/avif/av1/util/tile_log2.d.ts.map +1 -0
  195. package/src/format/image/avif/bitstream/BitReader.d.ts.map +1 -0
  196. package/src/format/image/avif/bitstream/BitWriter.d.ts.map +1 -0
  197. package/src/format/image/avif/color/ColourTransform.d.ts.map +1 -0
  198. package/src/format/image/avif/color/YuvImage.d.ts.map +1 -0
  199. package/src/format/image/avif/color/clamp_sample.d.ts.map +1 -0
  200. package/src/format/image/avif/color/linear_to_transfer.d.ts.map +1 -0
  201. package/src/format/image/avif/color/linear_to_transfer.js +126 -0
  202. package/src/format/image/avif/color/primaries.d.ts.map +1 -0
  203. package/src/format/image/avif/color/rgb_row_to_ycbcr.d.ts.map +1 -0
  204. package/src/format/image/avif/color/transfer_to_linear.d.ts.map +1 -0
  205. package/src/format/image/avif/color/transfer_to_linear.js +171 -0
  206. package/src/format/image/avif/color/upsample_chroma_row.d.ts.map +1 -0
  207. package/src/format/image/avif/color/upsample_chroma_row.js +89 -0
  208. package/src/format/image/avif/color/ycbcr_row_to_rgb.d.ts.map +1 -0
  209. package/src/format/image/avif/color/ycbcr_row_to_rgb.js +78 -0
  210. package/src/format/image/avif/heif/AvifFile.d.ts.map +1 -0
  211. package/src/format/image/avif/heif/ItemProperty.d.ts.map +1 -0
  212. package/src/format/image/avif/heif/find_item_property.d.ts.map +1 -0
  213. package/src/format/image/avif/heif/find_item_references.d.ts.map +1 -0
  214. package/src/format/image/avif/heif/find_items_referencing.d.ts.map +1 -0
  215. package/src/format/image/avif/heif/parse_avif_file.d.ts.map +1 -0
  216. package/src/format/image/avif/heif/parse_avif_file.js +384 -0
  217. package/src/format/image/avif/heif/parse_image_grid.d.ts.map +1 -0
  218. package/src/format/image/avif/heif/parse_image_grid.js +49 -0
  219. package/src/format/image/avif/heif/parse_item_property.d.ts.map +1 -0
  220. package/src/format/image/avif/heif/read_item_data.d.ts.map +1 -0
  221. package/src/format/image/avif/heif/write_avif_file.d.ts.map +1 -0
  222. package/src/format/image/avif/heif/write_item_property.d.ts.map +1 -0
  223. package/src/format/image/avif/index.d.ts +12 -0
  224. package/src/format/image/avif/index.d.ts.map +1 -0
  225. package/src/format/image/avif/index.js +58 -0
  226. package/src/format/image/avif/isobmff/BoxHeader.d.ts.map +1 -0
  227. package/src/format/image/avif/isobmff/BoxWriter.d.ts +118 -0
  228. package/src/format/image/avif/isobmff/BoxWriter.d.ts.map +1 -0
  229. package/src/format/image/avif/isobmff/BoxWriter.js +264 -0
  230. package/src/format/image/avif/isobmff/for_each_box.d.ts.map +1 -0
  231. package/src/format/image/avif/isobmff/read_box_header.d.ts.map +1 -0
  232. package/src/format/image/avif/isobmff/read_full_box_header.d.ts.map +1 -0
  233. package/src/format/image/jpeg/JpegFrame.d.ts.map +1 -0
  234. package/src/format/image/jpeg/JpegFrameComponent.d.ts.map +1 -0
  235. package/src/format/image/jpeg/JpegImage.d.ts.map +1 -0
  236. package/src/format/image/jpeg/JpegImage.js +664 -0
  237. package/src/format/image/jpeg/buildComponentData.d.ts.map +1 -0
  238. package/src/format/image/jpeg/buildHuffmanTable.d.ts.map +1 -0
  239. package/src/format/image/jpeg/decodeScan.d.ts.map +1 -0
  240. package/src/format/image/jpeg/idct8x8_float.d.ts.map +1 -0
  241. package/src/format/image/jpeg/idct8x8_float.js +31 -0
  242. package/src/format/image/jpeg/jpeg_component_row.d.ts.map +1 -0
  243. package/src/format/image/jpeg/jpeg_decode.d.ts.map +1 -0
  244. package/src/format/image/png/PNG.d.ts.map +1 -0
  245. package/src/format/image/png/PNGReader.d.ts +158 -0
  246. package/src/format/image/png/PNGReader.d.ts.map +1 -0
  247. package/src/format/image/png/PNGReader.js +656 -0
  248. package/src/format/image/png/PNG_HEADER_BYTES.d.ts.map +1 -0
  249. package/src/format/image/png/chunk/png_chunk_decode_iTXt.d.ts.map +1 -0
  250. package/src/format/image/png/chunk/png_chunk_decode_iTXt.js +53 -0
  251. package/src/format/image/png/chunk/png_chunk_decode_zTXt.d.ts.map +1 -0
  252. package/src/format/image/png/chunk/png_chunk_decode_zTXt.js +42 -0
  253. package/src/format/image/png/crc32.d.ts +2 -0
  254. package/src/format/image/png/crc32.d.ts.map +1 -0
  255. package/src/format/image/png/crc32.js +8 -0
  256. package/src/format/image/png/filter/png_filter_unFilterAverage.d.ts.map +1 -0
  257. package/src/format/image/png/filter/png_filter_unFilterNone.d.ts.map +1 -0
  258. package/src/format/image/png/filter/png_filter_unFilterPaeth.d.ts.map +1 -0
  259. package/src/format/image/png/filter/png_filter_unFilterSub.d.ts.map +1 -0
  260. package/src/format/image/png/filter/png_filter_unFilterUp.d.ts.map +1 -0
  261. package/src/format/image/png/filter/png_unfilter.d.ts.map +1 -0
  262. package/src/format/image/png/filter/png_unfilter.js +68 -0
  263. package/src/format/image/png/png_inflate.d.ts.map +1 -0
  264. package/src/format/image/png/png_unpack_samples.d.ts.map +1 -0
  265. package/src/format/scene/gltf/GLTF_PRIMITIVE_MODE.d.ts.map +1 -0
  266. package/src/format/scene/gltf/MESHOPT_COMPRESSION_PLAN.md +793 -0
  267. package/src/format/scene/gltf/coalesce_array_duplicates.d.ts.map +1 -0
  268. package/src/format/scene/gltf/ext/GltfBufferViewExtension.d.ts.map +1 -0
  269. package/src/format/scene/gltf/ext/GltfBufferViewExtensionSet.d.ts.map +1 -0
  270. package/src/format/scene/gltf/ext/GltfBufferViewExtensionSet.js +109 -0
  271. package/src/format/scene/gltf/ext/gltf_apply_buffer_view_extensions.d.ts.map +1 -0
  272. package/src/format/scene/gltf/ext/gltf_buffer_view_extensions.d.ts.map +1 -0
  273. package/src/format/scene/gltf/ext/gltf_geometry_extensions.d.ts.map +1 -0
  274. package/src/format/scene/gltf/ext/meshopt/MeshoptBufferViewExtension.d.ts.map +1 -0
  275. package/src/format/scene/gltf/ext/meshopt/MeshoptBufferViewExtension.js +301 -0
  276. package/src/format/scene/gltf/gltf_component_type.d.ts.map +1 -0
  277. package/src/format/scene/gltf/gltf_node_world_matrices.d.ts.map +1 -0
  278. package/src/format/scene/gltf/gltf_node_world_matrices.js +137 -0
  279. package/src/format/scene/gltf/gltf_parse_container.d.ts.map +1 -0
  280. package/src/format/scene/gltf/gltf_read_accessor.d.ts.map +1 -0
  281. package/src/format/scene/gltf/gltf_read_accessor.js +294 -0
  282. package/src/format/scene/gltf/gltf_used_image_indices.d.ts +51 -0
  283. package/src/format/scene/gltf/gltf_used_image_indices.d.ts.map +1 -0
  284. package/src/format/scene/gltf/gltf_used_image_indices.js +122 -0
  285. package/src/format/scene/usd/UsdError.d.ts.map +1 -0
  286. package/src/format/scene/usd/parse_usda.d.ts.map +1 -0
  287. package/src/format/scene/usd/unpack_usdz.d.ts.map +1 -0
  288. package/src/format/scene/usd/unpack_usdz.js +106 -0
  289. package/src/format/scene/usd/usd_compose_transform.d.ts.map +1 -0
  290. package/src/format/scene/usd/usd_compose_transform.js +258 -0
  291. package/src/format/scene/usd/usd_lz4.d.ts.map +1 -0
  292. package/src/format/scene/usd/usd_lz4.js +182 -0
  293. package/src/format/scene/usd/usd_triangulate.d.ts.map +1 -0
  294. package/src/format/texture/TexelPayload.d.ts +55 -0
  295. package/src/format/texture/TexelPayload.d.ts.map +1 -0
  296. package/src/format/texture/TexelPayload.js +39 -0
  297. package/src/format/texture/basis/BasisBitReader.d.ts +77 -0
  298. package/src/format/texture/basis/BasisBitReader.d.ts.map +1 -0
  299. package/src/format/texture/basis/BasisBitReader.js +231 -0
  300. package/src/format/texture/basis/BasisHuffmanTable.d.ts.map +1 -0
  301. package/src/format/texture/basis/astc_block.d.ts +92 -0
  302. package/src/format/texture/basis/astc_block.d.ts.map +1 -0
  303. package/src/format/texture/basis/astc_block.js +164 -0
  304. package/src/format/texture/basis/astc_integer_sequence.d.ts +59 -0
  305. package/src/format/texture/basis/astc_integer_sequence.d.ts.map +1 -0
  306. package/src/format/texture/basis/astc_integer_sequence.js +251 -0
  307. package/src/format/texture/basis/astc_partition.d.ts +56 -0
  308. package/src/format/texture/basis/astc_partition.d.ts.map +1 -0
  309. package/src/format/texture/basis/astc_partition.js +199 -0
  310. package/src/format/texture/basis/basis_read_huffman_table.d.ts.map +1 -0
  311. package/src/format/texture/basis/etc1s/Etc1sSelectorHistory.d.ts.map +1 -0
  312. package/src/format/texture/basis/etc1s/etc1s_block_colors.d.ts.map +1 -0
  313. package/src/format/texture/basis/etc1s/etc1s_decode_slice.d.ts.map +1 -0
  314. package/src/format/texture/basis/etc1s/etc1s_decode_slice.js +290 -0
  315. package/src/format/texture/basis/etc1s/etc1s_read_endpoint_codebook.d.ts.map +1 -0
  316. package/src/format/texture/basis/etc1s/etc1s_read_selector_codebook.d.ts.map +1 -0
  317. package/src/format/texture/basis/etc1s/etc1s_read_slice_tables.d.ts.map +1 -0
  318. package/src/format/texture/basis/transcode/build_range_plan.d.ts +46 -0
  319. package/src/format/texture/basis/transcode/build_range_plan.d.ts.map +1 -0
  320. package/src/format/texture/basis/transcode/etc1s_to_astc.d.ts +30 -0
  321. package/src/format/texture/basis/transcode/etc1s_to_astc.d.ts.map +1 -0
  322. package/src/format/texture/basis/transcode/etc1s_to_astc.js +328 -0
  323. package/src/format/texture/basis/transcode/etc1s_to_bc1.d.ts +34 -0
  324. package/src/format/texture/basis/transcode/etc1s_to_bc1.d.ts.map +1 -0
  325. package/src/format/texture/basis/transcode/etc1s_to_bc1.js +486 -0
  326. package/src/format/texture/basis/transcode/etc1s_to_bc7.d.ts +27 -0
  327. package/src/format/texture/basis/transcode/etc1s_to_bc7.d.ts.map +1 -0
  328. package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts +31 -0
  329. package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -0
  330. package/src/format/texture/basis/transcode/etc1s_to_etc2.js +332 -0
  331. package/src/format/texture/basis/transcode/etc1s_to_rgba8.d.ts +39 -0
  332. package/src/format/texture/basis/transcode/etc1s_to_rgba8.d.ts.map +1 -0
  333. package/src/format/texture/basis/transcode/etc1s_to_rgba8.js +115 -0
  334. package/src/format/texture/basis/transcode/fit_endpoints.d.ts +79 -0
  335. package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -0
  336. package/src/format/texture/basis/transcode/fit_endpoints.js +297 -0
  337. package/src/format/texture/basis/transcode_basis.d.ts +109 -0
  338. package/src/format/texture/basis/transcode_basis.d.ts.map +1 -0
  339. package/src/format/texture/basis/transcode_basis.js +250 -0
  340. package/src/format/texture/basis/transcode_uastc.d.ts +55 -0
  341. package/src/format/texture/basis/transcode_uastc.d.ts.map +1 -0
  342. package/src/format/texture/basis/transcode_uastc.js +117 -0
  343. package/src/format/texture/basis/uastc/bc7_tables.d.ts +111 -0
  344. package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +1 -0
  345. package/src/format/texture/basis/uastc/bc7_tables.js +276 -0
  346. package/src/format/texture/basis/uastc/bc7_write_block.d.ts +124 -0
  347. package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +1 -0
  348. package/src/format/texture/basis/uastc/bc7_write_block.js +227 -0
  349. package/src/format/texture/basis/uastc/uastc_decode_block.d.ts +105 -0
  350. package/src/format/texture/basis/uastc/uastc_decode_block.d.ts.map +1 -0
  351. package/src/format/texture/basis/uastc/uastc_decode_block.js +480 -0
  352. package/src/format/texture/basis/uastc/uastc_tables.d.ts +240 -0
  353. package/src/format/texture/basis/uastc/uastc_tables.d.ts.map +1 -0
  354. package/src/format/texture/basis/uastc/uastc_tables.js +383 -0
  355. package/src/format/texture/basis/uastc/uastc_to_astc.d.ts +30 -0
  356. package/src/format/texture/basis/uastc/uastc_to_astc.d.ts.map +1 -0
  357. package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -0
  358. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +26 -0
  359. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -0
  360. package/src/format/texture/basis/uastc/uastc_to_bc5.js +115 -0
  361. package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts +36 -0
  362. package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -0
  363. package/src/format/texture/basis/uastc/uastc_to_bc7.js +602 -0
  364. package/src/format/texture/basis/uastc/uastc_to_rgba8.d.ts +37 -0
  365. package/src/format/texture/basis/uastc/uastc_to_rgba8.d.ts.map +1 -0
  366. package/src/format/texture/basis/uastc/uastc_to_rgba8.js +87 -0
  367. package/src/format/texture/bc/bc1_write_block.d.ts +28 -0
  368. package/src/format/texture/bc/bc1_write_block.d.ts.map +1 -0
  369. package/src/format/texture/bc/bc1_write_block.js +41 -0
  370. package/src/format/texture/bc/bc4_write_block.d.ts +32 -0
  371. package/src/format/texture/bc/bc4_write_block.d.ts.map +1 -0
  372. package/src/format/texture/bc/bc4_write_block.js +50 -0
  373. package/src/format/texture/bc/bc6h_write_block_mode11.d.ts +30 -0
  374. package/src/format/texture/bc/bc6h_write_block_mode11.d.ts.map +1 -0
  375. package/src/format/texture/bc/bc6h_write_block_mode11.js +62 -0
  376. package/src/format/texture/ktx2/KTX2_IDENTIFIER.d.ts.map +1 -0
  377. package/src/format/texture/ktx2/KhrDfModel.d.ts.map +1 -0
  378. package/src/format/texture/ktx2/SupercompressionScheme.d.ts.map +1 -0
  379. package/src/format/texture/ktx2/ktx2_read.d.ts +105 -0
  380. package/src/format/texture/ktx2/ktx2_read.d.ts.map +1 -0
  381. package/src/format/texture/ktx2/ktx2_read.js +909 -0
  382. package/src/format/texture/ktx2/ktx2_read_basis_lz_global_data.d.ts +27 -0
  383. package/src/format/texture/ktx2/ktx2_read_basis_lz_global_data.d.ts.map +1 -0
  384. package/src/format/texture/ktx2/ktx2_read_basis_lz_global_data.js +189 -0
  385. package/src/format/texture/ktx2/vk_format_to_texture_format.d.ts +55 -0
  386. package/src/format/texture/ktx2/vk_format_to_texture_format.d.ts.map +1 -0
  387. package/src/format/texture/ktx2/vk_format_to_texture_format.js +290 -0
  388. package/src/shade/descriptor/texture/format/gpu_texture_format_feature.d.ts +16 -0
  389. package/src/shade/descriptor/texture/format/gpu_texture_format_feature.d.ts.map +1 -0
  390. package/src/shade/descriptor/texture/format/gpu_texture_format_feature.js +44 -0
  391. package/src/shade/descriptor/texture/format/gpu_texture_format_info.d.ts +16 -0
  392. package/src/shade/descriptor/texture/format/gpu_texture_format_info.d.ts.map +1 -1
  393. package/src/shade/descriptor/texture/format/gpu_texture_format_info.js +24 -0
  394. package/src/shade/descriptor/texture/format/gpu_texture_format_srgb.d.ts +19 -0
  395. package/src/shade/descriptor/texture/format/gpu_texture_format_srgb.d.ts.map +1 -0
  396. package/src/shade/descriptor/texture/format/gpu_texture_format_srgb.js +50 -0
  397. package/src/shade/device/COPY_BYTES_PER_ROW_ALIGNMENT.d.ts +14 -0
  398. package/src/shade/device/COPY_BYTES_PER_ROW_ALIGNMENT.d.ts.map +1 -0
  399. package/src/shade/device/COPY_BYTES_PER_ROW_ALIGNMENT.js +13 -0
  400. package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
  401. package/src/shade/device/mock/SoftwareGPUDevice.js +37 -3
  402. package/src/shade/device/mock/SoftwareGPUTexture.d.ts +4 -2
  403. package/src/shade/device/mock/SoftwareGPUTexture.d.ts.map +1 -1
  404. package/src/shade/device/mock/SoftwareGPUTexture.js +39 -3
  405. package/src/shade/device/mock/SoftwareGPUTextureView.d.ts +7 -0
  406. package/src/shade/device/mock/SoftwareGPUTextureView.d.ts.map +1 -1
  407. package/src/shade/device/mock/SoftwareGPUTextureView.js +8 -0
  408. package/src/shade/device/mock/texture_copy.d.ts.map +1 -1
  409. package/src/shade/device/mock/texture_copy.js +74 -12
  410. package/src/shade/playground/basis_textures/README.md +105 -0
  411. package/src/shade/playground/basis_textures/index.html +141 -0
  412. package/src/shade/playground/basis_textures/main.d.ts +8 -0
  413. package/src/shade/playground/basis_textures/main.d.ts.map +1 -0
  414. package/src/shade/playground/basis_textures/main.js +351 -0
  415. package/src/shade/playground/basis_textures/make_basis_gltf.d.mts +2 -0
  416. package/src/shade/playground/basis_textures/make_basis_gltf.d.mts.map +1 -0
  417. package/src/shade/playground/basis_textures/make_basis_gltf.mjs +197 -0
  418. package/src/shade/playground/basis_textures/node_modules/basis_universal/bin/basisu.exe +0 -0
  419. package/src/shade/playground/basis_textures/texture_inventory.d.ts +28 -0
  420. package/src/shade/playground/basis_textures/texture_inventory.d.ts.map +1 -0
  421. package/src/shade/playground/basis_textures/texture_inventory.js +98 -0
  422. package/src/shade/playground/image_decode_bench/README.md +42 -0
  423. package/src/shade/playground/image_decode_bench/decode_worker.d.ts +2 -0
  424. package/src/shade/playground/image_decode_bench/decode_worker.d.ts.map +1 -0
  425. package/src/shade/playground/image_decode_bench/decode_worker.js +19 -0
  426. package/src/shade/playground/image_decode_bench/index.html +34 -0
  427. package/src/shade/playground/image_decode_bench/main.d.ts +2 -0
  428. package/src/shade/playground/image_decode_bench/main.d.ts.map +1 -0
  429. package/src/shade/playground/image_decode_bench/main.js +211 -0
  430. package/src/shade/playground/skinned_blas_refit/README.md +1 -1
  431. package/src/shade/playground/skinned_blas_refit/index.html +15 -1
  432. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  433. package/src/shade/playground/skinned_blas_refit/main.js +339 -3
  434. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts +8 -1
  435. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts.map +1 -1
  436. package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.js +27 -5
  437. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts +27 -0
  438. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts.map +1 -0
  439. package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.js +127 -0
  440. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts.map +1 -1
  441. package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.js +3 -3
  442. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts.map +1 -1
  443. package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.js +10 -8
  444. package/src/shade/playground/texture_encode/README.md +109 -0
  445. package/src/shade/playground/texture_encode/index.html +133 -0
  446. package/src/shade/playground/texture_encode/main.d.ts +24 -0
  447. package/src/shade/playground/texture_encode/main.d.ts.map +1 -0
  448. package/src/shade/playground/texture_encode/main.js +1430 -0
  449. package/src/shade/playground/texture_encode/panel_view.d.ts +118 -0
  450. package/src/shade/playground/texture_encode/panel_view.d.ts.map +1 -0
  451. package/src/shade/playground/texture_encode/panel_view.js +363 -0
  452. package/src/shade/renderer/Renderer.js +2 -2
  453. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  454. package/src/shade/renderer/animation/GPUAnimationManager.js +49 -5
  455. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  456. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +32 -14
  457. package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
  458. package/src/shade/renderer/geometry/GPUGeometryManager.js +591 -497
  459. package/src/shade/renderer/geometry/GPUGeometryMetadata.d.ts +9 -0
  460. package/src/shade/renderer/geometry/GPUGeometryMetadata.d.ts.map +1 -1
  461. package/src/shade/renderer/geometry/GPUGeometryMetadata.js +10 -0
  462. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_BATCH_PLAN.md +606 -0
  463. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts +17 -0
  464. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts.map +1 -0
  465. package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.js +44 -0
  466. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts +58 -0
  467. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts.map +1 -0
  468. package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.js +362 -0
  469. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +38 -0
  470. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
  471. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +730 -617
  472. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +15 -2
  473. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
  474. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +15 -1
  475. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts +39 -0
  476. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts.map +1 -0
  477. package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.js +134 -0
  478. package/src/shade/renderer/geometry/virtual/build/gltf/gltf_collect_geometries.js +3 -3
  479. package/src/shade/renderer/geometry/virtual/build/gltf/gltf_open_document.js +3 -3
  480. package/src/shade/renderer/geometry/virtual/build/gltf/gltf_read_geometry.js +1 -1
  481. package/src/shade/renderer/gpu_primitive/bvh/BVH_NODE_LAYOUT_DEFINITION.d.ts +17 -0
  482. package/src/shade/renderer/gpu_primitive/bvh/BVH_NODE_LAYOUT_DEFINITION.d.ts.map +1 -0
  483. package/src/shade/renderer/gpu_primitive/bvh/BVH_NODE_LAYOUT_DEFINITION.js +30 -0
  484. package/src/shade/renderer/gpu_primitive/bvh/GPU_BVH_BUILD_PLAN.md +8 -1
  485. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_refit_climb.d.ts +34 -0
  486. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_refit_climb.d.ts.map +1 -0
  487. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_refit_climb.js +102 -0
  488. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_refit.d.ts +11 -9
  489. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_refit.d.ts.map +1 -1
  490. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_refit.js +24 -86
  491. package/src/shade/renderer/loader/gltf/gltf_create_texture.d.ts +18 -0
  492. package/src/shade/renderer/loader/gltf/gltf_create_texture.d.ts.map +1 -0
  493. package/src/shade/renderer/loader/gltf/gltf_create_texture.js +103 -0
  494. package/src/shade/renderer/loader/gltf/gltf_image_roles.d.ts +26 -0
  495. package/src/shade/renderer/loader/gltf/gltf_image_roles.d.ts.map +1 -0
  496. package/src/shade/renderer/loader/gltf/gltf_image_roles.js +108 -0
  497. package/src/shade/renderer/loader/gltf/load_gltf.d.ts +10 -3
  498. package/src/shade/renderer/loader/gltf/load_gltf.d.ts.map +1 -1
  499. package/src/shade/renderer/loader/gltf/load_gltf.js +1179 -1253
  500. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +18 -1
  501. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts.map +1 -1
  502. package/src/shade/renderer/loader/gltf/tiny-gltf.js +837 -646
  503. package/src/shade/renderer/loader/usd/load_usd.js +3 -3
  504. package/src/shade/renderer/loader/usd/usd_build_scene.js +2 -2
  505. package/src/shade/renderer/loader/usd/usd_decode_image.d.ts +6 -5
  506. package/src/shade/renderer/loader/usd/usd_decode_image.d.ts.map +1 -1
  507. package/src/shade/renderer/loader/usd/usd_decode_image.js +197 -384
  508. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  509. package/src/shade/renderer/postprocess/taa/TAA.d.ts +3 -3
  510. package/src/shade/renderer/postprocess/taa/TAA.d.ts.map +1 -1
  511. package/src/shade/renderer/postprocess/taa/TAA.js +2 -6
  512. package/src/shade/renderer/postprocess/taa/chunk_depth_clip_offset_codec.d.ts +18 -0
  513. package/src/shade/renderer/postprocess/taa/chunk_depth_clip_offset_codec.d.ts.map +1 -0
  514. package/src/shade/renderer/postprocess/taa/chunk_depth_clip_offset_codec.js +36 -0
  515. package/src/shade/renderer/postprocess/taa/chunk_taa_history_color_bounding_box_YCoCg.d.ts.map +1 -1
  516. package/src/shade/renderer/postprocess/taa/chunk_taa_history_color_bounding_box_YCoCg.js +4 -1
  517. package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.d.ts.map +1 -1
  518. package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.js +13 -8
  519. package/src/shade/renderer/postprocess/taa/shader_taa.d.ts +1 -1
  520. package/src/shade/renderer/postprocess/taa/shader_taa.d.ts.map +1 -1
  521. package/src/shade/renderer/postprocess/taa/shader_taa.js +52 -38
  522. package/src/shade/renderer/restir/di/chunk_restir_temporal_reuse.d.ts +4 -2
  523. package/src/shade/renderer/restir/di/chunk_restir_temporal_reuse.d.ts.map +1 -1
  524. package/src/shade/renderer/restir/di/chunk_restir_temporal_reuse.js +9 -6
  525. package/src/shade/renderer/scene/optimization/deduplicate_images.js +93 -93
  526. package/src/shade/renderer/scene/optimization/downscale_images.js +216 -216
  527. package/src/shade/renderer/scene/serialization/decode_image_source_hdr.js +1 -1
  528. package/src/shade/renderer/scene/serialization/deserialize_scene.js +1 -1
  529. package/src/shade/renderer/scene/serialization/write_image_source.js +1 -1
  530. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts +1 -1
  531. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.js +1 -1
  532. package/src/shade/renderer/shader/chunk/texture/sample/chunk_texture_sample_catmullrom_hardware_5tap_uv.d.ts +2 -1
  533. package/src/shade/renderer/shader/chunk/texture/sample/chunk_texture_sample_catmullrom_hardware_5tap_uv.d.ts.map +1 -1
  534. package/src/shade/renderer/shader/chunk/texture/sample/chunk_texture_sample_catmullrom_hardware_5tap_uv.js +2 -1
  535. package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +893 -10
  536. package/src/shade/renderer/texture/encode/ENCODE_NOTES_2026_09_02.md +462 -0
  537. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +33 -0
  538. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -0
  539. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +310 -0
  540. package/src/shade/renderer/texture/encode/chunk_astc_pack_4x4_rgb.d.ts +17 -0
  541. package/src/shade/renderer/texture/encode/chunk_astc_pack_4x4_rgb.d.ts.map +1 -0
  542. package/src/shade/renderer/texture/encode/chunk_astc_pack_4x4_rgb.js +51 -0
  543. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +42 -0
  544. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -0
  545. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +375 -0
  546. package/src/shade/renderer/texture/encode/chunk_bc1_pack_block.d.ts +12 -0
  547. package/src/shade/renderer/texture/encode/chunk_bc1_pack_block.d.ts.map +1 -0
  548. package/src/shade/renderer/texture/encode/chunk_bc1_pack_block.js +24 -0
  549. package/src/shade/renderer/texture/encode/chunk_bc4_encode_block.d.ts +45 -0
  550. package/src/shade/renderer/texture/encode/chunk_bc4_encode_block.d.ts.map +1 -0
  551. package/src/shade/renderer/texture/encode/chunk_bc4_encode_block.js +348 -0
  552. package/src/shade/renderer/texture/encode/chunk_bc4_pack_block.d.ts +16 -0
  553. package/src/shade/renderer/texture/encode/chunk_bc4_pack_block.d.ts.map +1 -0
  554. package/src/shade/renderer/texture/encode/chunk_bc4_pack_block.js +33 -0
  555. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts +32 -0
  556. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -0
  557. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +346 -0
  558. package/src/shade/renderer/texture/encode/chunk_bc6h_pack_mode11.d.ts +10 -0
  559. package/src/shade/renderer/texture/encode/chunk_bc6h_pack_mode11.d.ts.map +1 -0
  560. package/src/shade/renderer/texture/encode/chunk_bc6h_pack_mode11.js +54 -0
  561. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +36 -0
  562. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -0
  563. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +327 -0
  564. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +22 -0
  565. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -0
  566. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +71 -0
  567. package/src/shade/renderer/texture/encode/chunk_texture_encode_level.d.ts +20 -0
  568. package/src/shade/renderer/texture/encode/chunk_texture_encode_level.d.ts.map +1 -0
  569. package/src/shade/renderer/texture/encode/chunk_texture_encode_level.js +73 -0
  570. package/src/shade/renderer/texture/encode/chunk_texture_encode_load_block.d.ts +16 -0
  571. package/src/shade/renderer/texture/encode/chunk_texture_encode_load_block.d.ts.map +1 -0
  572. package/src/shade/renderer/texture/encode/chunk_texture_encode_load_block.js +36 -0
  573. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +13 -0
  574. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -0
  575. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +63 -0
  576. package/src/shade/renderer/texture/encode/shader_texture_encode_bc1.d.ts +12 -0
  577. package/src/shade/renderer/texture/encode/shader_texture_encode_bc1.d.ts.map +1 -0
  578. package/src/shade/renderer/texture/encode/shader_texture_encode_bc1.js +60 -0
  579. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4.d.ts +28 -0
  580. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4.d.ts.map +1 -0
  581. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4.js +76 -0
  582. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4_snorm.d.ts +16 -0
  583. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4_snorm.d.ts.map +1 -0
  584. package/src/shade/renderer/texture/encode/shader_texture_encode_bc4_snorm.js +64 -0
  585. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5.d.ts +14 -0
  586. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5.d.ts.map +1 -0
  587. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5.js +67 -0
  588. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5_snorm.d.ts +10 -0
  589. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5_snorm.d.ts.map +1 -0
  590. package/src/shade/renderer/texture/encode/shader_texture_encode_bc5_snorm.js +63 -0
  591. package/src/shade/renderer/texture/encode/shader_texture_encode_bc6h.d.ts +12 -0
  592. package/src/shade/renderer/texture/encode/shader_texture_encode_bc6h.d.ts.map +1 -0
  593. package/src/shade/renderer/texture/encode/shader_texture_encode_bc6h.js +62 -0
  594. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +14 -0
  595. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -0
  596. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +58 -0
  597. package/src/shade/renderer/texture/encode/texture_encode.d.ts +84 -0
  598. package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -0
  599. package/src/shade/renderer/texture/encode/texture_encode.js +168 -0
  600. package/src/shade/renderer/texture/encode/texture_encode_layout.d.ts +196 -0
  601. package/src/shade/renderer/texture/encode/texture_encode_layout.d.ts.map +1 -0
  602. package/src/shade/renderer/texture/encode/texture_encode_layout.js +248 -0
  603. package/src/shade/renderer/texture/encode/texture_encode_resources.d.ts +15 -0
  604. package/src/shade/renderer/texture/encode/texture_encode_resources.d.ts.map +1 -0
  605. package/src/shade/renderer/texture/encode/texture_encode_resources.js +25 -0
  606. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +30 -0
  607. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -0
  608. package/src/shade/renderer/texture/encode/texture_encode_shader.js +108 -0
  609. package/src/shade/renderer/texture/format/gpu_texture_compression_support.d.ts +3 -1
  610. package/src/shade/renderer/texture/format/gpu_texture_compression_support.d.ts.map +1 -1
  611. package/src/shade/renderer/texture/format/gpu_texture_compression_support.js +8 -25
  612. package/src/shade/renderer/texture/format/texture_format_from_shade_image.d.ts.map +1 -1
  613. package/src/shade/renderer/texture/format/texture_format_from_shade_image.js +26 -2
  614. package/src/shade/renderer/texture/source/texel_data_from_ktx2.d.ts +32 -0
  615. package/src/shade/renderer/texture/source/texel_data_from_ktx2.d.ts.map +1 -0
  616. package/src/shade/renderer/texture/source/texel_data_from_ktx2.js +48 -0
  617. package/src/shade/renderer/texture/texture_write_level.d.ts.map +1 -1
  618. package/src/shade/renderer/texture/texture_write_level.js +11 -1
  619. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  620. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +20 -0
  621. package/src/shade/renderer/volumetrics/NOTES.md +28 -0
  622. package/src/shade/renderer/volumetrics/taa/chunk_volumetric_history_bounding_box.d.ts.map +1 -1
  623. package/src/shade/renderer/volumetrics/taa/chunk_volumetric_history_bounding_box.js +7 -2
  624. package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_reproject.d.ts +17 -0
  625. package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_reproject.d.ts.map +1 -0
  626. package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_reproject.js +168 -0
  627. package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_resolve.d.ts +13 -0
  628. package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_resolve.d.ts.map +1 -0
  629. package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_resolve.js +56 -0
  630. package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.d.ts.map +1 -1
  631. package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.js +134 -334
  632. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts.map +1 -1
  633. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +49 -21
  634. package/src/avif/encode_image_source.d.ts +0 -70
  635. package/src/avif/encode_image_source.d.ts.map +0 -1
  636. package/src/avif/encode_image_source.js +0 -117
  637. package/src/avif/encoder_worker.d.ts.map +0 -1
  638. package/src/avif/index.d.ts +0 -5
  639. package/src/avif/index.d.ts.map +0 -1
  640. package/src/avif/index.js +0 -21
  641. package/src/avif/native/DECISIONS.md +0 -545
  642. package/src/avif/native/api/AvifDecoder.d.ts.map +0 -1
  643. package/src/avif/native/api/apply_transformations.d.ts.map +0 -1
  644. package/src/avif/native/api/avif_to_sampler2d.d.ts +0 -25
  645. package/src/avif/native/api/avif_to_sampler2d.d.ts.map +0 -1
  646. package/src/avif/native/api/avif_to_sampler2d.js +0 -42
  647. package/src/avif/native/api/convert_to_rgba.d.ts.map +0 -1
  648. package/src/avif/native/api/convert_to_rgba.js +0 -204
  649. package/src/avif/native/api/decode_avif.d.ts.map +0 -1
  650. package/src/avif/native/api/decode_image_item.d.ts.map +0 -1
  651. package/src/avif/native/api/encode_avif.d.ts.map +0 -1
  652. package/src/avif/native/api/sampler2d_to_avif.d.ts.map +0 -1
  653. package/src/avif/native/api/sampler2d_to_avif.js +0 -108
  654. package/src/avif/native/av1/decode/Av1FrameContext.d.ts.map +0 -1
  655. package/src/avif/native/av1/decode/block_decoded.d.ts.map +0 -1
  656. package/src/avif/native/av1/decode/decode_av1_still.d.ts.map +0 -1
  657. package/src/avif/native/av1/decode/decode_coefficients.d.ts.map +0 -1
  658. package/src/avif/native/av1/decode/decode_palette.d.ts.map +0 -1
  659. package/src/avif/native/av1/decode/decode_palette.js +0 -442
  660. package/src/avif/native/av1/decode/decode_tile.d.ts.map +0 -1
  661. package/src/avif/native/av1/decode/decode_tile.js +0 -1213
  662. package/src/avif/native/av1/decode/get_scan.d.ts.map +0 -1
  663. package/src/avif/native/av1/decode/read_lr.d.ts.map +0 -1
  664. package/src/avif/native/av1/decode/read_lr.js +0 -277
  665. package/src/avif/native/av1/decode/read_transform_type.d.ts.map +0 -1
  666. package/src/avif/native/av1/decode/read_transform_type.js +0 -92
  667. package/src/avif/native/av1/decode/reconstruct.d.ts.map +0 -1
  668. package/src/avif/native/av1/decode/reconstruct.js +0 -241
  669. package/src/avif/native/av1/decode/transform_type.d.ts.map +0 -1
  670. package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts.map +0 -1
  671. package/src/avif/native/av1/encode/Av1EncodeContext.d.ts.map +0 -1
  672. package/src/avif/native/av1/encode/build_headers.d.ts.map +0 -1
  673. package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts.map +0 -1
  674. package/src/avif/native/av1/encode/choose_filters.d.ts.map +0 -1
  675. package/src/avif/native/av1/encode/choose_restoration.d.ts.map +0 -1
  676. package/src/avif/native/av1/encode/choose_restoration.js +0 -616
  677. package/src/avif/native/av1/encode/decode_effort.d.ts.map +0 -1
  678. package/src/avif/native/av1/encode/encode_av1_still.d.ts.map +0 -1
  679. package/src/avif/native/av1/encode/encode_effort.d.ts.map +0 -1
  680. package/src/avif/native/av1/encode/encode_tile.d.ts.map +0 -1
  681. package/src/avif/native/av1/encode/encode_tile.js +0 -2331
  682. package/src/avif/native/av1/encode/quantise.d.ts.map +0 -1
  683. package/src/avif/native/av1/encode/write_coefficients.d.ts.map +0 -1
  684. package/src/avif/native/av1/encode/write_lr.d.ts.map +0 -1
  685. package/src/avif/native/av1/encode/write_transform_type.d.ts.map +0 -1
  686. package/src/avif/native/av1/entropy/CdfContext.d.ts.map +0 -1
  687. package/src/avif/native/av1/entropy/SymbolReader.d.ts.map +0 -1
  688. package/src/avif/native/av1/entropy/SymbolWriter.d.ts.map +0 -1
  689. package/src/avif/native/av1/entropy/coefficient_context.d.ts.map +0 -1
  690. package/src/avif/native/av1/entropy/partition_cdf.d.ts.map +0 -1
  691. package/src/avif/native/av1/entropy/symbol_cost.d.ts.map +0 -1
  692. package/src/avif/native/av1/filter/cdef.d.ts.map +0 -1
  693. package/src/avif/native/av1/filter/cdef.js +0 -313
  694. package/src/avif/native/av1/filter/loop_filter.d.ts.map +0 -1
  695. package/src/avif/native/av1/filter/loop_filter.js +0 -377
  696. package/src/avif/native/av1/filter/loop_restoration.d.ts.map +0 -1
  697. package/src/avif/native/av1/filter/loop_restoration.js +0 -451
  698. package/src/avif/native/av1/filter/superres.d.ts.map +0 -1
  699. package/src/avif/native/av1/filter/superres.js +0 -86
  700. package/src/avif/native/av1/grain/FilmGrainState.d.ts.map +0 -1
  701. package/src/avif/native/av1/grain/film_grain.d.ts.map +0 -1
  702. package/src/avif/native/av1/grain/film_grain.js +0 -623
  703. package/src/avif/native/av1/obu/FrameHeader.d.ts.map +0 -1
  704. package/src/avif/native/av1/obu/ObuHeader.d.ts.map +0 -1
  705. package/src/avif/native/av1/obu/SequenceHeader.d.ts.map +0 -1
  706. package/src/avif/native/av1/obu/for_each_obu.d.ts.map +0 -1
  707. package/src/avif/native/av1/obu/parse_frame_header.d.ts.map +0 -1
  708. package/src/avif/native/av1/obu/parse_frame_header.js +0 -841
  709. package/src/avif/native/av1/obu/parse_obu_header.d.ts.map +0 -1
  710. package/src/avif/native/av1/obu/parse_sequence_header.d.ts.map +0 -1
  711. package/src/avif/native/av1/obu/write_frame_header.d.ts.map +0 -1
  712. package/src/avif/native/av1/obu/write_sequence_header.d.ts.map +0 -1
  713. package/src/avif/native/av1/predict/IntraPredictionState.d.ts.map +0 -1
  714. package/src/avif/native/av1/predict/intra_filter_type.d.ts.map +0 -1
  715. package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts.map +0 -1
  716. package/src/avif/native/av1/predict/predict_chroma_from_luma.js +0 -153
  717. package/src/avif/native/av1/predict/predict_intra.d.ts.map +0 -1
  718. package/src/avif/native/av1/predict/predict_intra.js +0 -803
  719. package/src/avif/native/av1/predict/predict_palette.d.ts.map +0 -1
  720. package/src/avif/native/av1/tables/av1_symbols.d.ts.map +0 -1
  721. package/src/avif/native/av1/tables/av1_symbols.js +0 -419
  722. package/src/avif/native/av1/tables/block_tables.d.ts.map +0 -1
  723. package/src/avif/native/av1/tables/block_tables.js +0 -270
  724. package/src/avif/native/av1/tables/cdf_tables.d.ts.map +0 -1
  725. package/src/avif/native/av1/tables/cdf_tables.js +0 -1893
  726. package/src/avif/native/av1/tables/coefficient_tables.d.ts.map +0 -1
  727. package/src/avif/native/av1/tables/coefficient_tables.js +0 -82
  728. package/src/avif/native/av1/tables/derived_block_tables.d.ts.map +0 -1
  729. package/src/avif/native/av1/tables/filter_tables.d.ts.map +0 -1
  730. package/src/avif/native/av1/tables/filter_tables.js +0 -313
  731. package/src/avif/native/av1/tables/grain_tables.d.ts.map +0 -1
  732. package/src/avif/native/av1/tables/grain_tables.js +0 -190
  733. package/src/avif/native/av1/tables/prediction_tables.d.ts.map +0 -1
  734. package/src/avif/native/av1/tables/prediction_tables.js +0 -223
  735. package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts.map +0 -1
  736. package/src/avif/native/av1/tables/quantizer_matrix_tables.js +0 -38
  737. package/src/avif/native/av1/tables/quantizer_tables.d.ts.map +0 -1
  738. package/src/avif/native/av1/tables/quantizer_tables.js +0 -160
  739. package/src/avif/native/av1/tables/scan_tables.d.ts.map +0 -1
  740. package/src/avif/native/av1/tables/scan_tables.js +0 -727
  741. package/src/avif/native/av1/tables/segmentation_tables.d.ts.map +0 -1
  742. package/src/avif/native/av1/tables/segmentation_tables.js +0 -48
  743. package/src/avif/native/av1/tables/transform_tables.d.ts.map +0 -1
  744. package/src/avif/native/av1/tables/transform_tables.js +0 -140
  745. package/src/avif/native/av1/tables/unpack_table.d.ts.map +0 -1
  746. package/src/avif/native/av1/tables/unpack_table.js +0 -73
  747. package/src/avif/native/av1/transform/forward_transform_2d.d.ts.map +0 -1
  748. package/src/avif/native/av1/transform/inverse_transform_1d.d.ts.map +0 -1
  749. package/src/avif/native/av1/transform/inverse_transform_1d.js +0 -590
  750. package/src/avif/native/av1/transform/inverse_transform_2d.d.ts.map +0 -1
  751. package/src/avif/native/av1/transform/inverse_transform_2d.js +0 -180
  752. package/src/avif/native/av1/util/ceil_log2.d.ts.map +0 -1
  753. package/src/avif/native/av1/util/floor_log2.d.ts +0 -20
  754. package/src/avif/native/av1/util/floor_log2.d.ts.map +0 -1
  755. package/src/avif/native/av1/util/floor_log2.js +0 -20
  756. package/src/avif/native/av1/util/round2.d.ts.map +0 -1
  757. package/src/avif/native/av1/util/round2_signed.d.ts.map +0 -1
  758. package/src/avif/native/av1/util/tile_log2.d.ts.map +0 -1
  759. package/src/avif/native/bitstream/BitReader.d.ts.map +0 -1
  760. package/src/avif/native/bitstream/BitWriter.d.ts.map +0 -1
  761. package/src/avif/native/color/ColourTransform.d.ts.map +0 -1
  762. package/src/avif/native/color/YuvImage.d.ts.map +0 -1
  763. package/src/avif/native/color/clamp_sample.d.ts.map +0 -1
  764. package/src/avif/native/color/linear_to_transfer.d.ts.map +0 -1
  765. package/src/avif/native/color/linear_to_transfer.js +0 -126
  766. package/src/avif/native/color/primaries.d.ts.map +0 -1
  767. package/src/avif/native/color/rgb_row_to_ycbcr.d.ts.map +0 -1
  768. package/src/avif/native/color/transfer_to_linear.d.ts.map +0 -1
  769. package/src/avif/native/color/transfer_to_linear.js +0 -171
  770. package/src/avif/native/color/upsample_chroma_row.d.ts.map +0 -1
  771. package/src/avif/native/color/upsample_chroma_row.js +0 -89
  772. package/src/avif/native/color/ycbcr_row_to_rgb.d.ts.map +0 -1
  773. package/src/avif/native/color/ycbcr_row_to_rgb.js +0 -78
  774. package/src/avif/native/heif/AvifFile.d.ts.map +0 -1
  775. package/src/avif/native/heif/ItemProperty.d.ts.map +0 -1
  776. package/src/avif/native/heif/find_item_property.d.ts.map +0 -1
  777. package/src/avif/native/heif/find_item_references.d.ts.map +0 -1
  778. package/src/avif/native/heif/find_items_referencing.d.ts.map +0 -1
  779. package/src/avif/native/heif/parse_avif_file.d.ts.map +0 -1
  780. package/src/avif/native/heif/parse_avif_file.js +0 -384
  781. package/src/avif/native/heif/parse_image_grid.d.ts.map +0 -1
  782. package/src/avif/native/heif/parse_image_grid.js +0 -49
  783. package/src/avif/native/heif/parse_item_property.d.ts.map +0 -1
  784. package/src/avif/native/heif/read_item_data.d.ts.map +0 -1
  785. package/src/avif/native/heif/write_avif_file.d.ts.map +0 -1
  786. package/src/avif/native/heif/write_item_property.d.ts.map +0 -1
  787. package/src/avif/native/index.d.ts +0 -14
  788. package/src/avif/native/index.d.ts.map +0 -1
  789. package/src/avif/native/index.js +0 -56
  790. package/src/avif/native/isobmff/BoxHeader.d.ts.map +0 -1
  791. package/src/avif/native/isobmff/BoxWriter.d.ts +0 -118
  792. package/src/avif/native/isobmff/BoxWriter.d.ts.map +0 -1
  793. package/src/avif/native/isobmff/BoxWriter.js +0 -264
  794. package/src/avif/native/isobmff/for_each_box.d.ts.map +0 -1
  795. package/src/avif/native/isobmff/read_box_header.d.ts.map +0 -1
  796. package/src/avif/native/isobmff/read_full_box_header.d.ts.map +0 -1
  797. package/src/avif/threaded_image_encoder.d.ts.map +0 -1
  798. package/src/basis/BasisBitReader.d.ts +0 -77
  799. package/src/basis/BasisBitReader.d.ts.map +0 -1
  800. package/src/basis/BasisBitReader.js +0 -231
  801. package/src/basis/BasisHuffmanTable.d.ts.map +0 -1
  802. package/src/basis/basis_read_huffman_table.d.ts.map +0 -1
  803. package/src/basis/etc1s/Etc1sSelectorHistory.d.ts.map +0 -1
  804. package/src/basis/etc1s/etc1s_block_colors.d.ts.map +0 -1
  805. package/src/basis/etc1s/etc1s_decode_slice.d.ts.map +0 -1
  806. package/src/basis/etc1s/etc1s_decode_slice.js +0 -258
  807. package/src/basis/etc1s/etc1s_read_endpoint_codebook.d.ts.map +0 -1
  808. package/src/basis/etc1s/etc1s_read_selector_codebook.d.ts.map +0 -1
  809. package/src/basis/etc1s/etc1s_read_slice_tables.d.ts.map +0 -1
  810. package/src/basis/transcode/etc1s_to_bc1.d.ts +0 -24
  811. package/src/basis/transcode/etc1s_to_bc1.d.ts.map +0 -1
  812. package/src/basis/transcode/etc1s_to_bc1.js +0 -205
  813. package/src/basis/transcode/etc1s_to_bc7.d.ts +0 -30
  814. package/src/basis/transcode/etc1s_to_bc7.d.ts.map +0 -1
  815. package/src/basis/transcode/fit_endpoints.d.ts +0 -59
  816. package/src/basis/transcode/fit_endpoints.d.ts.map +0 -1
  817. package/src/basis/transcode/fit_endpoints.js +0 -226
  818. package/src/engine/asset/loaders/gltf/computeObjectBoundingSphere.d.ts +0 -8
  819. package/src/engine/asset/loaders/gltf/computeObjectBoundingSphere.d.ts.map +0 -1
  820. package/src/engine/asset/loaders/gltf/computeObjectBoundingSphere.js +0 -70
  821. package/src/engine/asset/loaders/gltf/isMesh.d.ts +0 -7
  822. package/src/engine/asset/loaders/gltf/isMesh.d.ts.map +0 -1
  823. package/src/engine/asset/loaders/gltf/isMesh.js +0 -8
  824. package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts.map +0 -1
  825. package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts.map +0 -1
  826. package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts.map +0 -1
  827. package/src/engine/asset/loaders/image/jpeg/JpegImage.js +0 -664
  828. package/src/engine/asset/loaders/image/jpeg/buildComponentData.d.ts.map +0 -1
  829. package/src/engine/asset/loaders/image/jpeg/buildHuffmanTable.d.ts.map +0 -1
  830. package/src/engine/asset/loaders/image/jpeg/decodeScan.d.ts.map +0 -1
  831. package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts.map +0 -1
  832. package/src/engine/asset/loaders/image/jpeg/idct8x8_float.js +0 -31
  833. package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts.map +0 -1
  834. package/src/engine/asset/loaders/image/jpeg/jpeg_decode.d.ts.map +0 -1
  835. package/src/engine/asset/loaders/image/png/PNG.d.ts.map +0 -1
  836. package/src/engine/asset/loaders/image/png/PNGReader.d.ts +0 -158
  837. package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +0 -1
  838. package/src/engine/asset/loaders/image/png/PNGReader.js +0 -656
  839. package/src/engine/asset/loaders/image/png/PNG_HEADER_BYTES.d.ts.map +0 -1
  840. package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_iTXt.d.ts.map +0 -1
  841. package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_iTXt.js +0 -53
  842. package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_zTXt.d.ts.map +0 -1
  843. package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_zTXt.js +0 -42
  844. package/src/engine/asset/loaders/image/png/crc32.d.ts +0 -2
  845. package/src/engine/asset/loaders/image/png/crc32.d.ts.map +0 -1
  846. package/src/engine/asset/loaders/image/png/crc32.js +0 -8
  847. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterAverage.d.ts.map +0 -1
  848. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts.map +0 -1
  849. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterPaeth.d.ts.map +0 -1
  850. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts.map +0 -1
  851. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts.map +0 -1
  852. package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts.map +0 -1
  853. package/src/engine/asset/loaders/image/png/filter/png_unfilter.js +0 -68
  854. package/src/engine/asset/loaders/image/png/png_inflate.d.ts.map +0 -1
  855. package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts.map +0 -1
  856. package/src/engine/asset/loaders/image/png/prototypePNG.d.ts.map +0 -1
  857. package/src/engine/asset/loaders/image/png/prototypePNG.js +0 -37
  858. package/src/ktx2/KTX2_IDENTIFIER.d.ts.map +0 -1
  859. package/src/ktx2/KhrDfModel.d.ts.map +0 -1
  860. package/src/ktx2/SupercompressionScheme.d.ts.map +0 -1
  861. package/src/ktx2/ktx2_read.d.ts +0 -71
  862. package/src/ktx2/ktx2_read.d.ts.map +0 -1
  863. package/src/ktx2/ktx2_read.js +0 -581
  864. package/src/ktx2/ktx2_read_basis_lz_global_data.d.ts +0 -27
  865. package/src/ktx2/ktx2_read_basis_lz_global_data.d.ts.map +0 -1
  866. package/src/ktx2/ktx2_read_basis_lz_global_data.js +0 -189
  867. package/src/ktx2/vk_format_to_texture_format.d.ts +0 -55
  868. package/src/ktx2/vk_format_to_texture_format.d.ts.map +0 -1
  869. package/src/ktx2/vk_format_to_texture_format.js +0 -290
  870. package/src/shade/renderer/geometry/bvh/record_blas_refit.d.ts +0 -25
  871. package/src/shade/renderer/geometry/bvh/record_blas_refit.d.ts.map +0 -1
  872. package/src/shade/renderer/geometry/bvh/record_blas_refit.js +0 -102
  873. package/src/shade/renderer/geometry/bvh/shader_blas_refit_leaf_bounds.d.ts +0 -30
  874. package/src/shade/renderer/geometry/bvh/shader_blas_refit_leaf_bounds.d.ts.map +0 -1
  875. package/src/shade/renderer/geometry/bvh/shader_blas_refit_leaf_bounds.js +0 -125
  876. package/src/shade/renderer/loader/gltf/GLTF_PRIMITIVE_MODE.d.ts.map +0 -1
  877. package/src/shade/renderer/loader/gltf/MESHOPT_COMPRESSION_PLAN.md +0 -793
  878. package/src/shade/renderer/loader/gltf/coalesce_array_duplicates.d.ts.map +0 -1
  879. package/src/shade/renderer/loader/gltf/ext/GltfBufferViewExtension.d.ts.map +0 -1
  880. package/src/shade/renderer/loader/gltf/ext/GltfBufferViewExtensionSet.d.ts.map +0 -1
  881. package/src/shade/renderer/loader/gltf/ext/GltfBufferViewExtensionSet.js +0 -109
  882. package/src/shade/renderer/loader/gltf/ext/gltf_apply_buffer_view_extensions.d.ts.map +0 -1
  883. package/src/shade/renderer/loader/gltf/ext/gltf_buffer_view_extensions.d.ts.map +0 -1
  884. package/src/shade/renderer/loader/gltf/ext/gltf_geometry_extensions.d.ts.map +0 -1
  885. package/src/shade/renderer/loader/gltf/ext/meshopt/MeshoptBufferViewExtension.d.ts.map +0 -1
  886. package/src/shade/renderer/loader/gltf/ext/meshopt/MeshoptBufferViewExtension.js +0 -301
  887. package/src/shade/renderer/loader/gltf/gltf_component_type.d.ts.map +0 -1
  888. package/src/shade/renderer/loader/gltf/gltf_node_world_matrices.d.ts.map +0 -1
  889. package/src/shade/renderer/loader/gltf/gltf_node_world_matrices.js +0 -137
  890. package/src/shade/renderer/loader/gltf/gltf_parse_container.d.ts.map +0 -1
  891. package/src/shade/renderer/loader/gltf/gltf_read_accessor.d.ts.map +0 -1
  892. package/src/shade/renderer/loader/gltf/gltf_read_accessor.js +0 -294
  893. package/src/shade/renderer/loader/gltf/gltf_used_image_indices.d.ts +0 -25
  894. package/src/shade/renderer/loader/gltf/gltf_used_image_indices.d.ts.map +0 -1
  895. package/src/shade/renderer/loader/gltf/gltf_used_image_indices.js +0 -49
  896. package/src/shade/renderer/loader/usd/UsdError.d.ts.map +0 -1
  897. package/src/shade/renderer/loader/usd/parse_usda.d.ts.map +0 -1
  898. package/src/shade/renderer/loader/usd/unpack_usdz.d.ts.map +0 -1
  899. package/src/shade/renderer/loader/usd/unpack_usdz.js +0 -106
  900. package/src/shade/renderer/loader/usd/usd_compose_transform.d.ts.map +0 -1
  901. package/src/shade/renderer/loader/usd/usd_compose_transform.js +0 -258
  902. package/src/shade/renderer/loader/usd/usd_lz4.d.ts.map +0 -1
  903. package/src/shade/renderer/loader/usd/usd_lz4.js +0 -182
  904. package/src/shade/renderer/loader/usd/usd_triangulate.d.ts.map +0 -1
  905. package/src/shade/renderer/postprocess/taa/chunk_taa_sample_history_color.d.ts +0 -2
  906. package/src/shade/renderer/postprocess/taa/chunk_taa_sample_history_color.d.ts.map +0 -1
  907. package/src/shade/renderer/postprocess/taa/chunk_taa_sample_history_color.js +0 -43
  908. package/src/shade/renderer/scene/optimization/sampler2d_compare.d.ts.map +0 -1
  909. package/src/shade/renderer/scene/optimization/sampler2d_compare.js +0 -94
  910. /package/src/{avif → engine/asset/loaders/image/avif}/encoder_worker.d.ts +0 -0
  911. /package/src/{avif → engine/asset/loaders/image/avif}/encoder_worker.js +0 -0
  912. /package/src/{avif → engine/asset/loaders/image/avif}/threaded_image_encoder.d.ts +0 -0
  913. /package/src/{avif → engine/asset/loaders/image/avif}/threaded_image_encoder.js +0 -0
  914. /package/src/engine/asset/loaders/image/{png/prototypePNG.d.ts → prototypePNG.d.ts} +0 -0
  915. /package/src/{shade/renderer/scene/optimization → engine/graphics/texture/sampler/compare}/sampler2d_compare.d.ts +0 -0
  916. /package/src/{avif/native/api → engine/graphics/texture/sampler}/sampler2d_to_avif.d.ts +0 -0
  917. /package/src/{avif/native → format/image/avif}/NOTICE.md +0 -0
  918. /package/src/{avif/native → format/image/avif}/api/AvifDecoder.d.ts +0 -0
  919. /package/src/{avif/native → format/image/avif}/api/AvifDecoder.js +0 -0
  920. /package/src/{avif/native → format/image/avif}/api/apply_transformations.d.ts +0 -0
  921. /package/src/{avif/native → format/image/avif}/api/apply_transformations.js +0 -0
  922. /package/src/{avif/native → format/image/avif}/api/convert_to_rgba.d.ts +0 -0
  923. /package/src/{avif/native → format/image/avif}/api/decode_avif.d.ts +0 -0
  924. /package/src/{avif/native → format/image/avif}/api/decode_avif.js +0 -0
  925. /package/src/{avif/native → format/image/avif}/api/decode_image_item.d.ts +0 -0
  926. /package/src/{avif/native → format/image/avif}/api/decode_image_item.js +0 -0
  927. /package/src/{avif/native → format/image/avif}/api/encode_avif.d.ts +0 -0
  928. /package/src/{avif/native → format/image/avif}/api/encode_avif.js +0 -0
  929. /package/src/{avif/native → format/image/avif}/av1/decode/Av1FrameContext.d.ts +0 -0
  930. /package/src/{avif/native → format/image/avif}/av1/decode/Av1FrameContext.js +0 -0
  931. /package/src/{avif/native → format/image/avif}/av1/decode/block_decoded.d.ts +0 -0
  932. /package/src/{avif/native → format/image/avif}/av1/decode/block_decoded.js +0 -0
  933. /package/src/{avif/native → format/image/avif}/av1/decode/decode_av1_still.d.ts +0 -0
  934. /package/src/{avif/native → format/image/avif}/av1/decode/decode_av1_still.js +0 -0
  935. /package/src/{avif/native → format/image/avif}/av1/decode/decode_coefficients.d.ts +0 -0
  936. /package/src/{avif/native → format/image/avif}/av1/decode/decode_coefficients.js +0 -0
  937. /package/src/{avif/native → format/image/avif}/av1/decode/decode_palette.d.ts +0 -0
  938. /package/src/{avif/native → format/image/avif}/av1/decode/decode_tile.d.ts +0 -0
  939. /package/src/{avif/native → format/image/avif}/av1/decode/get_scan.d.ts +0 -0
  940. /package/src/{avif/native → format/image/avif}/av1/decode/get_scan.js +0 -0
  941. /package/src/{avif/native → format/image/avif}/av1/decode/read_lr.d.ts +0 -0
  942. /package/src/{avif/native → format/image/avif}/av1/decode/read_transform_type.d.ts +0 -0
  943. /package/src/{avif/native → format/image/avif}/av1/decode/reconstruct.d.ts +0 -0
  944. /package/src/{avif/native → format/image/avif}/av1/decode/transform_type.d.ts +0 -0
  945. /package/src/{avif/native → format/image/avif}/av1/decode/transform_type.js +0 -0
  946. /package/src/{avif/native → format/image/avif}/av1/encode/Av1BlockSnapshot.d.ts +0 -0
  947. /package/src/{avif/native → format/image/avif}/av1/encode/Av1BlockSnapshot.js +0 -0
  948. /package/src/{avif/native → format/image/avif}/av1/encode/Av1EncodeContext.d.ts +0 -0
  949. /package/src/{avif/native → format/image/avif}/av1/encode/Av1EncodeContext.js +0 -0
  950. /package/src/{avif/native → format/image/avif}/av1/encode/build_headers.d.ts +0 -0
  951. /package/src/{avif/native → format/image/avif}/av1/encode/build_headers.js +0 -0
  952. /package/src/{avif/native → format/image/avif}/av1/encode/choose_chroma_alpha.d.ts +0 -0
  953. /package/src/{avif/native → format/image/avif}/av1/encode/choose_chroma_alpha.js +0 -0
  954. /package/src/{avif/native → format/image/avif}/av1/encode/choose_filters.d.ts +0 -0
  955. /package/src/{avif/native → format/image/avif}/av1/encode/choose_filters.js +0 -0
  956. /package/src/{avif/native → format/image/avif}/av1/encode/choose_restoration.d.ts +0 -0
  957. /package/src/{avif/native → format/image/avif}/av1/encode/decode_effort.d.ts +0 -0
  958. /package/src/{avif/native → format/image/avif}/av1/encode/decode_effort.js +0 -0
  959. /package/src/{avif/native → format/image/avif}/av1/encode/encode_av1_still.d.ts +0 -0
  960. /package/src/{avif/native → format/image/avif}/av1/encode/encode_av1_still.js +0 -0
  961. /package/src/{avif/native → format/image/avif}/av1/encode/encode_effort.d.ts +0 -0
  962. /package/src/{avif/native → format/image/avif}/av1/encode/encode_effort.js +0 -0
  963. /package/src/{avif/native → format/image/avif}/av1/encode/encode_tile.d.ts +0 -0
  964. /package/src/{avif/native → format/image/avif}/av1/encode/quantise.d.ts +0 -0
  965. /package/src/{avif/native → format/image/avif}/av1/encode/quantise.js +0 -0
  966. /package/src/{avif/native → format/image/avif}/av1/encode/write_coefficients.d.ts +0 -0
  967. /package/src/{avif/native → format/image/avif}/av1/encode/write_coefficients.js +0 -0
  968. /package/src/{avif/native → format/image/avif}/av1/encode/write_lr.d.ts +0 -0
  969. /package/src/{avif/native → format/image/avif}/av1/encode/write_lr.js +0 -0
  970. /package/src/{avif/native → format/image/avif}/av1/encode/write_transform_type.d.ts +0 -0
  971. /package/src/{avif/native → format/image/avif}/av1/encode/write_transform_type.js +0 -0
  972. /package/src/{avif/native → format/image/avif}/av1/entropy/CdfContext.d.ts +0 -0
  973. /package/src/{avif/native → format/image/avif}/av1/entropy/CdfContext.js +0 -0
  974. /package/src/{avif/native → format/image/avif}/av1/entropy/SymbolReader.d.ts +0 -0
  975. /package/src/{avif/native → format/image/avif}/av1/entropy/SymbolReader.js +0 -0
  976. /package/src/{avif/native → format/image/avif}/av1/entropy/SymbolWriter.d.ts +0 -0
  977. /package/src/{avif/native → format/image/avif}/av1/entropy/SymbolWriter.js +0 -0
  978. /package/src/{avif/native → format/image/avif}/av1/entropy/coefficient_context.d.ts +0 -0
  979. /package/src/{avif/native → format/image/avif}/av1/entropy/coefficient_context.js +0 -0
  980. /package/src/{avif/native → format/image/avif}/av1/entropy/partition_cdf.d.ts +0 -0
  981. /package/src/{avif/native → format/image/avif}/av1/entropy/partition_cdf.js +0 -0
  982. /package/src/{avif/native → format/image/avif}/av1/entropy/symbol_cost.d.ts +0 -0
  983. /package/src/{avif/native → format/image/avif}/av1/entropy/symbol_cost.js +0 -0
  984. /package/src/{avif/native → format/image/avif}/av1/filter/cdef.d.ts +0 -0
  985. /package/src/{avif/native → format/image/avif}/av1/filter/loop_filter.d.ts +0 -0
  986. /package/src/{avif/native → format/image/avif}/av1/filter/loop_restoration.d.ts +0 -0
  987. /package/src/{avif/native → format/image/avif}/av1/filter/superres.d.ts +0 -0
  988. /package/src/{avif/native → format/image/avif}/av1/grain/FilmGrainState.d.ts +0 -0
  989. /package/src/{avif/native → format/image/avif}/av1/grain/FilmGrainState.js +0 -0
  990. /package/src/{avif/native → format/image/avif}/av1/grain/film_grain.d.ts +0 -0
  991. /package/src/{avif/native → format/image/avif}/av1/obu/FrameHeader.d.ts +0 -0
  992. /package/src/{avif/native → format/image/avif}/av1/obu/FrameHeader.js +0 -0
  993. /package/src/{avif/native → format/image/avif}/av1/obu/ObuHeader.d.ts +0 -0
  994. /package/src/{avif/native → format/image/avif}/av1/obu/ObuHeader.js +0 -0
  995. /package/src/{avif/native → format/image/avif}/av1/obu/SequenceHeader.d.ts +0 -0
  996. /package/src/{avif/native → format/image/avif}/av1/obu/SequenceHeader.js +0 -0
  997. /package/src/{avif/native → format/image/avif}/av1/obu/for_each_obu.d.ts +0 -0
  998. /package/src/{avif/native → format/image/avif}/av1/obu/for_each_obu.js +0 -0
  999. /package/src/{avif/native → format/image/avif}/av1/obu/parse_frame_header.d.ts +0 -0
  1000. /package/src/{avif/native → format/image/avif}/av1/obu/parse_obu_header.d.ts +0 -0
  1001. /package/src/{avif/native → format/image/avif}/av1/obu/parse_obu_header.js +0 -0
  1002. /package/src/{avif/native → format/image/avif}/av1/obu/parse_sequence_header.d.ts +0 -0
  1003. /package/src/{avif/native → format/image/avif}/av1/obu/parse_sequence_header.js +0 -0
  1004. /package/src/{avif/native → format/image/avif}/av1/obu/write_frame_header.d.ts +0 -0
  1005. /package/src/{avif/native → format/image/avif}/av1/obu/write_frame_header.js +0 -0
  1006. /package/src/{avif/native → format/image/avif}/av1/obu/write_sequence_header.d.ts +0 -0
  1007. /package/src/{avif/native → format/image/avif}/av1/obu/write_sequence_header.js +0 -0
  1008. /package/src/{avif/native → format/image/avif}/av1/predict/IntraPredictionState.d.ts +0 -0
  1009. /package/src/{avif/native → format/image/avif}/av1/predict/IntraPredictionState.js +0 -0
  1010. /package/src/{avif/native → format/image/avif}/av1/predict/intra_filter_type.d.ts +0 -0
  1011. /package/src/{avif/native → format/image/avif}/av1/predict/intra_filter_type.js +0 -0
  1012. /package/src/{avif/native → format/image/avif}/av1/predict/predict_chroma_from_luma.d.ts +0 -0
  1013. /package/src/{avif/native → format/image/avif}/av1/predict/predict_intra.d.ts +0 -0
  1014. /package/src/{avif/native → format/image/avif}/av1/predict/predict_palette.d.ts +0 -0
  1015. /package/src/{avif/native → format/image/avif}/av1/predict/predict_palette.js +0 -0
  1016. /package/src/{avif/native → format/image/avif}/av1/tables/av1_symbols.d.ts +0 -0
  1017. /package/src/{avif/native → format/image/avif}/av1/tables/block_tables.d.ts +0 -0
  1018. /package/src/{avif/native → format/image/avif}/av1/tables/cdf_tables.d.ts +0 -0
  1019. /package/src/{avif/native → format/image/avif}/av1/tables/coefficient_tables.d.ts +0 -0
  1020. /package/src/{avif/native → format/image/avif}/av1/tables/derived_block_tables.d.ts +0 -0
  1021. /package/src/{avif/native → format/image/avif}/av1/tables/derived_block_tables.js +0 -0
  1022. /package/src/{avif/native → format/image/avif}/av1/tables/filter_tables.d.ts +0 -0
  1023. /package/src/{avif/native → format/image/avif}/av1/tables/grain_tables.d.ts +0 -0
  1024. /package/src/{avif/native → format/image/avif}/av1/tables/prediction_tables.d.ts +0 -0
  1025. /package/src/{avif/native → format/image/avif}/av1/tables/quantizer_matrix_tables.d.ts +0 -0
  1026. /package/src/{avif/native → format/image/avif}/av1/tables/quantizer_tables.d.ts +0 -0
  1027. /package/src/{avif/native → format/image/avif}/av1/tables/scan_tables.d.ts +0 -0
  1028. /package/src/{avif/native → format/image/avif}/av1/tables/segmentation_tables.d.ts +0 -0
  1029. /package/src/{avif/native → format/image/avif}/av1/tables/transform_tables.d.ts +0 -0
  1030. /package/src/{avif/native → format/image/avif}/av1/tables/unpack_table.d.ts +0 -0
  1031. /package/src/{avif/native → format/image/avif}/av1/transform/forward_transform_2d.d.ts +0 -0
  1032. /package/src/{avif/native → format/image/avif}/av1/transform/forward_transform_2d.js +0 -0
  1033. /package/src/{avif/native → format/image/avif}/av1/transform/inverse_transform_1d.d.ts +0 -0
  1034. /package/src/{avif/native → format/image/avif}/av1/transform/inverse_transform_2d.d.ts +0 -0
  1035. /package/src/{avif/native → format/image/avif}/av1/util/ceil_log2.d.ts +0 -0
  1036. /package/src/{avif/native → format/image/avif}/av1/util/ceil_log2.js +0 -0
  1037. /package/src/{avif/native → format/image/avif}/av1/util/round2.d.ts +0 -0
  1038. /package/src/{avif/native → format/image/avif}/av1/util/round2.js +0 -0
  1039. /package/src/{avif/native → format/image/avif}/av1/util/round2_signed.d.ts +0 -0
  1040. /package/src/{avif/native → format/image/avif}/av1/util/round2_signed.js +0 -0
  1041. /package/src/{avif/native → format/image/avif}/av1/util/tile_log2.d.ts +0 -0
  1042. /package/src/{avif/native → format/image/avif}/av1/util/tile_log2.js +0 -0
  1043. /package/src/{avif/native → format/image/avif}/bitstream/BitReader.d.ts +0 -0
  1044. /package/src/{avif/native → format/image/avif}/bitstream/BitReader.js +0 -0
  1045. /package/src/{avif/native → format/image/avif}/bitstream/BitWriter.d.ts +0 -0
  1046. /package/src/{avif/native → format/image/avif}/bitstream/BitWriter.js +0 -0
  1047. /package/src/{avif/native → format/image/avif}/color/ColourTransform.d.ts +0 -0
  1048. /package/src/{avif/native → format/image/avif}/color/ColourTransform.js +0 -0
  1049. /package/src/{avif/native → format/image/avif}/color/YuvImage.d.ts +0 -0
  1050. /package/src/{avif/native → format/image/avif}/color/YuvImage.js +0 -0
  1051. /package/src/{avif/native → format/image/avif}/color/clamp_sample.d.ts +0 -0
  1052. /package/src/{avif/native → format/image/avif}/color/clamp_sample.js +0 -0
  1053. /package/src/{avif/native → format/image/avif}/color/linear_to_transfer.d.ts +0 -0
  1054. /package/src/{avif/native → format/image/avif}/color/primaries.d.ts +0 -0
  1055. /package/src/{avif/native → format/image/avif}/color/primaries.js +0 -0
  1056. /package/src/{avif/native → format/image/avif}/color/rgb_row_to_ycbcr.d.ts +0 -0
  1057. /package/src/{avif/native → format/image/avif}/color/rgb_row_to_ycbcr.js +0 -0
  1058. /package/src/{avif/native → format/image/avif}/color/transfer_to_linear.d.ts +0 -0
  1059. /package/src/{avif/native → format/image/avif}/color/upsample_chroma_row.d.ts +0 -0
  1060. /package/src/{avif/native → format/image/avif}/color/ycbcr_row_to_rgb.d.ts +0 -0
  1061. /package/src/{avif/native → format/image/avif}/heif/AvifFile.d.ts +0 -0
  1062. /package/src/{avif/native → format/image/avif}/heif/AvifFile.js +0 -0
  1063. /package/src/{avif/native → format/image/avif}/heif/ItemProperty.d.ts +0 -0
  1064. /package/src/{avif/native → format/image/avif}/heif/ItemProperty.js +0 -0
  1065. /package/src/{avif/native → format/image/avif}/heif/find_item_property.d.ts +0 -0
  1066. /package/src/{avif/native → format/image/avif}/heif/find_item_property.js +0 -0
  1067. /package/src/{avif/native → format/image/avif}/heif/find_item_references.d.ts +0 -0
  1068. /package/src/{avif/native → format/image/avif}/heif/find_item_references.js +0 -0
  1069. /package/src/{avif/native → format/image/avif}/heif/find_items_referencing.d.ts +0 -0
  1070. /package/src/{avif/native → format/image/avif}/heif/find_items_referencing.js +0 -0
  1071. /package/src/{avif/native → format/image/avif}/heif/parse_avif_file.d.ts +0 -0
  1072. /package/src/{avif/native → format/image/avif}/heif/parse_image_grid.d.ts +0 -0
  1073. /package/src/{avif/native → format/image/avif}/heif/parse_item_property.d.ts +0 -0
  1074. /package/src/{avif/native → format/image/avif}/heif/parse_item_property.js +0 -0
  1075. /package/src/{avif/native → format/image/avif}/heif/read_item_data.d.ts +0 -0
  1076. /package/src/{avif/native → format/image/avif}/heif/read_item_data.js +0 -0
  1077. /package/src/{avif/native → format/image/avif}/heif/write_avif_file.d.ts +0 -0
  1078. /package/src/{avif/native → format/image/avif}/heif/write_avif_file.js +0 -0
  1079. /package/src/{avif/native → format/image/avif}/heif/write_item_property.d.ts +0 -0
  1080. /package/src/{avif/native → format/image/avif}/heif/write_item_property.js +0 -0
  1081. /package/src/{avif/native → format/image/avif}/isobmff/BoxHeader.d.ts +0 -0
  1082. /package/src/{avif/native → format/image/avif}/isobmff/BoxHeader.js +0 -0
  1083. /package/src/{avif/native → format/image/avif}/isobmff/for_each_box.d.ts +0 -0
  1084. /package/src/{avif/native → format/image/avif}/isobmff/for_each_box.js +0 -0
  1085. /package/src/{avif/native → format/image/avif}/isobmff/read_box_header.d.ts +0 -0
  1086. /package/src/{avif/native → format/image/avif}/isobmff/read_box_header.js +0 -0
  1087. /package/src/{avif/native → format/image/avif}/isobmff/read_full_box_header.d.ts +0 -0
  1088. /package/src/{avif/native → format/image/avif}/isobmff/read_full_box_header.js +0 -0
  1089. /package/src/{engine/asset/loaders → format}/image/jpeg/JpegFrame.d.ts +0 -0
  1090. /package/src/{engine/asset/loaders → format}/image/jpeg/JpegFrame.js +0 -0
  1091. /package/src/{engine/asset/loaders → format}/image/jpeg/JpegFrameComponent.d.ts +0 -0
  1092. /package/src/{engine/asset/loaders → format}/image/jpeg/JpegFrameComponent.js +0 -0
  1093. /package/src/{engine/asset/loaders → format}/image/jpeg/JpegImage.d.ts +0 -0
  1094. /package/src/{engine/asset/loaders → format}/image/jpeg/NOTES.md +0 -0
  1095. /package/src/{engine/asset/loaders → format}/image/jpeg/buildComponentData.d.ts +0 -0
  1096. /package/src/{engine/asset/loaders → format}/image/jpeg/buildComponentData.js +0 -0
  1097. /package/src/{engine/asset/loaders → format}/image/jpeg/buildHuffmanTable.d.ts +0 -0
  1098. /package/src/{engine/asset/loaders → format}/image/jpeg/buildHuffmanTable.js +0 -0
  1099. /package/src/{engine/asset/loaders → format}/image/jpeg/decodeScan.d.ts +0 -0
  1100. /package/src/{engine/asset/loaders → format}/image/jpeg/decodeScan.js +0 -0
  1101. /package/src/{engine/asset/loaders → format}/image/jpeg/idct8x8_float.d.ts +0 -0
  1102. /package/src/{engine/asset/loaders → format}/image/jpeg/jpeg_component_row.d.ts +0 -0
  1103. /package/src/{engine/asset/loaders → format}/image/jpeg/jpeg_component_row.js +0 -0
  1104. /package/src/{engine/asset/loaders → format}/image/jpeg/jpeg_decode.d.ts +0 -0
  1105. /package/src/{engine/asset/loaders → format}/image/jpeg/jpeg_decode.js +0 -0
  1106. /package/src/{engine/asset/loaders → format}/image/png/PNG.d.ts +0 -0
  1107. /package/src/{engine/asset/loaders → format}/image/png/PNG.js +0 -0
  1108. /package/src/{engine/asset/loaders → format}/image/png/PNG_HEADER_BYTES.d.ts +0 -0
  1109. /package/src/{engine/asset/loaders → format}/image/png/PNG_HEADER_BYTES.js +0 -0
  1110. /package/src/{engine/asset/loaders → format}/image/png/chunk/png_chunk_decode_iTXt.d.ts +0 -0
  1111. /package/src/{engine/asset/loaders → format}/image/png/chunk/png_chunk_decode_zTXt.d.ts +0 -0
  1112. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterAverage.d.ts +0 -0
  1113. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterAverage.js +0 -0
  1114. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterNone.d.ts +0 -0
  1115. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterNone.js +0 -0
  1116. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterPaeth.d.ts +0 -0
  1117. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterPaeth.js +0 -0
  1118. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterSub.d.ts +0 -0
  1119. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterSub.js +0 -0
  1120. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterUp.d.ts +0 -0
  1121. /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterUp.js +0 -0
  1122. /package/src/{engine/asset/loaders → format}/image/png/filter/png_unfilter.d.ts +0 -0
  1123. /package/src/{engine/asset/loaders → format}/image/png/png_inflate.d.ts +0 -0
  1124. /package/src/{engine/asset/loaders → format}/image/png/png_inflate.js +0 -0
  1125. /package/src/{engine/asset/loaders → format}/image/png/png_unpack_samples.d.ts +0 -0
  1126. /package/src/{engine/asset/loaders → format}/image/png/png_unpack_samples.js +0 -0
  1127. /package/src/{shade/renderer/loader → format/scene}/gltf/GLTF_PRIMITIVE_MODE.d.ts +0 -0
  1128. /package/src/{shade/renderer/loader → format/scene}/gltf/GLTF_PRIMITIVE_MODE.js +0 -0
  1129. /package/src/{shade/renderer/loader → format/scene}/gltf/coalesce_array_duplicates.d.ts +0 -0
  1130. /package/src/{shade/renderer/loader → format/scene}/gltf/coalesce_array_duplicates.js +0 -0
  1131. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/GltfBufferViewExtension.d.ts +0 -0
  1132. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/GltfBufferViewExtension.js +0 -0
  1133. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/GltfBufferViewExtensionSet.d.ts +0 -0
  1134. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_apply_buffer_view_extensions.d.ts +0 -0
  1135. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_apply_buffer_view_extensions.js +0 -0
  1136. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_buffer_view_extensions.d.ts +0 -0
  1137. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_buffer_view_extensions.js +0 -0
  1138. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_geometry_extensions.d.ts +0 -0
  1139. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_geometry_extensions.js +0 -0
  1140. /package/src/{shade/renderer/loader → format/scene}/gltf/ext/meshopt/MeshoptBufferViewExtension.d.ts +0 -0
  1141. /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_component_type.d.ts +0 -0
  1142. /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_component_type.js +0 -0
  1143. /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_node_world_matrices.d.ts +0 -0
  1144. /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_parse_container.d.ts +0 -0
  1145. /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_parse_container.js +0 -0
  1146. /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_read_accessor.d.ts +0 -0
  1147. /package/src/{shade/renderer/loader → format/scene}/usd/UsdError.d.ts +0 -0
  1148. /package/src/{shade/renderer/loader → format/scene}/usd/UsdError.js +0 -0
  1149. /package/src/{shade/renderer/loader → format/scene}/usd/parse_usda.d.ts +0 -0
  1150. /package/src/{shade/renderer/loader → format/scene}/usd/parse_usda.js +0 -0
  1151. /package/src/{shade/renderer/loader → format/scene}/usd/unpack_usdz.d.ts +0 -0
  1152. /package/src/{shade/renderer/loader → format/scene}/usd/usd_compose_transform.d.ts +0 -0
  1153. /package/src/{shade/renderer/loader → format/scene}/usd/usd_lz4.d.ts +0 -0
  1154. /package/src/{shade/renderer/loader → format/scene}/usd/usd_triangulate.d.ts +0 -0
  1155. /package/src/{shade/renderer/loader → format/scene}/usd/usd_triangulate.js +0 -0
  1156. /package/src/{basis → format/texture/basis}/BasisHuffmanTable.d.ts +0 -0
  1157. /package/src/{basis → format/texture/basis}/BasisHuffmanTable.js +0 -0
  1158. /package/src/{basis → format/texture/basis}/basis_read_huffman_table.d.ts +0 -0
  1159. /package/src/{basis → format/texture/basis}/basis_read_huffman_table.js +0 -0
  1160. /package/src/{basis → format/texture/basis}/etc1s/Etc1sSelectorHistory.d.ts +0 -0
  1161. /package/src/{basis → format/texture/basis}/etc1s/Etc1sSelectorHistory.js +0 -0
  1162. /package/src/{basis → format/texture/basis}/etc1s/etc1s_block_colors.d.ts +0 -0
  1163. /package/src/{basis → format/texture/basis}/etc1s/etc1s_block_colors.js +0 -0
  1164. /package/src/{basis → format/texture/basis}/etc1s/etc1s_decode_slice.d.ts +0 -0
  1165. /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_endpoint_codebook.d.ts +0 -0
  1166. /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_endpoint_codebook.js +0 -0
  1167. /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_selector_codebook.d.ts +0 -0
  1168. /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_selector_codebook.js +0 -0
  1169. /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_slice_tables.d.ts +0 -0
  1170. /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_slice_tables.js +0 -0
  1171. /package/src/{basis → format/texture/basis}/transcode/build_range_plan.js +0 -0
  1172. /package/src/{basis → format/texture/basis}/transcode/etc1s_to_bc7.js +0 -0
  1173. /package/src/{ktx2 → format/texture/ktx2}/KTX2_IDENTIFIER.d.ts +0 -0
  1174. /package/src/{ktx2 → format/texture/ktx2}/KTX2_IDENTIFIER.js +0 -0
  1175. /package/src/{ktx2 → format/texture/ktx2}/KhrDfModel.d.ts +0 -0
  1176. /package/src/{ktx2 → format/texture/ktx2}/KhrDfModel.js +0 -0
  1177. /package/src/{ktx2 → format/texture/ktx2}/SupercompressionScheme.d.ts +0 -0
  1178. /package/src/{ktx2 → format/texture/ktx2}/SupercompressionScheme.js +0 -0
@@ -0,0 +1,793 @@
1
+ # `EXT_meshopt_compression` / `KHR_meshopt_compression` — implementation plan
2
+
3
+ Status: plan. Written 2026-08-20.
4
+
5
+ Scope: decode side of both extensions.
6
+
7
+ - `EXT_meshopt_compression` — ratified, Vendor.
8
+ <https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_meshopt_compression>
9
+ - `KHR_meshopt_compression` — ratified, Khronos, merged 2026-01-23 (PR #2517).
10
+ <https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_meshopt_compression>
11
+
12
+ Reference encoder/decoder: <https://github.com/zeux/meshoptimizer>. Consulted for questions the
13
+ specification text leaves ambiguous; **not vendored and not transcribed** — no new dependency, and
14
+ the bitstream below is implemented from the two specifications.
15
+
16
+ ## 1. What these extensions are, and why that shapes the split
17
+
18
+ Neither is a geometry extension. Both are *bufferView* extensions: a bufferView declares that its
19
+ bytes are produced by running a decoder over a byte range of some other buffer. Nothing about the
20
+ decode depends on what the bufferView is later read as — vertex attributes, index data, morph
21
+ deltas, animation keyframes and `EXT_mesh_gpu_instancing` transforms all go through the same three
22
+ modes and (now) five filters.
23
+
24
+ That is the seam. Everything except roughly two dozen lines is a **byte-array in, byte-array out**
25
+ codec with no knowledge of glTF at all:
26
+
27
+ ```
28
+ src/core/binary/meshopt/ pure codec — bytes in, bytes out.
29
+ ^ No glTF, no geometry, no engine.
30
+ | called by
31
+ src/format/scene/gltf/ext/meshopt/ one bufferView's worth of meshopt: read the
32
+ ^ extension object, check it, return the bytes.
33
+ | called through GltfBufferViewExtension by
34
+ src/format/scene/gltf/ext/ the generic bufferView-extension layer — which
35
+ ^ extension claims a view, and what becomes of what
36
+ | it produced. Names no codec.
37
+ | called by
38
+ src/shade/renderer/loader/gltf/tiny-gltf.js one call, after buffers resolve. Names no
39
+ extension at all.
40
+ ```
41
+
42
+ `core/binary` is the codec's right home: it is where meep already keeps byte-level codecs
43
+ (`base64/`, `base58/`, `half_to_float_uint16`, `BinaryBuffer`'s LEB128 `readUintVar`). The codec
44
+ imports nothing outside `core/`, so it is usable from a worker, a tool, or the USD loader without
45
+ dragging Shade in.
46
+
47
+ ### 1.1 KHR is EXT plus three things
48
+
49
+ The two extensions share a JSON shape, a `bufferView`/`buffer` model, fallback buffers, and modes
50
+ 1 and 2 byte for byte. KHR adds:
51
+
52
+ 1. **Attribute codec version 1** (header `0xa1`). A genuinely different bitstream for mode 0: a
53
+ per-block control header, four control modes, an extra 1-bit sentinel encoding, and three
54
+ *channel* modes that widen the delta from 8-bit to 16-bit or to a rotated 32-bit XOR.
55
+ Version 0 (`0xa0`) remains legal under KHR and is bit-identical to EXT.
56
+ 2. **Filter 4, `COLOR`** — YCoCg, `byteStride` 4 or 8.
57
+ 3. One extra validity rule (`ATTRIBUTES` requires `byteStride >= 4`) and the constraint that a
58
+ bufferView must not carry both extensions.
59
+
60
+ So there is one codec that decodes everything, and a glTF layer that enforces the per-name subset:
61
+ a `0xa1` stream or a `COLOR` filter under the `EXT_` name is an invalid file and is rejected.
62
+
63
+ ## 2. Modules
64
+
65
+ ### 2.1 `src/core/binary/meshopt/` — the codec
66
+
67
+ | File | Export |
68
+ |:--|:--|
69
+ | `MeshoptCompressionMode.js` | `@enum` — `Attributes: 0`, `Triangles: 1`, `Indices: 2` |
70
+ | `MeshoptCompressionFilter.js` | `@enum` — `None: 0`, `Octahedral: 1`, `Quaternion: 2`, `Exponential: 3`, `Color: 4` |
71
+ | `MESHOPT_GROUP_SIZE.js` | the group size, and the 24-byte bound a group read stays inside |
72
+ | `meshopt_decode_byte_group.js` | one group of 16 byte-deltas at a given sentinel width |
73
+ | `meshopt_decode_data_block.js` | one "data block": header bits + its groups, for one byte position |
74
+ | `meshopt_decode_vertex_buffer.js` | mode 0, versions 0 and 1 |
75
+ | `meshopt_decode_index_buffer.js` | mode 1 |
76
+ | `meshopt_decode_index_sequence.js` | mode 2 |
77
+ | `meshopt_decode_filter_octahedral.js` | filter 1, in place |
78
+ | `meshopt_decode_filter_quaternion.js` | filter 2, in place |
79
+ | `meshopt_decode_filter_exponential.js` | filter 3, in place |
80
+ | `meshopt_decode_filter_color.js` | filter 4, in place |
81
+ | `meshopt_decode.js` | dispatch: mode, then filter |
82
+ | `meshopt_read_uint_var.js` | bounded LEB128 over a `Uint8Array` |
83
+ | `__meshopt_test_streams.js` | test-only encoders, shared by the codec specs and the glTF fixtures |
84
+
85
+ Signatures:
86
+
87
+ ```js
88
+ meshopt_decode_vertex_buffer(destination, count, byte_stride, source)
89
+ meshopt_decode_index_buffer(destination, index_count, index_size, source)
90
+ meshopt_decode_index_sequence(destination, index_count, index_size, source)
91
+ meshopt_decode_filter_*(destination, count, byte_stride)
92
+ meshopt_decode(destination, count, byte_stride, mode, filter, source)
93
+ ```
94
+
95
+ `destination` and `source` are `Uint8Array` throughout — the codec never assumes an aligned
96
+ `ArrayBuffer` offset, because a compressed source range in a glTF is only byte-aligned. Index modes
97
+ and filters build their typed views internally from `index_size` / `byte_stride`.
98
+
99
+ Two additions outside the package, both genuinely generic and both matching meep's existing naming:
100
+
101
+ - `src/core/math/round_half_away_from_zero.js` — `Math.round` breaks ties toward `+Infinity`
102
+ (`Math.round(-2.5) === -2`). Four of the five filters specify `round()` on a signed symmetric
103
+ quantity and round half away from zero. Sits beside the existing `round_up.js`.
104
+ - nothing else: `msb_32` (`core/binary`) is already `findMSB` including its `-1` for zero, `exp2`
105
+ and `copysign` (`core/math`) already exist, and `decode_octahedron_to_unit`
106
+ (`core/geom/3d/normal/octahedron`) is reused by filter 1 — see §4.1.
107
+
108
+ ### 2.2 `src/format/scene/gltf/ext/` — bufferView extensions, generically
109
+
110
+ A bufferView extension says "these bytes are not in the buffer I point at; run this to get them".
111
+ Meshopt is two of them; a future codec would be a third. The parser should know that shape and
112
+ nothing else, so the layer is split in two — see §9 for why this is not how it was first written.
113
+
114
+ | File | What it is |
115
+ |:--|:--|
116
+ | `GltfBufferViewExtension.js` | the contract one extension implements: a `name`, `decode()`, and whether it declares placeholder buffers |
117
+ | `GltfBufferViewExtensionSet.js` | which extensions a parser honours, and `claim(view)` — the *only* thing that decides whether anything happens |
118
+ | `gltf_apply_buffer_view_extensions.js` | the walk: claim, delegate, append the buffer, replace the descriptor. Identical for every extension |
119
+ | `gltf_buffer_view_extensions.js` | `GLTF_BUFFER_VIEW_EXTENSIONS`, the set the parser uses by default |
120
+ | `meshopt/MeshoptBufferViewExtension.js` | one class, two instances: `EXT_MESHOPT_COMPRESSION`, `KHR_MESHOPT_COMPRESSION` |
121
+
122
+ The walker:
123
+
124
+ 1. returns a **new** `bufferViews` array — claimed entries are replaced by fresh descriptors,
125
+ unclaimed entries pass through **by reference**,
126
+ 2. **appends** each decoded buffer to `buffers`, pointing the new descriptor at it with
127
+ `byteOffset: 0`,
128
+ 3. keeps `byteStride`, `target` and everything else from the parent, so accessor reads are unchanged,
129
+ 4. refuses a decoder that answered with the wrong number of bytes, whichever decoder it was.
130
+
131
+ Returning a new array rather than mutating the old descriptors is load-bearing, not taste — §6.3.
132
+
133
+ The difference between the two meshopt instances is two fields and no branches: which filter names
134
+ the extension defines, and the newest codec version each *mode* may carry. Per mode because both
135
+ index codecs' version 1 is legal under either extension; it is only the attribute codec that the
136
+ vendor extension pins at 0.
137
+
138
+ ### 2.3 `tiny-gltf.js` — the call site
139
+
140
+ Three edits, all in `loadFromJson`:
141
+
142
+ - **`~L422-448`, buffer resolution.** Today a buffer with no `uri` outside the GLB fast path is fed
143
+ to `resolveUri(undefined, baseUrl)` and fetched as `<baseUrl>undefined`. That is exactly the shape
144
+ of a meshopt *fallback* buffer (`{ "byteLength": N }`, no URI), so today a `gltfpack`-produced
145
+ `.gltf` cannot load at all. A buffer that is marked `fallback` or has no `uri` resolves to a
146
+ zero-length `ArrayBuffer` instead of a request (§6.8). Also: the GLB branch currently loads *only*
147
+ the binary chunk and ignores `buffers[1..n]`, which is where both extensions put the placeholder —
148
+ the branch becomes "buffer 0 is the chunk, the rest resolve normally".
149
+ - **`~L524-534`, an image sourced from a bufferView.** Throw if that bufferView is compressed. The
150
+ combination is legal in the abstract and pointless in practice (the payload is already a PNG or a
151
+ JPEG); the alternative to throwing is handing `createImageBitmap` the fallback buffer's bytes,
152
+ which is a silent wrong answer.
153
+ - **`~L557`, after `await Promise.all(pendingBuffers)`.** One call to
154
+ `gltf_apply_buffer_view_extensions` before `json.buffers` and `json.bufferViews` are published.
155
+
156
+ The parser names no extension: it asks `this.bufferViewExtensions` — a public field, defaulted to the
157
+ standard set and replaceable — and the set is the one place that knows what is implemented.
158
+
159
+ **Nothing in `load_gltf.js` changes.** It reads `gltf.bufferViews` / `gltf.buffers` inside
160
+ `process()`, which runs after `loadFromJson` has returned, so it sees decoded views and never learns
161
+ either extension exists. That is the point of doing this at the bufferView layer.
162
+
163
+ ## 3. The bitstream, as implemented
164
+
165
+ Written from the two specifications' Appendix A/B. Notes marked ⚠ are places where a plausible
166
+ reading is wrong.
167
+
168
+ ### 3.1 Mode 0 — attributes
169
+
170
+ ```
171
+ header 1 byte: 0xa0 (version 0) or 0xa1 (version 1, KHR only)
172
+ blocks one or more attribute blocks
173
+ tail padding zero bytes
174
+ tail block baseline element (byte_stride bytes)
175
+ channel modes (byte_stride / 4 bytes, version 1 only)
176
+ ```
177
+
178
+ ⚠ **The padding comes BEFORE the tail block; the tail block is flush against the end of the
179
+ stream.** So the baseline element starts at `byteLength - tail_size`, where
180
+
181
+ ```
182
+ tail_size = byte_stride + (version === 1 ? byte_stride / 4 : 0)
183
+ tail_size_pad = max(tail_size, version === 1 ? 24 : 32)
184
+ ```
185
+
186
+ and the decoder must have consumed exactly `byteLength - tail_size_pad` bytes when the blocks are
187
+ done. EXT's wording — "a baseline element stored verbatim, padded to 32 bytes" — reads equally well
188
+ as element-then-padding, which for any stride below 32 puts the baseline in the wrong place and
189
+ decodes garbage. KHR's rewording ("Tail padding, which pads the size of the *subsequent* tail
190
+ block…") settles it, and the reference decoder agrees: it takes the baseline from
191
+ `data_end - tail_size`, with `tail_size` **unpadded**, while validating the remainder against
192
+ `tail_size_pad`. Two different quantities that coincide only when `byte_stride >= 32`.
193
+
194
+ Block loop, identical in both versions:
195
+
196
+ ```
197
+ max_block_elements = min(floor(8192 / byte_stride) & ~15, 256)
198
+ block_elements = min(remaining, max_block_elements)
199
+ group_count = ceil(block_elements / 16)
200
+ ```
201
+
202
+ ⚠ `8192 / byte_stride` is integer division — `floor` before the mask. With `byte_stride <= 256` the
203
+ result is never below 32, so the loop always advances.
204
+
205
+ A block is, in order:
206
+
207
+ - a **control header** of `byte_stride / 4` bytes — **version 1 only**,
208
+ - `byte_stride` **data blocks**, one per byte position `k` of the element.
209
+
210
+ The control header packs a 2-bit *control mode* per byte position, low bits first:
211
+ `(c0 << 0) | (c1 << 2) | (c2 << 4) | (c3 << 6)`, one byte per aligned group of four byte positions.
212
+ The control mode selects what the data block for that byte position looks like:
213
+
214
+ | control mode | data block |
215
+ |:--|:--|
216
+ | 0 | header bits, group encodings `{zero, 1-bit, 2-bit, 4-bit}` |
217
+ | 1 | header bits, group encodings `{1-bit, 2-bit, 4-bit, raw}` |
218
+ | 2 | nothing at all — every delta byte is 0, no header bits, no bytes consumed |
219
+ | 3 | literal: `group_count * 16` delta bytes, no header bits |
220
+
221
+ Version 0 has no control header and behaves as a fixed table
222
+ `{zero, 2-bit, 4-bit, raw}` for every byte position.
223
+
224
+ Where header bits are present they are `ceil(group_count / 4)` bytes, 2 bits per group, packed
225
+ **low bits first**: `(g0 << 0) | (g1 << 2) | (g2 << 4) | (g3 << 6)`. Group encodings:
226
+
227
+ | encoding | packed bytes | sentinel | total |
228
+ |:--|:--|:--|:--|
229
+ | zero | 0 | — | 0 |
230
+ | 1-bit | 2 | `1` | 2..18 |
231
+ | 2-bit | 4 | `3` | 4..20 |
232
+ | 4-bit | 8 | `15` | 8..24 |
233
+ | raw | 16 | — | 16 |
234
+
235
+ ⚠ Bit order inside a packed byte is **not uniform**. 2-bit and 4-bit run high bits first —
236
+ `(d3 << 0) | (d2 << 2) | (d1 << 4) | (d0 << 6)` and `(d1 << 0) | (d0 << 4)` — while **1-bit runs low
237
+ bits first**, `(d0 << 0) | (d1 << 1) | … | (d7 << 7)`. The spec says so explicitly (it is there to
238
+ let SIMD implementations reuse a lookup table); it is not a transcription slip.
239
+
240
+ A delta equal to the sentinel means the real value is outside the bit range and is taken as a whole
241
+ byte from the run that follows the packed bytes, in order of appearance.
242
+
243
+ The delta bytes so recovered are then turned into values by the **channel mode**. Channels are
244
+ aligned groups of four byte positions; version 1 stores one mode byte per channel in the tail, and
245
+ version 0 behaves as though every channel were mode 0.
246
+
247
+ | channel mode | reconstruction |
248
+ |:--|:--|
249
+ | 0 | per byte: `v = (unzigzag8(d) + prev) & 0xff` |
250
+ | 1 | per aligned 2 bytes, little-endian: `v = (unzigzag16(d) + prev) & 0xffff` |
251
+ | 2 | per aligned 4 bytes, little-endian: `v = rotl32(d, r) ^ prev` |
252
+
253
+ `r` is the **high** 4 bits of the channel mode byte and applies only to mode 2. ⚠ The decoder
254
+ rotates **left by `r`** — the spec's `rotate(v, r) = (v << r) | (v >> ((32 - r) & 31))` is the
255
+ decode direction, despite the surrounding sentence describing how the encoder produced the delta.
256
+ A mode byte whose low nibble is 3 or above, or whose high nibble is non-zero for mode 0 or 1, makes
257
+ the stream invalid.
258
+
259
+ Groups always decode sixteen elements; anything past `block_elements` is discarded and does not
260
+ advance the delta chain. Each block ends by taking its **last decoded element** as the next block's
261
+ baseline.
262
+
263
+ The specification's own worked example is the acceptance test for the group decoder (§5.1).
264
+
265
+ ### 3.2 Mode 1 — triangles
266
+
267
+ ```
268
+ header 1 byte, (h & 0xf0) == 0xe0; version = h & 0x0f, 0 or 1 (both specs pin 0xe1)
269
+ codes index_count / 3 bytes, one per triangle
270
+ data variable, immediately after the codes
271
+ codeaux the last 16 bytes
272
+ ```
273
+
274
+ State: `next` (high-watermark, 0), `last` (0), a 16-entry edge FIFO and a 16-entry vertex FIFO, both
275
+ filled with `0xFFFFFFFF`. `data` must end exactly at the start of `codeaux` — that equality is the
276
+ stream's own checksum.
277
+
278
+ `fec_max` is 13 for version 1 and 15 for version 0; it is what makes codes `0xXd`/`0xXe` mean
279
+ `last - 1` / `last + 1` rather than two more FIFO slots. Reading it from the header rather than
280
+ hard-coding 13 is why both versions decode correctly.
281
+
282
+ ⚠ The two branches index the vertex FIFO differently: the `code < 0xf0` path reads
283
+ `(offset - 1 - fec) & 15`, the `0xf0..0xff` paths read `(offset - feb) & 15`. This follows from the
284
+ spec's own wording ("index Y" versus "index Z-1") and is not a slip.
285
+
286
+ ⚠ A conditional push writes the value at `offset` and then does not advance `offset`. Skipping the
287
+ write as well is *not* equivalent: every later FIFO read at distance `d` would see what belongs at
288
+ `d - 1`. Two tests reach back past a vertex that was not pushed, because until something does the
289
+ difference is invisible.
290
+
291
+ ⚠ The explicit indices in the `0xfe`/`0xff` branch are read in the order a, b, c, and `last` chains
292
+ through them, so that order is load-bearing. Their position relative to the `next++` allocations is
293
+ *not*: an index is either fresh or explicit, never both, so the two passes do not interfere. (The
294
+ plan asserted otherwise; see §8.)
295
+
296
+ ### 3.3 Mode 2 — indices
297
+
298
+ ```
299
+ header 1 byte, (h & 0xf0) == 0xd0 (both specs pin 0xd1)
300
+ deltas one LEB128 varint per index
301
+ tail 4 reserved bytes
302
+ ```
303
+
304
+ `v & 1` selects one of two running baselines; `v >> 1` is a zigzag delta applied to it. Two
305
+ baselines rather than one is what lets an encoder splice two monotonic runs (strips, line lists)
306
+ cheaply. Again `data` must land exactly on the 4-byte tail.
307
+
308
+ ### 3.4 Filters
309
+
310
+ All five are in place over the already-decoded bufferView, `count` elements of `byte_stride` bytes.
311
+
312
+ - **Octahedral** — `byte_stride` 4 → `Int8Array`, 8 → `Int16Array`. Components 0 and 1 are the
313
+ octahedral pair, component 2 encodes 1.0 at the element's own precision `K`, component 3 passes
314
+ through untouched. Output scaled by `max` = 127 or 32767. Reuses meep's own
315
+ `decode_octahedron_to_unit` — see §4.1.
316
+ - **Quaternion** — `byte_stride` 8, `Int16Array`. `one = input[3] | 3`,
317
+ `max_component = input[3] & 3`; outputs land at `(max_component + 1..3) & 3` for x/y/z and
318
+ `(max_component + 0) & 3` for w.
319
+ ⚠ `input[3]` is read for *both* purposes before any output is written — one of the four writes
320
+ lands on it.
321
+ ⚠ The radicand `1 - x² - y² - z²` is clamped at 0. meep already learned this in
322
+ `quat3_decode_from_uint32`; a NaN quaternion out of a loader poisons every transform downstream.
323
+ - **Exponential** — `byte_stride` divisible by 4. Each 32-bit word is `e = word >> 24` (signed),
324
+ `m = (word << 8) >> 8` (signed); the result `2^e · m` is written back as a float32. `e` is
325
+ spec-bounded to [-100, 100] and `|m| < 2^23`, so the product is exact in float32 and computing it
326
+ in JS doubles and storing through a `Float32Array` is bit-identical to the reference's
327
+ build-the-exponent-and-multiply.
328
+ - **Color** (KHR only) — `byte_stride` 4 → `Uint8Array`, 8 → `Uint16Array`. YCoCg:
329
+
330
+ ```
331
+ as = (1 << (msb_32(input[3]) + 1)) - 1
332
+ r = input[0] + int(input[1]) - int(input[2])
333
+ g = input[0] + int(input[2])
334
+ b = input[0] - int(input[1]) - int(input[2])
335
+ a = input[3] & (as >> 1); a = (a << 1) | (a & 1)
336
+ output = round(component * (UINTN_MAX / as))
337
+ ```
338
+
339
+ ⚠ Components 0 and 3 are **unsigned**, components 1 and 2 are **signed**, in the same element.
340
+ `msb_32` already returns `-1` for zero, so a malformed `input[3] === 0` yields `as = 0`, an
341
+ infinite scale, and finite garbage bytes once stored through a `Uint8Array` — defined, ugly, and
342
+ not worth a guard (§6.9).
343
+
344
+ ## 4. What is reused, and what deliberately is not
345
+
346
+ ### 4.1 Reused
347
+
348
+ - **`decode_octahedron_to_unit`** (`core/geom/3d/normal/octahedron`) implements filter 1's core.
349
+ meep's fold is the same arithmetic as the spec's `copysign` form (`x + t·sign(x)` either way) and
350
+ it renormalises, but it is written **Y-up**: meep's `(x, y, z)` is the spec's `(x, z, y)`. The
351
+ swizzle is the whole of the adaptation, and a spec checks the composition against the
352
+ specification's formula directly rather than against meep's.
353
+ - **`msb_32`** (`core/binary`) is `findMSB` for filter 4, `-1`-on-zero included.
354
+ - **`exp2`** and **`copysign`** (`core/math`).
355
+ - **`gltf_test_fixtures.js`** (`engine/asset/loaders`) already builds a one-triangle glTF and GLB by
356
+ hand; the end-to-end fixture extends it rather than introducing a second fixture vocabulary.
357
+
358
+ ### 4.2 Deliberately not
359
+
360
+ - **`BinaryBuffer.readUintVar`** is the same LEB128 scheme and reusing it would honour "use meep's
361
+ existing code". It is still wrong here: it reads through a `DataView` bound to a whole
362
+ `ArrayBuffer` where the compressed range is a slice, it is unbounded on malformed input where the
363
+ reference stops at five bytes, and `value |= (b & 0x7f) << shift` turns negative once `shift`
364
+ reaches 28 — which is inside the range mode 1 and mode 2 indices legitimately use. The deviation
365
+ and its three reasons are documented where `meshopt_read_uint_var` is defined, so the next reader
366
+ does not "fix" the duplication.
367
+ - **`quat3_decode_from_uint32`** is a different packing — 10-bit, fixed range, dropped component
368
+ inserted *at* index `max` — where filter 2 is 16-bit, variable precision and *cyclic*. Documented
369
+ as deliberately not reused rather than left to look overlooked.
370
+ - **`Vector3` / `Quaternion` / `vec3` helpers.** The filters run over hundreds of thousands of
371
+ elements through typed-array views; routing each through an object allocation would be the one
372
+ place in this feature where reuse costs more than it is worth. Scalars, module-static scratch.
373
+
374
+ ## 5. Tests
375
+
376
+ Every module gets a `.spec.js` beside it. House rules apply: black-box, no mocks, and no rejection
377
+ tests against `assert.*` (stripped in production) — everything that must reject bad *file* input
378
+ does so with a real `throw`, and those are tested.
379
+
380
+ ### 5.1 The independent oracle
381
+
382
+ The single most valuable test is free: **Appendix A of both specifications contains a worked
383
+ example** of the 4-bit sentinel encoding —
384
+
385
+ ```
386
+ 0x17 0x5f 0xf0 0xbc 0x77 0xa9 0x21 0x00 0x34 0xb5
387
+ -> -1 -4 -3 26 -91 0 -6 6 -4 -4 5 -5 1 -1 0 0
388
+ ```
389
+
390
+ — which pins the packed-nibble order, the sentinel value, the sentinel run's position and its
391
+ ordering, and the zigzag, all at once, from a document that is not this implementation. It is the
392
+ first test written, and the group decoder is developed against it. (Checked by hand while writing
393
+ this plan: the nibbles are `1 7 5 S S 0 11 12 7 7 10 9 2 1 0 0`, the two sentinels take `0x34` and
394
+ `0xb5`, and de-zigzagging reproduces the stated line exactly.)
395
+
396
+ ### 5.2 Hand-derived vectors
397
+
398
+ The remaining streams are small enough to author by hand from the spec, with the derivation in the
399
+ test as a comment. Worked out in advance so this plan can be checked before any code exists:
400
+
401
+ - **mode 0 v0, all-zero groups.** `byte_stride` 4, `count` 3 → one block, one group, four data
402
+ blocks each a single `0x00` header byte: `[0xa0, 0x00, 0x00, 0x00, 0x00]` then 28 zero bytes then
403
+ the 4 baseline bytes. All three elements equal the baseline. This is the test that fails if the
404
+ tail is read from the wrong end (§3.1 ⚠) — under the element-then-padding reading the baseline
405
+ comes out `0,0,0,0`.
406
+ - **mode 0 v1, control modes.** The same shape with header `0xa1`, one control byte, and one tail
407
+ channel-mode byte: control mode 2 (nothing stored) on every byte position; then control mode 3
408
+ (literal) with hand-written delta bytes; then control mode 0 with a 1-bit sentinel group, which
409
+ is the only place the low-bits-first packing is exercised.
410
+ - **mode 0 v1, channel modes 1 and 2.** `byte_stride` 4, one channel: a 16-bit delta pair that
411
+ wraps modulo 65536, and a rotated XOR whose `r` is non-zero — the two places where a
412
+ left-versus-right rotation or a byte-order slip is invisible at `r = 0`.
413
+ - **mode 1, one triangle.** `[0xe1, 0xf0]` + 16 `codeaux` bytes with `codeaux[0] = 0x00` →
414
+ `feb = fec = 0` → `a, b, c = next++, next++, next++` → `[0, 1, 2]`. 18 bytes, `1 + 6/3 + 16`;
415
+ `data` lands exactly on `codeaux`.
416
+ - **mode 1, two triangles sharing an edge.** Append code `0x00`: after triangle one the edge FIFO
417
+ holds `(1,0), (2,1), (0,2)` at offset 3, so `fe = 0` reads `(0, 2)` and `fec = 0` takes
418
+ `c = next = 3` → `[0, 1, 2, 0, 2, 3]`. This is the test that fails if the edge-FIFO push order is
419
+ wrong.
420
+ - **mode 1, the `0xXf` and `0xfe`/`0xff` paths** — explicit indices through `decodeIndex`, and the
421
+ `codeaux == 0` restart that resets `next`.
422
+ - **mode 2.** `[0xd1, 0x14, 0x08, 0, 0, 0, 0]` → `0x14 = 20`: baseline 0, zigzag 10, delta +5 → `5`;
423
+ `0x08 = 8`: baseline 0, zigzag 4, delta +2 → `7`. Output `[5, 7]`. Plus a vector that alternates
424
+ the baseline bit, which is the whole reason mode 2 exists.
425
+ - **filters.** Values computed from each spec's own pseudo-code in the test, not from the
426
+ implementation: unit ±X/±Y/±Z normals through octahedral at both strides, identity and
427
+ each-of-four-`max_component` quaternions, exponential words with negative exponents, negative
428
+ mantissas and `m = 0`, and for colour a grey, a saturated primary and a partial alpha at both
429
+ strides and at a `K` below the component width.
430
+ - **rejection.** Truncated streams, wrong header bytes, a `0xa1` stream offered under the `EXT_`
431
+ name, a `COLOR` filter under the `EXT_` name, an invalid channel mode byte, and a mode 1 stream
432
+ whose `data` does not land on `codeaux`.
433
+
434
+ ### 5.3 Round trip
435
+
436
+ A **test-only** mode 0 encoder in the spec file (raw-byte groups only, the simplest legal encoding)
437
+ gives a randomised round trip over strides 4/8/12/16/64 and counts that straddle the 16-element
438
+ group and 256-element block boundaries. It is deliberately *secondary*: it shares the layout
439
+ assumptions of the decoder, so a shared misreading passes. Its job is exercising the block and group
440
+ loop bounds, not proving the format. §5.1 and §5.2 prove the format.
441
+
442
+ ### 5.4 End to end
443
+
444
+ `gltf_test_fixtures.js` gains `build_meshopt_triangle_gltf_json(extension_name, buffer_uri, options)`
445
+ and a matching `_glb`: the one-triangle model with its four bufferViews compressed (positions, normals and
446
+ uvs in mode 0, indices in mode 1) by the fixture's own minimal encoder, a `fallback: true`
447
+ placeholder buffer with no URI, and `extensionsUsed` / `extensionsRequired` set. A spec then loads
448
+ it through the real `AssetManager` and `GLTFSceneBundleAssetLoader` — as
449
+ `GLTFSceneBundleAssetLoader.spec.js` already does — under **both** extension names, and asserts the
450
+ resulting bundle's geometry equals the uncompressed fixture's. That covers the fallback-buffer path,
451
+ the bufferView rewrite, and the fact that `load_gltf.js` needs no changes.
452
+
453
+ That file, though, is one the *vendor* extension could have described just as well — the Khronos name
454
+ on it and nothing else. `options` makes it a file only KHR defines: attribute streams at codec
455
+ version 1 carrying a channel mode each (a rotated exclusive-or over the positions, byte deltas over
456
+ the normals, 16-bit deltas over the texture coordinates), and a `COLOR`-filtered `COLOR_0` the mesh
457
+ reader maps to `StandardAttributes.Color`. Each of the two is served on its own as well as together,
458
+ so that a test watching the vendor extension refuse one is refusing *that* one — asserting against a
459
+ file carrying both passes on either constraint, and then removing one of them from the vendor
460
+ extension goes unnoticed.
461
+
462
+ ### 5.5 What none of this covers
463
+
464
+ No test here decodes a stream produced by `gltfpack`. Every byte under test was authored from a
465
+ specification by me or by a fixture encoder I also wrote; a misreading shared between them survives.
466
+ §5.1 is the only genuinely external oracle, and it covers one group encoding of one mode.
467
+
468
+ **Recommendation to the sponsor: drop one `gltfpack -noq -cc` output (and one `-cc -vv` for codec
469
+ version 1) into the repo, and add a golden test that decodes it and checks every `POSITION`
470
+ accessor's values against that accessor's declared `min`/`max`, and every index against the vertex
471
+ count.** Those bounds are written by the encoder, are not derivable from the compressed bytes, and
472
+ would catch a systematic misreading immediately. Left out of this plan because it needs files only
473
+ the sponsor can supply.
474
+
475
+ ## 6. Adversarial review of this plan
476
+
477
+ Each item is a way this plan is wrong or insufficient, and what it changes.
478
+
479
+ ### 6.1 The tail was read from the wrong end
480
+
481
+ The first draft of this plan had the baseline element at the **start** of a `max(stride, 32)`-byte
482
+ tail, from EXT's "a baseline element stored verbatim, padded to 32 bytes", and cited a reading of
483
+ the reference decoder that appeared to confirm it. Both were wrong, and for any `byteStride` below
484
+ 32 — which is every attribute meshopt is actually used on — it decodes an entire model to garbage
485
+ while every unit test written from the same misreading passes.
486
+
487
+ What caught it was reading KHR, which reworded the same clause to "Tail padding, which pads the size
488
+ of the *subsequent* tail block…" and added a second item to the tail block that forces the question.
489
+ The corroborating detail is that the reference keeps two quantities, `tail_size` and
490
+ `tail_size_pad`, uses the **unpadded** one to locate the baseline and the **padded** one to validate
491
+ the remainder — a distinction that has no meaning at all under the wrong reading.
492
+
493
+ **Changes:** §3.1 states both quantities and where each is used; §5.2's first vector is chosen
494
+ specifically to discriminate them; and the general lesson is written into §6.11.
495
+
496
+ ### 6.2 `Uint8Array` out-of-bounds reads return `undefined`, and `undefined & 0xff` is `0`
497
+
498
+ The worst failure mode in the design. JavaScript does not fault on a typed-array read past the end —
499
+ it yields `undefined`, and every bitwise operator coerces that to `0`. A truncated or malformed
500
+ stream therefore decodes to *plausible-looking zeros* rather than an error, and the model loads
501
+ wrong instead of failing. The reference is bounds-checked at every group and every index read for
502
+ exactly this reason.
503
+
504
+ **Change:** explicit bounds checks are not optional, and are not `assert` (stripped in production —
505
+ this input is a file, not a caller). Real `throw` at the header, at each byte group against the
506
+ 24-byte decode limit, at each literal and control-header read, at each index varint, and at the
507
+ final data-lands-on-the-tail equality in all three modes. Reject-a-truncated-stream cases added to
508
+ §5.2.
509
+
510
+ ### 6.3 Mutating the bufferView descriptors races the image loader
511
+
512
+ The first draft rewrote `json.bufferViews[i]` in place. `loadFromJson` builds the image promises
513
+ *before* buffers resolve, and each one closes over its `bufferView` object and reads `.byteOffset` /
514
+ `.byteLength` inside a `.then()` that runs *after* the rewrite. Mutating in place changes what an
515
+ already-scheduled image read sees, from a different code path, with no visible link between the two.
516
+
517
+ **Change:** §2.2 returns a new array of new descriptors and leaves the originals untouched. The
518
+ image path keeps reading exactly what it reads today, whatever order the promises settle in. This is
519
+ the reason for a design choice that otherwise looks like needless allocation, and it is recorded
520
+ where the code lives.
521
+
522
+ ### 6.4 `Math.round` is not the spec's `round`
523
+
524
+ `Math.round(-2.5)` is `-2`. The filters round signed symmetric quantities and the reference rounds
525
+ half away from zero. Half a quantisation step on normals is invisible in a screenshot and visible in
526
+ a diff against any other decoder — exactly the kind of drift nobody attributes correctly six months
527
+ later.
528
+
529
+ **Change:** `round_half_away_from_zero` in `core/math`, used by every filter, with the asymmetry
530
+ named in its JSDoc.
531
+
532
+ ### 6.5 A green suite here does not mean a `gltfpack` file loads
533
+
534
+ Two things sit between this feature and a real compressed asset, and neither is in scope:
535
+
536
+ - **`KHR_mesh_quantization`.** `gltfpack`'s default output quantises as well as compresses, and meep
537
+ does not implement that extension. Worse, quantised attributes are padded — a `VEC3`/`SHORT`
538
+ position gets `byteStride` 8, not 6 — and `load_gltf.js` rejects any bufferView whose `byteStride`
539
+ differs from `componentSize × componentCount` with `'Interleaved attributes are not supported'`.
540
+ So a default `gltfpack` file will fail *after* decompressing correctly.
541
+ - **Interleaved attributes**, same rejection, for the same reason.
542
+
543
+ `gltfpack -noq -cc` produces meshopt-compressed, non-quantised, non-interleaved output, and that is
544
+ the configuration this feature makes work. Stated here rather than discovered later; picking up
545
+ `KHR_mesh_quantization` is separate work and is not silently folded into this one.
546
+
547
+ ### 6.6 Pure JS is roughly an order of magnitude off the reference
548
+
549
+ The reference reaches ~1 GB/s with WebAssembly SIMD. This will not, and the extension exists partly
550
+ *because* decode is meant to be nearly free. Decompression is synchronous inside `loadFromJson`, so
551
+ it lands on whichever thread is parsing — the main thread for a foreground load.
552
+
553
+ Accepted, not designed around: the alternative is a WASM dependency, which the brief excludes.
554
+ Mitigated by the shape the reference already uses — a module-static 8 KiB delta scratch (one
555
+ attribute block's worth: `byte_stride × max_block_elements <= 8192` by construction) and a 256-byte
556
+ group buffer, so the strided writes stay in cache and there is no per-block allocation. No
557
+ performance claim is made without a measurement, and none has been taken.
558
+
559
+ ### 6.7 The extension's `count` is not the accessor's `count`
560
+
561
+ `count` is the number of *stride-sized elements in the bufferView*; for index modes that is the
562
+ index count, not the triangle count. Reading it as either is a silent 3× error that only shows on
563
+ non-triangle-aligned data.
564
+
565
+ **Change:** each spec's own invariants become the validation list, checked before decode and thrown
566
+ on. Parent `byteLength === byteStride × count`; parent `byteStride`, when present, equals the
567
+ extension's; `ATTRIBUTES` → stride divisible by 4, `>= 4` (KHR) and `<= 256`; `TRIANGLES` → count
568
+ divisible by 3; `TRIANGLES`/`INDICES` → stride 2 or 4 and filter absent or `NONE`; `OCTAHEDRAL` →
569
+ stride 4 or 8; `QUATERNION` → stride 8; `EXPONENTIAL` → stride divisible by 4; `COLOR` → stride 4
570
+ or 8 **and** the KHR name. Plus the source range lying inside the source buffer, which both specs
571
+ leave implicit, and the KHR rule that a bufferView must not carry both extension names.
572
+
573
+ ### 6.8 The fallback buffer is allocated at its declared `byteLength`
574
+
575
+ Both specs require a placeholder large enough to hold every uncompressed view referencing it — a
576
+ megabyte-scale allocation for a real model, of a buffer that by construction nothing reads once the
577
+ views are rewritten.
578
+
579
+ **Change:** it resolves to a **zero-length** buffer. A well-formed file never touches it; a
580
+ malformed one — a view referencing the fallback without carrying the extension — fails loudly on an
581
+ out-of-range typed-array construction, which is the correct outcome and is preferable to quietly
582
+ handing out a megabyte of zeros that renders as a degenerate mesh.
583
+
584
+ ### 6.9 Version and name policy has three different answers, and uniformity would be a bug
585
+
586
+ The temptation is one rule for all three headers. They are not the same:
587
+
588
+ - Mode 0 version 1 is a *different bitstream*, so decoding `0xa1` as `0xa0` is a silent wrong
589
+ answer. It is supported, and it is rejected under the `EXT_` name, which does not define it.
590
+ - Mode 1 and mode 2 versions 0 and 1 differ only in `fec_max`, which is read from the header, so
591
+ both decode correctly and both are accepted under either name.
592
+ - Filter `COLOR` is accepted only under the `KHR_` name.
593
+
594
+ And two decode-time hazards are left alone on purpose, because the specs declare them unspecified
595
+ and JavaScript's typed arrays already contain the damage: a colour element whose fourth component is
596
+ zero (infinite scale, finite garbage bytes on store) and a quaternion whose retained components
597
+ exceed unit length (already clamped at the radicand). Neither can produce a `NaN` that escapes into
598
+ the scene, and neither gets a guard.
599
+
600
+ ### 6.10 Nothing checks `extensionsRequired`
601
+
602
+ The loader ignores `extensionsRequired` entirely, so a file requiring an extension meep does not
603
+ implement loads and renders wrong. Pre-existing and out of scope — noted so it is not mistaken for
604
+ something this change introduced or fixed.
605
+
606
+ ### 6.11 The residual risk this plan cannot retire
607
+
608
+ Three details are taken from questions put to the reference implementation rather than from
609
+ specification text, and one is taken from an inference:
610
+
611
+ - literal control mode 3 consumes the **group-aligned** element count per byte position, not the
612
+ block's unaligned count (inferred: all four control modes must agree on the scratch stride);
613
+ - channel mode 2 rotates **left** by `r` on decode;
614
+ - the version 1 tail-padding minimum is 24 bytes, not 32.
615
+
616
+ Each is a silent-garbage failure if wrong, and none is discriminated by any test in §5 — a fixture
617
+ encoder written from the same understanding agrees with the decoder. They are the specific reason
618
+ §5.5's ask matters: one real `gltfpack -cc -vv` file settles all three at once. Until there is one,
619
+ **version 1 support is implemented and tested but not evidenced**, and this paragraph is the honest
620
+ statement of that.
621
+
622
+ ## 7. Commit sequence
623
+
624
+ Each commit is independently green (`npm run test` from `H:/git/moh`).
625
+
626
+ 1. `feat(math): rounding that breaks its ties away from zero`
627
+ 2. `feat(binary): meshopt's attribute codec, against the bytes the spec itself decodes`
628
+ — mode 0 version 0, the group and channel decoders, the varint, the two enums, specs.
629
+ 3. `feat(binary): the attribute codec's second version, and the channels it decodes through`
630
+ — mode 0 version 1: control header, control modes, 1-bit groups, channel modes, specs.
631
+ 4. `feat(binary): meshopt's two index codecs, and the tail that checks them`
632
+ — modes 1 and 2, specs.
633
+ 5. `feat(binary): four meshopt filters, one of them meep's own octahedron`
634
+ — filters 1/2/3/4, specs.
635
+ 6. `feat(binary): one entry point per compressed buffer view`
636
+ — `meshopt_decode` dispatch, spec.
637
+ 7. `feat(gltf): a compressed buffer view becomes an ordinary one`
638
+ — the binding module and its validation, under both extension names, spec.
639
+ 8. `fix(gltf): a buffer with no URI is a placeholder, not a request`
640
+ — the tiny-gltf buffer loop, GLB buffers past the chunk.
641
+ 9. `feat(gltf): the loader decodes compressed views before an accessor reads one`
642
+ — the `loadFromJson` call, the compressed-image-view throw, the end-to-end fixture and spec.
643
+
644
+ ## 8. What execution changed
645
+
646
+ Written after the work landed. The plan above is corrected in place where it was factually wrong
647
+ about the format; everything else is recorded here rather than edited away, because a plan that
648
+ quietly matches its outcome is not evidence of anything.
649
+
650
+ ### 8.1 The plan was wrong about the `0xfe`/`0xff` ordering
651
+
652
+ §3.2 claimed that computing and explicitly reading each of the three indices in turn "diverges on
653
+ the first triangle that mixes them". It does not. An index in that branch is either fresh — and
654
+ takes a turn at `next` — or explicit, and takes a varint; never both. The two passes are disjoint
655
+ per index, so interleaving them is equivalent.
656
+
657
+ Found by mutation: rewriting the branch to interleave them left all fifty-four tests green, and the
658
+ question "which test should have caught this?" has the answer "none, because there is nothing to
659
+ catch". What *is* order-dependent is the sequence of the explicit reads, because `last` chains
660
+ through them; a test with a codeaux of `0xff`, where all three indices are explicit, now pins it.
661
+
662
+ §3.2 also conflated two things about the conditional FIFO push. The *write* at a non-advancing
663
+ offset is unobservable (no well-formed stream reads distance 16). The *non-advance* is very much
664
+ observable, at any distance a later code reaches. Two tests now do.
665
+
666
+ ### 8.2 A specification erratum, in both documents
667
+
668
+ Of the three worked examples both extensions print for the varint encoding,
669
+
670
+ ```
671
+ 0x7f => 0x7f
672
+ 0x81 0x04 => 0x201
673
+ 0xff 0xa0 0x05 => 0x1fd005
674
+ ```
675
+
676
+ the third is wrong. Those bytes are the LEB128 encoding of `0x1fd005` written back to front; read as
677
+ LEB128 they are `0x1507f`, and `0x1fd005` encodes as `0x85 0xa0 0x7f`. The example only works if the
678
+ groups are read most significant first, which contradicts the example above it, the encoding the
679
+ document names, and the reference implementation.
680
+
681
+ `meshopt_read_uint_var.spec.js` pins both readings of both byte strings so that nobody later "fixes"
682
+ the reader to match the printed line.
683
+
684
+ ### 8.3 Two things the plan claimed mattered, which cannot be observed
685
+
686
+ Both were found by mutating the implementation and watching the suite stay green, and both are now
687
+ written down where they live rather than left to look like tested behaviour.
688
+
689
+ - **§6.4, the rounding mode.** `round_half_away_from_zero` cannot be told from `Math.round` through
690
+ any of the four filters. A renormalised octahedral component is a ratio with an irrational
691
+ denominator and never lands halfway between two integers — checked exhaustively over the whole
692
+ 8-bit input space, 8388477 component values, no ties — and the quaternion filter's scale is
693
+ irrational for the same reason. The colour filter's scale is rational, but its inputs are
694
+ non-negative for any valid element, and a positive tie rounds the same way either way. The helper
695
+ is kept because it is what the specifications say; the claim that a test proves it is withdrawn,
696
+ and a standing sweep now asserts the no-ties property that makes it moot.
697
+ - **§3.4, the quaternion radicand's clamp.** The output goes through an `Int16Array`, and storing a
698
+ `NaN` there yields the same zero the clamp produces. Kept so the function is total on its own
699
+ rather than by a coincidence thirty lines downstream — which is exactly the kind of thing a
700
+ refactor removes — but nothing tests it, and the spec now says so.
701
+
702
+ ### 8.4 Structure
703
+
704
+ - Planned commits 2 and 3 (attribute codec versions 0 and 1) landed as one. The block loop, the
705
+ group decoder and the channel reconstruction are shared; splitting them would have meant writing
706
+ the module twice.
707
+ - The test-only encoder §5.3 put inline in a spec file became `__meshopt_test_streams.js`, because
708
+ the end-to-end glTF fixtures need the same streams. `**/__**.js` is already how meep's coverage
709
+ configuration spells "scaffolding".
710
+ - Three test vectors in the first draft were wrong and the implementation was right: a quaternion
711
+ component stored at full scale is `1/sqrt(2)` and not 1; a quaternion whose four components are
712
+ equal has its dropped component absorb all three of the others' rounding, so it is up to three and
713
+ a half quantisation steps out rather than half a step; and a colour alpha of `0x80` is the marker
714
+ bit over an empty field, which is zero and not one. The bounds are now derived in the test from
715
+ the quantisation step rather than picked.
716
+
717
+ ### 8.5 The record
718
+
719
+ Thirty-two mutations were applied to the finished implementation to check the suite says so. Thirty
720
+ failed at least one test. The two that did not are §8.3, and are documented rather than papered over.
721
+
722
+ `npm run test` from `H:/git/moh` covers all of it; the meshopt package and its glTF binding are 96
723
+ tests across 12 files, plus 7 end-to-end through the real asset framework.
724
+
725
+ ### 8.6 What is still owed
726
+
727
+ §5.5 and §6.11 stand unchanged, and are the honest limit of this work:
728
+
729
+ **No test here decodes a stream `gltfpack` produced.** Every byte under test was authored from a
730
+ specification by me, or by a fixture encoder I also wrote. Three details — literal control mode 3's
731
+ element count, channel mode 2's rotation direction, and version 1's 24-byte tail minimum — come from
732
+ questions put to the reference rather than from specification text, and no test discriminates any of
733
+ them.
734
+
735
+ One `gltfpack -noq -cc` output and one `-cc -vv` output, checked in with a golden test that
736
+ validates every `POSITION` accessor against its own declared `min`/`max` and every index against the
737
+ vertex count, would settle all three at once. Those bounds are written by the encoder and are not
738
+ derivable from the compressed bytes.
739
+
740
+ Until then: version 0 is corroborated by the specification's own worked example, and **version 1 is
741
+ implemented and tested but not evidenced.**
742
+
743
+ ## 9. The seam this was first built on the wrong side of
744
+
745
+ The first version put the whole glTF half in one module, `gltf_meshopt_compression.js`, exporting
746
+ `gltf_meshopt_decode_buffer_views(buffer_views, buffers)`. The parser imported that by name and
747
+ called it on every model it loaded.
748
+
749
+ It worked, and every test above passed against it. It was still the wrong shape, for reasons worth
750
+ writing down because none of them is a bug:
751
+
752
+ - **The name described the caller's hope, not the function.** A thing called
753
+ `gltf_meshopt_decode_buffer_views` does not decode bufferViews. It walks all of them, works out
754
+ which are anybody's, decodes those, and rewrites the array. Three jobs under one codec's name.
755
+ - **Detection was welded to decoding.** The parser assumed meshopt by importing it, and the check
756
+ that it was meshopt happened *inside*, four frames down. Reading the call site told you nothing
757
+ about whether a plain glTF paid anything — which is exactly the question it should answer.
758
+ - **The second extension proved the point and the third would have made it.** `KHR_` was bolted on
759
+ as `if (name === MESHOPT_COMPRESSION_EXT && ...)` inside the decoder. A Draco or a future codec
760
+ would have been another module the parser imported by name, and another branch.
761
+
762
+ What replaced it is in §2.2. The parser asks a set what claims a view; the set answers with an
763
+ extension or with nothing; the walk is identical for all of them. `tiny-gltf.js` no longer contains
764
+ the string "meshopt" anywhere, comments included.
765
+
766
+ Two smaller things went the same way:
767
+
768
+ - `meshopt_decode`'s mode and filter dispatch were a seven-branch `if / else if` chain. The three
769
+ modes already share a signature and the filters already share theirs, so both are now arrays
770
+ indexed by the enum, and "none" is a function that does nothing rather than a branch that asks
771
+ whether to.
772
+ - The extension validator was fourteen `if (...) throw` in a row, several of them comparing mode and
773
+ filter names. The specifications state those constraints as a table, so it is a table: what each
774
+ mode and each filter admits of a stride and a count, with the rule's own wording carried alongside
775
+ for the message. Eight guards, none of them naming a mode.
776
+
777
+ Eight mutations were applied to the new seams to check the suite says so — the walker decoding
778
+ unclaimed views, the walker dropping its length backstop, the set taking the first claimant, the set
779
+ forgetting placeholder buffers, meshopt admitting any filter it can name, one version ceiling for
780
+ every mode, and each dispatch table shuffled. All eight fail at least one test.
781
+
782
+ ## Addendum, 2026-08-20: a document's resolved buffers are `Uint8Array`
783
+
784
+ Written into the plan as `ArrayBuffer`, and changed when the virtual-geometry builder started
785
+ reading containers through the same layer. A buffer is a *range* of bytes: a `.glb`'s binary chunk
786
+ is a range of the file it arrived in, and a buffer read off a filesystem starts wherever the runtime
787
+ put it. Carrying the offset with the bytes is what lets the chunk be handed on without copying a
788
+ model-sized allocation, and `Uint8Array.subarray` is what a decoder's source range wants anyway —
789
+ `MeshoptBufferViewExtension` reads one with `subarray` rather than a three-argument constructor that
790
+ can only be laid over an aligned offset.
791
+
792
+ `decode()` answers with a `Uint8Array` for the same reason, and the length check over it is
793
+ unchanged.