@woosh/meep-engine 3.14.1 → 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.
- package/README.md +31 -24
- package/editor/prototypeEditorShell.js +6 -0
- package/package.json +1 -1
- package/src/CODEC_LAYOUT_VERIFICATION.md +420 -0
- package/src/core/binary/ByteCursor.d.ts +138 -0
- package/src/core/binary/ByteCursor.d.ts.map +1 -0
- package/src/core/binary/ByteCursor.js +325 -0
- package/src/core/binary/zstd/ZstdReverseBitReader.d.ts +76 -0
- package/src/core/binary/zstd/ZstdReverseBitReader.d.ts.map +1 -0
- package/src/core/binary/zstd/ZstdReverseBitReader.js +223 -0
- package/src/core/binary/zstd/zstd_decompress.d.ts +31 -0
- package/src/core/binary/zstd/zstd_decompress.d.ts.map +1 -0
- package/src/core/binary/zstd/zstd_decompress.js +628 -0
- package/src/core/binary/zstd/zstd_fse.d.ts +83 -0
- package/src/core/binary/zstd/zstd_fse.d.ts.map +1 -0
- package/src/core/binary/zstd/zstd_fse.js +265 -0
- package/src/core/binary/zstd/zstd_huffman.d.ts +56 -0
- package/src/core/binary/zstd/zstd_huffman.d.ts.map +1 -0
- package/src/core/binary/zstd/zstd_huffman.js +244 -0
- package/src/core/binary/zstd/zstd_sequence_tables.d.ts +62 -0
- package/src/core/binary/zstd/zstd_sequence_tables.d.ts.map +1 -0
- package/src/core/binary/zstd/zstd_sequence_tables.js +98 -0
- package/src/core/color/COLOR_REVIEW_2026_08_28.md +1 -1
- package/src/core/color/PQ/PQ_constants.d.ts +1 -1
- package/src/core/color/PQ/PQ_constants.js +1 -1
- package/src/engine/EngineHarness.js +1 -1
- package/src/engine/asset/GameAssetType.d.ts +1 -0
- package/src/engine/asset/GameAssetType.js +8 -0
- package/src/engine/asset/codec/Codec.d.ts.map +1 -0
- package/src/engine/asset/codec/CodecWithFallback.d.ts.map +1 -0
- package/src/engine/asset/codec/CodecWithFallback.js +105 -0
- package/src/engine/asset/codec/DecodedImage.d.ts +39 -0
- package/src/engine/asset/codec/DecodedImage.d.ts.map +1 -0
- package/src/engine/asset/codec/DecodedImage.js +26 -0
- package/src/engine/asset/guessAssetType.d.ts.map +1 -1
- package/src/engine/asset/guessAssetType.js +10 -0
- package/src/engine/asset/load_model_scene_bundle.d.ts +1 -1
- package/src/engine/asset/load_model_scene_bundle.d.ts.map +1 -1
- package/src/engine/asset/load_model_scene_bundle.js +6 -2
- package/src/engine/asset/loaders/USDSceneBundleAssetLoader.d.ts +37 -0
- package/src/engine/asset/loaders/USDSceneBundleAssetLoader.d.ts.map +1 -0
- package/src/engine/asset/loaders/USDSceneBundleAssetLoader.js +104 -0
- package/src/engine/asset/loaders/image/IMAGE_CODEC_REVIEW_2026_08_28.md +87 -75
- package/src/engine/asset/loaders/image/ImageDecoderWorker.js +2 -2
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts +9 -10
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +13 -4
- package/src/engine/asset/loaders/image/avif/encode_image_source.d.ts +70 -0
- package/src/engine/asset/loaders/image/avif/encode_image_source.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/avif/encode_image_source.js +117 -0
- package/src/engine/asset/loaders/image/avif/encoder_worker.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/avif/threaded_image_encoder.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/codec/AvifCodec.d.ts +34 -0
- package/src/engine/asset/loaders/image/codec/AvifCodec.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/codec/AvifCodec.js +85 -0
- package/src/engine/asset/loaders/image/codec/JpegCodec.d.ts +26 -0
- package/src/engine/asset/loaders/image/codec/JpegCodec.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/codec/JpegCodec.js +66 -0
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts +5 -17
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +3 -3
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts +22 -2
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js +22 -2
- package/src/engine/asset/loaders/image/prototypePNG.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/prototypePNG.js +37 -0
- package/src/engine/asset/preloader/extractAssetListFromManager.d.ts.map +1 -1
- package/src/engine/asset/preloader/extractAssetListFromManager.js +2 -1
- package/src/engine/graphics/ecs/mesh/assetTypeByPath.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh/assetTypeByPath.js +6 -0
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -0
- package/src/engine/graphics/texture/sampler/avif_to_sampler2d.d.ts +25 -0
- package/src/engine/graphics/texture/sampler/avif_to_sampler2d.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/avif_to_sampler2d.js +42 -0
- package/src/engine/graphics/texture/sampler/compare/sampler2d_compare.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/compare/sampler2d_compare.js +94 -0
- package/src/engine/graphics/texture/sampler/compare/sampler2d_max_absolute_difference.d.ts +19 -0
- package/src/engine/graphics/texture/sampler/compare/sampler2d_max_absolute_difference.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/compare/sampler2d_max_absolute_difference.js +62 -0
- package/src/engine/graphics/texture/sampler/compare/sampler2d_psnr.d.ts +30 -0
- package/src/engine/graphics/texture/sampler/compare/sampler2d_psnr.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/compare/sampler2d_psnr.js +115 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_avif.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_avif.js +108 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_f16.d.ts +7 -1
- package/src/engine/graphics/texture/sampler/sampler2d_to_f16.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_to_f16.js +28 -21
- package/src/engine/graphics/texture/sampler/sampler2d_to_uint8_RGBA.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_to_uint8_RGBA.js +3 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -1
- package/src/engine/physics/broadphase/generate_pairs.js +7 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/format/image/avif/DECISIONS.md +545 -0
- package/src/format/image/avif/api/AvifDecoder.d.ts.map +1 -0
- package/src/format/image/avif/api/apply_transformations.d.ts.map +1 -0
- package/src/format/image/avif/api/convert_to_rgba.d.ts.map +1 -0
- package/src/format/image/avif/api/convert_to_rgba.js +204 -0
- package/src/format/image/avif/api/decode_avif.d.ts.map +1 -0
- package/src/format/image/avif/api/decode_image_item.d.ts.map +1 -0
- package/src/format/image/avif/api/encode_avif.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/Av1FrameContext.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/block_decoded.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/decode_av1_still.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/decode_coefficients.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/decode_palette.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/decode_palette.js +442 -0
- package/src/format/image/avif/av1/decode/decode_tile.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/decode_tile.js +1213 -0
- package/src/format/image/avif/av1/decode/get_scan.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/read_lr.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/read_lr.js +277 -0
- package/src/format/image/avif/av1/decode/read_transform_type.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/read_transform_type.js +92 -0
- package/src/format/image/avif/av1/decode/reconstruct.d.ts.map +1 -0
- package/src/format/image/avif/av1/decode/reconstruct.js +241 -0
- package/src/format/image/avif/av1/decode/transform_type.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/Av1BlockSnapshot.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/Av1EncodeContext.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/build_headers.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/choose_chroma_alpha.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/choose_filters.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/choose_restoration.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/choose_restoration.js +616 -0
- package/src/format/image/avif/av1/encode/decode_effort.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/encode_av1_still.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/encode_effort.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/encode_tile.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/encode_tile.js +2331 -0
- package/src/format/image/avif/av1/encode/quantise.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/write_coefficients.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/write_lr.d.ts.map +1 -0
- package/src/format/image/avif/av1/encode/write_transform_type.d.ts.map +1 -0
- package/src/format/image/avif/av1/entropy/CdfContext.d.ts.map +1 -0
- package/src/format/image/avif/av1/entropy/SymbolReader.d.ts.map +1 -0
- package/src/format/image/avif/av1/entropy/SymbolWriter.d.ts.map +1 -0
- package/src/format/image/avif/av1/entropy/coefficient_context.d.ts.map +1 -0
- package/src/format/image/avif/av1/entropy/partition_cdf.d.ts.map +1 -0
- package/src/format/image/avif/av1/entropy/symbol_cost.d.ts.map +1 -0
- package/src/format/image/avif/av1/filter/cdef.d.ts.map +1 -0
- package/src/format/image/avif/av1/filter/cdef.js +313 -0
- package/src/format/image/avif/av1/filter/loop_filter.d.ts.map +1 -0
- package/src/format/image/avif/av1/filter/loop_filter.js +377 -0
- package/src/format/image/avif/av1/filter/loop_restoration.d.ts.map +1 -0
- package/src/format/image/avif/av1/filter/loop_restoration.js +451 -0
- package/src/format/image/avif/av1/filter/superres.d.ts.map +1 -0
- package/src/format/image/avif/av1/filter/superres.js +86 -0
- package/src/format/image/avif/av1/grain/FilmGrainState.d.ts.map +1 -0
- package/src/format/image/avif/av1/grain/film_grain.d.ts.map +1 -0
- package/src/format/image/avif/av1/grain/film_grain.js +623 -0
- package/src/format/image/avif/av1/obu/FrameHeader.d.ts.map +1 -0
- package/src/format/image/avif/av1/obu/ObuHeader.d.ts.map +1 -0
- package/src/format/image/avif/av1/obu/SequenceHeader.d.ts.map +1 -0
- package/src/format/image/avif/av1/obu/for_each_obu.d.ts.map +1 -0
- package/src/format/image/avif/av1/obu/parse_frame_header.d.ts.map +1 -0
- package/src/format/image/avif/av1/obu/parse_frame_header.js +841 -0
- package/src/format/image/avif/av1/obu/parse_obu_header.d.ts.map +1 -0
- package/src/format/image/avif/av1/obu/parse_sequence_header.d.ts.map +1 -0
- package/src/format/image/avif/av1/obu/write_frame_header.d.ts.map +1 -0
- package/src/format/image/avif/av1/obu/write_sequence_header.d.ts.map +1 -0
- package/src/format/image/avif/av1/predict/IntraPredictionState.d.ts.map +1 -0
- package/src/format/image/avif/av1/predict/intra_filter_type.d.ts.map +1 -0
- package/src/format/image/avif/av1/predict/predict_chroma_from_luma.d.ts.map +1 -0
- package/src/format/image/avif/av1/predict/predict_chroma_from_luma.js +153 -0
- package/src/format/image/avif/av1/predict/predict_intra.d.ts.map +1 -0
- package/src/format/image/avif/av1/predict/predict_intra.js +803 -0
- package/src/format/image/avif/av1/predict/predict_palette.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/av1_symbols.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/av1_symbols.js +419 -0
- package/src/format/image/avif/av1/tables/block_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/block_tables.js +270 -0
- package/src/format/image/avif/av1/tables/cdf_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/cdf_tables.js +1893 -0
- package/src/format/image/avif/av1/tables/coefficient_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/coefficient_tables.js +82 -0
- package/src/format/image/avif/av1/tables/derived_block_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/filter_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/filter_tables.js +313 -0
- package/src/format/image/avif/av1/tables/grain_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/grain_tables.js +190 -0
- package/src/format/image/avif/av1/tables/prediction_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/prediction_tables.js +223 -0
- package/src/format/image/avif/av1/tables/quantizer_matrix_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/quantizer_matrix_tables.js +38 -0
- package/src/format/image/avif/av1/tables/quantizer_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/quantizer_tables.js +160 -0
- package/src/format/image/avif/av1/tables/scan_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/scan_tables.js +727 -0
- package/src/format/image/avif/av1/tables/segmentation_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/segmentation_tables.js +48 -0
- package/src/format/image/avif/av1/tables/transform_tables.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/transform_tables.js +140 -0
- package/src/format/image/avif/av1/tables/unpack_table.d.ts.map +1 -0
- package/src/format/image/avif/av1/tables/unpack_table.js +73 -0
- package/src/format/image/avif/av1/transform/forward_transform_2d.d.ts.map +1 -0
- package/src/format/image/avif/av1/transform/inverse_transform_1d.d.ts.map +1 -0
- package/src/format/image/avif/av1/transform/inverse_transform_1d.js +590 -0
- package/src/format/image/avif/av1/transform/inverse_transform_2d.d.ts.map +1 -0
- package/src/format/image/avif/av1/transform/inverse_transform_2d.js +180 -0
- package/src/format/image/avif/av1/util/ceil_log2.d.ts.map +1 -0
- package/src/format/image/avif/av1/util/floor_log2.d.ts +20 -0
- package/src/format/image/avif/av1/util/floor_log2.d.ts.map +1 -0
- package/src/format/image/avif/av1/util/floor_log2.js +20 -0
- package/src/format/image/avif/av1/util/round2.d.ts.map +1 -0
- package/src/format/image/avif/av1/util/round2_signed.d.ts.map +1 -0
- package/src/format/image/avif/av1/util/tile_log2.d.ts.map +1 -0
- package/src/format/image/avif/bitstream/BitReader.d.ts.map +1 -0
- package/src/format/image/avif/bitstream/BitWriter.d.ts.map +1 -0
- package/src/format/image/avif/color/ColourTransform.d.ts.map +1 -0
- package/src/format/image/avif/color/YuvImage.d.ts.map +1 -0
- package/src/format/image/avif/color/clamp_sample.d.ts.map +1 -0
- package/src/format/image/avif/color/linear_to_transfer.d.ts.map +1 -0
- package/src/format/image/avif/color/linear_to_transfer.js +126 -0
- package/src/format/image/avif/color/primaries.d.ts.map +1 -0
- package/src/format/image/avif/color/rgb_row_to_ycbcr.d.ts.map +1 -0
- package/src/format/image/avif/color/transfer_to_linear.d.ts.map +1 -0
- package/src/format/image/avif/color/transfer_to_linear.js +171 -0
- package/src/format/image/avif/color/upsample_chroma_row.d.ts.map +1 -0
- package/src/format/image/avif/color/upsample_chroma_row.js +89 -0
- package/src/format/image/avif/color/ycbcr_row_to_rgb.d.ts.map +1 -0
- package/src/format/image/avif/color/ycbcr_row_to_rgb.js +78 -0
- package/src/format/image/avif/heif/AvifFile.d.ts.map +1 -0
- package/src/format/image/avif/heif/ItemProperty.d.ts.map +1 -0
- package/src/format/image/avif/heif/find_item_property.d.ts.map +1 -0
- package/src/format/image/avif/heif/find_item_references.d.ts.map +1 -0
- package/src/format/image/avif/heif/find_items_referencing.d.ts.map +1 -0
- package/src/format/image/avif/heif/parse_avif_file.d.ts.map +1 -0
- package/src/format/image/avif/heif/parse_avif_file.js +384 -0
- package/src/format/image/avif/heif/parse_image_grid.d.ts.map +1 -0
- package/src/format/image/avif/heif/parse_image_grid.js +49 -0
- package/src/format/image/avif/heif/parse_item_property.d.ts.map +1 -0
- package/src/format/image/avif/heif/read_item_data.d.ts.map +1 -0
- package/src/format/image/avif/heif/write_avif_file.d.ts.map +1 -0
- package/src/format/image/avif/heif/write_item_property.d.ts.map +1 -0
- package/src/format/image/avif/index.d.ts +12 -0
- package/src/format/image/avif/index.d.ts.map +1 -0
- package/src/format/image/avif/index.js +58 -0
- package/src/format/image/avif/isobmff/BoxHeader.d.ts.map +1 -0
- package/src/format/image/avif/isobmff/BoxWriter.d.ts +118 -0
- package/src/format/image/avif/isobmff/BoxWriter.d.ts.map +1 -0
- package/src/format/image/avif/isobmff/BoxWriter.js +264 -0
- package/src/format/image/avif/isobmff/for_each_box.d.ts.map +1 -0
- package/src/format/image/avif/isobmff/read_box_header.d.ts.map +1 -0
- package/src/format/image/avif/isobmff/read_full_box_header.d.ts.map +1 -0
- package/src/format/image/jpeg/JpegFrame.d.ts.map +1 -0
- package/src/format/image/jpeg/JpegFrameComponent.d.ts.map +1 -0
- package/src/format/image/jpeg/JpegImage.d.ts.map +1 -0
- package/src/format/image/jpeg/JpegImage.js +664 -0
- package/src/format/image/jpeg/buildComponentData.d.ts.map +1 -0
- package/src/format/image/jpeg/buildHuffmanTable.d.ts.map +1 -0
- package/src/format/image/jpeg/decodeScan.d.ts.map +1 -0
- package/src/format/image/jpeg/idct8x8_float.d.ts.map +1 -0
- package/src/format/image/jpeg/idct8x8_float.js +31 -0
- package/src/format/image/jpeg/jpeg_component_row.d.ts.map +1 -0
- package/src/format/image/jpeg/jpeg_decode.d.ts.map +1 -0
- package/src/format/image/png/PNG.d.ts.map +1 -0
- package/src/format/image/png/PNGReader.d.ts +158 -0
- package/src/format/image/png/PNGReader.d.ts.map +1 -0
- package/src/format/image/png/PNGReader.js +656 -0
- package/src/format/image/png/PNG_HEADER_BYTES.d.ts.map +1 -0
- package/src/format/image/png/chunk/png_chunk_decode_iTXt.d.ts.map +1 -0
- package/src/format/image/png/chunk/png_chunk_decode_iTXt.js +53 -0
- package/src/format/image/png/chunk/png_chunk_decode_zTXt.d.ts.map +1 -0
- package/src/format/image/png/chunk/png_chunk_decode_zTXt.js +42 -0
- package/src/format/image/png/crc32.d.ts +2 -0
- package/src/format/image/png/crc32.d.ts.map +1 -0
- package/src/format/image/png/crc32.js +8 -0
- package/src/format/image/png/filter/png_filter_unFilterAverage.d.ts.map +1 -0
- package/src/format/image/png/filter/png_filter_unFilterNone.d.ts.map +1 -0
- package/src/format/image/png/filter/png_filter_unFilterPaeth.d.ts.map +1 -0
- package/src/format/image/png/filter/png_filter_unFilterSub.d.ts.map +1 -0
- package/src/format/image/png/filter/png_filter_unFilterUp.d.ts.map +1 -0
- package/src/format/image/png/filter/png_unfilter.d.ts.map +1 -0
- package/src/format/image/png/filter/png_unfilter.js +68 -0
- package/src/format/image/png/png_inflate.d.ts.map +1 -0
- package/src/format/image/png/png_unpack_samples.d.ts.map +1 -0
- package/src/format/scene/gltf/GLTF_PRIMITIVE_MODE.d.ts.map +1 -0
- package/src/format/scene/gltf/MESHOPT_COMPRESSION_PLAN.md +793 -0
- package/src/format/scene/gltf/coalesce_array_duplicates.d.ts.map +1 -0
- package/src/format/scene/gltf/ext/GltfBufferViewExtension.d.ts.map +1 -0
- package/src/format/scene/gltf/ext/GltfBufferViewExtensionSet.d.ts.map +1 -0
- package/src/format/scene/gltf/ext/GltfBufferViewExtensionSet.js +109 -0
- package/src/format/scene/gltf/ext/gltf_apply_buffer_view_extensions.d.ts.map +1 -0
- package/src/format/scene/gltf/ext/gltf_buffer_view_extensions.d.ts.map +1 -0
- package/src/format/scene/gltf/ext/gltf_geometry_extensions.d.ts.map +1 -0
- package/src/format/scene/gltf/ext/meshopt/MeshoptBufferViewExtension.d.ts.map +1 -0
- package/src/format/scene/gltf/ext/meshopt/MeshoptBufferViewExtension.js +301 -0
- package/src/format/scene/gltf/gltf_component_type.d.ts.map +1 -0
- package/src/format/scene/gltf/gltf_node_world_matrices.d.ts.map +1 -0
- package/src/format/scene/gltf/gltf_node_world_matrices.js +137 -0
- package/src/format/scene/gltf/gltf_parse_container.d.ts.map +1 -0
- package/src/format/scene/gltf/gltf_read_accessor.d.ts.map +1 -0
- package/src/format/scene/gltf/gltf_read_accessor.js +294 -0
- package/src/format/scene/gltf/gltf_used_image_indices.d.ts +51 -0
- package/src/format/scene/gltf/gltf_used_image_indices.d.ts.map +1 -0
- package/src/format/scene/gltf/gltf_used_image_indices.js +122 -0
- package/src/format/scene/usd/UsdError.d.ts.map +1 -0
- package/src/format/scene/usd/parse_usda.d.ts.map +1 -0
- package/src/format/scene/usd/unpack_usdz.d.ts.map +1 -0
- package/src/format/scene/usd/unpack_usdz.js +106 -0
- package/src/format/scene/usd/usd_compose_transform.d.ts.map +1 -0
- package/src/format/scene/usd/usd_compose_transform.js +258 -0
- package/src/format/scene/usd/usd_lz4.d.ts.map +1 -0
- package/src/format/scene/usd/usd_lz4.js +182 -0
- package/src/format/scene/usd/usd_triangulate.d.ts.map +1 -0
- package/src/format/texture/TexelPayload.d.ts +55 -0
- package/src/format/texture/TexelPayload.d.ts.map +1 -0
- package/src/format/texture/TexelPayload.js +39 -0
- package/src/format/texture/basis/BasisBitReader.d.ts +77 -0
- package/src/format/texture/basis/BasisBitReader.d.ts.map +1 -0
- package/src/format/texture/basis/BasisBitReader.js +231 -0
- package/src/format/texture/basis/BasisHuffmanTable.d.ts +53 -0
- package/src/format/texture/basis/BasisHuffmanTable.d.ts.map +1 -0
- package/src/format/texture/basis/BasisHuffmanTable.js +263 -0
- package/src/format/texture/basis/astc_block.d.ts +92 -0
- package/src/format/texture/basis/astc_block.d.ts.map +1 -0
- package/src/format/texture/basis/astc_block.js +164 -0
- package/src/format/texture/basis/astc_integer_sequence.d.ts +59 -0
- package/src/format/texture/basis/astc_integer_sequence.d.ts.map +1 -0
- package/src/format/texture/basis/astc_integer_sequence.js +251 -0
- package/src/format/texture/basis/astc_partition.d.ts +56 -0
- package/src/format/texture/basis/astc_partition.d.ts.map +1 -0
- package/src/format/texture/basis/astc_partition.js +199 -0
- package/src/format/texture/basis/basis_read_huffman_table.d.ts +20 -0
- package/src/format/texture/basis/basis_read_huffman_table.d.ts.map +1 -0
- package/src/format/texture/basis/basis_read_huffman_table.js +187 -0
- package/src/format/texture/basis/etc1s/Etc1sSelectorHistory.d.ts +50 -0
- package/src/format/texture/basis/etc1s/Etc1sSelectorHistory.d.ts.map +1 -0
- package/src/format/texture/basis/etc1s/Etc1sSelectorHistory.js +89 -0
- package/src/format/texture/basis/etc1s/etc1s_block_colors.d.ts +14 -0
- package/src/format/texture/basis/etc1s/etc1s_block_colors.d.ts.map +1 -0
- package/src/format/texture/basis/etc1s/etc1s_block_colors.js +75 -0
- package/src/format/texture/basis/etc1s/etc1s_decode_slice.d.ts +57 -0
- package/src/format/texture/basis/etc1s/etc1s_decode_slice.d.ts.map +1 -0
- package/src/format/texture/basis/etc1s/etc1s_decode_slice.js +290 -0
- package/src/format/texture/basis/etc1s/etc1s_read_endpoint_codebook.d.ts +48 -0
- package/src/format/texture/basis/etc1s/etc1s_read_endpoint_codebook.d.ts.map +1 -0
- package/src/format/texture/basis/etc1s/etc1s_read_endpoint_codebook.js +111 -0
- package/src/format/texture/basis/etc1s/etc1s_read_selector_codebook.d.ts +42 -0
- package/src/format/texture/basis/etc1s/etc1s_read_selector_codebook.d.ts.map +1 -0
- package/src/format/texture/basis/etc1s/etc1s_read_selector_codebook.js +127 -0
- package/src/format/texture/basis/etc1s/etc1s_read_slice_tables.d.ts +54 -0
- package/src/format/texture/basis/etc1s/etc1s_read_slice_tables.d.ts.map +1 -0
- package/src/format/texture/basis/etc1s/etc1s_read_slice_tables.js +47 -0
- package/src/format/texture/basis/transcode/build_range_plan.d.ts +46 -0
- package/src/format/texture/basis/transcode/build_range_plan.d.ts.map +1 -0
- package/src/format/texture/basis/transcode/build_range_plan.js +54 -0
- package/src/format/texture/basis/transcode/etc1s_to_astc.d.ts +30 -0
- package/src/format/texture/basis/transcode/etc1s_to_astc.d.ts.map +1 -0
- package/src/format/texture/basis/transcode/etc1s_to_astc.js +328 -0
- package/src/format/texture/basis/transcode/etc1s_to_bc1.d.ts +34 -0
- package/src/format/texture/basis/transcode/etc1s_to_bc1.d.ts.map +1 -0
- package/src/format/texture/basis/transcode/etc1s_to_bc1.js +486 -0
- package/src/format/texture/basis/transcode/etc1s_to_bc7.d.ts +27 -0
- package/src/format/texture/basis/transcode/etc1s_to_bc7.d.ts.map +1 -0
- package/src/format/texture/basis/transcode/etc1s_to_bc7.js +496 -0
- package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts +31 -0
- package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -0
- package/src/format/texture/basis/transcode/etc1s_to_etc2.js +332 -0
- package/src/format/texture/basis/transcode/etc1s_to_rgba8.d.ts +39 -0
- package/src/format/texture/basis/transcode/etc1s_to_rgba8.d.ts.map +1 -0
- package/src/format/texture/basis/transcode/etc1s_to_rgba8.js +115 -0
- package/src/format/texture/basis/transcode/fit_endpoints.d.ts +79 -0
- package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -0
- package/src/format/texture/basis/transcode/fit_endpoints.js +297 -0
- package/src/format/texture/basis/transcode_basis.d.ts +109 -0
- package/src/format/texture/basis/transcode_basis.d.ts.map +1 -0
- package/src/format/texture/basis/transcode_basis.js +250 -0
- package/src/format/texture/basis/transcode_uastc.d.ts +55 -0
- package/src/format/texture/basis/transcode_uastc.d.ts.map +1 -0
- package/src/format/texture/basis/transcode_uastc.js +117 -0
- package/src/format/texture/basis/uastc/bc7_tables.d.ts +111 -0
- package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/bc7_tables.js +276 -0
- package/src/format/texture/basis/uastc/bc7_write_block.d.ts +124 -0
- package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/bc7_write_block.js +227 -0
- package/src/format/texture/basis/uastc/uastc_decode_block.d.ts +105 -0
- package/src/format/texture/basis/uastc/uastc_decode_block.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_decode_block.js +480 -0
- package/src/format/texture/basis/uastc/uastc_tables.d.ts +240 -0
- package/src/format/texture/basis/uastc/uastc_tables.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_tables.js +383 -0
- package/src/format/texture/basis/uastc/uastc_to_astc.d.ts +30 -0
- package/src/format/texture/basis/uastc/uastc_to_astc.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -0
- package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +26 -0
- package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_to_bc5.js +115 -0
- package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts +36 -0
- package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_to_bc7.js +602 -0
- package/src/format/texture/basis/uastc/uastc_to_rgba8.d.ts +37 -0
- package/src/format/texture/basis/uastc/uastc_to_rgba8.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_to_rgba8.js +87 -0
- package/src/format/texture/bc/bc1_write_block.d.ts +28 -0
- package/src/format/texture/bc/bc1_write_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc1_write_block.js +41 -0
- package/src/format/texture/bc/bc4_write_block.d.ts +32 -0
- package/src/format/texture/bc/bc4_write_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_write_block.js +50 -0
- package/src/format/texture/bc/bc6h_write_block_mode11.d.ts +30 -0
- package/src/format/texture/bc/bc6h_write_block_mode11.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_write_block_mode11.js +62 -0
- package/src/format/texture/ktx2/KTX2_IDENTIFIER.d.ts +14 -0
- package/src/format/texture/ktx2/KTX2_IDENTIFIER.d.ts.map +1 -0
- package/src/format/texture/ktx2/KTX2_IDENTIFIER.js +15 -0
- package/src/format/texture/ktx2/KhrDfModel.d.ts +35 -0
- package/src/format/texture/ktx2/KhrDfModel.d.ts.map +1 -0
- package/src/format/texture/ktx2/KhrDfModel.js +49 -0
- package/src/format/texture/ktx2/SupercompressionScheme.d.ts +16 -0
- package/src/format/texture/ktx2/SupercompressionScheme.d.ts.map +1 -0
- package/src/format/texture/ktx2/SupercompressionScheme.js +23 -0
- package/src/format/texture/ktx2/ktx2_read.d.ts +105 -0
- package/src/format/texture/ktx2/ktx2_read.d.ts.map +1 -0
- package/src/format/texture/ktx2/ktx2_read.js +909 -0
- package/src/format/texture/ktx2/ktx2_read_basis_lz_global_data.d.ts +27 -0
- package/src/format/texture/ktx2/ktx2_read_basis_lz_global_data.d.ts.map +1 -0
- package/src/format/texture/ktx2/ktx2_read_basis_lz_global_data.js +189 -0
- package/src/format/texture/ktx2/vk_format_to_texture_format.d.ts +55 -0
- package/src/format/texture/ktx2/vk_format_to_texture_format.d.ts.map +1 -0
- package/src/format/texture/ktx2/vk_format_to_texture_format.js +290 -0
- package/src/shade/descriptor/GPUTextureUsage.d.ts +23 -0
- package/src/shade/descriptor/GPUTextureUsage.d.ts.map +1 -0
- package/src/shade/descriptor/GPUTextureUsage.js +24 -0
- package/src/shade/descriptor/WebGPUExtensionType.d.ts +3 -0
- package/src/shade/descriptor/WebGPUExtensionType.js +26 -0
- package/src/shade/descriptor/texture/TextureDescriptor.d.ts +2 -6
- package/src/shade/descriptor/texture/TextureDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/texture/TextureDescriptor.js +24 -40
- package/src/shade/descriptor/texture/format/TextureFormat.d.ts +125 -0
- package/src/shade/descriptor/texture/format/TextureFormat.d.ts.map +1 -0
- package/src/shade/descriptor/texture/format/TextureFormat.js +146 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_feature.d.ts +16 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_feature.d.ts.map +1 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_feature.js +44 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_info.d.ts +76 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_info.d.ts.map +1 -1
- package/src/shade/descriptor/texture/format/gpu_texture_format_info.js +126 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_srgb.d.ts +19 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_srgb.d.ts.map +1 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_srgb.js +50 -0
- package/src/shade/device/COPY_BYTES_PER_ROW_ALIGNMENT.d.ts +14 -0
- package/src/shade/device/COPY_BYTES_PER_ROW_ALIGNMENT.d.ts.map +1 -0
- package/src/shade/device/COPY_BYTES_PER_ROW_ALIGNMENT.js +13 -0
- package/src/shade/device/graph/TextureResourceDescriptor.d.ts.map +1 -1
- package/src/shade/device/graph/TextureResourceDescriptor.js +160 -155
- package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUDevice.js +37 -3
- package/src/shade/device/mock/SoftwareGPUQueue.d.ts +11 -4
- package/src/shade/device/mock/SoftwareGPUQueue.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUQueue.js +31 -37
- package/src/shade/device/mock/SoftwareGPUTexture.d.ts +4 -2
- package/src/shade/device/mock/SoftwareGPUTexture.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUTexture.js +47 -7
- package/src/shade/device/mock/SoftwareGPUTextureView.d.ts +7 -0
- package/src/shade/device/mock/SoftwareGPUTextureView.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUTextureView.js +8 -0
- package/src/shade/device/mock/texture_copy.d.ts.map +1 -1
- package/src/shade/device/mock/texture_copy.js +74 -12
- package/src/shade/device/timing/profile/frame_graph_extract_topology.d.ts.map +1 -1
- package/src/shade/device/timing/profile/frame_graph_extract_topology.js +164 -174
- package/src/shade/playground/basis_textures/README.md +105 -0
- package/src/shade/playground/basis_textures/index.html +141 -0
- package/src/shade/playground/basis_textures/main.d.ts +8 -0
- package/src/shade/playground/basis_textures/main.d.ts.map +1 -0
- package/src/shade/playground/basis_textures/main.js +351 -0
- package/src/shade/playground/basis_textures/make_basis_gltf.d.mts +2 -0
- package/src/shade/playground/basis_textures/make_basis_gltf.d.mts.map +1 -0
- package/src/shade/playground/basis_textures/make_basis_gltf.mjs +197 -0
- package/src/shade/playground/basis_textures/node_modules/basis_universal/bin/basisu.exe +0 -0
- package/src/shade/playground/basis_textures/texture_inventory.d.ts +28 -0
- package/src/shade/playground/basis_textures/texture_inventory.d.ts.map +1 -0
- package/src/shade/playground/basis_textures/texture_inventory.js +98 -0
- package/src/shade/playground/ground_seam/README.md +235 -0
- package/src/shade/playground/ground_seam/capture_scene_color.d.ts +45 -0
- package/src/shade/playground/ground_seam/capture_scene_color.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/capture_scene_color.js +242 -0
- package/src/shade/playground/ground_seam/depth_step_across_seam.d.ts +11 -0
- package/src/shade/playground/ground_seam/depth_step_across_seam.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/depth_step_across_seam.js +185 -0
- package/src/shade/playground/ground_seam/index.html +195 -0
- package/src/shade/playground/ground_seam/main.d.ts +2 -0
- package/src/shade/playground/ground_seam/main.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/main.js +879 -0
- package/src/shade/playground/ground_seam/make_grid_texture.d.ts +29 -0
- package/src/shade/playground/ground_seam/make_grid_texture.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/make_grid_texture.js +105 -0
- package/src/shade/playground/ground_seam/make_ground.d.ts +70 -0
- package/src/shade/playground/ground_seam/make_ground.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/make_ground.js +161 -0
- package/src/shade/playground/ground_seam/measure_flicker.d.ts +71 -0
- package/src/shade/playground/ground_seam/measure_flicker.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/measure_flicker.js +531 -0
- package/src/shade/playground/image_decode_bench/README.md +42 -0
- package/src/shade/playground/image_decode_bench/decode_worker.d.ts +2 -0
- package/src/shade/playground/image_decode_bench/decode_worker.d.ts.map +1 -0
- package/src/shade/playground/image_decode_bench/decode_worker.js +19 -0
- package/src/shade/playground/image_decode_bench/index.html +34 -0
- package/src/shade/playground/image_decode_bench/main.d.ts +2 -0
- package/src/shade/playground/image_decode_bench/main.d.ts.map +1 -0
- package/src/shade/playground/image_decode_bench/main.js +211 -0
- package/src/shade/playground/skinned_blas_refit/README.md +1 -1
- package/src/shade/playground/skinned_blas_refit/index.html +15 -1
- package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/main.js +339 -3
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts +8 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.js +27 -5
- package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts +27 -0
- package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts.map +1 -0
- package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.js +127 -0
- package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.js +3 -3
- package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.js +10 -8
- package/src/shade/playground/texture_encode/README.md +109 -0
- package/src/shade/playground/texture_encode/index.html +133 -0
- package/src/shade/playground/texture_encode/main.d.ts +24 -0
- package/src/shade/playground/texture_encode/main.d.ts.map +1 -0
- package/src/shade/playground/texture_encode/main.js +1430 -0
- package/src/shade/playground/texture_encode/panel_view.d.ts +118 -0
- package/src/shade/playground/texture_encode/panel_view.d.ts.map +1 -0
- package/src/shade/playground/texture_encode/panel_view.js +363 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +2519 -2511
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +49 -5
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +32 -14
- package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/GPUGeometryManager.js +591 -497
- package/src/shade/renderer/geometry/GPUGeometryMetadata.d.ts +9 -0
- package/src/shade/renderer/geometry/GPUGeometryMetadata.d.ts.map +1 -1
- package/src/shade/renderer/geometry/GPUGeometryMetadata.js +10 -0
- package/src/shade/renderer/geometry/bvh/BLAS_REFIT_BATCH_PLAN.md +606 -0
- package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts +17 -0
- package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.js +44 -0
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts +58 -0
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts.map +1 -0
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.js +362 -0
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +38 -0
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +730 -617
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +15 -2
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +15 -1
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts +39 -0
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts.map +1 -0
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.js +134 -0
- package/src/shade/renderer/geometry/virtual/build/gltf/gltf_collect_geometries.js +3 -3
- package/src/shade/renderer/geometry/virtual/build/gltf/gltf_open_document.js +3 -3
- package/src/shade/renderer/geometry/virtual/build/gltf/gltf_read_geometry.js +1 -1
- package/src/shade/renderer/gpu_primitive/bvh/BVH_NODE_LAYOUT_DEFINITION.d.ts +17 -0
- package/src/shade/renderer/gpu_primitive/bvh/BVH_NODE_LAYOUT_DEFINITION.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh/BVH_NODE_LAYOUT_DEFINITION.js +30 -0
- package/src/shade/renderer/gpu_primitive/bvh/GPU_BVH_BUILD_PLAN.md +8 -1
- package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_refit_climb.d.ts +34 -0
- package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_refit_climb.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_refit_climb.js +102 -0
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_refit.d.ts +11 -9
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_refit.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_refit.js +24 -86
- package/src/shade/renderer/hiz/HierarchicalZBuffer.d.ts.map +1 -1
- package/src/shade/renderer/hiz/HierarchicalZBuffer.js +275 -274
- package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
- package/src/shade/renderer/light/GPULightCollection.js +323 -314
- package/src/shade/renderer/lightmap/GPULightMap.js +336 -336
- package/src/shade/renderer/loader/gltf/gltf_create_texture.d.ts +18 -0
- package/src/shade/renderer/loader/gltf/gltf_create_texture.d.ts.map +1 -0
- package/src/shade/renderer/loader/gltf/gltf_create_texture.js +103 -0
- package/src/shade/renderer/loader/gltf/gltf_image_roles.d.ts +26 -0
- package/src/shade/renderer/loader/gltf/gltf_image_roles.d.ts.map +1 -0
- package/src/shade/renderer/loader/gltf/gltf_image_roles.js +108 -0
- package/src/shade/renderer/loader/gltf/load_gltf.d.ts +10 -3
- package/src/shade/renderer/loader/gltf/load_gltf.d.ts.map +1 -1
- package/src/shade/renderer/loader/gltf/load_gltf.js +1179 -1253
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +18 -1
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts.map +1 -1
- package/src/shade/renderer/loader/gltf/tiny-gltf.js +837 -646
- package/src/shade/renderer/loader/usd/load_usd.js +3 -3
- package/src/shade/renderer/loader/usd/usd_build_scene.js +2 -2
- package/src/shade/renderer/loader/usd/usd_decode_image.d.ts +6 -5
- package/src/shade/renderer/loader/usd/usd_decode_image.d.ts.map +1 -1
- package/src/shade/renderer/loader/usd/usd_decode_image.js +197 -384
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +12 -2
- package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/material/standard/fragment_gbuffer.js +3 -1
- package/src/shade/renderer/material/standard/fragment_gbuffer_vt.js +169 -169
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +3 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/postprocess/taa/TAA.d.ts +3 -3
- package/src/shade/renderer/postprocess/taa/TAA.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/taa/TAA.js +2 -6
- package/src/shade/renderer/postprocess/taa/chunk_depth_clip_offset_codec.d.ts +18 -0
- package/src/shade/renderer/postprocess/taa/chunk_depth_clip_offset_codec.d.ts.map +1 -0
- package/src/shade/renderer/postprocess/taa/chunk_depth_clip_offset_codec.js +36 -0
- package/src/shade/renderer/postprocess/taa/chunk_taa_history_color_bounding_box_YCoCg.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/taa/chunk_taa_history_color_bounding_box_YCoCg.js +4 -1
- package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.js +13 -8
- package/src/shade/renderer/postprocess/taa/shader_taa.d.ts +1 -1
- package/src/shade/renderer/postprocess/taa/shader_taa.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/taa/shader_taa.js +52 -38
- package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_brick4.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_brick4.js +3 -1
- package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_ibl.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_ibl.js +3 -1
- package/src/shade/renderer/restir/di/chunk_restir_temporal_reuse.d.ts +4 -2
- package/src/shade/renderer/restir/di/chunk_restir_temporal_reuse.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/chunk_restir_temporal_reuse.js +9 -6
- package/src/shade/renderer/scene/optimization/deduplicate_images.js +93 -93
- package/src/shade/renderer/scene/optimization/downscale_images.js +216 -216
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.js +1 -1
- package/src/shade/renderer/scene/serialization/deserialize_scene.js +1 -1
- package/src/shade/renderer/scene/serialization/write_image_source.js +1 -1
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.js +1 -1
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_tangent_normal.d.ts +28 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_tangent_normal.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_tangent_normal.js +39 -0
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_full.d.ts +45 -0
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_full.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_full.js +94 -61
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_solve.d.ts +24 -0
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_solve.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_solve.js +43 -0
- package/src/shade/renderer/shader/chunk/texture/sample/chunk_texture_sample_catmullrom_hardware_5tap_uv.d.ts +2 -1
- package/src/shade/renderer/shader/chunk/texture/sample/chunk_texture_sample_catmullrom_hardware_5tap_uv.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/texture/sample/chunk_texture_sample_catmullrom_hardware_5tap_uv.js +2 -1
- package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2345 -0
- package/src/shade/renderer/texture/TextureManager.d.ts.map +1 -1
- package/src/shade/renderer/texture/TextureManager.js +20 -8
- package/src/shade/renderer/texture/TextureRole.d.ts +19 -0
- package/src/shade/renderer/texture/TextureRole.d.ts.map +1 -0
- package/src/shade/renderer/texture/TextureRole.js +26 -0
- package/src/shade/renderer/texture/TextureVariantSet.d.ts +71 -0
- package/src/shade/renderer/texture/TextureVariantSet.d.ts.map +1 -0
- package/src/shade/renderer/texture/TextureVariantSet.js +105 -0
- package/src/shade/renderer/texture/download_texture_data.d.ts.map +1 -1
- package/src/shade/renderer/texture/download_texture_data.js +22 -0
- package/src/shade/renderer/texture/encode/ENCODE_NOTES_2026_09_02.md +462 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +33 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +310 -0
- package/src/shade/renderer/texture/encode/chunk_astc_pack_4x4_rgb.d.ts +17 -0
- package/src/shade/renderer/texture/encode/chunk_astc_pack_4x4_rgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_astc_pack_4x4_rgb.js +51 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +42 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +375 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_pack_block.d.ts +12 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_pack_block.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_pack_block.js +24 -0
- package/src/shade/renderer/texture/encode/chunk_bc4_encode_block.d.ts +45 -0
- package/src/shade/renderer/texture/encode/chunk_bc4_encode_block.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc4_encode_block.js +348 -0
- package/src/shade/renderer/texture/encode/chunk_bc4_pack_block.d.ts +16 -0
- package/src/shade/renderer/texture/encode/chunk_bc4_pack_block.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc4_pack_block.js +33 -0
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts +32 -0
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +346 -0
- package/src/shade/renderer/texture/encode/chunk_bc6h_pack_mode11.d.ts +10 -0
- package/src/shade/renderer/texture/encode/chunk_bc6h_pack_mode11.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc6h_pack_mode11.js +54 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +36 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +327 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +22 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +71 -0
- package/src/shade/renderer/texture/encode/chunk_texture_encode_level.d.ts +20 -0
- package/src/shade/renderer/texture/encode/chunk_texture_encode_level.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_texture_encode_level.js +73 -0
- package/src/shade/renderer/texture/encode/chunk_texture_encode_load_block.d.ts +16 -0
- package/src/shade/renderer/texture/encode/chunk_texture_encode_load_block.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_texture_encode_load_block.js +36 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +13 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +63 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc1.d.ts +12 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc1.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc1.js +60 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc4.d.ts +28 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc4.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc4.js +76 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc4_snorm.d.ts +16 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc4_snorm.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc4_snorm.js +64 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc5.d.ts +14 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc5.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc5.js +67 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc5_snorm.d.ts +10 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc5_snorm.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc5_snorm.js +63 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc6h.d.ts +12 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc6h.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc6h.js +62 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +14 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +58 -0
- package/src/shade/renderer/texture/encode/texture_encode.d.ts +84 -0
- package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/texture_encode.js +168 -0
- package/src/shade/renderer/texture/encode/texture_encode_layout.d.ts +196 -0
- package/src/shade/renderer/texture/encode/texture_encode_layout.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/texture_encode_layout.js +248 -0
- package/src/shade/renderer/texture/encode/texture_encode_resources.d.ts +15 -0
- package/src/shade/renderer/texture/encode/texture_encode_resources.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/texture_encode_resources.js +25 -0
- package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +30 -0
- package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/texture_encode_shader.js +108 -0
- package/src/shade/renderer/texture/format/gpu_texture_compression_support.d.ts +17 -0
- package/src/shade/renderer/texture/format/gpu_texture_compression_support.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/gpu_texture_compression_support.js +33 -0
- package/src/shade/renderer/texture/format/gpu_texture_format_can_generate_mipmaps.d.ts +27 -0
- package/src/shade/renderer/texture/format/gpu_texture_format_can_generate_mipmaps.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/gpu_texture_format_can_generate_mipmaps.js +65 -0
- package/src/shade/renderer/texture/format/infer_format_from_parameters.d.ts +11 -0
- package/src/shade/renderer/texture/format/infer_format_from_parameters.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/infer_format_from_parameters.js +88 -0
- package/src/shade/renderer/texture/format/texture_format_from_shade_image.d.ts +24 -0
- package/src/shade/renderer/texture/format/texture_format_from_shade_image.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_format_from_shade_image.js +95 -0
- package/src/shade/renderer/texture/format/texture_format_preference.d.ts +22 -0
- package/src/shade/renderer/texture/format/texture_format_preference.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_format_preference.js +89 -0
- package/src/shade/renderer/texture/format/texture_variant_select.d.ts +24 -0
- package/src/shade/renderer/texture/format/texture_variant_select.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_variant_select.js +38 -0
- package/src/shade/renderer/texture/shade_texture_might_have_alpha.d.ts +9 -1
- package/src/shade/renderer/texture/shade_texture_might_have_alpha.d.ts.map +1 -1
- package/src/shade/renderer/texture/shade_texture_might_have_alpha.js +73 -8
- package/src/shade/renderer/texture/source/AlphaMode.d.ts +27 -0
- package/src/shade/renderer/texture/source/AlphaMode.d.ts.map +1 -0
- package/src/shade/renderer/texture/source/AlphaMode.js +52 -0
- package/src/shade/renderer/texture/source/ShadeImage.d.ts +33 -0
- package/src/shade/renderer/texture/source/ShadeImage.d.ts.map +1 -1
- package/src/shade/renderer/texture/source/ShadeImage.js +74 -0
- package/src/shade/renderer/texture/source/ShadeTexelData.d.ts +78 -0
- package/src/shade/renderer/texture/source/ShadeTexelData.d.ts.map +1 -0
- package/src/shade/renderer/texture/source/ShadeTexelData.js +158 -0
- package/src/shade/renderer/texture/source/texel_data_from_ktx2.d.ts +32 -0
- package/src/shade/renderer/texture/source/texel_data_from_ktx2.d.ts.map +1 -0
- package/src/shade/renderer/texture/source/texel_data_from_ktx2.js +48 -0
- package/src/shade/renderer/texture/texture_descriptor_from_texture_shade.d.ts +0 -10
- package/src/shade/renderer/texture/texture_descriptor_from_texture_shade.d.ts.map +1 -1
- package/src/shade/renderer/texture/texture_descriptor_from_texture_shade.js +73 -175
- package/src/shade/renderer/texture/texture_write_level.d.ts +32 -0
- package/src/shade/renderer/texture/texture_write_level.d.ts.map +1 -0
- package/src/shade/renderer/texture/texture_write_level.js +87 -0
- package/src/shade/renderer/texture/texture_write_to_gpu.d.ts +8 -1
- package/src/shade/renderer/texture/texture_write_to_gpu.d.ts.map +1 -1
- package/src/shade/renderer/texture/texture_write_to_gpu.js +62 -37
- package/src/shade/renderer/texture/virtual/source/VTSourceImage.d.ts +8 -0
- package/src/shade/renderer/texture/virtual/source/VTSourceImage.d.ts.map +1 -1
- package/src/shade/renderer/texture/virtual/source/VTSourceImage.js +8 -0
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +20 -0
- package/src/shade/renderer/volumetrics/NOTES.md +28 -0
- package/src/shade/renderer/volumetrics/taa/chunk_volumetric_history_bounding_box.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/taa/chunk_volumetric_history_bounding_box.js +7 -2
- package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_reproject.d.ts +17 -0
- package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_reproject.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_reproject.js +168 -0
- package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_resolve.d.ts +13 -0
- package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_resolve.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/taa/chunk_volumetrics_taa_resolve.js +56 -0
- package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.js +134 -334
- package/src/shade/util/texture_mip_extent.d.ts +49 -0
- package/src/shade/util/texture_mip_extent.d.ts.map +1 -0
- package/src/shade/util/texture_mip_extent.js +87 -0
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +49 -21
- package/src/avif/encode_image_source.d.ts +0 -70
- package/src/avif/encode_image_source.d.ts.map +0 -1
- package/src/avif/encode_image_source.js +0 -117
- package/src/avif/encoder_worker.d.ts.map +0 -1
- package/src/avif/index.d.ts +0 -5
- package/src/avif/index.d.ts.map +0 -1
- package/src/avif/index.js +0 -21
- package/src/avif/native/DECISIONS.md +0 -537
- package/src/avif/native/api/AvifDecoder.d.ts.map +0 -1
- package/src/avif/native/api/apply_transformations.d.ts.map +0 -1
- package/src/avif/native/api/avif_to_sampler2d.d.ts +0 -25
- package/src/avif/native/api/avif_to_sampler2d.d.ts.map +0 -1
- package/src/avif/native/api/avif_to_sampler2d.js +0 -42
- package/src/avif/native/api/convert_to_rgba.d.ts.map +0 -1
- package/src/avif/native/api/convert_to_rgba.js +0 -204
- package/src/avif/native/api/decode_avif.d.ts.map +0 -1
- package/src/avif/native/api/decode_image_item.d.ts.map +0 -1
- package/src/avif/native/api/encode_avif.d.ts.map +0 -1
- package/src/avif/native/api/sampler2d_to_avif.d.ts.map +0 -1
- package/src/avif/native/api/sampler2d_to_avif.js +0 -108
- package/src/avif/native/av1/decode/Av1FrameContext.d.ts.map +0 -1
- package/src/avif/native/av1/decode/block_decoded.d.ts.map +0 -1
- package/src/avif/native/av1/decode/decode_av1_still.d.ts.map +0 -1
- package/src/avif/native/av1/decode/decode_coefficients.d.ts.map +0 -1
- package/src/avif/native/av1/decode/decode_palette.d.ts.map +0 -1
- package/src/avif/native/av1/decode/decode_palette.js +0 -442
- package/src/avif/native/av1/decode/decode_tile.d.ts.map +0 -1
- package/src/avif/native/av1/decode/decode_tile.js +0 -1213
- package/src/avif/native/av1/decode/get_scan.d.ts.map +0 -1
- package/src/avif/native/av1/decode/read_lr.d.ts.map +0 -1
- package/src/avif/native/av1/decode/read_lr.js +0 -277
- package/src/avif/native/av1/decode/read_transform_type.d.ts.map +0 -1
- package/src/avif/native/av1/decode/read_transform_type.js +0 -92
- package/src/avif/native/av1/decode/reconstruct.d.ts.map +0 -1
- package/src/avif/native/av1/decode/reconstruct.js +0 -241
- package/src/avif/native/av1/decode/transform_type.d.ts.map +0 -1
- package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts.map +0 -1
- package/src/avif/native/av1/encode/Av1EncodeContext.d.ts.map +0 -1
- package/src/avif/native/av1/encode/build_headers.d.ts.map +0 -1
- package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts.map +0 -1
- package/src/avif/native/av1/encode/choose_filters.d.ts.map +0 -1
- package/src/avif/native/av1/encode/choose_restoration.d.ts.map +0 -1
- package/src/avif/native/av1/encode/choose_restoration.js +0 -616
- package/src/avif/native/av1/encode/decode_effort.d.ts.map +0 -1
- package/src/avif/native/av1/encode/encode_av1_still.d.ts.map +0 -1
- package/src/avif/native/av1/encode/encode_effort.d.ts.map +0 -1
- package/src/avif/native/av1/encode/encode_tile.d.ts.map +0 -1
- package/src/avif/native/av1/encode/encode_tile.js +0 -2331
- package/src/avif/native/av1/encode/quantise.d.ts.map +0 -1
- package/src/avif/native/av1/encode/write_coefficients.d.ts.map +0 -1
- package/src/avif/native/av1/encode/write_lr.d.ts.map +0 -1
- package/src/avif/native/av1/encode/write_transform_type.d.ts.map +0 -1
- package/src/avif/native/av1/entropy/CdfContext.d.ts.map +0 -1
- package/src/avif/native/av1/entropy/SymbolReader.d.ts.map +0 -1
- package/src/avif/native/av1/entropy/SymbolWriter.d.ts.map +0 -1
- package/src/avif/native/av1/entropy/coefficient_context.d.ts.map +0 -1
- package/src/avif/native/av1/entropy/partition_cdf.d.ts.map +0 -1
- package/src/avif/native/av1/entropy/symbol_cost.d.ts.map +0 -1
- package/src/avif/native/av1/filter/cdef.d.ts.map +0 -1
- package/src/avif/native/av1/filter/cdef.js +0 -313
- package/src/avif/native/av1/filter/loop_filter.d.ts.map +0 -1
- package/src/avif/native/av1/filter/loop_filter.js +0 -377
- package/src/avif/native/av1/filter/loop_restoration.d.ts.map +0 -1
- package/src/avif/native/av1/filter/loop_restoration.js +0 -451
- package/src/avif/native/av1/filter/superres.d.ts.map +0 -1
- package/src/avif/native/av1/filter/superres.js +0 -86
- package/src/avif/native/av1/grain/FilmGrainState.d.ts.map +0 -1
- package/src/avif/native/av1/grain/film_grain.d.ts.map +0 -1
- package/src/avif/native/av1/grain/film_grain.js +0 -623
- package/src/avif/native/av1/obu/FrameHeader.d.ts.map +0 -1
- package/src/avif/native/av1/obu/ObuHeader.d.ts.map +0 -1
- package/src/avif/native/av1/obu/SequenceHeader.d.ts.map +0 -1
- package/src/avif/native/av1/obu/for_each_obu.d.ts.map +0 -1
- package/src/avif/native/av1/obu/parse_frame_header.d.ts.map +0 -1
- package/src/avif/native/av1/obu/parse_frame_header.js +0 -841
- package/src/avif/native/av1/obu/parse_obu_header.d.ts.map +0 -1
- package/src/avif/native/av1/obu/parse_sequence_header.d.ts.map +0 -1
- package/src/avif/native/av1/obu/write_frame_header.d.ts.map +0 -1
- package/src/avif/native/av1/obu/write_sequence_header.d.ts.map +0 -1
- package/src/avif/native/av1/predict/IntraPredictionState.d.ts.map +0 -1
- package/src/avif/native/av1/predict/intra_filter_type.d.ts.map +0 -1
- package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts.map +0 -1
- package/src/avif/native/av1/predict/predict_chroma_from_luma.js +0 -153
- package/src/avif/native/av1/predict/predict_intra.d.ts.map +0 -1
- package/src/avif/native/av1/predict/predict_intra.js +0 -803
- package/src/avif/native/av1/predict/predict_palette.d.ts.map +0 -1
- package/src/avif/native/av1/tables/av1_symbols.d.ts.map +0 -1
- package/src/avif/native/av1/tables/av1_symbols.js +0 -419
- package/src/avif/native/av1/tables/block_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/block_tables.js +0 -270
- package/src/avif/native/av1/tables/cdf_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/cdf_tables.js +0 -1893
- package/src/avif/native/av1/tables/coefficient_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/coefficient_tables.js +0 -82
- package/src/avif/native/av1/tables/derived_block_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/filter_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/filter_tables.js +0 -313
- package/src/avif/native/av1/tables/grain_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/grain_tables.js +0 -190
- package/src/avif/native/av1/tables/prediction_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/prediction_tables.js +0 -223
- package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/quantizer_matrix_tables.js +0 -38
- package/src/avif/native/av1/tables/quantizer_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/quantizer_tables.js +0 -160
- package/src/avif/native/av1/tables/scan_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/scan_tables.js +0 -727
- package/src/avif/native/av1/tables/segmentation_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/segmentation_tables.js +0 -48
- package/src/avif/native/av1/tables/transform_tables.d.ts.map +0 -1
- package/src/avif/native/av1/tables/transform_tables.js +0 -140
- package/src/avif/native/av1/tables/unpack_table.d.ts.map +0 -1
- package/src/avif/native/av1/tables/unpack_table.js +0 -73
- package/src/avif/native/av1/transform/forward_transform_2d.d.ts.map +0 -1
- package/src/avif/native/av1/transform/inverse_transform_1d.d.ts.map +0 -1
- package/src/avif/native/av1/transform/inverse_transform_1d.js +0 -590
- package/src/avif/native/av1/transform/inverse_transform_2d.d.ts.map +0 -1
- package/src/avif/native/av1/transform/inverse_transform_2d.js +0 -180
- package/src/avif/native/av1/util/ceil_log2.d.ts.map +0 -1
- package/src/avif/native/av1/util/floor_log2.d.ts +0 -20
- package/src/avif/native/av1/util/floor_log2.d.ts.map +0 -1
- package/src/avif/native/av1/util/floor_log2.js +0 -20
- package/src/avif/native/av1/util/round2.d.ts.map +0 -1
- package/src/avif/native/av1/util/round2_signed.d.ts.map +0 -1
- package/src/avif/native/av1/util/tile_log2.d.ts.map +0 -1
- package/src/avif/native/bitstream/BitReader.d.ts.map +0 -1
- package/src/avif/native/bitstream/BitWriter.d.ts.map +0 -1
- package/src/avif/native/color/ColourTransform.d.ts.map +0 -1
- package/src/avif/native/color/YuvImage.d.ts.map +0 -1
- package/src/avif/native/color/clamp_sample.d.ts.map +0 -1
- package/src/avif/native/color/linear_to_transfer.d.ts.map +0 -1
- package/src/avif/native/color/linear_to_transfer.js +0 -126
- package/src/avif/native/color/primaries.d.ts.map +0 -1
- package/src/avif/native/color/rgb_row_to_ycbcr.d.ts.map +0 -1
- package/src/avif/native/color/transfer_to_linear.d.ts.map +0 -1
- package/src/avif/native/color/transfer_to_linear.js +0 -171
- package/src/avif/native/color/upsample_chroma_row.d.ts.map +0 -1
- package/src/avif/native/color/upsample_chroma_row.js +0 -89
- package/src/avif/native/color/ycbcr_row_to_rgb.d.ts.map +0 -1
- package/src/avif/native/color/ycbcr_row_to_rgb.js +0 -78
- package/src/avif/native/heif/AvifFile.d.ts.map +0 -1
- package/src/avif/native/heif/ItemProperty.d.ts.map +0 -1
- package/src/avif/native/heif/find_item_property.d.ts.map +0 -1
- package/src/avif/native/heif/find_item_references.d.ts.map +0 -1
- package/src/avif/native/heif/find_items_referencing.d.ts.map +0 -1
- package/src/avif/native/heif/parse_avif_file.d.ts.map +0 -1
- package/src/avif/native/heif/parse_avif_file.js +0 -383
- package/src/avif/native/heif/parse_image_grid.d.ts.map +0 -1
- package/src/avif/native/heif/parse_image_grid.js +0 -48
- package/src/avif/native/heif/parse_item_property.d.ts.map +0 -1
- package/src/avif/native/heif/read_item_data.d.ts.map +0 -1
- package/src/avif/native/heif/write_avif_file.d.ts.map +0 -1
- package/src/avif/native/heif/write_item_property.d.ts.map +0 -1
- package/src/avif/native/index.d.ts +0 -14
- package/src/avif/native/index.d.ts.map +0 -1
- package/src/avif/native/index.js +0 -56
- package/src/avif/native/isobmff/BoxHeader.d.ts.map +0 -1
- package/src/avif/native/isobmff/BoxWriter.d.ts +0 -118
- package/src/avif/native/isobmff/BoxWriter.d.ts.map +0 -1
- package/src/avif/native/isobmff/BoxWriter.js +0 -264
- package/src/avif/native/isobmff/ByteCursor.d.ts +0 -125
- package/src/avif/native/isobmff/ByteCursor.d.ts.map +0 -1
- package/src/avif/native/isobmff/ByteCursor.js +0 -298
- package/src/avif/native/isobmff/for_each_box.d.ts.map +0 -1
- package/src/avif/native/isobmff/read_box_header.d.ts.map +0 -1
- package/src/avif/native/isobmff/read_full_box_header.d.ts.map +0 -1
- package/src/avif/threaded_image_encoder.d.ts.map +0 -1
- package/src/engine/asset/loaders/gltf/computeObjectBoundingSphere.d.ts +0 -8
- package/src/engine/asset/loaders/gltf/computeObjectBoundingSphere.d.ts.map +0 -1
- package/src/engine/asset/loaders/gltf/computeObjectBoundingSphere.js +0 -70
- package/src/engine/asset/loaders/gltf/isMesh.d.ts +0 -7
- package/src/engine/asset/loaders/gltf/isMesh.d.ts.map +0 -1
- package/src/engine/asset/loaders/gltf/isMesh.js +0 -8
- package/src/engine/asset/loaders/image/codec/Codec.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/codec/CodecWithFallback.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/codec/CodecWithFallback.js +0 -105
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/JpegImage.js +0 -664
- package/src/engine/asset/loaders/image/jpeg/buildComponentData.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/buildHuffmanTable.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/decodeScan.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.js +0 -31
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/jpeg_decode.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/PNG.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts +0 -158
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +0 -656
- package/src/engine/asset/loaders/image/png/PNG_HEADER_BYTES.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_iTXt.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_iTXt.js +0 -53
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_zTXt.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_zTXt.js +0 -42
- package/src/engine/asset/loaders/image/png/crc32.d.ts +0 -2
- package/src/engine/asset/loaders/image/png/crc32.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/crc32.js +0 -8
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterAverage.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterPaeth.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.js +0 -68
- package/src/engine/asset/loaders/image/png/png_inflate.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/prototypePNG.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/prototypePNG.js +0 -37
- package/src/shade/renderer/geometry/bvh/record_blas_refit.d.ts +0 -25
- package/src/shade/renderer/geometry/bvh/record_blas_refit.d.ts.map +0 -1
- package/src/shade/renderer/geometry/bvh/record_blas_refit.js +0 -102
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_leaf_bounds.d.ts +0 -30
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_leaf_bounds.d.ts.map +0 -1
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_leaf_bounds.js +0 -125
- package/src/shade/renderer/loader/gltf/GLTF_PRIMITIVE_MODE.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/MESHOPT_COMPRESSION_PLAN.md +0 -793
- package/src/shade/renderer/loader/gltf/coalesce_array_duplicates.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/ext/GltfBufferViewExtension.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/ext/GltfBufferViewExtensionSet.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/ext/GltfBufferViewExtensionSet.js +0 -109
- package/src/shade/renderer/loader/gltf/ext/gltf_apply_buffer_view_extensions.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/ext/gltf_buffer_view_extensions.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/ext/gltf_geometry_extensions.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/ext/meshopt/MeshoptBufferViewExtension.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/ext/meshopt/MeshoptBufferViewExtension.js +0 -301
- package/src/shade/renderer/loader/gltf/gltf_component_type.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/gltf_node_world_matrices.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/gltf_node_world_matrices.js +0 -137
- package/src/shade/renderer/loader/gltf/gltf_parse_container.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/gltf_read_accessor.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/gltf_read_accessor.js +0 -294
- package/src/shade/renderer/loader/gltf/gltf_used_image_indices.d.ts +0 -25
- package/src/shade/renderer/loader/gltf/gltf_used_image_indices.d.ts.map +0 -1
- package/src/shade/renderer/loader/gltf/gltf_used_image_indices.js +0 -49
- package/src/shade/renderer/loader/usd/UsdError.d.ts.map +0 -1
- package/src/shade/renderer/loader/usd/parse_usda.d.ts.map +0 -1
- package/src/shade/renderer/loader/usd/unpack_usdz.d.ts.map +0 -1
- package/src/shade/renderer/loader/usd/unpack_usdz.js +0 -106
- package/src/shade/renderer/loader/usd/usd_compose_transform.d.ts.map +0 -1
- package/src/shade/renderer/loader/usd/usd_compose_transform.js +0 -258
- package/src/shade/renderer/loader/usd/usd_lz4.d.ts.map +0 -1
- package/src/shade/renderer/loader/usd/usd_lz4.js +0 -182
- package/src/shade/renderer/loader/usd/usd_triangulate.d.ts.map +0 -1
- package/src/shade/renderer/postprocess/taa/chunk_taa_sample_history_color.d.ts +0 -2
- package/src/shade/renderer/postprocess/taa/chunk_taa_sample_history_color.d.ts.map +0 -1
- package/src/shade/renderer/postprocess/taa/chunk_taa_sample_history_color.js +0 -43
- package/src/shade/renderer/scene/optimization/sampler2d_compare.d.ts.map +0 -1
- package/src/shade/renderer/scene/optimization/sampler2d_compare.js +0 -94
- package/src/shade/util/compute_max_mip_count.d.ts +0 -8
- package/src/shade/util/compute_max_mip_count.d.ts.map +0 -1
- package/src/shade/util/compute_max_mip_count.js +0 -27
- /package/src/engine/asset/{loaders/image/codec → codec}/Codec.d.ts +0 -0
- /package/src/engine/asset/{loaders/image/codec → codec}/Codec.js +0 -0
- /package/src/engine/asset/{loaders/image/codec → codec}/CodecWithFallback.d.ts +0 -0
- /package/src/{avif → engine/asset/loaders/image/avif}/encoder_worker.d.ts +0 -0
- /package/src/{avif → engine/asset/loaders/image/avif}/encoder_worker.js +0 -0
- /package/src/{avif → engine/asset/loaders/image/avif}/threaded_image_encoder.d.ts +0 -0
- /package/src/{avif → engine/asset/loaders/image/avif}/threaded_image_encoder.js +0 -0
- /package/src/engine/asset/loaders/image/{png/prototypePNG.d.ts → prototypePNG.d.ts} +0 -0
- /package/src/{shade/renderer/scene/optimization → engine/graphics/texture/sampler/compare}/sampler2d_compare.d.ts +0 -0
- /package/src/{avif/native/api → engine/graphics/texture/sampler}/sampler2d_to_avif.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/NOTICE.md +0 -0
- /package/src/{avif/native → format/image/avif}/api/AvifDecoder.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/api/AvifDecoder.js +0 -0
- /package/src/{avif/native → format/image/avif}/api/apply_transformations.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/api/apply_transformations.js +0 -0
- /package/src/{avif/native → format/image/avif}/api/convert_to_rgba.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/api/decode_avif.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/api/decode_avif.js +0 -0
- /package/src/{avif/native → format/image/avif}/api/decode_image_item.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/api/decode_image_item.js +0 -0
- /package/src/{avif/native → format/image/avif}/api/encode_avif.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/api/encode_avif.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/Av1FrameContext.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/Av1FrameContext.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/block_decoded.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/block_decoded.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/decode_av1_still.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/decode_av1_still.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/decode_coefficients.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/decode_coefficients.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/decode_palette.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/decode_tile.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/get_scan.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/get_scan.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/read_lr.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/read_transform_type.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/reconstruct.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/transform_type.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/decode/transform_type.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/Av1BlockSnapshot.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/Av1BlockSnapshot.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/Av1EncodeContext.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/Av1EncodeContext.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/build_headers.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/build_headers.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/choose_chroma_alpha.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/choose_chroma_alpha.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/choose_filters.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/choose_filters.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/choose_restoration.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/decode_effort.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/decode_effort.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/encode_av1_still.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/encode_av1_still.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/encode_effort.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/encode_effort.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/encode_tile.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/quantise.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/quantise.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/write_coefficients.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/write_coefficients.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/write_lr.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/write_lr.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/write_transform_type.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/encode/write_transform_type.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/CdfContext.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/CdfContext.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/SymbolReader.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/SymbolReader.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/SymbolWriter.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/SymbolWriter.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/coefficient_context.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/coefficient_context.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/partition_cdf.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/partition_cdf.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/symbol_cost.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/entropy/symbol_cost.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/filter/cdef.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/filter/loop_filter.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/filter/loop_restoration.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/filter/superres.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/grain/FilmGrainState.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/grain/FilmGrainState.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/grain/film_grain.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/FrameHeader.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/FrameHeader.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/ObuHeader.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/ObuHeader.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/SequenceHeader.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/SequenceHeader.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/for_each_obu.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/for_each_obu.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/parse_frame_header.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/parse_obu_header.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/parse_obu_header.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/parse_sequence_header.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/parse_sequence_header.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/write_frame_header.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/write_frame_header.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/write_sequence_header.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/obu/write_sequence_header.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/predict/IntraPredictionState.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/predict/IntraPredictionState.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/predict/intra_filter_type.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/predict/intra_filter_type.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/predict/predict_chroma_from_luma.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/predict/predict_intra.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/predict/predict_palette.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/predict/predict_palette.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/av1_symbols.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/block_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/cdf_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/coefficient_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/derived_block_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/derived_block_tables.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/filter_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/grain_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/prediction_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/quantizer_matrix_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/quantizer_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/scan_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/segmentation_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/transform_tables.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/tables/unpack_table.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/transform/forward_transform_2d.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/transform/forward_transform_2d.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/transform/inverse_transform_1d.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/transform/inverse_transform_2d.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/util/ceil_log2.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/util/ceil_log2.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/util/round2.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/util/round2.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/util/round2_signed.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/util/round2_signed.js +0 -0
- /package/src/{avif/native → format/image/avif}/av1/util/tile_log2.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/av1/util/tile_log2.js +0 -0
- /package/src/{avif/native → format/image/avif}/bitstream/BitReader.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/bitstream/BitReader.js +0 -0
- /package/src/{avif/native → format/image/avif}/bitstream/BitWriter.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/bitstream/BitWriter.js +0 -0
- /package/src/{avif/native → format/image/avif}/color/ColourTransform.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/color/ColourTransform.js +0 -0
- /package/src/{avif/native → format/image/avif}/color/YuvImage.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/color/YuvImage.js +0 -0
- /package/src/{avif/native → format/image/avif}/color/clamp_sample.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/color/clamp_sample.js +0 -0
- /package/src/{avif/native → format/image/avif}/color/linear_to_transfer.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/color/primaries.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/color/primaries.js +0 -0
- /package/src/{avif/native → format/image/avif}/color/rgb_row_to_ycbcr.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/color/rgb_row_to_ycbcr.js +0 -0
- /package/src/{avif/native → format/image/avif}/color/transfer_to_linear.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/color/upsample_chroma_row.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/color/ycbcr_row_to_rgb.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/AvifFile.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/AvifFile.js +0 -0
- /package/src/{avif/native → format/image/avif}/heif/ItemProperty.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/ItemProperty.js +0 -0
- /package/src/{avif/native → format/image/avif}/heif/find_item_property.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/find_item_property.js +0 -0
- /package/src/{avif/native → format/image/avif}/heif/find_item_references.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/find_item_references.js +0 -0
- /package/src/{avif/native → format/image/avif}/heif/find_items_referencing.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/find_items_referencing.js +0 -0
- /package/src/{avif/native → format/image/avif}/heif/parse_avif_file.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/parse_image_grid.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/parse_item_property.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/parse_item_property.js +0 -0
- /package/src/{avif/native → format/image/avif}/heif/read_item_data.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/read_item_data.js +0 -0
- /package/src/{avif/native → format/image/avif}/heif/write_avif_file.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/write_avif_file.js +0 -0
- /package/src/{avif/native → format/image/avif}/heif/write_item_property.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/heif/write_item_property.js +0 -0
- /package/src/{avif/native → format/image/avif}/isobmff/BoxHeader.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/isobmff/BoxHeader.js +0 -0
- /package/src/{avif/native → format/image/avif}/isobmff/for_each_box.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/isobmff/for_each_box.js +0 -0
- /package/src/{avif/native → format/image/avif}/isobmff/read_box_header.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/isobmff/read_box_header.js +0 -0
- /package/src/{avif/native → format/image/avif}/isobmff/read_full_box_header.d.ts +0 -0
- /package/src/{avif/native → format/image/avif}/isobmff/read_full_box_header.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/JpegFrame.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/JpegFrame.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/JpegFrameComponent.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/JpegFrameComponent.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/JpegImage.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/NOTES.md +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/buildComponentData.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/buildComponentData.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/buildHuffmanTable.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/buildHuffmanTable.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/decodeScan.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/decodeScan.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/idct8x8_float.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/jpeg_component_row.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/jpeg_component_row.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/jpeg_decode.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/jpeg/jpeg_decode.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/PNG.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/PNG.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/PNG_HEADER_BYTES.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/PNG_HEADER_BYTES.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/chunk/png_chunk_decode_iTXt.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/chunk/png_chunk_decode_zTXt.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterAverage.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterAverage.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterNone.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterNone.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterPaeth.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterPaeth.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterSub.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterSub.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterUp.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_filter_unFilterUp.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/filter/png_unfilter.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/png_inflate.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/png_inflate.js +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/png_unpack_samples.d.ts +0 -0
- /package/src/{engine/asset/loaders → format}/image/png/png_unpack_samples.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/GLTF_PRIMITIVE_MODE.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/GLTF_PRIMITIVE_MODE.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/coalesce_array_duplicates.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/coalesce_array_duplicates.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/GltfBufferViewExtension.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/GltfBufferViewExtension.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/GltfBufferViewExtensionSet.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_apply_buffer_view_extensions.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_apply_buffer_view_extensions.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_buffer_view_extensions.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_buffer_view_extensions.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_geometry_extensions.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/gltf_geometry_extensions.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/ext/meshopt/MeshoptBufferViewExtension.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_component_type.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_component_type.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_node_world_matrices.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_parse_container.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_parse_container.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/gltf/gltf_read_accessor.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/UsdError.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/UsdError.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/parse_usda.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/parse_usda.js +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/unpack_usdz.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/usd_compose_transform.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/usd_lz4.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/usd_triangulate.d.ts +0 -0
- /package/src/{shade/renderer/loader → format/scene}/usd/usd_triangulate.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.
|