@woosh/meep-engine 3.79.0 → 3.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -3
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts +45 -0
- package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts.map +1 -0
- package/src/format/image/webp/vp8/VP8BoolDecoder.js +137 -0
- package/src/format/image/webp/vp8/vp8_decode.d.ts +21 -0
- package/src/format/image/webp/vp8/vp8_decode.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_decode.js +756 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.d.ts +31 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.js +189 -0
- package/src/format/image/webp/vp8/vp8_predict.d.ts +48 -0
- package/src/format/image/webp/vp8/vp8_predict.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_predict.js +290 -0
- package/src/format/image/webp/vp8/vp8_tables.d.ts +34 -0
- package/src/format/image/webp/vp8/vp8_tables.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_tables.js +350 -0
- package/src/format/image/webp/vp8/vp8_transform.d.ts +22 -0
- package/src/format/image/webp/vp8/vp8_transform.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_transform.js +114 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts +23 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.js +133 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.d.ts +47 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.js +84 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts +27 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.js +184 -0
- package/src/format/image/webp/vp8l/vp8l_decode.d.ts +28 -0
- package/src/format/image/webp/vp8l/vp8l_decode.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_decode.js +261 -0
- package/src/format/image/webp/vp8l/vp8l_distance.d.ts +22 -0
- package/src/format/image/webp/vp8l/vp8l_distance.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_distance.js +62 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts +50 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.js +267 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts +14 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.js +99 -0
- package/src/format/image/webp/webp_decode.d.ts +23 -0
- package/src/format/image/webp/webp_decode.d.ts.map +1 -0
- package/src/format/image/webp/webp_decode.js +179 -0
- package/src/format/image/webp/webp_decode_alpha.d.ts +18 -0
- package/src/format/image/webp/webp_decode_alpha.d.ts.map +1 -0
- package/src/format/image/webp/webp_decode_alpha.js +84 -0
- package/src/format/texture/{basis → astc}/astc_block.d.ts +41 -0
- package/src/format/texture/astc/astc_block.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_block.js +284 -164
- package/src/format/texture/astc/astc_decode_block.d.ts +68 -0
- package/src/format/texture/astc/astc_decode_block.d.ts.map +1 -0
- package/src/format/texture/astc/astc_decode_block.js +1119 -0
- package/src/format/texture/astc/astc_encode_block_4x4.d.ts +32 -0
- package/src/format/texture/astc/astc_encode_block_4x4.d.ts.map +1 -0
- package/src/format/texture/astc/astc_encode_block_4x4.js +181 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts +32 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts.map +1 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.js +337 -0
- package/src/format/texture/astc/astc_integer_sequence.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_integer_sequence.js +251 -251
- package/src/format/texture/astc/astc_partition.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_partition.js +199 -199
- package/src/format/texture/basis/transcode/etc1s_to_astc.js +329 -329
- package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -1
- package/src/format/texture/basis/transcode/etc1s_to_etc2.js +305 -332
- package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -1
- package/src/format/texture/basis/transcode/fit_endpoints.js +14 -27
- package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts +66 -0
- package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_bc7_tables.js +148 -0
- package/src/format/texture/basis/uastc/uastc_decode_block.js +463 -463
- package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -421
- package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +1 -6
- package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -1
- package/src/format/texture/basis/uastc/uastc_to_bc5.js +48 -115
- package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -1
- package/src/format/texture/basis/uastc/uastc_to_bc7.js +604 -602
- package/src/format/texture/bc/bc1_decode_block.d.ts +19 -0
- package/src/format/texture/bc/bc1_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc1_decode_block.js +22 -0
- package/src/format/texture/bc/bc1_decode_colors.d.ts +27 -0
- package/src/format/texture/bc/bc1_decode_colors.d.ts.map +1 -0
- package/src/format/texture/bc/bc1_decode_colors.js +100 -0
- package/src/format/texture/bc/bc2_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc2_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc2_decode_block.js +28 -0
- package/src/format/texture/bc/bc3_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc3_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc3_decode_block.js +23 -0
- package/src/format/texture/bc/bc4_decode_channel.d.ts +56 -0
- package/src/format/texture/bc/bc4_decode_channel.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_decode_channel.js +138 -0
- package/src/format/texture/bc/bc4_encode_block.d.ts +43 -0
- package/src/format/texture/bc/bc4_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_encode_block.js +324 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.js +27 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.d.ts +17 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.js +26 -0
- package/src/format/texture/bc/bc5_encode_block.d.ts +25 -0
- package/src/format/texture/bc/bc5_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_encode_block.js +34 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.js +27 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.d.ts +17 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.js +26 -0
- package/src/format/texture/bc/bc6h_decode_texels.d.ts +30 -0
- package/src/format/texture/bc/bc6h_decode_texels.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_decode_texels.js +430 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts +20 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.js +23 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.js +21 -0
- package/src/format/texture/bc/bc7_decode_block.d.ts +30 -0
- package/src/format/texture/bc/bc7_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc7_decode_block.js +232 -0
- package/src/format/texture/bc/bc7_encode_block.d.ts +39 -0
- package/src/format/texture/bc/bc7_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc7_encode_block.js +423 -0
- package/src/format/texture/bc/bc7_tables.d.ts +126 -0
- package/src/format/texture/bc/bc7_tables.d.ts.map +1 -0
- package/src/format/texture/{basis/uastc → bc}/bc7_tables.js +225 -276
- package/src/format/texture/bc/bc7_write_block.d.ts +65 -0
- package/src/format/texture/bc/bc7_write_block.d.ts.map +1 -0
- package/src/format/texture/{basis/uastc → bc}/bc7_write_block.js +185 -227
- package/src/format/texture/etc/eac_decode_channel.d.ts +50 -0
- package/src/format/texture/etc/eac_decode_channel.d.ts.map +1 -0
- package/src/format/texture/etc/eac_decode_channel.js +142 -0
- package/src/format/texture/etc/eac_modifiers.d.ts +15 -0
- package/src/format/texture/etc/eac_modifiers.d.ts.map +1 -0
- package/src/format/texture/etc/eac_modifiers.js +31 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts +21 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.js +30 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts +20 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.js +29 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts +19 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.js +28 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts +19 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.js +28 -0
- package/src/format/texture/etc/etc2_decode_color.d.ts +25 -0
- package/src/format/texture/etc/etc2_decode_color.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_decode_color.js +370 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts +18 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.js +21 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts +21 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.js +24 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts +18 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.js +24 -0
- package/src/format/texture/fit/fit_line.d.ts +23 -0
- package/src/format/texture/fit/fit_line.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line.js +123 -0
- package/src/format/texture/fit/fit_line_refine.d.ts +21 -0
- package/src/format/texture/fit/fit_line_refine.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line_refine.js +69 -0
- package/src/format/texture/fit/fit_line_solve.d.ts +23 -0
- package/src/format/texture/fit/fit_line_solve.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line_solve.js +71 -0
- package/src/format/texture/texel_decode_image.d.ts +44 -0
- package/src/format/texture/texel_decode_image.d.ts.map +1 -0
- package/src/format/texture/texel_decode_image.js +251 -0
- package/src/format/texture/texel_encode_image.d.ts +77 -0
- package/src/format/texture/texel_encode_image.d.ts.map +1 -0
- package/src/format/texture/texel_encode_image.js +187 -0
- package/src/shade/renderer/ShadeIndirectLightingMode.js +2 -0
- package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +1 -0
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +102 -28
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts +19 -0
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.js +60 -0
- package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_write.js +7 -31
- package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts +23 -0
- package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_write_collection.js +36 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts +13 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.js +39 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +3 -2
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +6 -21
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts +42 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.js +612 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +5 -4
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +8 -25
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +3 -19
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +14 -4
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +65 -54
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +2 -2
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +5 -22
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +1 -1
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts +27 -0
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.js +147 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +3 -4
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +6 -13
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts +13 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.js +66 -0
- package/src/shade/renderer/texture/encode/texture_encode.d.ts +28 -1
- package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/texture_encode.js +202 -168
- package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +13 -1
- package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/texture_encode_shader.js +146 -108
- package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts +20 -0
- package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_formats_to_build.js +98 -0
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +4 -23
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts +53 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.js +76 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts +40 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.js +43 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts +17 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.js +29 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.js +91 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts +32 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.js +216 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts +30 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.js +134 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.js +33 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.js +71 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts +20 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.js +57 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.js +111 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.js +33 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.js +128 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.js +169 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.js +119 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.js +19 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts +24 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.js +41 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts +24 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.js +140 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.js +35 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts +19 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.js +27 -0
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_catmull_rom.js +4 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts +13 -0
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js +54 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mitchell.js +4 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js +9 -13
- package/src/shade/renderer/texture/texture_block_encodings.d.ts +33 -0
- package/src/shade/renderer/texture/texture_block_encodings.d.ts.map +1 -0
- package/src/shade/renderer/texture/texture_block_encodings.js +89 -0
- package/src/format/texture/basis/astc_block.d.ts.map +0 -1
- package/src/format/texture/basis/astc_integer_sequence.d.ts.map +0 -1
- package/src/format/texture/basis/astc_partition.d.ts.map +0 -1
- package/src/format/texture/basis/uastc/bc7_tables.d.ts +0 -111
- package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +0 -1
- package/src/format/texture/basis/uastc/bc7_write_block.d.ts +0 -124
- package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +0 -1
- /package/src/format/texture/{basis → astc}/astc_integer_sequence.d.ts +0 -0
- /package/src/format/texture/{basis → astc}/astc_partition.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texels_rgba8unorm_to_f32.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.js"],"names":[],"mappings":"AAWA;;;;;;;;;;GAUG;AACH,iDAPW,YAAY,SACZ,UAAU,UACV,MAAM,QAShB;AA1BD;;;;GAIG;AACH,gCAFU,YAAY,CAEiC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a shader reads from each byte of an `rgba8unorm` texel: `byte / 255`, the nearest f32.
|
|
3
|
+
* @readonly
|
|
4
|
+
* @type {Float32Array}
|
|
5
|
+
*/
|
|
6
|
+
export const RGBA8UNORM_TO_F32 = new Float32Array(256);
|
|
7
|
+
|
|
8
|
+
for (let byte = 0; byte < 256; byte++) {
|
|
9
|
+
RGBA8UNORM_TO_F32[byte] = byte / 255;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Read `rgba8unorm` texels as a shader reads them through a view of that format: each channel
|
|
14
|
+
* `byte / 255`, the nearest f32.
|
|
15
|
+
*
|
|
16
|
+
* @param {Float32Array} output written from index 0
|
|
17
|
+
* @param {Uint8Array} input
|
|
18
|
+
* @param {number} length values to convert, four a texel
|
|
19
|
+
*
|
|
20
|
+
* @author Alex Goldring
|
|
21
|
+
* @copyright Company Named Limited (c) 2026
|
|
22
|
+
*/
|
|
23
|
+
export function texels_rgba8unorm_to_f32(output, input, length) {
|
|
24
|
+
for (let i = 0; i < length; i++) {
|
|
25
|
+
output[i] = RGBA8UNORM_TO_F32[input[i]];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -30,9 +30,9 @@ fn main(
|
|
|
30
30
|
let src_center = uv_to_texel_coordinate(uv, source_dim);
|
|
31
31
|
|
|
32
32
|
// 3. Determine Kernel Radius
|
|
33
|
-
//
|
|
33
|
+
// Catmull-Rom filter is defined on range [-2, 2], in output texels.
|
|
34
34
|
// We must stretch this range by the stride to cover the correct area.
|
|
35
|
-
let radius =
|
|
35
|
+
let radius = 2.0 * stride;
|
|
36
36
|
|
|
37
37
|
// 4. Calculate Bounds (Clamped to texture dimensions)
|
|
38
38
|
// We clamp the loop range here so we don't need 'if' checks inside the loop.
|
|
@@ -51,7 +51,7 @@ fn main(
|
|
|
51
51
|
|
|
52
52
|
let dy_norm = dy / stride.y;
|
|
53
53
|
|
|
54
|
-
let weight_y = filter_catmullrom(dy_norm
|
|
54
|
+
let weight_y = filter_catmullrom(dy_norm);
|
|
55
55
|
|
|
56
56
|
for (var x = start.x; x <= end.x; x++) {
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ fn main(
|
|
|
59
59
|
|
|
60
60
|
let dx_norm = dx / stride.x;
|
|
61
61
|
|
|
62
|
-
let weight_x = filter_catmullrom(dx_norm
|
|
62
|
+
let weight_x = filter_catmullrom(dx_norm);
|
|
63
63
|
|
|
64
64
|
let weight = (weight_x * weight_y);
|
|
65
65
|
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The linear reduction: each output texel is the mean of the source over the texel's footprint.
|
|
3
|
+
* Along an axis, output texel `i` of `D` covers `[i * S / D, (i + 1) * S / D)` of a source `S` texels
|
|
4
|
+
* long, and each source texel weighs the share of that footprint it covers; the 2D weight is the
|
|
5
|
+
* product of the two axes'. A source twice the size gives the average of a 2x2 block; an odd one,
|
|
6
|
+
* three texels a side with the outer two shared with the neighbours, so every source texel counts
|
|
7
|
+
* toward the level below and the level keeps its mean.
|
|
8
|
+
*
|
|
9
|
+
* Coverage is counted exactly, in integers, in units of `1 / D` of a source texel; each axis weight
|
|
10
|
+
* is `covered / S`, rounded once to f32. The weighted sum is divided by the sum of the weights.
|
|
11
|
+
*
|
|
12
|
+
* @type {CodeChunk}
|
|
13
|
+
*/
|
|
1
14
|
export const mipmap_shader_code_linear: CodeChunk;
|
|
2
15
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
3
16
|
//# sourceMappingURL=mipmap_shader_code_linear.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mipmap_shader_code_linear.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mipmap_shader_code_linear.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,wCAFU,SAAS,CAqD+B;0BAnExB,uCAAuC"}
|
|
@@ -1,18 +1,68 @@
|
|
|
1
1
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { MIP_SHADER_UNIFORM_STRUCT } from "../MIP_SHADER_UNIFORM_STRUCT.js";
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The linear reduction: each output texel is the mean of the source over the texel's footprint.
|
|
6
|
+
* Along an axis, output texel `i` of `D` covers `[i * S / D, (i + 1) * S / D)` of a source `S` texels
|
|
7
|
+
* long, and each source texel weighs the share of that footprint it covers; the 2D weight is the
|
|
8
|
+
* product of the two axes'. A source twice the size gives the average of a 2x2 block; an odd one,
|
|
9
|
+
* three texels a side with the outer two shared with the neighbours, so every source texel counts
|
|
10
|
+
* toward the level below and the level keeps its mean.
|
|
11
|
+
*
|
|
12
|
+
* Coverage is counted exactly, in integers, in units of `1 / D` of a source texel; each axis weight
|
|
13
|
+
* is `covered / S`, rounded once to f32. The weighted sum is divided by the sum of the weights.
|
|
14
|
+
*
|
|
15
|
+
* @type {CodeChunk}
|
|
16
|
+
*/
|
|
3
17
|
export const mipmap_shader_code_linear = CodeChunk.from(
|
|
4
18
|
//language=WGSL
|
|
5
19
|
`
|
|
6
|
-
@group(0) @binding(0) var imgSampler : sampler;
|
|
7
20
|
@group(0) @binding(1) var img : texture_2d<f32>;
|
|
21
|
+
@group(0) @binding(2) var<uniform> params: ${MIP_SHADER_UNIFORM_STRUCT.wgsl_ref};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The share of a footprint [lo, hi) that source texel k covers. lo and hi are in units of
|
|
25
|
+
* 1 / output_size of a source texel, so the footprint is source_size of them long.
|
|
26
|
+
*/
|
|
27
|
+
fn mip_box_weight(k: u32, lo: u32, hi: u32, output_size: u32, source_size: u32) -> f32 {
|
|
28
|
+
let covered = min(hi, (k + 1u) * output_size) - max(lo, k * output_size);
|
|
29
|
+
|
|
30
|
+
return f32(covered) / f32(source_size);
|
|
31
|
+
}
|
|
8
32
|
|
|
9
33
|
@fragment
|
|
10
34
|
fn main(
|
|
11
35
|
@location(0) uv : vec2<f32>
|
|
12
36
|
) -> @location(0) vec4<f32> {
|
|
37
|
+
let source_dim = textureDimensions(img, 0);
|
|
38
|
+
let output_dim = params.output_resolution;
|
|
13
39
|
|
|
14
|
-
|
|
40
|
+
let texel = vec2<u32>(uv * vec2<f32>(output_dim));
|
|
15
41
|
|
|
16
|
-
|
|
17
|
-
|
|
42
|
+
// the footprint, in units of 1 / output_dim of a source texel
|
|
43
|
+
let lo = texel * source_dim;
|
|
44
|
+
let hi = lo + source_dim;
|
|
45
|
+
|
|
46
|
+
// the source texels it touches
|
|
47
|
+
let first = lo / output_dim;
|
|
48
|
+
let last = (hi - 1u) / output_dim;
|
|
49
|
+
|
|
50
|
+
var result = vec4<f32>(0.0);
|
|
51
|
+
var weight_sum = 0.0;
|
|
18
52
|
|
|
53
|
+
for (var y = first.y; y <= last.y; y++) {
|
|
54
|
+
let weight_y = mip_box_weight(y, lo.y, hi.y, output_dim.y, source_dim.y);
|
|
55
|
+
|
|
56
|
+
for (var x = first.x; x <= last.x; x++) {
|
|
57
|
+
let weight_x = mip_box_weight(x, lo.x, hi.x, output_dim.x, source_dim.x);
|
|
58
|
+
|
|
59
|
+
let weight = weight_x * weight_y;
|
|
60
|
+
|
|
61
|
+
result += textureLoad(img, vec2u(x, y), 0) * weight;
|
|
62
|
+
weight_sum += weight;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return result / weight_sum;
|
|
67
|
+
}
|
|
68
|
+
`, [MIP_SHADER_UNIFORM_STRUCT.declaration_chunk]);
|
|
@@ -26,9 +26,9 @@ fn main(
|
|
|
26
26
|
let src_center = uv_to_texel_coordinate(uv, source_dim);
|
|
27
27
|
|
|
28
28
|
// 3. Determine Kernel Radius
|
|
29
|
-
// Mitchell filter is defined on range [-2, 2].
|
|
29
|
+
// Mitchell filter is defined on range [-2, 2], in output texels.
|
|
30
30
|
// We must stretch this range by the stride to cover the correct area.
|
|
31
|
-
let radius =
|
|
31
|
+
let radius = 2.0 * stride;
|
|
32
32
|
|
|
33
33
|
// 4. Calculate Bounds (Clamped to texture dimensions)
|
|
34
34
|
// We clamp the loop range here so we don't need 'if' checks inside the loop.
|
|
@@ -47,7 +47,7 @@ fn main(
|
|
|
47
47
|
|
|
48
48
|
let dy_norm = dy / stride.y;
|
|
49
49
|
|
|
50
|
-
let weight_y = filter_mitchell(dy_norm
|
|
50
|
+
let weight_y = filter_mitchell(dy_norm);
|
|
51
51
|
|
|
52
52
|
for (var x = start.x; x <= end.x; x++) {
|
|
53
53
|
|
|
@@ -55,7 +55,7 @@ fn main(
|
|
|
55
55
|
|
|
56
56
|
let dx_norm = dx / stride.x;
|
|
57
57
|
|
|
58
|
-
let weight_x = filter_mitchell(dx_norm
|
|
58
|
+
let weight_x = filter_mitchell(dx_norm);
|
|
59
59
|
|
|
60
60
|
let weight = (weight_x * weight_y);
|
|
61
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mipmap_shader_code_mks.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js"],"names":[],"mappings":"AAgCA;;;;GAIG;AACH,qCAFU,SAAS,
|
|
1
|
+
{"version":3,"file":"mipmap_shader_code_mks.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js"],"names":[],"mappings":"AAgCA;;;;GAIG;AACH,qCAFU,SAAS,CAqEZ;0BAvGmB,uCAAuC"}
|
|
@@ -51,15 +51,12 @@ fn main(
|
|
|
51
51
|
let stride = max(vec2(1.0), vec2<f32>(source_dim) / vec2<f32>(output_dim));
|
|
52
52
|
|
|
53
53
|
let src_center = uv_to_texel_coordinate(uv, source_dim);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
radius.y = ceil(3.5 * stride.y);
|
|
61
|
-
}
|
|
62
|
-
|
|
54
|
+
|
|
55
|
+
// The kernel is non-zero on (-4.5, 4.5), in output texels
|
|
56
|
+
const SUPPORT_RADIUS = 4.5;
|
|
57
|
+
|
|
58
|
+
let radius = SUPPORT_RADIUS * stride;
|
|
59
|
+
|
|
63
60
|
let min_bound = vec2(0.0);
|
|
64
61
|
let max_bound = vec2<f32>(source_dim) - 1.0;
|
|
65
62
|
|
|
@@ -73,9 +70,8 @@ fn main(
|
|
|
73
70
|
|
|
74
71
|
let dy = abs(f32(y) - src_center.y);
|
|
75
72
|
let dy_norm = dy / stride.y;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (dy_norm >= 4.5) { continue; }
|
|
73
|
+
|
|
74
|
+
if (dy_norm >= SUPPORT_RADIUS) { continue; }
|
|
79
75
|
|
|
80
76
|
let weight_y = filter_mks_2021(dy_norm);
|
|
81
77
|
|
|
@@ -84,7 +80,7 @@ fn main(
|
|
|
84
80
|
let dx = abs(f32(x) - src_center.x);
|
|
85
81
|
let dx_norm = dx / stride.x;
|
|
86
82
|
|
|
87
|
-
if (dx_norm >=
|
|
83
|
+
if (dx_norm >= SUPPORT_RADIUS) { continue; }
|
|
88
84
|
|
|
89
85
|
let weight_x = filter_mks_2021(dx_norm);
|
|
90
86
|
let weight = (weight_x * weight_y);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A texture in each block format it is built in: what a device that can sample the format is handed instead of
|
|
3
|
+
* the texture's uncompressed fallback.
|
|
4
|
+
*
|
|
5
|
+
* - **Which formats** is {@link texture_formats_to_build} for the role, less what cannot be had: a format nothing
|
|
6
|
+
* here encodes, and every format if the base level is not whole blocks (a device makes no block texture of it).
|
|
7
|
+
* - **Which channels.** For a role whose alpha the renderer reads, all four, kept in every format. For any other
|
|
8
|
+
* role alpha is not read here either: every block is fitted to the colour alone ({@link texel_encode_image_rgb}),
|
|
9
|
+
* and what it decodes to in alpha is whatever served the colour.
|
|
10
|
+
* - **Which levels** is the texture's own rule: when it is to have its chain generated
|
|
11
|
+
* ({@link ShadeTextureFlags.GenerateMipMaps}), the chain the device would generate from the base level with the
|
|
12
|
+
* texture's filter ({@link mipmap_chain_cpu}); otherwise the levels it brings, as they are.
|
|
13
|
+
*
|
|
14
|
+
* The pixels given are not changed.
|
|
15
|
+
*
|
|
16
|
+
* @param {Sampler2D[]} levels the texture's pixels, base first: one level, or its whole chain; eight-bit, one to
|
|
17
|
+
* four channels
|
|
18
|
+
* @param {TextureRole|number} role
|
|
19
|
+
* @param {boolean} generate whether the texture is to have its chain generated from the base level
|
|
20
|
+
* @param {TextureFilterType|number} filter what a generated chain is filtered with
|
|
21
|
+
* @param {boolean} srgb whether the pixels are sRGB-encoded, which a generated chain is filtered in linear light for
|
|
22
|
+
* @returns {[GPUTextureFormat, ShadeTexelData][]} in the order {@link texture_formats_to_build} gives; empty when
|
|
23
|
+
* no format can be had
|
|
24
|
+
*
|
|
25
|
+
* @author Alex Goldring
|
|
26
|
+
* @copyright Company Named Limited (c) 2026
|
|
27
|
+
*/
|
|
28
|
+
export function texture_block_encodings(levels: Sampler2D[], role: TextureRole | number, generate: boolean, filter: TextureFilterType | number, srgb: boolean): [GPUTextureFormat, ShadeTexelData][];
|
|
29
|
+
export type TextureFilterType = import("./TextureFilterType.js").TextureFilterType;
|
|
30
|
+
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
31
|
+
import { TextureRole } from "./TextureRole.js";
|
|
32
|
+
import { ShadeTexelData } from "./source/ShadeTexelData.js";
|
|
33
|
+
//# sourceMappingURL=texture_block_encodings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture_block_encodings.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/texture/texture_block_encodings.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,gDAZW,SAAS,EAAE,QAEX,WAAW,GAAC,MAAM,YAClB,OAAO,UACP,iBAAiB,GAAC,MAAM,QACxB,OAAO,GACL,mBAAmB,cAAc,CAAC,EAAE,CAuChD;gCA9EY,OAAO,wBAAwB,EAAE,iBAAiB;0BATrC,uDAAuD;4BAMrD,kBAAkB;+BADf,4BAA4B"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { sampler2d_to_uint8_RGBA } from "../../../engine/graphics/texture/sampler/sampler2d_to_uint8_RGBA.js";
|
|
2
|
+
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
3
|
+
import { texel_encode_image, texel_encode_image_rgb, texel_encode_image_writes } from "../../../format/texture/texel_encode_image.js";
|
|
4
|
+
import { gpu_texture_format_info } from "../../descriptor/texture/format/gpu_texture_format_info.js";
|
|
5
|
+
import { texture_formats_to_build } from "./format/texture_formats_to_build.js";
|
|
6
|
+
import { mipmap_chain_cpu } from "./mipmaps/cpu/mipmap_chain_cpu.js";
|
|
7
|
+
import { ShadeTexelData } from "./source/ShadeTexelData.js";
|
|
8
|
+
import { TextureRole } from "./TextureRole.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("./TextureFilterType.js").TextureFilterType} TextureFilterType
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A copy of pixels as eight-bit RGBA, which is what the mip generator and the block encoders read: grey is grey
|
|
16
|
+
* in every colour channel, and an image without alpha is opaque.
|
|
17
|
+
*
|
|
18
|
+
* @param {Sampler2D} pixels
|
|
19
|
+
* @returns {Sampler2D} always a new sampler, so its texels are free to change
|
|
20
|
+
*/
|
|
21
|
+
function rgba8_copy(pixels) {
|
|
22
|
+
const copy = Sampler2D.uint8(4, pixels.width, pixels.height);
|
|
23
|
+
|
|
24
|
+
sampler2d_to_uint8_RGBA(copy, pixels);
|
|
25
|
+
|
|
26
|
+
return copy;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A texture in each block format it is built in: what a device that can sample the format is handed instead of
|
|
31
|
+
* the texture's uncompressed fallback.
|
|
32
|
+
*
|
|
33
|
+
* - **Which formats** is {@link texture_formats_to_build} for the role, less what cannot be had: a format nothing
|
|
34
|
+
* here encodes, and every format if the base level is not whole blocks (a device makes no block texture of it).
|
|
35
|
+
* - **Which channels.** For a role whose alpha the renderer reads, all four, kept in every format. For any other
|
|
36
|
+
* role alpha is not read here either: every block is fitted to the colour alone ({@link texel_encode_image_rgb}),
|
|
37
|
+
* and what it decodes to in alpha is whatever served the colour.
|
|
38
|
+
* - **Which levels** is the texture's own rule: when it is to have its chain generated
|
|
39
|
+
* ({@link ShadeTextureFlags.GenerateMipMaps}), the chain the device would generate from the base level with the
|
|
40
|
+
* texture's filter ({@link mipmap_chain_cpu}); otherwise the levels it brings, as they are.
|
|
41
|
+
*
|
|
42
|
+
* The pixels given are not changed.
|
|
43
|
+
*
|
|
44
|
+
* @param {Sampler2D[]} levels the texture's pixels, base first: one level, or its whole chain; eight-bit, one to
|
|
45
|
+
* four channels
|
|
46
|
+
* @param {TextureRole|number} role
|
|
47
|
+
* @param {boolean} generate whether the texture is to have its chain generated from the base level
|
|
48
|
+
* @param {TextureFilterType|number} filter what a generated chain is filtered with
|
|
49
|
+
* @param {boolean} srgb whether the pixels are sRGB-encoded, which a generated chain is filtered in linear light for
|
|
50
|
+
* @returns {[GPUTextureFormat, ShadeTexelData][]} in the order {@link texture_formats_to_build} gives; empty when
|
|
51
|
+
* no format can be had
|
|
52
|
+
*
|
|
53
|
+
* @author Alex Goldring
|
|
54
|
+
* @copyright Company Named Limited (c) 2026
|
|
55
|
+
*/
|
|
56
|
+
export function texture_block_encodings(levels, role, generate, filter, srgb) {
|
|
57
|
+
const base = levels[0];
|
|
58
|
+
|
|
59
|
+
const formats = texture_formats_to_build(role).filter(format => {
|
|
60
|
+
const info = gpu_texture_format_info(format);
|
|
61
|
+
|
|
62
|
+
return texel_encode_image_writes(format)
|
|
63
|
+
&& base.width % info.block_width === 0
|
|
64
|
+
&& base.height % info.block_height === 0;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
if (formats.length === 0) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const rgba = generate
|
|
72
|
+
? mipmap_chain_cpu(rgba8_copy(base), filter, srgb)
|
|
73
|
+
: levels.map(rgba8_copy);
|
|
74
|
+
|
|
75
|
+
const reads_alpha = role === TextureRole.Albedo;
|
|
76
|
+
|
|
77
|
+
// alpha that means nothing for the role is not read: it would only cost the colour precision
|
|
78
|
+
const encode = reads_alpha ? texel_encode_image : texel_encode_image_rgb;
|
|
79
|
+
|
|
80
|
+
const encodings = [];
|
|
81
|
+
|
|
82
|
+
for (const format of formats) {
|
|
83
|
+
const blocks = rgba.map(level => encode(format, level));
|
|
84
|
+
|
|
85
|
+
encodings.push([format, new ShadeTexelData(format, base.width, base.height, 1, blocks)]);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return encodings;
|
|
89
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"astc_block.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/basis/astc_block.js"],"names":[],"mappings":"AA4DA;;;;;;;;;;;;;GAaG;AACH,qCALW,MAAM,MACN,MAAM,UACN,MAAM,GACJ,MAAM,CAOlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,gDAJW,UAAU,WACV,UAAU,OACV,MAAM,QAoBhB;AAED;;;;;;;;;GASG;AACH,sCANW,UAAU,UACV,MAAM,aACN,UAAU,WACV,UAAU,eACV,MAAM,QAoChB;AAnKD;;;;;GAKG;AACH,+BAFU,MAAM,CAEmB;AAEnC;;;;;GAKG;AACH,iCAFU,MAAM,CAEoB;AAUpC;;;;;;;;;;;;;;GAcG;AACH;QAFiB,MAAM,GAAE,MAAM;EAK7B;AAEF;;;;;;;;;;GAUG;AACH;QAFiB,MAAM,GAAE,MAAM,EAAE;EAK/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"astc_integer_sequence.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/basis/astc_integer_sequence.js"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;GAYG;AACH,0CAHW,MAAM,GACJ,MAAM,EAAE,CAgDpB;AAED;;;;;;GAMG;AACH,2CAJW,MAAM,GACJ,MAAM,EAAE,CAiCpB;AA0CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,mDAPW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,UACtC,MAAM,EAAE,GAAC,UAAU,eACnB,MAAM,QAiDhB;AA7OD;;;;;;;;;GASG;AACH,yBAFU;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,EAAE,CAwBvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"astc_partition.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/basis/astc_partition.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,4CAVW,MAAM,KACN,MAAM,KACN,MAAM,mBACN,MAAM,GACJ,MAAM,CAiFlB;AAED;;;;;;GAMG;AACH,6CAJW,MAAM,mBACN,MAAM,GACJ,UAAU,CAYtB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iDALW,UAAU,mBACV,MAAM,GACJ;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAC,GAAC,SAAS,CAmC3D"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which of UASTC's two subsets a BC7 three-subset index belongs to, under one of the six folds.
|
|
3
|
-
*
|
|
4
|
-
* @param {number} subset BC7's, `0` to `2`
|
|
5
|
-
* @param {number} fold
|
|
6
|
-
* @returns {number} UASTC's, `0` or `1`
|
|
7
|
-
*/
|
|
8
|
-
export function bc7_fold_subset_3_to_2(subset: number, fold: number): number;
|
|
9
|
-
/**
|
|
10
|
-
* BC7's own partition and anchor tables, and how UASTC's patterns map onto them.
|
|
11
|
-
*
|
|
12
|
-
* **Two specifications meet here.** The partition and anchor tables are BC7's, transcribed from the
|
|
13
|
-
* BPTC specification; the three mapping tables are UASTC's, which name for each of its patterns the
|
|
14
|
-
* BC7 pattern that draws the same subsets and how the two number them differently.
|
|
15
|
-
*
|
|
16
|
-
* They are checked against each other by `bc7_tables.spec.js` rather than trusted: for every UASTC
|
|
17
|
-
* pattern, applying the stated relabelling to BC7's own pattern must reproduce UASTC's texel for
|
|
18
|
-
* texel. That check is what makes a transcription error here impossible to miss, and it passes for
|
|
19
|
-
* all sixty patterns.
|
|
20
|
-
*
|
|
21
|
-
* @see the BPTC specification (ARB_texture_compression_bptc), tables P2, P3, A2, A3a and A3b
|
|
22
|
-
* @see the UASTC LDR 4x4 specification, "Partition Pattern Table" sections
|
|
23
|
-
* @author Alex Goldring
|
|
24
|
-
* @copyright Company Named Limited (c) 2026
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* BC7's two-subset partitions: one subset index per texel, sixty-four patterns of sixteen.
|
|
28
|
-
*
|
|
29
|
-
* @readonly
|
|
30
|
-
* @type {Uint8Array}
|
|
31
|
-
*/
|
|
32
|
-
export const BC7_PARTITIONS_2: Uint8Array;
|
|
33
|
-
/**
|
|
34
|
-
* BC7's three-subset partitions.
|
|
35
|
-
*
|
|
36
|
-
* @readonly
|
|
37
|
-
* @type {Uint8Array}
|
|
38
|
-
*/
|
|
39
|
-
export const BC7_PARTITIONS_3: Uint8Array;
|
|
40
|
-
/**
|
|
41
|
-
* The texel whose index is stored a bit short for the second subset of a two-subset partition.
|
|
42
|
-
*
|
|
43
|
-
* Subset zero's anchor is always texel zero, so only the others are tabulated. The anchor is *not*
|
|
44
|
-
* the first texel of its subset — BC7 chose these positions for the encoder's benefit and a decoder
|
|
45
|
-
* has to read them from the table.
|
|
46
|
-
*
|
|
47
|
-
* @readonly
|
|
48
|
-
* @type {Uint8Array}
|
|
49
|
-
*/
|
|
50
|
-
export const BC7_ANCHOR_2: Uint8Array;
|
|
51
|
-
/**
|
|
52
|
-
* The same for the second subset of a three-subset partition.
|
|
53
|
-
*
|
|
54
|
-
* @readonly
|
|
55
|
-
* @type {Uint8Array}
|
|
56
|
-
*/
|
|
57
|
-
export const BC7_ANCHOR_3_SECOND: Uint8Array;
|
|
58
|
-
/**
|
|
59
|
-
* The same for the third subset of a three-subset partition.
|
|
60
|
-
*
|
|
61
|
-
* @readonly
|
|
62
|
-
* @type {Uint8Array}
|
|
63
|
-
*/
|
|
64
|
-
export const BC7_ANCHOR_3_THIRD: Uint8Array;
|
|
65
|
-
/**
|
|
66
|
-
* For each UASTC two-subset pattern, the BC7 pattern drawing the same shape.
|
|
67
|
-
*
|
|
68
|
-
* `invert` says the two number their subsets oppositely, so a UASTC subset `s` is BC7's `1 - s`.
|
|
69
|
-
*
|
|
70
|
-
* @readonly
|
|
71
|
-
* @type {{bc7: number, invert: boolean}[]}
|
|
72
|
-
*/
|
|
73
|
-
export const UASTC_TO_BC7_2: {
|
|
74
|
-
bc7: number;
|
|
75
|
-
invert: boolean;
|
|
76
|
-
}[];
|
|
77
|
-
/**
|
|
78
|
-
* For each UASTC three-subset pattern, the BC7 pattern and which relabelling of the three subsets
|
|
79
|
-
* takes UASTC's numbering to BC7's.
|
|
80
|
-
*
|
|
81
|
-
* @readonly
|
|
82
|
-
* @type {{bc7: number, permutation: number}[]}
|
|
83
|
-
*/
|
|
84
|
-
export const UASTC_TO_BC7_3: {
|
|
85
|
-
bc7: number;
|
|
86
|
-
permutation: number;
|
|
87
|
-
}[];
|
|
88
|
-
/**
|
|
89
|
-
* The relabellings {@link UASTC_TO_BC7_3} refers to: entry `p` of a row is the BC7 subset that
|
|
90
|
-
* UASTC's subset `p` becomes.
|
|
91
|
-
*
|
|
92
|
-
* @readonly
|
|
93
|
-
* @type {number[][]}
|
|
94
|
-
*/
|
|
95
|
-
export const SUBSET_PERMUTATIONS: number[][];
|
|
96
|
-
/**
|
|
97
|
-
* For each of mode 7's patterns, the BC7 *three*-subset pattern to use and the rule folding its
|
|
98
|
-
* three subsets back down to UASTC's two.
|
|
99
|
-
*
|
|
100
|
-
* Mode 7 is the odd one: two subsets in UASTC and three in BC7, which works because two of BC7's
|
|
101
|
-
* three endpoint pairs are written identically. `fold` is the rule, applied by
|
|
102
|
-
* {@link bc7_fold_subset_3_to_2}.
|
|
103
|
-
*
|
|
104
|
-
* @readonly
|
|
105
|
-
* @type {{bc7: number, fold: number}[]}
|
|
106
|
-
*/
|
|
107
|
-
export const UASTC_TO_BC7_2_VIA_3: {
|
|
108
|
-
bc7: number;
|
|
109
|
-
fold: number;
|
|
110
|
-
}[];
|
|
111
|
-
//# sourceMappingURL=bc7_tables.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bc7_tables.d.ts","sourceRoot":"","sources":["../../../../../../src/format/texture/basis/uastc/bc7_tables.js"],"names":[],"mappings":"AA2PA;;;;;;GAMG;AACH,+CAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAmBlB;AAnRD;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,+BAFU,UAAU,CAmCjB;AAEH;;;;;GAKG;AACH,+BAFU,UAAU,CAmCjB;AAEH;;;;;;;;;GASG;AACH,2BAFU,UAAU,CAMjB;AAEH;;;;;GAKG;AACH,kCAFU,UAAU,CAMjB;AAEH;;;;;GAKG;AACH,iCAFU,UAAU,CAMjB;AAEH;;;;;;;GAOG;AACH,6BAFU;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAC,EAAE,CAiCxC;AAEF;;;;;;GAMG;AACH,6BAFU;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,EAAE,CAc5C;AAEF;;;;;;GAMG;AACH,kCAFU,MAAM,EAAE,EAAE,CASlB;AAEF;;;;;;;;;;GAUG;AACH,mCAFU;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,EAAE,CAsBrC"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The eight-bit value a stored endpoint component decodes to.
|
|
3
|
-
*
|
|
4
|
-
* The parity bit, where the mode has one, sits *below* the stored bits — so a five-bit component
|
|
5
|
-
* with a parity bit is a six-bit value — and the result is then widened to eight by replicating its
|
|
6
|
-
* top bits downward.
|
|
7
|
-
*
|
|
8
|
-
* @param {number} stored
|
|
9
|
-
* @param {number} bits including the parity bit
|
|
10
|
-
* @returns {number}
|
|
11
|
-
*/
|
|
12
|
-
export function bc7_expand_endpoint(stored: number, bits: number): number;
|
|
13
|
-
/**
|
|
14
|
-
* Quantise an eight-bit value to what a mode can store, optionally forced to a parity.
|
|
15
|
-
*
|
|
16
|
-
* @param {number} value
|
|
17
|
-
* @param {number} bits including the parity bit, where there is one
|
|
18
|
-
* @param {number} parity `-1` when the mode has none
|
|
19
|
-
* @returns {number} the value including its parity bit, so `bits` wide
|
|
20
|
-
*/
|
|
21
|
-
export function bc7_quantise_endpoint(value: number, bits: number, parity: number): number;
|
|
22
|
-
/**
|
|
23
|
-
* Write one BC7 block.
|
|
24
|
-
*
|
|
25
|
-
* **One writer for every mode**, because the specification says the fields are always in the same
|
|
26
|
-
* order and only their widths change. Writing each mode out separately would be the same sequence
|
|
27
|
-
* five times with different constants, and the constants are already a table.
|
|
28
|
-
*
|
|
29
|
-
* Endpoints are ordered as the specification stores them: by channel, then by subset, then by
|
|
30
|
-
* endpoint — so red for both ends of subset 0, then both ends of subset 1, then green, and so on.
|
|
31
|
-
*
|
|
32
|
-
* @param {Uint8Array} out
|
|
33
|
-
* @param {number} byte_offset of the block
|
|
34
|
-
* @param {number} mode
|
|
35
|
-
* @param {object} block
|
|
36
|
-
* @param {number} [block.partition] index into BC7's partition table
|
|
37
|
-
* @param {number} [block.rotation]
|
|
38
|
-
* @param {Uint8Array} block.endpoints `subsets * 2 * 4` stored fields, low then high RGBA per
|
|
39
|
-
* subset — already quantised to the mode's width, with any parity bit held separately
|
|
40
|
-
* @param {Uint8Array} block.indices sixteen
|
|
41
|
-
* @param {Uint8Array} [block.secondary_indices] sixteen, for a mode with two index sets
|
|
42
|
-
* @param {Uint8Array} block.anchors one texel index per subset
|
|
43
|
-
* @param {Int8Array} [block.parity] one bit per endpoint, or per subset for a shared-parity mode
|
|
44
|
-
*
|
|
45
|
-
* @author Alex Goldring
|
|
46
|
-
* @copyright Company Named Limited (c) 2026
|
|
47
|
-
*/
|
|
48
|
-
export function bc7_write_block(out: Uint8Array, byte_offset: number, mode: number, block: {
|
|
49
|
-
partition?: number;
|
|
50
|
-
rotation?: number;
|
|
51
|
-
endpoints: Uint8Array;
|
|
52
|
-
indices: Uint8Array;
|
|
53
|
-
secondary_indices?: Uint8Array;
|
|
54
|
-
anchors: Uint8Array;
|
|
55
|
-
parity?: Int8Array;
|
|
56
|
-
}): void;
|
|
57
|
-
/**
|
|
58
|
-
* Bytes one BC7 block occupies.
|
|
59
|
-
*
|
|
60
|
-
* @readonly
|
|
61
|
-
* @type {number}
|
|
62
|
-
*/
|
|
63
|
-
export const BC7_BLOCK_BYTES: number;
|
|
64
|
-
/**
|
|
65
|
-
* What one BC7 mode stores, from the specification's mode table.
|
|
66
|
-
*
|
|
67
|
-
* The field *order* is the same for every mode — partition, rotation, index selection, colour,
|
|
68
|
-
* alpha, per-endpoint parity, shared parity, indices — so a mode is entirely described by how many
|
|
69
|
-
* bits it gives each, which is what makes one writer enough for all of them.
|
|
70
|
-
*
|
|
71
|
-
* @typedef {object} Bc7Mode
|
|
72
|
-
* @property {number} subsets
|
|
73
|
-
* @property {number} partition_bits
|
|
74
|
-
* @property {number} rotation_bits
|
|
75
|
-
* @property {number} color_bits
|
|
76
|
-
* @property {number} alpha_bits `0` where the mode has no alpha, which then decodes as opaque
|
|
77
|
-
* @property {number} endpoint_parity_bits one parity bit per endpoint, `0` or `1`
|
|
78
|
-
* @property {number} shared_parity_bits one parity bit per *subset*, shared by both its endpoints
|
|
79
|
-
* @property {number} index_bits
|
|
80
|
-
* @property {number} secondary_index_bits `0` unless the mode has a second index set
|
|
81
|
-
*/
|
|
82
|
-
/**
|
|
83
|
-
* Every BC7 mode this writes, from Table.M of the specification.
|
|
84
|
-
*
|
|
85
|
-
* Modes 0 and 4 are absent: no UASTC mode maps to either, so writing them would be code with no
|
|
86
|
-
* caller and no test.
|
|
87
|
-
*
|
|
88
|
-
* @readonly
|
|
89
|
-
* @type {Object<number, Bc7Mode>}
|
|
90
|
-
*/
|
|
91
|
-
export const BC7_MODES: {
|
|
92
|
-
[x: number]: Bc7Mode;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* What one BC7 mode stores, from the specification's mode table.
|
|
96
|
-
*
|
|
97
|
-
* The field *order* is the same for every mode — partition, rotation, index selection, colour,
|
|
98
|
-
* alpha, per-endpoint parity, shared parity, indices — so a mode is entirely described by how many
|
|
99
|
-
* bits it gives each, which is what makes one writer enough for all of them.
|
|
100
|
-
*/
|
|
101
|
-
export type Bc7Mode = {
|
|
102
|
-
subsets: number;
|
|
103
|
-
partition_bits: number;
|
|
104
|
-
rotation_bits: number;
|
|
105
|
-
color_bits: number;
|
|
106
|
-
/**
|
|
107
|
-
* `0` where the mode has no alpha, which then decodes as opaque
|
|
108
|
-
*/
|
|
109
|
-
alpha_bits: number;
|
|
110
|
-
/**
|
|
111
|
-
* one parity bit per endpoint, `0` or `1`
|
|
112
|
-
*/
|
|
113
|
-
endpoint_parity_bits: number;
|
|
114
|
-
/**
|
|
115
|
-
* one parity bit per *subset*, shared by both its endpoints
|
|
116
|
-
*/
|
|
117
|
-
shared_parity_bits: number;
|
|
118
|
-
index_bits: number;
|
|
119
|
-
/**
|
|
120
|
-
* `0` unless the mode has a second index set
|
|
121
|
-
*/
|
|
122
|
-
secondary_index_bits: number;
|
|
123
|
-
};
|
|
124
|
-
//# sourceMappingURL=bc7_write_block.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bc7_write_block.d.ts","sourceRoot":"","sources":["../../../../../../src/format/texture/basis/uastc/bc7_write_block.js"],"names":[],"mappings":"AA+DA;;;;;;;;;;GAUG;AACH,4CAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAQlB;AAED;;;;;;;GAOG;AACH,6CALW,MAAM,QACN,MAAM,UACN,MAAM,GACJ,MAAM,CAyBlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qCAhBW,UAAU,eACV,MAAM,QACN,MAAM;IAES,SAAS,GAAxB,MAAM;IACS,QAAQ,GAAvB,MAAM;IACY,SAAS,EAA3B,UAAU;IAEQ,OAAO,EAAzB,UAAU;IACS,iBAAiB,GAApC,UAAU;IACQ,OAAO,EAAzB,UAAU;IACQ,MAAM,GAAxB,SAAS;SAmEnB;AA3MD;;;;;GAKG;AACH,8BAFU,MAAM,CAEkB;AAElC;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;;GAQG;AACH;QAFiB,MAAM,GAAE,OAAO;EA2B9B;;;;;;;;;aA7CY,MAAM;oBACN,MAAM;mBACN,MAAM;gBACN,MAAM;;;;gBACN,MAAM;;;;0BACN,MAAM;;;;wBACN,MAAM;gBACN,MAAM;;;;0BACN,MAAM"}
|
|
File without changes
|
|
File without changes
|