@woosh/meep-engine 3.78.3 → 3.79.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 +80 -13
- package/editor/view/node-graph/NodeGraphView.d.ts +1 -1
- package/editor/view/node-graph/NodeGraphView.js +1 -1
- package/package.json +1 -1
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts +2 -1
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts.map +1 -1
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.js +2 -1
- package/src/core/math/snap_to_integer.d.ts +13 -0
- package/src/core/math/snap_to_integer.d.ts.map +1 -0
- package/src/core/math/snap_to_integer.js +20 -0
- package/src/core/model/node-graph/NodeGraph.d.ts +0 -1
- package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
- package/src/core/model/node-graph/NodeGraph.js +0 -1
- package/src/engine/asset/GameAssetType.d.ts +2 -0
- package/src/engine/asset/GameAssetType.js +10 -0
- package/src/engine/asset/guessAssetType.d.ts.map +1 -1
- package/src/engine/asset/guessAssetType.js +4 -0
- package/src/engine/asset/load_model_scene_bundle.d.ts +1 -1
- package/src/engine/asset/load_model_scene_bundle.js +2 -2
- package/src/engine/asset/loaders/MTFSceneBundleAssetLoader.d.ts +42 -0
- package/src/engine/asset/loaders/MTFSceneBundleAssetLoader.d.ts.map +1 -0
- package/src/engine/asset/loaders/MTFSceneBundleAssetLoader.js +83 -0
- package/src/engine/asset/loaders/MTFTextureAssetLoader.d.ts +36 -0
- package/src/engine/asset/loaders/MTFTextureAssetLoader.d.ts.map +1 -0
- package/src/engine/asset/loaders/MTFTextureAssetLoader.js +78 -0
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.d.ts +6 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +8 -2
- package/src/engine/graphics/hair/groom_bind_to_mesh.d.ts +1 -1
- package/src/engine/graphics/hair/groom_bind_to_mesh.js +1 -1
- package/src/engine/graphics/hair/groom_build_guides.d.ts +1 -1
- package/src/engine/graphics/hair/groom_build_guides.js +1 -1
- package/src/engine/graphics/impostors/voxel/README.md +11 -11
- package/src/engine/physics/cloth/collider/ClothColliderKind.js +1 -1
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +1 -1
- package/src/engine/physics/cloth/ecs/cloth_geodesic.js +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts +2 -3
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js +2 -3
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts +0 -2
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts.map +1 -1
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +0 -5
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.d.ts.map +1 -1
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.js +5 -3
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.d.ts.map +1 -1
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js +5 -3
- package/src/generation/grid/coords/grid_to_texel.d.ts +7 -1
- package/src/generation/grid/coords/grid_to_texel.d.ts.map +1 -1
- package/src/generation/grid/coords/grid_to_texel.js +11 -1
- package/src/generation/grid/coords/grid_to_texel_span.d.ts +15 -0
- package/src/generation/grid/coords/grid_to_texel_span.d.ts.map +1 -0
- package/src/generation/grid/coords/grid_to_texel_span.js +38 -0
- package/src/generation/grid/coords/texel_to_grid.d.ts +2 -1
- package/src/generation/grid/coords/texel_to_grid.d.ts.map +1 -1
- package/src/generation/grid/coords/texel_to_grid.js +6 -1
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts +32 -1
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.js +114 -9
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts +8 -0
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +91 -29
- package/src/generation/grid/layers/GridDataLayer.d.ts +21 -2
- package/src/generation/grid/layers/GridDataLayer.d.ts.map +1 -1
- package/src/generation/grid/layers/GridDataLayer.js +43 -4
- package/src/generation/placement/action/GridCellActionPlaceTags.d.ts +7 -1
- package/src/generation/placement/action/GridCellActionPlaceTags.d.ts.map +1 -1
- package/src/generation/placement/action/GridCellActionPlaceTags.js +42 -16
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts +5 -0
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts.map +1 -1
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +32 -9
- package/src/generation/rules/CellMatcherLayerBitMaskTest.d.ts.map +1 -1
- package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -2
- package/src/generation/wfc/GridWFCCompiledTileSet.d.ts +4 -2
- package/src/generation/wfc/GridWFCCompiledTileSet.d.ts.map +1 -1
- package/src/generation/wfc/GridWFCCompiledTileSet.js +2 -2
- package/src/generation/wfc/GridWFCTileSet.d.ts +16 -7
- package/src/generation/wfc/GridWFCTileSet.d.ts.map +1 -1
- package/src/generation/wfc/GridWFCTileSet.js +32 -8
- package/src/shade/playground/contact_shadows/shader_contact_lab_composite.js +2 -2
- package/src/shade/playground/particle_editor/README.md +2 -2
- package/src/shade/playground/probe_clipmap/index.html +1 -1
- package/src/shade/playground/screen_probes/README.md +5 -5
- package/src/shade/playground/screen_probes/main.js +1 -1
- package/src/shade/playground/tonemap_sdr/README.md +3 -2
- package/src/shade/playground/vgeo_scene/README.md +1 -3
- package/src/shade/playground/vgeo_scene/main.js +3 -3
- package/src/shade/renderer/Renderer.d.ts +3 -3
- package/src/shade/renderer/Renderer.js +4 -4
- package/src/shade/renderer/ShadeIndirectLightingMode.js +1 -1
- package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.d.ts +33 -0
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.d.ts.map +1 -0
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.js +196 -0
- package/src/shade/renderer/animation/SkinSerializationAdapter.d.ts +25 -0
- package/src/shade/renderer/animation/SkinSerializationAdapter.d.ts.map +1 -0
- package/src/shade/renderer/animation/SkinSerializationAdapter.js +85 -0
- package/src/shade/renderer/camera/PerspectiveCamera.js +1 -1
- package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts +11 -13
- package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/ColorGrade.js +11 -13
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.js +6 -7
- package/src/shade/renderer/deferred/tonemap/ToneMapper.d.ts +1 -1
- package/src/shade/renderer/deferred/tonemap/ToneMapper.js +1 -1
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts +6 -8
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.js +7 -10
- package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/MESH_SDF.js +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts +1 -2
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +1 -2
- package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.js +2 -1
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.js +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_cluster_graph.js +1 -1
- package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts +2 -2
- package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.js +2 -2
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts +2 -2
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js +4 -4
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.d.ts +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.js +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts +3 -3
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js +3 -3
- package/src/shade/renderer/global_illumination/brick4/README.md +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +4 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +4 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +28 -35
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +28 -35
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +21 -24
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +21 -24
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts +8 -8
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +8 -8
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.d.ts +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.js +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts +3 -5
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.js +3 -5
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.d.ts +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.js +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +2 -3
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +2 -3
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.d.ts +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.js +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts +2 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.js +2 -4
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts +2 -4
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.js +2 -4
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +13 -17
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +13 -17
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts +11 -14
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.js +11 -14
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.d.ts +2 -2
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.js +2 -2
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.d.ts +9 -9
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.js +9 -9
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +15 -18
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +16 -19
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts +10 -11
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.js +11 -12
- package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -1
- package/src/shade/renderer/hair/GPUHairSystem.js +16 -7
- package/src/shade/renderer/hair/HAIR.d.ts +5 -3
- package/src/shade/renderer/hair/HAIR.d.ts.map +1 -1
- package/src/shade/renderer/hair/HAIR.js +6 -4
- package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +9 -8
- package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -1
- package/src/shade/renderer/hair/chunk_hair_bsdf.js +10 -9
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +5 -6
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -1
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +5 -6
- package/src/shade/renderer/hair/hair_lighting.d.ts +3 -3
- package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -1
- package/src/shade/renderer/hair/hair_lighting.js +4 -5
- package/src/shade/renderer/hair/hair_scattering_lut.d.ts +5 -5
- package/src/shade/renderer/hair/hair_scattering_lut.js +5 -5
- package/src/shade/renderer/hair/hair_shadow_draw.d.ts +10 -10
- package/src/shade/renderer/hair/hair_shadow_draw.d.ts.map +1 -1
- package/src/shade/renderer/hair/hair_shadow_draw.js +21 -17
- package/src/shade/renderer/hair/shader_hair_cull.d.ts.map +1 -1
- package/src/shade/renderer/hair/shader_hair_cull.js +6 -2
- package/src/shade/renderer/hair/shader_hair_roots.d.ts +2 -2
- package/src/shade/renderer/hair/shader_hair_roots.js +2 -2
- package/src/shade/renderer/hair/shader_hair_shadow_list.d.ts +5 -4
- package/src/shade/renderer/hair/shader_hair_shadow_list.d.ts.map +1 -1
- package/src/shade/renderer/hair/shader_hair_shadow_list.js +10 -12
- package/src/shade/renderer/light/environment/DEFINES.d.ts +1 -1
- package/src/shade/renderer/light/environment/DEFINES.js +1 -1
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_blurred.js +2 -2
- package/src/shade/renderer/loader/SceneNodeSerializationAdapter.d.ts +38 -0
- package/src/shade/renderer/loader/SceneNodeSerializationAdapter.d.ts.map +1 -0
- package/src/shade/renderer/loader/SceneNodeSerializationAdapter.js +198 -0
- package/src/shade/renderer/loader/mtf/MTFTexture.d.ts +88 -0
- package/src/shade/renderer/loader/mtf/MTFTexture.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/MTFTexture.js +159 -0
- package/src/shade/renderer/loader/mtf/MTFTextureSerializationAdapter.d.ts +30 -0
- package/src/shade/renderer/loader/mtf/MTFTextureSerializationAdapter.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/MTFTextureSerializationAdapter.js +136 -0
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_MAGIC.d.ts +7 -0
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_MAGIC.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_MAGIC.js +6 -0
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.d.ts +8 -0
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.js +7 -0
- package/src/shade/renderer/loader/mtf/MTF_TEXTURE_MAGIC.d.ts +7 -0
- package/src/shade/renderer/loader/mtf/MTF_TEXTURE_MAGIC.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/MTF_TEXTURE_MAGIC.js +6 -0
- package/src/shade/renderer/loader/mtf/MTF_TEXTURE_VERSION.d.ts +7 -0
- package/src/shade/renderer/loader/mtf/MTF_TEXTURE_VERSION.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/MTF_TEXTURE_VERSION.js +6 -0
- package/src/shade/renderer/loader/mtf/load_mtf.d.ts +41 -0
- package/src/shade/renderer/loader/mtf/load_mtf.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/load_mtf.js +73 -0
- package/src/shade/renderer/loader/mtf/mtf_bundle_textures.d.ts +19 -0
- package/src/shade/renderer/loader/mtf/mtf_bundle_textures.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_bundle_textures.js +57 -0
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +9 -0
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +78 -0
- package/src/shade/renderer/loader/mtf/mtf_export.d.ts +45 -0
- package/src/shade/renderer/loader/mtf/mtf_export.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_export.js +161 -0
- package/src/shade/renderer/loader/mtf/mtf_is_texture.d.ts +9 -0
- package/src/shade/renderer/loader/mtf/mtf_is_texture.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_is_texture.js +12 -0
- package/src/shade/renderer/loader/mtf/mtf_read_collection.d.ts +24 -0
- package/src/shade/renderer/loader/mtf/mtf_read_collection.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_read_collection.js +37 -0
- package/src/shade/renderer/loader/mtf/mtf_read_scene.d.ts +27 -0
- package/src/shade/renderer/loader/mtf/mtf_read_scene.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_read_scene.js +121 -0
- package/src/shade/renderer/loader/mtf/mtf_read_textures.d.ts +18 -0
- package/src/shade/renderer/loader/mtf/mtf_read_textures.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_read_textures.js +51 -0
- package/src/shade/renderer/loader/mtf/mtf_resolve_uri.d.ts +21 -0
- package/src/shade/renderer/loader/mtf/mtf_resolve_uri.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_resolve_uri.js +98 -0
- package/src/shade/renderer/loader/mtf/mtf_serialization_registry.d.ts +25 -0
- package/src/shade/renderer/loader/mtf/mtf_serialization_registry.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_serialization_registry.js +51 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_read.d.ts +20 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_read.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_read.js +80 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_select.d.ts +24 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_select.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_select.js +42 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_write.d.ts +31 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_write.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_texture_write.js +87 -0
- package/src/shade/renderer/loader/mtf/mtf_write.d.ts +36 -0
- package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_write.js +161 -0
- package/src/shade/renderer/material/StandardShadeMaterialSerializationAdapter.d.ts +39 -0
- package/src/shade/renderer/material/StandardShadeMaterialSerializationAdapter.d.ts.map +1 -0
- package/src/shade/renderer/material/StandardShadeMaterialSerializationAdapter.js +207 -0
- package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts +1 -2
- package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts.map +1 -1
- package/src/shade/renderer/material/dispatch/MaterialDispatch.js +1 -2
- package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/material/standard/fragment_gbuffer.js +2 -1
- package/src/shade/renderer/material/util/dielectric_specular_color.d.ts +1 -1
- package/src/shade/renderer/material/util/dielectric_specular_color.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_PRESETS.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +3 -4
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +3 -4
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +1 -1
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts +1 -1
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +1 -1
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +2 -3
- package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts +1 -2
- package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.js +1 -2
- package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts +2 -3
- package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.js +2 -3
- package/src/shade/renderer/postprocess/taa/filter_blackman_harris.d.ts +1 -1
- package/src/shade/renderer/postprocess/taa/filter_blackman_harris.js +1 -1
- package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.d.ts +1 -1
- package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.js +1 -1
- package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.js +1 -1
- package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +3 -3
- package/src/shade/renderer/restir/di/ReSTIRDI.js +3 -3
- package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.d.ts +1 -1
- package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.js +1 -1
- package/src/shade/renderer/scene/optimization/source_to_sampler2d.d.ts.map +1 -1
- package/src/shade/renderer/scene/optimization/source_to_sampler2d.js +3 -1
- package/src/shade/renderer/scene/serialization/STANDARD_MATERIAL_SERIALIZED_BYTE_SIZE.d.ts +5 -5
- package/src/shade/renderer/scene/serialization/STANDARD_MATERIAL_SERIALIZED_BYTE_SIZE.js +5 -5
- package/src/shade/renderer/scene/serialization/deserialize_scene.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/deserialize_scene.js +491 -528
- package/src/shade/renderer/scene/serialization/serialize_scene.d.ts +0 -10
- package/src/shade/renderer/scene/serialization/serialize_scene.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/serialize_scene.js +15 -71
- package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.js +1 -1
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +1 -2
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +1 -2
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts +4 -5
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.js +4 -5
- package/src/shade/renderer/shader/chunk/color/grade/chunk_color_grade.js +2 -2
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts +2 -2
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.js +2 -2
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts +14 -17
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js +18 -21
- package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.js +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.js +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +3 -4
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +3 -4
- package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +1 -1
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +3 -3
- package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts +6 -8
- package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts.map +1 -1
- package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.js +8 -10
- package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts +5 -7
- package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts.map +1 -1
- package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.js +5 -7
- package/src/shade/renderer/texture/format/gpu_texture_format_without_srgb.d.ts +11 -0
- package/src/shade/renderer/texture/format/gpu_texture_format_without_srgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/gpu_texture_format_without_srgb.js +14 -0
- package/src/shade/renderer/texture/texture_role_image_quality.d.ts +10 -0
- package/src/shade/renderer/texture/texture_role_image_quality.d.ts.map +1 -0
- package/src/shade/renderer/texture/texture_role_image_quality.js +29 -0
- package/src/shade/renderer/texture/virtual/README.md +257 -257
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +2 -2
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { BinaryCollectionDeSerializer } from "../../../../engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js";
|
|
2
|
+
import { SceneBundle } from "../SceneBundle.js";
|
|
3
|
+
import { mtf_read_collection } from "./mtf_read_collection.js";
|
|
4
|
+
import {
|
|
5
|
+
MTF_CLASS_CLIP,
|
|
6
|
+
MTF_CLASS_GEOMETRY,
|
|
7
|
+
MTF_CLASS_MATERIAL,
|
|
8
|
+
MTF_CLASS_NODE,
|
|
9
|
+
MTF_CLASS_SKIN,
|
|
10
|
+
mtf_serialization_registry
|
|
11
|
+
} from "./mtf_serialization_registry.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {import("../../../../core/binary/BinaryBuffer.js").BinaryBuffer} BinaryBuffer
|
|
15
|
+
* @typedef {import("../../texture/ShadeTexture.js").ShadeTexture} ShadeTexture
|
|
16
|
+
* @typedef {import("../../material/StandardShadeMaterial.js").StandardShadeMaterial} StandardShadeMaterial
|
|
17
|
+
* @typedef {import("../../geometry/MeshletGeometry.js").MeshletGeometry} MeshletGeometry
|
|
18
|
+
* @typedef {import("../SceneNode.js").SceneNode} SceneNode
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const NO_OPTIONS = [];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} owner what names the nodes, for the refusal
|
|
25
|
+
* @param {number[]} indices
|
|
26
|
+
* @param {number} node_count
|
|
27
|
+
*/
|
|
28
|
+
function check_node_indices(owner, indices, node_count) {
|
|
29
|
+
for (let i = 0; i < indices.length; i++) {
|
|
30
|
+
const index = indices[i];
|
|
31
|
+
|
|
32
|
+
if (index >= node_count) {
|
|
33
|
+
throw new Error(`${owner} names node ${index}, and the MTF package holds ${node_count}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The second half of reading an MTF package: its materials, geometries, nodes, skins and clips, as the bundle
|
|
40
|
+
* every loader produces.
|
|
41
|
+
*
|
|
42
|
+
* A geometry or a material several nodes draw is one object in the bundle, as it is one record in the package.
|
|
43
|
+
* Nothing is built: a geometry comes back with the tree it was written with, and a clip with its curves as they
|
|
44
|
+
* were.
|
|
45
|
+
*
|
|
46
|
+
* Every refusal is a thrown error and none is an assert: a file is outside data.
|
|
47
|
+
*
|
|
48
|
+
* @param {BinaryBuffer} buffer where {@link mtf_read_textures} left it
|
|
49
|
+
* @param {ShadeTexture[]} textures one for each record {@link mtf_read_textures} returned, in that order
|
|
50
|
+
* @returns {SceneBundle}
|
|
51
|
+
* @throws {Error} if a record names something the package does not hold, a node comes before its parent, or
|
|
52
|
+
* bytes follow the last collection
|
|
53
|
+
*
|
|
54
|
+
* @author Alex Goldring
|
|
55
|
+
* @copyright Company Named Limited (c) 2026
|
|
56
|
+
*/
|
|
57
|
+
export function mtf_read_scene(buffer, textures) {
|
|
58
|
+
const deserializer = new BinaryCollectionDeSerializer();
|
|
59
|
+
|
|
60
|
+
deserializer.setRegistry(mtf_serialization_registry());
|
|
61
|
+
deserializer.setBuffer(buffer);
|
|
62
|
+
|
|
63
|
+
/** @type {StandardShadeMaterial[]} */
|
|
64
|
+
const materials = [];
|
|
65
|
+
|
|
66
|
+
/** @type {MeshletGeometry[]} */
|
|
67
|
+
const geometries = [];
|
|
68
|
+
|
|
69
|
+
/** @type {SceneNode[]} */
|
|
70
|
+
const nodes = [];
|
|
71
|
+
|
|
72
|
+
mtf_read_collection(deserializer, MTF_CLASS_MATERIAL, [textures], materials);
|
|
73
|
+
mtf_read_collection(deserializer, MTF_CLASS_GEOMETRY, NO_OPTIONS, geometries);
|
|
74
|
+
mtf_read_collection(deserializer, MTF_CLASS_NODE, [geometries, materials], nodes);
|
|
75
|
+
|
|
76
|
+
const bundle = new SceneBundle();
|
|
77
|
+
const node_count = nodes.length;
|
|
78
|
+
|
|
79
|
+
for (let i = 0; i < node_count; i++) {
|
|
80
|
+
const node = nodes[i];
|
|
81
|
+
|
|
82
|
+
// pre-order is what lets every reader of a bundle compose worlds in one forward pass
|
|
83
|
+
if (node.parent < -1 || node.parent >= i) {
|
|
84
|
+
throw new Error(`node ${i} '${node.name}' of the MTF package names parent ${node.parent}: a parent comes before its children`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
bundle.add_node(node);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const skins = bundle.skins;
|
|
91
|
+
const clips = bundle.clips;
|
|
92
|
+
|
|
93
|
+
mtf_read_collection(deserializer, MTF_CLASS_SKIN, NO_OPTIONS, skins);
|
|
94
|
+
mtf_read_collection(deserializer, MTF_CLASS_CLIP, NO_OPTIONS, clips);
|
|
95
|
+
|
|
96
|
+
for (let i = 0; i < skins.length; i++) {
|
|
97
|
+
const skin = skins[i];
|
|
98
|
+
|
|
99
|
+
check_node_indices(`skin '${skin.name}'`, skin.joints, node_count);
|
|
100
|
+
check_node_indices(`skin '${skin.name}'`, skin.meshes, node_count);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
for (let i = 0; i < clips.length; i++) {
|
|
104
|
+
const clip = clips[i];
|
|
105
|
+
const channels = clip.channels;
|
|
106
|
+
|
|
107
|
+
for (let c = 0; c < channels.length; c++) {
|
|
108
|
+
const target = channels[c].target;
|
|
109
|
+
|
|
110
|
+
if (target >= node_count) {
|
|
111
|
+
throw new Error(`clip '${clip.name}' names node ${target}, and the MTF package holds ${node_count}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (buffer.position !== buffer.capacity) {
|
|
117
|
+
throw new Error(`the MTF package holds ${buffer.capacity - buffer.position} bytes after its last collection`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return bundle;
|
|
121
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The first half of reading an MTF package: its header and its texture records.
|
|
3
|
+
*
|
|
4
|
+
* A package holds no texels, so between this and {@link mtf_read_scene} somebody fetches them: a record says
|
|
5
|
+
* which encodings exist and where, the caller picks one for its device and makes a texture of what arrives, and
|
|
6
|
+
* the second half is given those textures in the order of these records.
|
|
7
|
+
*
|
|
8
|
+
* @param {BinaryBuffer} buffer at the start of a package; left at the start of what {@link mtf_read_scene} reads
|
|
9
|
+
* @returns {MTFTexture[]} in the order materials name them by
|
|
10
|
+
* @throws {Error} if the bytes are not a package, or are of a version newer than {@link MTF_PACKAGE_VERSION}
|
|
11
|
+
*
|
|
12
|
+
* @author Alex Goldring
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
|
+
*/
|
|
15
|
+
export function mtf_read_textures(buffer: BinaryBuffer): MTFTexture[];
|
|
16
|
+
export type BinaryBuffer = import("../../../../core/binary/BinaryBuffer.js").BinaryBuffer;
|
|
17
|
+
export type MTFTexture = import("./MTFTexture.js").MTFTexture;
|
|
18
|
+
//# sourceMappingURL=mtf_read_textures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mtf_read_textures.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_read_textures.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;GAaG;AACH,0CAPW,YAAY,GACV,UAAU,EAAE,CA6BxB;2BA3CY,OAAO,yCAAyC,EAAE,YAAY;yBAC9D,OAAO,iBAAiB,EAAE,UAAU"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BinaryCollectionDeSerializer } from "../../../../engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js";
|
|
2
|
+
import { MTF_PACKAGE_MAGIC } from "./MTF_PACKAGE_MAGIC.js";
|
|
3
|
+
import { MTF_PACKAGE_VERSION } from "./MTF_PACKAGE_VERSION.js";
|
|
4
|
+
import { mtf_read_collection } from "./mtf_read_collection.js";
|
|
5
|
+
import { MTF_CLASS_TEXTURE, mtf_serialization_registry } from "./mtf_serialization_registry.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import("../../../../core/binary/BinaryBuffer.js").BinaryBuffer} BinaryBuffer
|
|
9
|
+
* @typedef {import("./MTFTexture.js").MTFTexture} MTFTexture
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const NO_OPTIONS = [];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The first half of reading an MTF package: its header and its texture records.
|
|
16
|
+
*
|
|
17
|
+
* A package holds no texels, so between this and {@link mtf_read_scene} somebody fetches them: a record says
|
|
18
|
+
* which encodings exist and where, the caller picks one for its device and makes a texture of what arrives, and
|
|
19
|
+
* the second half is given those textures in the order of these records.
|
|
20
|
+
*
|
|
21
|
+
* @param {BinaryBuffer} buffer at the start of a package; left at the start of what {@link mtf_read_scene} reads
|
|
22
|
+
* @returns {MTFTexture[]} in the order materials name them by
|
|
23
|
+
* @throws {Error} if the bytes are not a package, or are of a version newer than {@link MTF_PACKAGE_VERSION}
|
|
24
|
+
*
|
|
25
|
+
* @author Alex Goldring
|
|
26
|
+
* @copyright Company Named Limited (c) 2026
|
|
27
|
+
*/
|
|
28
|
+
export function mtf_read_textures(buffer) {
|
|
29
|
+
// thrown, not asserted: a file is outside data, and a wrong one is refused with asserts stripped too
|
|
30
|
+
if (buffer.capacity - buffer.position < 8 || buffer.readUint32() !== MTF_PACKAGE_MAGIC) {
|
|
31
|
+
throw new Error("not an MTF package: it does not open with 'MTFP'");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const version = buffer.readUint32();
|
|
35
|
+
|
|
36
|
+
if (version > MTF_PACKAGE_VERSION) {
|
|
37
|
+
throw new Error(`an MTF package of version ${version}, newer than this engine reads (${MTF_PACKAGE_VERSION})`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const deserializer = new BinaryCollectionDeSerializer();
|
|
41
|
+
|
|
42
|
+
deserializer.setRegistry(mtf_serialization_registry());
|
|
43
|
+
deserializer.setBuffer(buffer);
|
|
44
|
+
|
|
45
|
+
/** @type {MTFTexture[]} */
|
|
46
|
+
const records = [];
|
|
47
|
+
|
|
48
|
+
mtf_read_collection(deserializer, MTF_CLASS_TEXTURE, NO_OPTIONS, records);
|
|
49
|
+
|
|
50
|
+
return records;
|
|
51
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a file an MTF package names is: the URI as the package holds it, resolved against the package's own URL
|
|
3
|
+
* the way a browser resolves a link against the page it is on.
|
|
4
|
+
*
|
|
5
|
+
* The result has no `.` or `..` left in it wherever the package's URL allows, and that is the point of doing it
|
|
6
|
+
* here rather than leaving it to the fetch: a texture is shared by being asked for under one name. Two packages
|
|
7
|
+
* in different folders reach the same file by different relative URIs, and an asset manager that keyed on the
|
|
8
|
+
* unresolved forms would fetch it twice and hold two images.
|
|
9
|
+
*
|
|
10
|
+
* Characters are left as they are. Nothing is percent-encoded or decoded, so a path that names a file comes back
|
|
11
|
+
* as a path that names it.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} uri relative to the package, from a root, or whole
|
|
14
|
+
* @param {string} package_url what the package was asked for by: a URL, or a path
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*
|
|
17
|
+
* @author Alex Goldring
|
|
18
|
+
* @copyright Company Named Limited (c) 2026
|
|
19
|
+
*/
|
|
20
|
+
export function mtf_resolve_uri(uri: string, package_url: string): string;
|
|
21
|
+
//# sourceMappingURL=mtf_resolve_uri.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mtf_resolve_uri.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_resolve_uri.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,qCAPW,MAAM,eACN,MAAM,GACJ,MAAM,CA8DlB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A URI that says where it is on its own: it opens with a scheme.
|
|
3
|
+
*
|
|
4
|
+
* @type {RegExp}
|
|
5
|
+
*/
|
|
6
|
+
const HAS_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The part of a URL that is not path: a scheme and a host, or a host alone.
|
|
10
|
+
*
|
|
11
|
+
* @type {RegExp}
|
|
12
|
+
*/
|
|
13
|
+
const AUTHORITY = /^(?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*/i;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Where a path ends and a query or a fragment begins.
|
|
17
|
+
*
|
|
18
|
+
* @type {RegExp}
|
|
19
|
+
*/
|
|
20
|
+
const AFTER_PATH = /[?#]/;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Where a file an MTF package names is: the URI as the package holds it, resolved against the package's own URL
|
|
24
|
+
* the way a browser resolves a link against the page it is on.
|
|
25
|
+
*
|
|
26
|
+
* The result has no `.` or `..` left in it wherever the package's URL allows, and that is the point of doing it
|
|
27
|
+
* here rather than leaving it to the fetch: a texture is shared by being asked for under one name. Two packages
|
|
28
|
+
* in different folders reach the same file by different relative URIs, and an asset manager that keyed on the
|
|
29
|
+
* unresolved forms would fetch it twice and hold two images.
|
|
30
|
+
*
|
|
31
|
+
* Characters are left as they are. Nothing is percent-encoded or decoded, so a path that names a file comes back
|
|
32
|
+
* as a path that names it.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} uri relative to the package, from a root, or whole
|
|
35
|
+
* @param {string} package_url what the package was asked for by: a URL, or a path
|
|
36
|
+
* @returns {string}
|
|
37
|
+
*
|
|
38
|
+
* @author Alex Goldring
|
|
39
|
+
* @copyright Company Named Limited (c) 2026
|
|
40
|
+
*/
|
|
41
|
+
export function mtf_resolve_uri(uri, package_url) {
|
|
42
|
+
if (HAS_SCHEME.test(uri) || uri.startsWith("//")) {
|
|
43
|
+
return uri;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const authority = AUTHORITY.exec(package_url);
|
|
47
|
+
const prefix = authority === null ? "" : authority[0];
|
|
48
|
+
|
|
49
|
+
if (uri.startsWith("/")) {
|
|
50
|
+
return prefix + uri;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let base_path = package_url.substring(prefix.length);
|
|
54
|
+
|
|
55
|
+
const base_end = base_path.search(AFTER_PATH);
|
|
56
|
+
|
|
57
|
+
if (base_end !== -1) {
|
|
58
|
+
base_path = base_path.substring(0, base_end);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const uri_end = uri.search(AFTER_PATH);
|
|
62
|
+
const uri_path = uri_end === -1 ? uri : uri.substring(0, uri_end);
|
|
63
|
+
const uri_rest = uri_end === -1 ? "" : uri.substring(uri_end);
|
|
64
|
+
|
|
65
|
+
const segments = base_path.split("/");
|
|
66
|
+
|
|
67
|
+
// the package's own name
|
|
68
|
+
segments.pop();
|
|
69
|
+
|
|
70
|
+
// a path from a root opens with an empty segment, which is the root: nothing climbs above it
|
|
71
|
+
const rooted = prefix.length > 0 || base_path.startsWith("/");
|
|
72
|
+
const floor = rooted && segments.length > 0 && segments[0] === "" ? 1 : 0;
|
|
73
|
+
|
|
74
|
+
const parts = uri_path.split("/");
|
|
75
|
+
|
|
76
|
+
for (let i = 0; i < parts.length; i++) {
|
|
77
|
+
const part = parts[i];
|
|
78
|
+
|
|
79
|
+
if (part === ".") {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (part !== "..") {
|
|
84
|
+
segments.push(part);
|
|
85
|
+
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (segments.length > floor && segments[segments.length - 1] !== "..") {
|
|
90
|
+
segments.pop();
|
|
91
|
+
} else if (!rooted) {
|
|
92
|
+
// a relative path may be climbed out of: where that leads is whoever resolves it next to say
|
|
93
|
+
segments.push("..");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return prefix + segments.join("/") + uri_rest;
|
|
98
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The adapters an MTF package is written and read with, and the upgraders that bring a collection written at an
|
|
3
|
+
* earlier version of its class up to the one the adapter reads. A new registry a call: the adapters that resolve
|
|
4
|
+
* indices hold the lists they resolve against while a collection is being written or read.
|
|
5
|
+
*
|
|
6
|
+
* A class that gains a version registers its upgrader here, and every package ever written keeps reading.
|
|
7
|
+
*
|
|
8
|
+
* @returns {BinarySerializationRegistry}
|
|
9
|
+
*
|
|
10
|
+
* @author Alex Goldring
|
|
11
|
+
* @copyright Company Named Limited (c) 2026
|
|
12
|
+
*/
|
|
13
|
+
export function mtf_serialization_registry(): BinarySerializationRegistry;
|
|
14
|
+
/**
|
|
15
|
+
* The names an MTF package's collections carry, in the order a package holds them. A name is what the file says
|
|
16
|
+
* its elements are, and what the reader finds their adapter and its upgraders by.
|
|
17
|
+
*/
|
|
18
|
+
export const MTF_CLASS_TEXTURE: "MTFTexture";
|
|
19
|
+
export const MTF_CLASS_MATERIAL: "StandardShadeMaterial";
|
|
20
|
+
export const MTF_CLASS_GEOMETRY: "MeshletGeometry";
|
|
21
|
+
export const MTF_CLASS_NODE: "SceneNode";
|
|
22
|
+
export const MTF_CLASS_SKIN: "Skin";
|
|
23
|
+
export const MTF_CLASS_CLIP: "ShadeAnimationClip";
|
|
24
|
+
import { BinarySerializationRegistry } from "../../../../engine/ecs/storage/binary/BinarySerializationRegistry.js";
|
|
25
|
+
//# sourceMappingURL=mtf_serialization_registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mtf_serialization_registry.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_serialization_registry.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;GAWG;AACH,8CALa,2BAA2B,CAuBvC;AAzCD;;;GAGG;AACH,6CAA8C;AAC9C,yDAA0D;AAC1D,mDAAoD;AACpD,yCAA0C;AAC1C,oCAAqC;AACrC,kDAAmD;4CAlBP,sEAAsE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BinarySerializationRegistry } from "../../../../engine/ecs/storage/binary/BinarySerializationRegistry.js";
|
|
2
|
+
import { ShadeAnimationClipSerializationAdapter } from "../../animation/ShadeAnimationClipSerializationAdapter.js";
|
|
3
|
+
import { SkinSerializationAdapter } from "../../animation/SkinSerializationAdapter.js";
|
|
4
|
+
import { MeshletGeometrySerializationAdapter } from "../../geometry/MeshletGeometrySerializationAdapter.js";
|
|
5
|
+
import { MeshletGeometrySerializationUpgrader_0_1 } from "../../geometry/MeshletGeometrySerializationUpgrader_0_1.js";
|
|
6
|
+
import { StandardShadeMaterialSerializationAdapter } from "../../material/StandardShadeMaterialSerializationAdapter.js";
|
|
7
|
+
import { SceneNodeSerializationAdapter } from "../SceneNodeSerializationAdapter.js";
|
|
8
|
+
import { MTFTextureSerializationAdapter } from "./MTFTextureSerializationAdapter.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The names an MTF package's collections carry, in the order a package holds them. A name is what the file says
|
|
12
|
+
* its elements are, and what the reader finds their adapter and its upgraders by.
|
|
13
|
+
*/
|
|
14
|
+
export const MTF_CLASS_TEXTURE = "MTFTexture";
|
|
15
|
+
export const MTF_CLASS_MATERIAL = "StandardShadeMaterial";
|
|
16
|
+
export const MTF_CLASS_GEOMETRY = "MeshletGeometry";
|
|
17
|
+
export const MTF_CLASS_NODE = "SceneNode";
|
|
18
|
+
export const MTF_CLASS_SKIN = "Skin";
|
|
19
|
+
export const MTF_CLASS_CLIP = "ShadeAnimationClip";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The adapters an MTF package is written and read with, and the upgraders that bring a collection written at an
|
|
23
|
+
* earlier version of its class up to the one the adapter reads. A new registry a call: the adapters that resolve
|
|
24
|
+
* indices hold the lists they resolve against while a collection is being written or read.
|
|
25
|
+
*
|
|
26
|
+
* A class that gains a version registers its upgrader here, and every package ever written keeps reading.
|
|
27
|
+
*
|
|
28
|
+
* @returns {BinarySerializationRegistry}
|
|
29
|
+
*
|
|
30
|
+
* @author Alex Goldring
|
|
31
|
+
* @copyright Company Named Limited (c) 2026
|
|
32
|
+
*/
|
|
33
|
+
export function mtf_serialization_registry() {
|
|
34
|
+
const registry = new BinarySerializationRegistry();
|
|
35
|
+
|
|
36
|
+
registry.registerAdapter(new MTFTextureSerializationAdapter(), MTF_CLASS_TEXTURE);
|
|
37
|
+
registry.registerAdapter(new StandardShadeMaterialSerializationAdapter(), MTF_CLASS_MATERIAL);
|
|
38
|
+
|
|
39
|
+
// with its tree: a package is read without building anything
|
|
40
|
+
const geometry = new MeshletGeometrySerializationAdapter();
|
|
41
|
+
geometry.serialize_bvh = true;
|
|
42
|
+
|
|
43
|
+
registry.registerAdapter(geometry, MTF_CLASS_GEOMETRY);
|
|
44
|
+
registry.registerUpgrader(MTF_CLASS_GEOMETRY, new MeshletGeometrySerializationUpgrader_0_1());
|
|
45
|
+
|
|
46
|
+
registry.registerAdapter(new SceneNodeSerializationAdapter(), MTF_CLASS_NODE);
|
|
47
|
+
registry.registerAdapter(new SkinSerializationAdapter(), MTF_CLASS_SKIN);
|
|
48
|
+
registry.registerAdapter(new ShadeAnimationClipSerializationAdapter(), MTF_CLASS_CLIP);
|
|
49
|
+
|
|
50
|
+
return registry;
|
|
51
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The texture an MTF texture file holds, as {@link mtf_texture_write} wrote it.
|
|
3
|
+
*
|
|
4
|
+
* Its levels are views of `data`, not copies: a level goes to the device from the file it arrived in, and the file
|
|
5
|
+
* lives as long as the texels do.
|
|
6
|
+
*
|
|
7
|
+
* Every refusal is a thrown error and none is an assert: a file is outside data, and a wrong one has to be refused
|
|
8
|
+
* in a build with asserts stripped too.
|
|
9
|
+
*
|
|
10
|
+
* @param {ArrayBuffer} data the whole file
|
|
11
|
+
* @returns {ShadeTexelData}
|
|
12
|
+
* @throws {Error} if the bytes are not a texture file, are of a version newer than {@link MTF_TEXTURE_VERSION},
|
|
13
|
+
* name a format the engine does not know, or are not exactly as long as their levels
|
|
14
|
+
*
|
|
15
|
+
* @author Alex Goldring
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
|
+
*/
|
|
18
|
+
export function mtf_texture_read(data: ArrayBuffer): ShadeTexelData;
|
|
19
|
+
import { ShadeTexelData } from "../../texture/source/ShadeTexelData.js";
|
|
20
|
+
//# sourceMappingURL=mtf_texture_read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mtf_texture_read.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_texture_read.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;GAgBG;AACH,uCARW,WAAW,GACT,cAAc,CA+D1B;+BA7E8B,wCAAwC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BinaryBuffer } from "../../../../core/binary/BinaryBuffer.js";
|
|
2
|
+
import { gpu_texture_format_without_srgb } from "../../texture/format/gpu_texture_format_without_srgb.js";
|
|
3
|
+
import { ShadeTexelData } from "../../texture/source/ShadeTexelData.js";
|
|
4
|
+
import { mtf_is_texture } from "./mtf_is_texture.js";
|
|
5
|
+
import { MTF_TEXTURE_VERSION } from "./MTF_TEXTURE_VERSION.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The texture an MTF texture file holds, as {@link mtf_texture_write} wrote it.
|
|
9
|
+
*
|
|
10
|
+
* Its levels are views of `data`, not copies: a level goes to the device from the file it arrived in, and the file
|
|
11
|
+
* lives as long as the texels do.
|
|
12
|
+
*
|
|
13
|
+
* Every refusal is a thrown error and none is an assert: a file is outside data, and a wrong one has to be refused
|
|
14
|
+
* in a build with asserts stripped too.
|
|
15
|
+
*
|
|
16
|
+
* @param {ArrayBuffer} data the whole file
|
|
17
|
+
* @returns {ShadeTexelData}
|
|
18
|
+
* @throws {Error} if the bytes are not a texture file, are of a version newer than {@link MTF_TEXTURE_VERSION},
|
|
19
|
+
* name a format the engine does not know, or are not exactly as long as their levels
|
|
20
|
+
*
|
|
21
|
+
* @author Alex Goldring
|
|
22
|
+
* @copyright Company Named Limited (c) 2026
|
|
23
|
+
*/
|
|
24
|
+
export function mtf_texture_read(data) {
|
|
25
|
+
if (!mtf_is_texture(data)) {
|
|
26
|
+
throw new Error("not an MTF texture file: it does not open with 'MTFT'");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const buffer = BinaryBuffer.fromArrayBuffer(data);
|
|
30
|
+
|
|
31
|
+
// the magic
|
|
32
|
+
buffer.skip(4);
|
|
33
|
+
|
|
34
|
+
const version = buffer.readUint32();
|
|
35
|
+
|
|
36
|
+
if (version > MTF_TEXTURE_VERSION) {
|
|
37
|
+
throw new Error(`an MTF texture file of version ${version}, newer than this engine reads (${MTF_TEXTURE_VERSION})`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// a file that names the sRGB one of a pair holds the same bytes: read as the other, as this engine writes it
|
|
41
|
+
const format = gpu_texture_format_without_srgb(buffer.readUTF8String());
|
|
42
|
+
|
|
43
|
+
const width = buffer.readUint32();
|
|
44
|
+
const height = buffer.readUint32();
|
|
45
|
+
const depth = buffer.readUint32();
|
|
46
|
+
|
|
47
|
+
const level_count = buffer.readUint8();
|
|
48
|
+
|
|
49
|
+
if (width === 0 || height === 0 || depth === 0 || level_count === 0) {
|
|
50
|
+
throw new Error(`an MTF texture file of ${width}x${height}x${depth} texels and ${level_count} levels holds no texture`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const file_bytes = buffer.raw_bytes;
|
|
54
|
+
const file_length = data.byteLength;
|
|
55
|
+
|
|
56
|
+
/** @type {Uint8Array[]} */
|
|
57
|
+
const levels = new Array(level_count);
|
|
58
|
+
|
|
59
|
+
let position = buffer.position;
|
|
60
|
+
|
|
61
|
+
for (let level = level_count - 1; level >= 0; level--) {
|
|
62
|
+
// throws for a name that is not a format
|
|
63
|
+
const length = ShadeTexelData.level_byte_length(format, width, height, depth, level);
|
|
64
|
+
|
|
65
|
+
if (position + length > file_length) {
|
|
66
|
+
throw new Error(`the MTF texture file is cut short: level ${level} of the ${width}x${height}x${depth} '${format}' texture is ${length} bytes from ${position}, and the file is ${file_length} bytes long`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
levels[level] = file_bytes.subarray(position, position + length);
|
|
70
|
+
|
|
71
|
+
position += length;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (position !== file_length) {
|
|
75
|
+
throw new Error(`the MTF texture file holds ${file_length - position} bytes after its last level`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// refuses a chain that is neither one level nor whole
|
|
79
|
+
return new ShadeTexelData(format, width, height, depth, levels);
|
|
80
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../../texture/TextureVariantSet.js").TextureVariantSet} TextureVariantSet
|
|
3
|
+
* @typedef {import("../../texture/TextureRole.js").TextureRole} TextureRole
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Which of a texture's files a device fetches.
|
|
7
|
+
*
|
|
8
|
+
* First the engine's own choice: the best format for the role that was built and that the device samples
|
|
9
|
+
* ({@link texture_variant_select}). Where none of those was built, any format that was and that the device samples,
|
|
10
|
+
* in the order the record lists them, which is the order whoever built them chose. The fallback only when the
|
|
11
|
+
* device samples nothing that was built: texels a device takes as they are come before an image it has to decode.
|
|
12
|
+
*
|
|
13
|
+
* @param {TextureVariantSet} variants what was built for the texture
|
|
14
|
+
* @param {TextureRole|number} role what the texture is for
|
|
15
|
+
* @param {Set<GPUTextureFormat>} support what the device can sample
|
|
16
|
+
* @returns {string} the URI to fetch, as the record holds it
|
|
17
|
+
*
|
|
18
|
+
* @author Alex Goldring
|
|
19
|
+
* @copyright Company Named Limited (c) 2026
|
|
20
|
+
*/
|
|
21
|
+
export function mtf_texture_select(variants: TextureVariantSet, role: TextureRole | number, support: Set<GPUTextureFormat>): string;
|
|
22
|
+
export type TextureVariantSet = import("../../texture/TextureVariantSet.js").TextureVariantSet;
|
|
23
|
+
export type TextureRole = import("../../texture/TextureRole.js").TextureRole;
|
|
24
|
+
//# sourceMappingURL=mtf_texture_select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mtf_texture_select.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_texture_select.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,6CARW,iBAAiB,QACjB,WAAW,GAAC,MAAM,WAClB,qBAAqB,GACnB,MAAM,CAuBlB;gCAtCY,OAAO,oCAAoC,EAAE,iBAAiB;0BAC9D,OAAO,8BAA8B,EAAE,WAAW"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { texture_variant_select } from "../../texture/format/texture_variant_select.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import("../../texture/TextureVariantSet.js").TextureVariantSet} TextureVariantSet
|
|
5
|
+
* @typedef {import("../../texture/TextureRole.js").TextureRole} TextureRole
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Which of a texture's files a device fetches.
|
|
10
|
+
*
|
|
11
|
+
* First the engine's own choice: the best format for the role that was built and that the device samples
|
|
12
|
+
* ({@link texture_variant_select}). Where none of those was built, any format that was and that the device samples,
|
|
13
|
+
* in the order the record lists them, which is the order whoever built them chose. The fallback only when the
|
|
14
|
+
* device samples nothing that was built: texels a device takes as they are come before an image it has to decode.
|
|
15
|
+
*
|
|
16
|
+
* @param {TextureVariantSet} variants what was built for the texture
|
|
17
|
+
* @param {TextureRole|number} role what the texture is for
|
|
18
|
+
* @param {Set<GPUTextureFormat>} support what the device can sample
|
|
19
|
+
* @returns {string} the URI to fetch, as the record holds it
|
|
20
|
+
*
|
|
21
|
+
* @author Alex Goldring
|
|
22
|
+
* @copyright Company Named Limited (c) 2026
|
|
23
|
+
*/
|
|
24
|
+
export function mtf_texture_select(variants, role, support) {
|
|
25
|
+
const preferred = texture_variant_select(variants, role, support);
|
|
26
|
+
|
|
27
|
+
if (preferred !== variants.fallback) {
|
|
28
|
+
return preferred;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const formats = variants.formats;
|
|
32
|
+
|
|
33
|
+
for (let i = 0; i < formats.length; i++) {
|
|
34
|
+
const format = formats[i];
|
|
35
|
+
|
|
36
|
+
if (support.has(format)) {
|
|
37
|
+
return variants.path(format);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return variants.fallback;
|
|
42
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One texture in one GPU format, as an MTF texture file:
|
|
3
|
+
*
|
|
4
|
+
* <pre>
|
|
5
|
+
* u32 magic {@link MTF_TEXTURE_MAGIC}
|
|
6
|
+
* u32 version {@link MTF_TEXTURE_VERSION}
|
|
7
|
+
* UTF8 format the WebGPU name the payload states
|
|
8
|
+
* u32 width texels of the base level
|
|
9
|
+
* u32 height
|
|
10
|
+
* u32 depth
|
|
11
|
+
* u8 level_count
|
|
12
|
+
* levels coarsest first, the base level last
|
|
13
|
+
* </pre>
|
|
14
|
+
*
|
|
15
|
+
* A level is the payload's own bytes, rows of blocks with no padding, and its length is not written: it follows
|
|
16
|
+
* from the format and the size ({@link ShadeTexelData.level_byte_length}). Coarsest first puts a usable texture at
|
|
17
|
+
* the head of the file.
|
|
18
|
+
*
|
|
19
|
+
* What the bytes mean is the producer's to have settled: colour that carries opacity is premultiplied, and the
|
|
20
|
+
* format named is the non-sRGB one of its pair.
|
|
21
|
+
*
|
|
22
|
+
* @param {ShadeTexelData} texel_data every level present
|
|
23
|
+
* @returns {ArrayBuffer} the file
|
|
24
|
+
* @throws {Error} if a level has not arrived
|
|
25
|
+
*
|
|
26
|
+
* @author Alex Goldring
|
|
27
|
+
* @copyright Company Named Limited (c) 2026
|
|
28
|
+
*/
|
|
29
|
+
export function mtf_texture_write(texel_data: ShadeTexelData): ArrayBuffer;
|
|
30
|
+
export type ShadeTexelData = import("../../texture/source/ShadeTexelData.js").ShadeTexelData;
|
|
31
|
+
//# sourceMappingURL=mtf_texture_write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mtf_texture_write.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_texture_write.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,8CAPW,cAAc,GACZ,WAAW,CAgDvB;6BAhFY,OAAO,wCAAwC,EAAE,cAAc"}
|