@woosh/meep-engine 3.14.2 → 3.14.4
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/editor/prototypeEditorShell.js +6 -0
- package/package.json +1 -1
- package/src/CODEC_LAYOUT_VERIFICATION.md +420 -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/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +733 -726
- package/src/engine/asset/GameAssetType.d.ts +1 -0
- package/src/engine/asset/GameAssetType.js +8 -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 +83 -71
- package/src/engine/asset/loaders/image/ImageDecoderWorker.js +2 -2
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts +8 -9
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +12 -3
- 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 +4 -16
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +2 -2
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts +21 -1
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js +21 -1
- 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/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/network/NetworkSession.d.ts +24 -4
- package/src/engine/network/NetworkSession.d.ts.map +1 -1
- package/src/engine/network/NetworkSession.js +28 -4
- package/src/engine/network/orchestrator/NetworkPeer.d.ts +47 -6
- package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +184 -56
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +97 -11
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +304 -22
- package/src/engine/network/replication/Replicator.d.ts +14 -1
- package/src/engine/network/replication/Replicator.d.ts.map +1 -1
- package/src/engine/network/replication/Replicator.js +44 -3
- package/src/engine/network/sim/ActionLog.d.ts +21 -3
- package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
- package/src/engine/network/sim/ActionLog.js +24 -3
- package/src/engine/network/sim/SimAction.d.ts +15 -0
- package/src/engine/network/sim/SimAction.d.ts.map +1 -1
- package/src/engine/network/sim/SimAction.js +15 -0
- package/src/engine/network/sim/SimActionExecutor.d.ts +51 -1
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +73 -5
- package/src/engine/network/transport/Channel.d.ts +1 -1
- package/src/engine/network/transport/Channel.js +1 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/simulation/Ticker.d.ts.map +1 -1
- package/src/engine/simulation/Ticker.js +4 -1
- package/src/engine/ui/GUIEngine.d.ts.map +1 -1
- package/src/engine/ui/GUIEngine.js +6 -0
- 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.map +1 -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.map +1 -0
- package/src/format/texture/basis/etc1s/Etc1sSelectorHistory.d.ts.map +1 -0
- package/src/format/texture/basis/etc1s/etc1s_block_colors.d.ts.map +1 -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.map +1 -0
- package/src/format/texture/basis/etc1s/etc1s_read_selector_codebook.d.ts.map +1 -0
- package/src/format/texture/basis/etc1s/etc1s_read_slice_tables.d.ts.map +1 -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/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_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.map +1 -0
- package/src/format/texture/ktx2/KhrDfModel.d.ts.map +1 -0
- package/src/format/texture/ktx2/SupercompressionScheme.d.ts.map +1 -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/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 +16 -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 +24 -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/mock/SoftwareGPUDevice.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUDevice.js +37 -3
- 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 +39 -3
- 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/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/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/particle_system/README.md +98 -0
- package/src/shade/playground/particle_system/index.html +124 -0
- package/src/shade/playground/particle_system/main.d.ts +2 -0
- package/src/shade/playground/particle_system/main.d.ts.map +1 -0
- package/src/shade/playground/particle_system/main.js +180 -0
- package/src/shade/playground/particle_system/particle_scene.d.ts +52 -0
- package/src/shade/playground/particle_system/particle_scene.d.ts.map +1 -0
- package/src/shade/playground/particle_system/particle_scene.js +552 -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/skinned_mesh_soup/README.md +122 -0
- package/src/shade/playground/skinned_mesh_soup/index.html +199 -0
- package/src/shade/playground/skinned_mesh_soup/main.d.ts +7 -0
- package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -0
- package/src/shade/playground/skinned_mesh_soup/main.js +564 -0
- package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.d.ts +23 -0
- package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.d.ts.map +1 -0
- package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.js +409 -0
- 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.js +2 -2
- 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/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/particles/cull/chunk_particle_cull.d.ts.map +1 -1
- package/src/shade/renderer/particles/cull/chunk_particle_cull.js +3 -1
- package/src/shade/renderer/particles/data/chunk_particle_emitter.js +1 -1
- package/src/shade/renderer/particles/graph/compile_particle_graph.d.ts +1 -1
- package/src/shade/renderer/particles/graph/compile_particle_graph.d.ts.map +1 -1
- package/src/shade/renderer/particles/isa/InstructionStream.d.ts +89 -0
- package/src/shade/renderer/particles/isa/InstructionStream.d.ts.map +1 -0
- package/src/shade/renderer/particles/isa/InstructionStream.js +162 -0
- package/src/shade/renderer/particles/isa/ParticleAssembler.d.ts +1 -48
- package/src/shade/renderer/particles/isa/ParticleAssembler.d.ts.map +1 -1
- package/src/shade/renderer/particles/isa/ParticleAssembler.js +25 -114
- package/src/shade/renderer/particles/shaders/chunk_particle_curve_animation.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/chunk_particle_curve_animation.js +4 -2
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts +4 -4
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.js +7 -5
- package/src/shade/renderer/particles/shaders/chunk_particle_render_math.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/chunk_particle_render_math.js +3 -1
- package/src/shade/renderer/particles/shaders/shader_particle_emit.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_emit.js +3 -1
- package/src/shade/renderer/particles/shaders/shader_particle_finalize.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_finalize.js +5 -2
- package/src/shade/renderer/particles/shaders/shader_particle_render.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_render.js +9 -2
- package/src/shade/renderer/particles/shaders/shader_particle_simulate.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_simulate.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/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/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 +893 -10
- 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 +3 -1
- package/src/shade/renderer/texture/format/gpu_texture_compression_support.d.ts.map +1 -1
- package/src/shade/renderer/texture/format/gpu_texture_compression_support.js +8 -25
- package/src/shade/renderer/texture/format/texture_format_from_shade_image.d.ts.map +1 -1
- package/src/shade/renderer/texture/format/texture_format_from_shade_image.js +26 -2
- 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_write_level.d.ts.map +1 -1
- package/src/shade/renderer/texture/texture_write_level.js +11 -1
- 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/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 -545
- 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 -384
- package/src/avif/native/heif/parse_image_grid.d.ts.map +0 -1
- package/src/avif/native/heif/parse_image_grid.js +0 -49
- 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/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/basis/BasisBitReader.d.ts +0 -77
- package/src/basis/BasisBitReader.d.ts.map +0 -1
- package/src/basis/BasisBitReader.js +0 -231
- package/src/basis/BasisHuffmanTable.d.ts.map +0 -1
- package/src/basis/basis_read_huffman_table.d.ts.map +0 -1
- package/src/basis/etc1s/Etc1sSelectorHistory.d.ts.map +0 -1
- package/src/basis/etc1s/etc1s_block_colors.d.ts.map +0 -1
- package/src/basis/etc1s/etc1s_decode_slice.d.ts.map +0 -1
- package/src/basis/etc1s/etc1s_decode_slice.js +0 -258
- package/src/basis/etc1s/etc1s_read_endpoint_codebook.d.ts.map +0 -1
- package/src/basis/etc1s/etc1s_read_selector_codebook.d.ts.map +0 -1
- package/src/basis/etc1s/etc1s_read_slice_tables.d.ts.map +0 -1
- package/src/basis/transcode/etc1s_to_bc1.d.ts +0 -24
- package/src/basis/transcode/etc1s_to_bc1.d.ts.map +0 -1
- package/src/basis/transcode/etc1s_to_bc1.js +0 -205
- package/src/basis/transcode/etc1s_to_bc7.d.ts +0 -30
- package/src/basis/transcode/etc1s_to_bc7.d.ts.map +0 -1
- package/src/basis/transcode/fit_endpoints.d.ts +0 -59
- package/src/basis/transcode/fit_endpoints.d.ts.map +0 -1
- package/src/basis/transcode/fit_endpoints.js +0 -226
- 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/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/ktx2/KTX2_IDENTIFIER.d.ts.map +0 -1
- package/src/ktx2/KhrDfModel.d.ts.map +0 -1
- package/src/ktx2/SupercompressionScheme.d.ts.map +0 -1
- package/src/ktx2/ktx2_read.d.ts +0 -71
- package/src/ktx2/ktx2_read.d.ts.map +0 -1
- package/src/ktx2/ktx2_read.js +0 -581
- package/src/ktx2/ktx2_read_basis_lz_global_data.d.ts +0 -27
- package/src/ktx2/ktx2_read_basis_lz_global_data.d.ts.map +0 -1
- package/src/ktx2/ktx2_read_basis_lz_global_data.js +0 -189
- package/src/ktx2/vk_format_to_texture_format.d.ts +0 -55
- package/src/ktx2/vk_format_to_texture_format.d.ts.map +0 -1
- package/src/ktx2/vk_format_to_texture_format.js +0 -290
- 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/particles/prototypeParticleSystem.d.ts +0 -2
- package/src/shade/renderer/particles/prototypeParticleSystem.d.ts.map +0 -1
- package/src/shade/renderer/particles/prototypeParticleSystem.js +0 -448
- 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/{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
- /package/src/{basis → format/texture/basis}/BasisHuffmanTable.d.ts +0 -0
- /package/src/{basis → format/texture/basis}/BasisHuffmanTable.js +0 -0
- /package/src/{basis → format/texture/basis}/basis_read_huffman_table.d.ts +0 -0
- /package/src/{basis → format/texture/basis}/basis_read_huffman_table.js +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/Etc1sSelectorHistory.d.ts +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/Etc1sSelectorHistory.js +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_block_colors.d.ts +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_block_colors.js +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_decode_slice.d.ts +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_endpoint_codebook.d.ts +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_endpoint_codebook.js +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_selector_codebook.d.ts +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_selector_codebook.js +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_slice_tables.d.ts +0 -0
- /package/src/{basis → format/texture/basis}/etc1s/etc1s_read_slice_tables.js +0 -0
- /package/src/{basis → format/texture/basis}/transcode/build_range_plan.js +0 -0
- /package/src/{basis → format/texture/basis}/transcode/etc1s_to_bc7.js +0 -0
- /package/src/{ktx2 → format/texture/ktx2}/KTX2_IDENTIFIER.d.ts +0 -0
- /package/src/{ktx2 → format/texture/ktx2}/KTX2_IDENTIFIER.js +0 -0
- /package/src/{ktx2 → format/texture/ktx2}/KhrDfModel.d.ts +0 -0
- /package/src/{ktx2 → format/texture/ktx2}/KhrDfModel.js +0 -0
- /package/src/{ktx2 → format/texture/ktx2}/SupercompressionScheme.d.ts +0 -0
- /package/src/{ktx2 → format/texture/ktx2}/SupercompressionScheme.js +0 -0
|
@@ -0,0 +1,909 @@
|
|
|
1
|
+
import pako from "pako";
|
|
2
|
+
import { assert } from "../../../core/assert.js";
|
|
3
|
+
import { ByteCursor } from "../../../core/binary/ByteCursor.js";
|
|
4
|
+
import { zstd_decompress } from "../../../core/binary/zstd/zstd_decompress.js";
|
|
5
|
+
import { EndianType } from "../../../core/binary/EndianType.js";
|
|
6
|
+
import { utf8_decode } from "../../../core/binary/utf8/utf8_decode.js";
|
|
7
|
+
import { isArrayEqualStrict } from "../../../core/collection/array/isArrayEqualStrict.js";
|
|
8
|
+
import {
|
|
9
|
+
gpu_texture_format_is_block_compressed,
|
|
10
|
+
gpu_texture_format_level_bytes
|
|
11
|
+
} from "../../../shade/descriptor/texture/format/gpu_texture_format_info.js";
|
|
12
|
+
import { texture_mip_extent } from "../../../shade/util/texture_mip_extent.js";
|
|
13
|
+
import { transcode_basis, transcode_basis_carries_alpha, transcode_basis_formats } from "../basis/transcode_basis.js";
|
|
14
|
+
import { transcode_uastc, transcode_uastc_formats } from "../basis/transcode_uastc.js";
|
|
15
|
+
import { khr_df_model_name, KhrDfModel } from "./KhrDfModel.js";
|
|
16
|
+
import { KTX2_IDENTIFIER } from "./KTX2_IDENTIFIER.js";
|
|
17
|
+
import { ktx2_read_basis_lz_global_data } from "./ktx2_read_basis_lz_global_data.js";
|
|
18
|
+
import { SupercompressionScheme } from "./SupercompressionScheme.js";
|
|
19
|
+
import { vk_format_to_texture_format, VK_FORMAT_UNDEFINED } from "./vk_format_to_texture_format.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Offset of the Data Format Descriptor's `colorModel` byte from the start of the DFD section:
|
|
23
|
+
* past `dfdTotalSize`, then past the basic block's first two words.
|
|
24
|
+
*
|
|
25
|
+
* @readonly
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
const DFD_COLOR_MODEL_OFFSET = 4 + 8;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Bytes of the Data Format Descriptor's basic block that come before its samples.
|
|
32
|
+
*
|
|
33
|
+
* @readonly
|
|
34
|
+
* @type {number}
|
|
35
|
+
*/
|
|
36
|
+
const DFD_BASIC_BLOCK_BYTES = 24;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Bytes each sample of the basic block occupies.
|
|
40
|
+
*
|
|
41
|
+
* @readonly
|
|
42
|
+
* @type {number}
|
|
43
|
+
*/
|
|
44
|
+
const DFD_SAMPLE_BYTES = 16;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Bytes each entry of the level index occupies — three 64-bit fields.
|
|
48
|
+
*
|
|
49
|
+
* @readonly
|
|
50
|
+
* @type {number}
|
|
51
|
+
*/
|
|
52
|
+
const LEVEL_INDEX_ENTRY_BYTES = 24;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The only orientation this reader accepts, as the axis letters KTX2 writes them in.
|
|
56
|
+
*
|
|
57
|
+
* `r` then `d` is a top-left origin with rows running down, which is what `queue.writeTexture` takes
|
|
58
|
+
* and what every tool in this tree assumes; `i` is the third axis running away from the viewer,
|
|
59
|
+
* which is the order 3D slices are uploaded in. As many letters are checked as the texture has
|
|
60
|
+
* dimensions, so a 2D file is judged on `rd` alone.
|
|
61
|
+
*
|
|
62
|
+
* Deliberately strict about the third axis, which is the one that could go either way: `o` would
|
|
63
|
+
* mean the slices are stored back to front, and a volume loaded inside out is not a failure anybody
|
|
64
|
+
* would attribute to the reader. Refusing names the value, so a file that is genuinely fine is a
|
|
65
|
+
* one-line change here rather than a mystery.
|
|
66
|
+
*
|
|
67
|
+
* @readonly
|
|
68
|
+
* @type {string}
|
|
69
|
+
*/
|
|
70
|
+
const SUPPORTED_ORIENTATION = "rdi";
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Read a KTX2 file into a {@link TexelPayload}.
|
|
74
|
+
*
|
|
75
|
+
* **The whole contract is `bytes -> TexelPayload`.** No device, no queue, no engine: the same
|
|
76
|
+
* function serves a worker, a node tool and the offline encoder, which is why a container reader is
|
|
77
|
+
* not engine code. The engine's door is `texel_data_from_ktx2`, which wraps the payload in a
|
|
78
|
+
* `ShadeTexelData` — a compressed texture entering that way is indistinguishable, below `ShadeImage`,
|
|
79
|
+
* from one that arrived any other way.
|
|
80
|
+
*
|
|
81
|
+
* **What it reads.** Two kinds of file, and the difference between them is the whole shape of this
|
|
82
|
+
* function:
|
|
83
|
+
*
|
|
84
|
+
* 1. **Already in a device format** — any `vkFormat` that maps to a `GPUTextureFormat` (see
|
|
85
|
+
* {@link vk_format_to_texture_format}). That is what first-party tooling emits, and the payload
|
|
86
|
+
* reaches the GPU untouched.
|
|
87
|
+
* 2. **Basis Universal**, in either encoding: ETC1S behind
|
|
88
|
+
* {@link SupercompressionScheme.BasisLZ}, transcoded by {@link transcode_basis}, and UASTC, which
|
|
89
|
+
* uses no supercompression scheme of its own, transcoded by {@link transcode_uastc}. That is what
|
|
90
|
+
* the web's model pipeline emits — `gltf-transform` and `toktx` produce one or the other by
|
|
91
|
+
* default, ETC1S for colour and UASTC where quality matters.
|
|
92
|
+
*
|
|
93
|
+
* **Array textures and cube maps are read.** A level holds its images back to back — layer-major,
|
|
94
|
+
* then face, then depth slice, with no padding between them, which is KTX2's own order and the one
|
|
95
|
+
* `writeTexture` takes for `depthOrArrayLayers`. The payload reports `layers` and `faces` and leaves
|
|
96
|
+
* what to do with them to the caller: the engine's adapter refuses what its texture type cannot yet
|
|
97
|
+
* hold, and a reader that refused for it would be refusing well-formed files on another tier's behalf.
|
|
98
|
+
*
|
|
99
|
+
* Any of them may be wrapped: {@link SupercompressionScheme.ZLIB} is undone by `pako` and
|
|
100
|
+
* {@link SupercompressionScheme.Zstandard} by {@link zstd_decompress}. Wrapping is a property of the
|
|
101
|
+
* file rather than of the payload, so it is undone before anything looks at what is inside.
|
|
102
|
+
*
|
|
103
|
+
* **The second kind is a compatibility path, not the delivery path.** Transcoding pays CPU time on
|
|
104
|
+
* load to recover a format the device could have been handed directly, and meep's own pipeline hands
|
|
105
|
+
* it directly. Reading it is what lets the engine open third-party content at all.
|
|
106
|
+
*
|
|
107
|
+
* **`transcode_target` is required for a Basis file and meaningless for any other.** Which format
|
|
108
|
+
* such a payload should become depends on the device and on the material slot the texture fills,
|
|
109
|
+
* neither of which a container reader knows — see `texture_format_preference`. Omitting it is not a
|
|
110
|
+
* default but an absence, and a Basis file read without one is refused rather than guessed at.
|
|
111
|
+
*
|
|
112
|
+
* **What it refuses, by name.** Everything else, individually, because the point of a refusal is to
|
|
113
|
+
* say which feature is missing rather than to produce a texture full of the wrong bytes:
|
|
114
|
+
*
|
|
115
|
+
* | Refused | Why |
|
|
116
|
+
* |---|---|
|
|
117
|
+
* | a Basis file with no `transcode_target` | see above |
|
|
118
|
+
* | an unmapped `vkFormat` | WebGPU does not expose it |
|
|
119
|
+
* | `layerCount > 0` or `faceCount == 6` with `pixelDepth > 0` | a 3D array — WebGPU's 3D textures have no layers |
|
|
120
|
+
* | `layerCount > 0` or `faceCount == 6` on a Basis payload | the transcoders take one image per level |
|
|
121
|
+
* | `pixelHeight == 0` | a 1D texture, likewise |
|
|
122
|
+
* | a 3D block-compressed payload | needs `texture-compression-*-sliced-3d`, which nothing here asks for |
|
|
123
|
+
* | `levelCount == 0` on a block format | see below |
|
|
124
|
+
* | a non-default `KTXorientation` or `KTXswizzle` | the bytes would need rearranging, and nothing here rearranges them |
|
|
125
|
+
*
|
|
126
|
+
* **`levelCount == 0` means "generate the mip chain at load", which is not the same as `1`.** It is
|
|
127
|
+
* an *instruction*, and the payload type carries data rather than instructions: the engine's
|
|
128
|
+
* instruction is `ShadeTextureFlags.GenerateMipMaps`, which lives on the `ShadeTexture` and is
|
|
129
|
+
* honoured or thrown. So a `levelCount == 0` file reads as the single level it physically contains,
|
|
130
|
+
* and whether mips get generated is the caller's to state — which is the same rule that makes a
|
|
131
|
+
* supplied chain and a generated one distinguishable at all. For a block-compressed payload the
|
|
132
|
+
* instruction cannot be honoured by anything, at any layer, so that combination is refused here
|
|
133
|
+
* rather than left to fail later with a message about a flag the file never mentioned.
|
|
134
|
+
*
|
|
135
|
+
* **The level index is base-first; the image data usually is not.** KTX2 conventionally stores the
|
|
136
|
+
* smallest level at the lowest offset, so levels are read through `byteOffset` and never by walking
|
|
137
|
+
* the file. `levels[0]` is the base level whatever order the file laid its bytes out in.
|
|
138
|
+
*
|
|
139
|
+
* Level bytes are views onto `bytes`, not copies, wherever supercompression permits it — the payload
|
|
140
|
+
* is the overwhelming majority of a texture file, and copying it to hand it to `writeTexture` would
|
|
141
|
+
* double the peak memory of every texture load for nothing.
|
|
142
|
+
*
|
|
143
|
+
* @param {ArrayBuffer|Uint8Array} bytes the whole file
|
|
144
|
+
* @param {TextureFormat|TextureFormat[]} [transcode_target] what a Basis payload should be
|
|
145
|
+
* transcoded into. Required for such a file and ignored for every other; see above for why it is not
|
|
146
|
+
* defaulted.
|
|
147
|
+
*
|
|
148
|
+
* **An array is an ordered preference, not a set**, and is the form to use when more than one target
|
|
149
|
+
* would do. Whether a file carries alpha is knowable only from its descriptor, which is read here, so
|
|
150
|
+
* a caller that names a single three-channel format for a payload that turns out to have alpha gets a
|
|
151
|
+
* refusal where it could have got its second choice. Given the list, this passes over the targets that
|
|
152
|
+
* cannot hold what the file contains and takes the first that can
|
|
153
|
+
* @returns {TexelPayload}
|
|
154
|
+
* @throws {Error} naming the feature, for a file this reader does not read; naming the field, for a
|
|
155
|
+
* file that is truncated or self-inconsistent
|
|
156
|
+
*
|
|
157
|
+
* @see https://registry.khronos.org/KTX/specs/2.0/ktxspec.v2.html
|
|
158
|
+
* @author Alex Goldring
|
|
159
|
+
* @copyright Company Named Limited (c) 2026
|
|
160
|
+
*/
|
|
161
|
+
export function ktx2_read(bytes, transcode_target = undefined) {
|
|
162
|
+
assert.defined(bytes, 'bytes');
|
|
163
|
+
assert.notNull(bytes, 'bytes');
|
|
164
|
+
|
|
165
|
+
// KTX2 is little-endian throughout, which is the one thing the cursor has to be told
|
|
166
|
+
const cursor = new ByteCursor().init(bytes, EndianType.LittleEndian);
|
|
167
|
+
|
|
168
|
+
read_identifier(cursor);
|
|
169
|
+
|
|
170
|
+
const vk_format = cursor.u32();
|
|
171
|
+
const type_size = cursor.u32();
|
|
172
|
+
const pixel_width = cursor.u32();
|
|
173
|
+
const pixel_height = cursor.u32();
|
|
174
|
+
const pixel_depth = cursor.u32();
|
|
175
|
+
const layer_count = cursor.u32();
|
|
176
|
+
const face_count = cursor.u32();
|
|
177
|
+
const level_count = cursor.u32();
|
|
178
|
+
const supercompression_scheme = cursor.u32();
|
|
179
|
+
|
|
180
|
+
const dfd_byte_offset = cursor.u32();
|
|
181
|
+
const dfd_byte_length = cursor.u32();
|
|
182
|
+
const kvd_byte_offset = cursor.u32();
|
|
183
|
+
const kvd_byte_length = cursor.u32();
|
|
184
|
+
|
|
185
|
+
/*
|
|
186
|
+
Where the supercompression global data sits. It holds the BasisLZ endpoint and selector
|
|
187
|
+
codebooks and the Huffman tables every image in the file shares, and it is read only when the
|
|
188
|
+
scheme says it is there — for every other scheme these two fields are zero.
|
|
189
|
+
*/
|
|
190
|
+
const sgd_byte_offset = cursor.u64();
|
|
191
|
+
const sgd_byte_length = cursor.u64();
|
|
192
|
+
|
|
193
|
+
/*
|
|
194
|
+
The level index follows the header immediately, but the refusals below read from elsewhere in
|
|
195
|
+
the file and a cursor is one position. Remember where the index starts rather than depending on
|
|
196
|
+
which of them happened to move it, which is the kind of coupling that survives until someone
|
|
197
|
+
reorders two lines.
|
|
198
|
+
*/
|
|
199
|
+
const level_index_position = cursor.position;
|
|
200
|
+
|
|
201
|
+
refuse_unsupported_supercompression(supercompression_scheme);
|
|
202
|
+
|
|
203
|
+
/*
|
|
204
|
+
A BasisLZ file's payload is ETC1S, which no device samples, so the format it ends up in is the
|
|
205
|
+
caller's choice rather than the file's. Every other file already holds a device format and the
|
|
206
|
+
caller's choice does not enter into it.
|
|
207
|
+
*/
|
|
208
|
+
const basis_lz = supercompression_scheme === SupercompressionScheme.BasisLZ;
|
|
209
|
+
|
|
210
|
+
/*
|
|
211
|
+
UASTC is the other Basis encoding and does not use BasisLZ — every block stands alone, so there
|
|
212
|
+
is no global data and nothing to supercompress beyond an ordinary wrapper. It is told apart by
|
|
213
|
+
the same field ETC1S is: an undefined `vkFormat` and the descriptor's colour model.
|
|
214
|
+
*/
|
|
215
|
+
const uastc = !basis_lz
|
|
216
|
+
&& vk_format === VK_FORMAT_UNDEFINED
|
|
217
|
+
&& read_dfd_color_model(cursor, dfd_byte_offset, dfd_byte_length) === KhrDfModel.UASTC;
|
|
218
|
+
|
|
219
|
+
const format = basis_lz || uastc
|
|
220
|
+
? basis_target_format(cursor, dfd_byte_offset, dfd_byte_length, transcode_target, basis_lz)
|
|
221
|
+
: texture_format_of(cursor, vk_format, dfd_byte_offset, dfd_byte_length);
|
|
222
|
+
|
|
223
|
+
refuse_unsupported_shape(pixel_width, pixel_height, pixel_depth, layer_count, face_count, format);
|
|
224
|
+
|
|
225
|
+
if ((basis_lz || uastc) && (layer_count > 0 || face_count === 6)) {
|
|
226
|
+
/*
|
|
227
|
+
One image per level is what the transcoders take: a BasisLZ file's global data describes its
|
|
228
|
+
images level by level, and neither transcoder has a notion of a layer or a face. Refused by
|
|
229
|
+
name rather than transcoded as a stack nothing asked for.
|
|
230
|
+
*/
|
|
231
|
+
throw new Error(
|
|
232
|
+
`KTX2: the payload is Basis Universal and the file is`
|
|
233
|
+
+ ` ${layer_count > 0 ? `an array of ${layer_count} layers` : "a cube map"}. The transcoders`
|
|
234
|
+
+ ` take one image per level; encode the layers as separate files, or in a device format.`
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
refuse_unsupported_metadata(cursor, kvd_byte_offset, kvd_byte_length, pixel_depth);
|
|
239
|
+
|
|
240
|
+
if (gpu_texture_format_is_block_compressed(format)) {
|
|
241
|
+
/*
|
|
242
|
+
The specification requires this of a block-compressed payload, and it is worth checking
|
|
243
|
+
rather than ignoring: `typeSize` is the width of the unit a big-endian host would byte-swap,
|
|
244
|
+
and a block has no such unit. A file claiming otherwise disagrees with itself about what its
|
|
245
|
+
own bytes are.
|
|
246
|
+
*/
|
|
247
|
+
if (type_size !== 1) {
|
|
248
|
+
throw new Error(
|
|
249
|
+
`KTX2: typeSize is ${type_size} for '${format}', which is block-compressed and must`
|
|
250
|
+
+ ` declare a typeSize of 1`
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (level_count === 0) {
|
|
255
|
+
throw new Error(
|
|
256
|
+
`KTX2: levelCount is 0 — "generate the mip chain at load" — for '${format}', which`
|
|
257
|
+
+ ` is block-compressed. Nothing can generate mips for a block format: they come`
|
|
258
|
+
+ ` from the encoder. Re-encode with a mip chain, or declare levelCount 1 and accept`
|
|
259
|
+
+ ` a single-level texture.`
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
cursor.seek(level_index_position);
|
|
265
|
+
|
|
266
|
+
const level_index = read_level_index(cursor, Math.max(level_count, 1));
|
|
267
|
+
|
|
268
|
+
const levels = level_index.map(
|
|
269
|
+
(entry, level) => read_level(cursor, entry, level, supercompression_scheme)
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
if (uastc) {
|
|
273
|
+
/*
|
|
274
|
+
Nothing to gather: a UASTC level is its blocks and every block stands alone, so the levels
|
|
275
|
+
the index already located are the payload.
|
|
276
|
+
*/
|
|
277
|
+
return transcode_uastc({ width: pixel_width, height: pixel_height, levels }, format);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (basis_lz) {
|
|
281
|
+
const payload = ktx2_read_basis_lz_global_data(
|
|
282
|
+
bytes, sgd_byte_offset, sgd_byte_length, levels.length, levels,
|
|
283
|
+
read_dfd_sample_count(cursor, dfd_byte_offset, dfd_byte_length) === 2
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
payload.width = pixel_width;
|
|
287
|
+
payload.height = pixel_height;
|
|
288
|
+
|
|
289
|
+
/*
|
|
290
|
+
The transcoder builds the payload, because it is the thing that knows how many
|
|
291
|
+
bytes its own output came to. A reader that constructed one here would be asserting a byte
|
|
292
|
+
count for blocks it did not write.
|
|
293
|
+
*/
|
|
294
|
+
return transcode_basis(payload, format);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const depth = Math.max(pixel_depth, 1);
|
|
298
|
+
const layers = Math.max(layer_count, 1);
|
|
299
|
+
const faces = face_count;
|
|
300
|
+
|
|
301
|
+
/*
|
|
302
|
+
A level is exactly as many bytes as its format and extent imply — times the images it holds, for
|
|
303
|
+
an array or a cube map — and a file whose level index
|
|
304
|
+
says otherwise is mislabelled — its `vkFormat` or its dimensions are lying about the bytes below
|
|
305
|
+
them, and a payload that uploads without complaint renders garbage. Checked against the format
|
|
306
|
+
table here rather than left to the engine because this reader's contract is "the file's levels,
|
|
307
|
+
each the right size", to a node tool as much as to a renderer. Whether the *number* of levels is
|
|
308
|
+
one the engine can take is the engine's question, and `texel_data_from_ktx2` asks it.
|
|
309
|
+
|
|
310
|
+
The transcoded paths above need no such check: the transcoder wrote those bytes itself.
|
|
311
|
+
*/
|
|
312
|
+
const images_per_level = layers * faces;
|
|
313
|
+
|
|
314
|
+
for (let level = 0; level < levels.length; level++) {
|
|
315
|
+
const extent = texture_mip_extent(pixel_width, pixel_height, depth, "3d", level);
|
|
316
|
+
const expected = gpu_texture_format_level_bytes(format, extent[0], extent[1], extent[2])
|
|
317
|
+
* images_per_level;
|
|
318
|
+
|
|
319
|
+
if (levels[level].byteLength !== expected) {
|
|
320
|
+
throw new Error(
|
|
321
|
+
`KTX2: level ${level} of a ${pixel_width}x${pixel_height}x${depth} '${format}' payload`
|
|
322
|
+
+ (images_per_level > 1 ? ` holding ${images_per_level} images` : "")
|
|
323
|
+
+ ` should be ${expected} bytes, got ${levels[level].byteLength}`
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return { format, width: pixel_width, height: pixel_height, depth, layers, faces, levels };
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @param {ByteCursor} cursor positioned at the start of the file
|
|
333
|
+
* @throws {Error} for anything that is not a KTX2 file
|
|
334
|
+
*/
|
|
335
|
+
function read_identifier(cursor) {
|
|
336
|
+
if (cursor.remaining < KTX2_IDENTIFIER.length) {
|
|
337
|
+
throw new Error(
|
|
338
|
+
`KTX2: a ${cursor.remaining} byte input is too short to hold the 12 byte identifier`
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const identifier = cursor.view_bytes(KTX2_IDENTIFIER.length);
|
|
343
|
+
|
|
344
|
+
if (!isArrayEqualStrict(identifier, KTX2_IDENTIFIER)) {
|
|
345
|
+
const found = Array.from(identifier, byte => byte.toString(16).padStart(2, "0")).join(" ");
|
|
346
|
+
|
|
347
|
+
throw new Error(
|
|
348
|
+
`KTX2: identifier mismatch. Expected AB 4B 54 58 20 32 30 BB 0D 0A 1A 0A, found ${found}.`
|
|
349
|
+
+ ` This is not a KTX2 file — a KTX1 file starts AB 4B 54 58 20 31 31 BB.`
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* @param {SupercompressionScheme|number} scheme
|
|
356
|
+
* @throws {Error} for a scheme from a later revision of the specification, which cannot be read by
|
|
357
|
+
* guessing what its levels contain
|
|
358
|
+
*/
|
|
359
|
+
function refuse_unsupported_supercompression(scheme) {
|
|
360
|
+
if (
|
|
361
|
+
scheme === SupercompressionScheme.None
|
|
362
|
+
|| scheme === SupercompressionScheme.ZLIB
|
|
363
|
+
|| scheme === SupercompressionScheme.Zstandard
|
|
364
|
+
|| scheme === SupercompressionScheme.BasisLZ
|
|
365
|
+
) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
throw new Error(
|
|
370
|
+
`KTX2: supercompressionScheme ${scheme} is not one this reader knows — the specification`
|
|
371
|
+
+ ` defines 0 (None), 1 (BasisLZ), 2 (Zstandard) and 3 (ZLIB). A file from a later revision`
|
|
372
|
+
+ ` cannot be read by guessing what its levels contain.`
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* The format a BasisLZ file's payload will be transcoded into.
|
|
378
|
+
*
|
|
379
|
+
* Unlike every other path through this reader, the answer is not in the file. A BasisLZ payload is
|
|
380
|
+
* ETC1S, which nothing samples, so what it becomes depends on the device and on which material slot
|
|
381
|
+
* the texture fills — see `texture_format_preference`. That makes it the caller's to state, and a
|
|
382
|
+
* caller that has not stated it gets a refusal rather than a guess.
|
|
383
|
+
*
|
|
384
|
+
* @param {ByteCursor} cursor
|
|
385
|
+
* @param {number} dfd_byte_offset
|
|
386
|
+
* @param {number} dfd_byte_length
|
|
387
|
+
* @param {TextureFormat|undefined} transcode_target
|
|
388
|
+
* @returns {TextureFormat}
|
|
389
|
+
* @throws {Error} for a payload that is not ETC1S, or for no target
|
|
390
|
+
*/
|
|
391
|
+
function basis_target_format(
|
|
392
|
+
cursor, dfd_byte_offset, dfd_byte_length, transcode_target, basis_lz
|
|
393
|
+
) {
|
|
394
|
+
const color_model = read_dfd_color_model(cursor, dfd_byte_offset, dfd_byte_length);
|
|
395
|
+
|
|
396
|
+
if (basis_lz && color_model !== KhrDfModel.ETC1S) {
|
|
397
|
+
/*
|
|
398
|
+
BasisLZ is defined only over ETC1S — a UASTC file carries its blocks uncompressed or behind
|
|
399
|
+
an ordinary wrapper and never sets this scheme. A file that pairs them is malformed, and
|
|
400
|
+
saying which two things disagree beats failing later inside a codebook read.
|
|
401
|
+
*/
|
|
402
|
+
throw new Error(
|
|
403
|
+
`KTX2: the file declares BasisLZ supercompression, whose payload is always ETC1S, and`
|
|
404
|
+
+ ` its Data Format Descriptor says the colour model is`
|
|
405
|
+
+ ` ${color_model === undefined ? "nothing this reader could read" : khr_df_model_name(color_model)}.`
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
if (transcode_target === undefined) {
|
|
410
|
+
throw new Error(
|
|
411
|
+
`KTX2: the payload is Basis Universal ${khr_df_model_name(color_model)}, which is`
|
|
412
|
+
+ ` transcoded to a device format rather than sampled, and no target format was given.`
|
|
413
|
+
+ ` Pass one — from texture_format_preference(role, support), which is what knows the`
|
|
414
|
+
+ ` device's capabilities and the texture's role.`
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (!Array.isArray(transcode_target)) {
|
|
419
|
+
return transcode_target;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (transcode_target.length === 0) {
|
|
423
|
+
throw new Error(
|
|
424
|
+
`KTX2: the payload is Basis Universal ${khr_df_model_name(color_model)} and the list of`
|
|
425
|
+
+ ` acceptable transcode targets was empty. Pass at least one.`
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/*
|
|
430
|
+
**Choosing from a list is what lets the payload decide.** A caller ranks targets by what the
|
|
431
|
+
device can sample and what the texture is for. What it cannot rank them by is anything about
|
|
432
|
+
*this file* — which of the two Basis encodings it holds, and whether it carries alpha — because
|
|
433
|
+
neither is known until something reads the descriptor, which happens here.
|
|
434
|
+
|
|
435
|
+
Two things can rule a target out, and both would otherwise surface as a refusal thrown after the
|
|
436
|
+
caller had committed, with no second chance to pick differently:
|
|
437
|
+
|
|
438
|
+
1. **The encoding's transcoder does not write it.** The two write overlapping but different
|
|
439
|
+
sets — only UASTC reaches BC5, only ETC1S reaches BC1 — so a list headed by a format the
|
|
440
|
+
file's own encoding cannot produce has to move down rather than fail. An ASTC-first device
|
|
441
|
+
loading a model whose normal maps are UASTC hits exactly this.
|
|
442
|
+
2. **It has no room for the payload's alpha**, which is an ETC1S question: its alpha is a second
|
|
443
|
+
slice that a target either has somewhere to put or does not. UASTC carries alpha inside the
|
|
444
|
+
block, and its BC5 target drops channels deliberately because a normal map has none worth
|
|
445
|
+
keeping, so nothing there is ruled out on those grounds.
|
|
446
|
+
*/
|
|
447
|
+
const writable = basis_lz ? transcode_basis_formats() : transcode_uastc_formats();
|
|
448
|
+
|
|
449
|
+
const supported = transcode_target.filter(
|
|
450
|
+
format => writable.includes(strip_srgb(format))
|
|
451
|
+
);
|
|
452
|
+
|
|
453
|
+
if (!basis_lz) {
|
|
454
|
+
return first_or_refuse(supported, transcode_target, color_model, "this encoding cannot produce");
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const has_alpha = read_dfd_sample_count(cursor, dfd_byte_offset, dfd_byte_length) === 2;
|
|
458
|
+
|
|
459
|
+
if (!has_alpha) {
|
|
460
|
+
return first_or_refuse(supported, transcode_target, color_model, "this encoding cannot produce");
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
return first_or_refuse(
|
|
464
|
+
supported.filter(format => transcode_basis_carries_alpha(format)),
|
|
465
|
+
transcode_target,
|
|
466
|
+
color_model,
|
|
467
|
+
"can hold this payload's alpha"
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* An sRGB format's linear spelling, which is the one a transcoder's format list names.
|
|
473
|
+
*
|
|
474
|
+
* The two are the same blocks — which one a texture is created with is decided from the image's
|
|
475
|
+
* colour space, not here — so a caller may legitimately ask for either and a list that only knows
|
|
476
|
+
* the linear name would pass over the sRGB one for no reason.
|
|
477
|
+
*
|
|
478
|
+
* @param {TextureFormat} format
|
|
479
|
+
* @returns {TextureFormat}
|
|
480
|
+
*/
|
|
481
|
+
function strip_srgb(format) {
|
|
482
|
+
return format.endsWith("-srgb") ? format.slice(0, -"-srgb".length) : format;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* The head of a filtered list, or a refusal naming what was offered and what was wrong with it.
|
|
487
|
+
*
|
|
488
|
+
* @param {TextureFormat[]} usable
|
|
489
|
+
* @param {TextureFormat[]} offered the caller's whole list, for the message
|
|
490
|
+
* @param {number} color_model
|
|
491
|
+
* @param {string} requirement what none of them met, as a phrase completing "none of them ..."
|
|
492
|
+
* @returns {TextureFormat}
|
|
493
|
+
* @throws {Error} when nothing is usable
|
|
494
|
+
*/
|
|
495
|
+
function first_or_refuse(usable, offered, color_model, requirement) {
|
|
496
|
+
if (usable.length > 0) {
|
|
497
|
+
return usable[0];
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
throw new Error(
|
|
501
|
+
`KTX2: the payload is Basis Universal ${khr_df_model_name(color_model)} and none of the`
|
|
502
|
+
+ ` targets offered ${requirement}: ${offered.join(", ")}. 'rgba8unorm' always can, and is`
|
|
503
|
+
+ ` what a caller should put at the end of its list.`
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* How many samples the Data Format Descriptor's basic block describes.
|
|
509
|
+
*
|
|
510
|
+
* For an ETC1S payload this is how the file says whether it carries alpha: one sample is colour
|
|
511
|
+
* alone, two is colour plus an alpha slice in every image. There is no other field that says so —
|
|
512
|
+
* the image descriptors carry alpha slice lengths, but reading a zero there would confuse "no alpha"
|
|
513
|
+
* with "alpha that happens to be empty".
|
|
514
|
+
*
|
|
515
|
+
* @param {ByteCursor} cursor
|
|
516
|
+
* @param {number} byte_offset of the DFD section
|
|
517
|
+
* @param {number} byte_length
|
|
518
|
+
* @returns {number}
|
|
519
|
+
* @throws {Error} for a descriptor block whose size is not a whole number of samples past the fixed
|
|
520
|
+
* part, which means it is not the basic block this expects
|
|
521
|
+
*/
|
|
522
|
+
function read_dfd_sample_count(cursor, byte_offset, byte_length) {
|
|
523
|
+
if (byte_offset === 0 || byte_length < DFD_BASIC_BLOCK_BYTES) {
|
|
524
|
+
throw new Error(
|
|
525
|
+
`KTX2: an ETC1S payload needs a Data Format Descriptor to say whether it has alpha, and`
|
|
526
|
+
+ ` this file's is ${byte_length} bytes`
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
// past dfdTotalSize, then past the first word, to the descriptorBlockSize half of the second
|
|
531
|
+
cursor.seek(byte_offset + 4 + 6);
|
|
532
|
+
|
|
533
|
+
const descriptor_block_bytes = cursor.u16();
|
|
534
|
+
|
|
535
|
+
const sample_bytes = descriptor_block_bytes - DFD_BASIC_BLOCK_BYTES;
|
|
536
|
+
|
|
537
|
+
if (sample_bytes < 0 || sample_bytes % DFD_SAMPLE_BYTES !== 0) {
|
|
538
|
+
throw new Error(
|
|
539
|
+
`KTX2: the Data Format Descriptor's basic block is ${descriptor_block_bytes} bytes,`
|
|
540
|
+
+ ` which is not ${DFD_BASIC_BLOCK_BYTES} plus a whole number of`
|
|
541
|
+
+ ` ${DFD_SAMPLE_BYTES} byte samples`
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return sample_bytes / DFD_SAMPLE_BYTES;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* The `GPUTextureFormat` a file's payload is already in.
|
|
550
|
+
*
|
|
551
|
+
* @param {ByteCursor} cursor
|
|
552
|
+
* @param {number} vk_format
|
|
553
|
+
* @param {number} dfd_byte_offset
|
|
554
|
+
* @param {number} dfd_byte_length
|
|
555
|
+
* @returns {TextureFormat}
|
|
556
|
+
* @throws {Error} naming the encoding, for a payload that is not in a device format
|
|
557
|
+
*/
|
|
558
|
+
function texture_format_of(cursor, vk_format, dfd_byte_offset, dfd_byte_length) {
|
|
559
|
+
if (vk_format !== VK_FORMAT_UNDEFINED) {
|
|
560
|
+
return vk_format_to_texture_format(vk_format);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/*
|
|
564
|
+
`VK_FORMAT_UNDEFINED` is not "no format". It is how a Basis Universal payload is spelled, and
|
|
565
|
+
the Data Format Descriptor's colour model is the only field that says which of the two encodings
|
|
566
|
+
it holds. Reading it costs one byte and turns "vkFormat 0" — which says nothing — into the name
|
|
567
|
+
of the transcoder the file needs.
|
|
568
|
+
*/
|
|
569
|
+
const color_model = read_dfd_color_model(cursor, dfd_byte_offset, dfd_byte_length);
|
|
570
|
+
|
|
571
|
+
if (color_model === KhrDfModel.ETC1S) {
|
|
572
|
+
/*
|
|
573
|
+
Reachable only for an ETC1S payload that is not behind BasisLZ, which the specification does
|
|
574
|
+
not describe: the codebooks and Huffman tables an ETC1S slice is decoded against live in the
|
|
575
|
+
supercompression global data, and a file declaring no supercompression has none.
|
|
576
|
+
*/
|
|
577
|
+
throw new Error(
|
|
578
|
+
`KTX2: the payload is Basis Universal ETC1S and the file declares no BasisLZ`
|
|
579
|
+
+ ` supercompression, so it carries no endpoint or selector codebooks. Its slices are`
|
|
580
|
+
+ ` indices into tables that are not present.`
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
throw new Error(
|
|
585
|
+
`KTX2: vkFormat is VK_FORMAT_UNDEFINED, so the payload's encoding is whatever the Data Format`
|
|
586
|
+
+ ` Descriptor says — and it says ${color_model === undefined
|
|
587
|
+
? "nothing this reader could read"
|
|
588
|
+
: khr_df_model_name(color_model)}.`
|
|
589
|
+
+ ` Only ETC1S and UASTC use an undefined vkFormat, and neither is supported.`
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* @param {ByteCursor} cursor
|
|
595
|
+
* @param {number} byte_offset of the DFD section, `0` when there is none
|
|
596
|
+
* @param {number} byte_length
|
|
597
|
+
* @returns {KhrDfModel|number|undefined} `undefined` when the file has no DFD, or one too short to
|
|
598
|
+
* hold a basic descriptor block's colour model
|
|
599
|
+
*/
|
|
600
|
+
function read_dfd_color_model(cursor, byte_offset, byte_length) {
|
|
601
|
+
if (byte_offset === 0 || byte_length <= DFD_COLOR_MODEL_OFFSET) {
|
|
602
|
+
return undefined;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
if (byte_offset + DFD_COLOR_MODEL_OFFSET >= cursor.end) {
|
|
606
|
+
return undefined;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
cursor.seek(byte_offset + DFD_COLOR_MODEL_OFFSET);
|
|
610
|
+
|
|
611
|
+
return cursor.u8();
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* @param {number} pixel_width
|
|
616
|
+
* @param {number} pixel_height
|
|
617
|
+
* @param {number} pixel_depth
|
|
618
|
+
* @param {number} layer_count `0` for a texture that is not an array
|
|
619
|
+
* @param {number} face_count `1`, or `6` for a cube map
|
|
620
|
+
* @param {TextureFormat} format
|
|
621
|
+
* @throws {Error} for a shape a {@link TexelPayload} cannot describe — arrays and cube maps are not
|
|
622
|
+
* among them; a 3D array is, because WebGPU has no such texture
|
|
623
|
+
*/
|
|
624
|
+
function refuse_unsupported_shape(
|
|
625
|
+
pixel_width, pixel_height, pixel_depth, layer_count, face_count, format
|
|
626
|
+
) {
|
|
627
|
+
if (pixel_width === 0) {
|
|
628
|
+
throw new Error("KTX2: pixelWidth is 0, which no texture has");
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
if (pixel_height === 0) {
|
|
632
|
+
throw new Error(
|
|
633
|
+
"KTX2: pixelHeight is 0, which is a 1D texture. The payload describes a 2D or 3D"
|
|
634
|
+
+ " image only, and nothing in the engine samples a 1D texture."
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
if (face_count !== 1 && face_count !== 6) {
|
|
639
|
+
throw new Error(`KTX2: faceCount is ${face_count}, which is neither 1 nor 6`);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
if (pixel_depth > 0 && (layer_count > 0 || face_count === 6)) {
|
|
643
|
+
/*
|
|
644
|
+
Vulkan has no 3D array or 3D cube image and neither does WebGPU: a "3d" texture's third
|
|
645
|
+
extent is its depth, and layers are the third extent of a "2d" one. A file claiming both
|
|
646
|
+
has nowhere to put one of them.
|
|
647
|
+
*/
|
|
648
|
+
throw new Error(
|
|
649
|
+
`KTX2: pixelDepth is ${pixel_depth} and the file is`
|
|
650
|
+
+ ` ${layer_count > 0 ? `an array of ${layer_count} layers` : "a cube map"}. A 3D texture`
|
|
651
|
+
+ ` has no layers — WebGPU's third extent is depth or array layers, never both.`
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
if (pixel_depth > 0 && gpu_texture_format_is_block_compressed(format)) {
|
|
656
|
+
/*
|
|
657
|
+
Sampling a block-compressed 3D texture needs `texture-compression-bc-sliced-3d` or its ASTC
|
|
658
|
+
counterpart, neither of which the renderer requests, and the block layout of a 3D level is
|
|
659
|
+
not the 2D one repeated per slice for every format. Refusing beats producing a payload whose
|
|
660
|
+
byte lengths happen to add up.
|
|
661
|
+
*/
|
|
662
|
+
throw new Error(
|
|
663
|
+
`KTX2: pixelDepth is ${pixel_depth} and the format is '${format}', which is`
|
|
664
|
+
+ ` block-compressed. A 3D block-compressed texture needs a sliced-3d device feature that`
|
|
665
|
+
+ ` the renderer does not request.`
|
|
666
|
+
);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Refuse a file whose metadata says its texels are arranged in a way nothing here rearranges.
|
|
672
|
+
*
|
|
673
|
+
* Both keys are cheap to read and expensive to ignore: a flipped orientation renders the texture
|
|
674
|
+
* upside down and a non-identity swizzle renders it in the wrong channels, and neither failure looks
|
|
675
|
+
* like a bug in the reader.
|
|
676
|
+
*
|
|
677
|
+
* @param {ByteCursor} cursor
|
|
678
|
+
* @param {number} kvd_byte_offset `0` when the file carries no key/value data
|
|
679
|
+
* @param {number} kvd_byte_length
|
|
680
|
+
* @param {number} pixel_depth
|
|
681
|
+
* @throws {Error} naming the key and its value
|
|
682
|
+
*/
|
|
683
|
+
function refuse_unsupported_metadata(cursor, kvd_byte_offset, kvd_byte_length, pixel_depth) {
|
|
684
|
+
if (kvd_byte_offset === 0 || kvd_byte_length === 0) {
|
|
685
|
+
// absent means the default, which is the orientation and swizzle this reader wants
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const key_values = read_key_values(cursor, kvd_byte_offset, kvd_byte_length);
|
|
690
|
+
|
|
691
|
+
const orientation = key_values.get("KTXorientation");
|
|
692
|
+
|
|
693
|
+
if (orientation !== undefined) {
|
|
694
|
+
const axes = pixel_depth > 0 ? 3 : 2;
|
|
695
|
+
const expected = SUPPORTED_ORIENTATION.slice(0, axes);
|
|
696
|
+
|
|
697
|
+
if (orientation.slice(0, axes) !== expected) {
|
|
698
|
+
throw new Error(
|
|
699
|
+
`KTX2: KTXorientation is '${orientation}', and only '${expected}' is supported —`
|
|
700
|
+
+ ` a top-left origin with rows running down, which is the arrangement`
|
|
701
|
+
+ ` queue.writeTexture takes. Flipping the payload would mean re-encoding every`
|
|
702
|
+
+ ` block, which is the encoder's job.`
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
const swizzle = key_values.get("KTXswizzle");
|
|
708
|
+
|
|
709
|
+
if (swizzle !== undefined && swizzle !== "rgba") {
|
|
710
|
+
throw new Error(
|
|
711
|
+
`KTX2: KTXswizzle is '${swizzle}', and only the identity 'rgba' is supported. Applying a`
|
|
712
|
+
+ ` swizzle means rewriting the texels, which for a block format means re-encoding them.`
|
|
713
|
+
);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* The file's key/value data, as strings.
|
|
719
|
+
*
|
|
720
|
+
* Every value KTX2 defines is a NUL-terminated string, and a value this reader does not recognise is
|
|
721
|
+
* never looked at, so decoding them all as text costs nothing and keeps the caller simple. A value
|
|
722
|
+
* that is genuinely binary decodes to nonsense and is ignored, which is what an unrecognised key
|
|
723
|
+
* gets either way.
|
|
724
|
+
*
|
|
725
|
+
* @param {ByteCursor} cursor
|
|
726
|
+
* @param {number} byte_offset
|
|
727
|
+
* @param {number} byte_length
|
|
728
|
+
* @returns {Map<string, string>}
|
|
729
|
+
* @throws {Error} for a section that runs past the end of the file, or an entry that runs past the
|
|
730
|
+
* end of the section
|
|
731
|
+
*/
|
|
732
|
+
function read_key_values(cursor, byte_offset, byte_length) {
|
|
733
|
+
if (byte_offset + byte_length > cursor.end) {
|
|
734
|
+
throw new Error(
|
|
735
|
+
`KTX2: the key/value section [${byte_offset}, ${byte_offset + byte_length}) runs past`
|
|
736
|
+
+ ` the end of a ${cursor.end} byte file`
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
const section = cursor.sub_cursor(byte_offset, byte_length);
|
|
741
|
+
|
|
742
|
+
const result = new Map();
|
|
743
|
+
|
|
744
|
+
// four bytes is the smallest an entry's length field can be; a shorter tail is the padding of
|
|
745
|
+
// the last entry rather than the start of another one
|
|
746
|
+
while (section.remaining >= 4) {
|
|
747
|
+
const entry_byte_length = section.u32();
|
|
748
|
+
|
|
749
|
+
const entry_start = section.position;
|
|
750
|
+
|
|
751
|
+
if (entry_byte_length > section.remaining) {
|
|
752
|
+
throw new Error(
|
|
753
|
+
`KTX2: a key/value entry declares ${entry_byte_length} bytes with only`
|
|
754
|
+
+ ` ${section.remaining} left in the section`
|
|
755
|
+
);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
// the key is NUL-terminated and the value is whatever follows it, to the entry's end
|
|
759
|
+
const key = section.utf8_string();
|
|
760
|
+
|
|
761
|
+
const key_bytes = section.position - entry_start;
|
|
762
|
+
|
|
763
|
+
if (key_bytes > entry_byte_length) {
|
|
764
|
+
throw new Error(
|
|
765
|
+
`KTX2: the key/value entry '${key}' has no NUL terminator inside its own`
|
|
766
|
+
+ ` ${entry_byte_length} bytes`
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
const value_bytes = section.view_bytes(entry_byte_length - key_bytes);
|
|
771
|
+
|
|
772
|
+
result.set(key, decode_key_value(value_bytes));
|
|
773
|
+
|
|
774
|
+
// entries are padded to a four byte boundary, and the padding is not part of the value
|
|
775
|
+
section.skip(Math.min((4 - (entry_byte_length % 4)) % 4, section.remaining));
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
return result;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* @param {Uint8Array} bytes
|
|
783
|
+
* @returns {string} the value, without the NUL that terminates it
|
|
784
|
+
*/
|
|
785
|
+
function decode_key_value(bytes) {
|
|
786
|
+
const end = bytes.indexOf(0);
|
|
787
|
+
|
|
788
|
+
return utf8_decode(bytes, 0, end === -1 ? bytes.length : end);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* @typedef {Object} Ktx2LevelIndexEntry
|
|
793
|
+
* @property {number} byte_offset where this level's bytes are, from the start of the file
|
|
794
|
+
* @property {number} byte_length how many of them there are, supercompressed
|
|
795
|
+
* @property {number} uncompressed_byte_length how many there are after inflation
|
|
796
|
+
*/
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* @param {ByteCursor} cursor positioned at the start of the level index
|
|
800
|
+
* @param {number} entry_count `levelCount`, or `1` when that is zero
|
|
801
|
+
* @returns {Ktx2LevelIndexEntry[]} index 0 first, which is the base level
|
|
802
|
+
* @throws {Error} for an index that runs past the end of the file
|
|
803
|
+
*/
|
|
804
|
+
function read_level_index(cursor, entry_count) {
|
|
805
|
+
cursor.require(entry_count * LEVEL_INDEX_ENTRY_BYTES, `level index of ${entry_count} levels`);
|
|
806
|
+
|
|
807
|
+
const entries = [];
|
|
808
|
+
|
|
809
|
+
for (let i = 0; i < entry_count; i++) {
|
|
810
|
+
entries.push({
|
|
811
|
+
byte_offset: cursor.u64(),
|
|
812
|
+
byte_length: cursor.u64(),
|
|
813
|
+
uncompressed_byte_length: cursor.u64(),
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
return entries;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* One level's texel bytes, inflated if the file supercompressed them.
|
|
822
|
+
*
|
|
823
|
+
* @param {ByteCursor} cursor
|
|
824
|
+
* @param {Ktx2LevelIndexEntry} entry
|
|
825
|
+
* @param {number} level `0` is the base
|
|
826
|
+
* @param {SupercompressionScheme|number} scheme already known to be one of the two supported ones
|
|
827
|
+
* @returns {Uint8Array} a view onto the file where the scheme is `None`, its own memory otherwise
|
|
828
|
+
* @throws {Error} naming the level, for one that runs past the end of the file or inflates to the
|
|
829
|
+
* wrong size
|
|
830
|
+
*/
|
|
831
|
+
function read_level(cursor, entry, level, scheme) {
|
|
832
|
+
const { byte_offset, byte_length, uncompressed_byte_length } = entry;
|
|
833
|
+
|
|
834
|
+
/*
|
|
835
|
+
Checked here rather than left to the cursor because the cursor's message names a byte range and
|
|
836
|
+
this one names the level, which is the difference between a file that is truncated and a level
|
|
837
|
+
index that points somewhere it should not.
|
|
838
|
+
*/
|
|
839
|
+
if (byte_offset + byte_length > cursor.end) {
|
|
840
|
+
throw new Error(
|
|
841
|
+
`KTX2: level ${level} claims bytes [${byte_offset}, ${byte_offset + byte_length}) of a`
|
|
842
|
+
+ ` ${cursor.end} byte file, which is past its end`
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
cursor.seek(byte_offset);
|
|
847
|
+
|
|
848
|
+
const stored = cursor.view_bytes(byte_length);
|
|
849
|
+
|
|
850
|
+
if (scheme === SupercompressionScheme.None || scheme === SupercompressionScheme.BasisLZ) {
|
|
851
|
+
/*
|
|
852
|
+
A view, not a copy. The level data is nearly the whole of a texture file, and `writeTexture`
|
|
853
|
+
takes a view as readily as it takes its own array — copying here would double the peak
|
|
854
|
+
memory of every texture load to no end.
|
|
855
|
+
|
|
856
|
+
BasisLZ belongs on this side of the branch even though it is nominally a supercompression
|
|
857
|
+
scheme: its level bytes are the ETC1S slices themselves, entropy-coded against codebooks in
|
|
858
|
+
the global data. Undoing that is the transcoder's, and there is nothing to unwrap here —
|
|
859
|
+
which is also why such a level declares an `uncompressedByteLength` of zero.
|
|
860
|
+
*/
|
|
861
|
+
return stored;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
/*
|
|
865
|
+
`pako.inflate` rather than `png_inflate`: what that function adds over this call is PNG's two
|
|
866
|
+
peculiarities — a stream split across IDAT chunks, and a fallback that abandons the adler32
|
|
867
|
+
check because real encoders get it wrong. A KTX2 level is one stream, and a texture payload
|
|
868
|
+
whose checksum fails should fail rather than decode to blocks nobody verified.
|
|
869
|
+
|
|
870
|
+
What it also adds, and what this has to do for itself: **pako throws a bare string.** Not an
|
|
871
|
+
Error — `"incorrect header check"`, with no stack, no `.message`, and nothing saying which file
|
|
872
|
+
or which level it came from. Letting that escape would make the one path this reader adds beyond
|
|
873
|
+
the plan the one path that does not refuse by name.
|
|
874
|
+
*/
|
|
875
|
+
let inflated;
|
|
876
|
+
|
|
877
|
+
if (scheme === SupercompressionScheme.Zstandard) {
|
|
878
|
+
/*
|
|
879
|
+
The level declares what it inflates to, so the frame's own declared size is checked against
|
|
880
|
+
it rather than trusted — a Zstandard frame carries its content size and a KTX2 level carries
|
|
881
|
+
it too, and a file where the two disagree is one where something has been re-wrapped without
|
|
882
|
+
being re-indexed.
|
|
883
|
+
*/
|
|
884
|
+
try {
|
|
885
|
+
inflated = zstd_decompress(stored, uncompressed_byte_length);
|
|
886
|
+
} catch (error) {
|
|
887
|
+
throw new Error(
|
|
888
|
+
`KTX2: level ${level} is not a readable Zstandard frame: ${error?.message ?? error}`
|
|
889
|
+
);
|
|
890
|
+
}
|
|
891
|
+
} else {
|
|
892
|
+
try {
|
|
893
|
+
inflated = pako.inflate(stored);
|
|
894
|
+
} catch (error) {
|
|
895
|
+
throw new Error(
|
|
896
|
+
`KTX2: level ${level} is not a readable zlib stream: ${error?.message ?? error}`
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
if (uncompressed_byte_length !== inflated.byteLength) {
|
|
902
|
+
throw new Error(
|
|
903
|
+
`KTX2: level ${level} declares an uncompressedByteLength of ${uncompressed_byte_length}`
|
|
904
|
+
+ ` but inflates to ${inflated.byteLength} bytes`
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
return inflated;
|
|
909
|
+
}
|