@woosh/meep-engine 3.53.0 → 3.54.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/package.json +1 -1
- package/src/core/math/noise/worley_noise_2d.d.ts +14 -0
- package/src/core/math/noise/worley_noise_2d.d.ts.map +1 -0
- package/src/core/math/noise/worley_noise_2d.js +74 -0
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.d.ts +6 -1
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.js +363 -325
- package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.d.ts +93 -14
- package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.js +322 -183
- package/src/engine/graphics/texture/atlas/ReferencedTextureAtlas.d.ts +9 -0
- package/src/engine/graphics/texture/atlas/ReferencedTextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/ReferencedTextureAtlas.js +110 -83
- package/src/engine/graphics/texture/atlas/SpriteAtlas.d.ts +42 -0
- package/src/engine/graphics/texture/atlas/SpriteAtlas.d.ts.map +1 -0
- package/src/engine/{graphics3/decal/DecalAtlas.js → graphics/texture/atlas/SpriteAtlas.js} +202 -194
- package/src/engine/graphics/texture/atlas/SpriteAtlasFill.d.ts +12 -0
- package/src/engine/graphics/texture/atlas/SpriteAtlasFill.d.ts.map +1 -0
- package/src/engine/graphics/texture/atlas/SpriteAtlasFill.js +30 -0
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts +7 -0
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/TextureAtlas.js +11 -1
- package/src/engine/graphics/texture/atlas/sprite_atlas_border.d.ts +52 -0
- package/src/engine/graphics/texture/atlas/sprite_atlas_border.d.ts.map +1 -0
- package/src/engine/{graphics3/decal/decal_atlas_border.js → graphics/texture/atlas/sprite_atlas_border.js} +69 -69
- package/src/engine/graphics3/DecalSystem.d.ts.map +1 -1
- package/src/engine/graphics3/DecalSystem.js +447 -450
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +9 -22
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.js +892 -951
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/generation/foliage/FOLIAGE_DESIGN.md +2 -1
- package/src/generation/foliage/config/BarkMaterialConfig.d.ts +4 -3
- package/src/generation/foliage/config/BarkMaterialConfig.d.ts.map +1 -1
- package/src/generation/foliage/config/BarkMaterialConfig.js +6 -6
- package/src/generation/foliage/config/FoliageBarkType.d.ts +11 -0
- package/src/generation/foliage/config/FoliageBarkType.d.ts.map +1 -0
- package/src/generation/foliage/config/FoliageBarkType.js +16 -0
- package/src/generation/foliage/config/FoliageMaterialConfig.d.ts +58 -5
- package/src/generation/foliage/config/FoliageMaterialConfig.d.ts.map +1 -1
- package/src/generation/foliage/config/FoliageMaterialConfig.js +279 -181
- package/src/generation/foliage/index.d.ts +2 -1
- package/src/generation/foliage/index.js +44 -43
- package/src/generation/foliage/material/make_bark_material.d.ts.map +1 -1
- package/src/generation/foliage/material/make_bark_material.js +23 -95
- package/src/generation/foliage/material/make_foliage_material.d.ts +29 -3
- package/src/generation/foliage/material/make_foliage_material.d.ts.map +1 -1
- package/src/generation/foliage/material/make_foliage_material.js +605 -359
- package/src/generation/foliage/mesh/branch_collar_project.d.ts.map +1 -1
- package/src/generation/foliage/mesh/branch_collar_project.js +205 -203
- package/src/generation/foliage/mesh/foliage_collect_attachments.d.ts +15 -0
- package/src/generation/foliage/mesh/foliage_collect_attachments.d.ts.map +1 -1
- package/src/generation/foliage/mesh/foliage_collect_attachments.js +569 -502
- package/src/generation/foliage/mesh/tree_mesh_build_bark.d.ts.map +1 -1
- package/src/generation/foliage/mesh/tree_mesh_build_bark.js +1049 -1047
- package/src/generation/foliage/mesh/tree_mesh_build_foliage.d.ts +2 -1
- package/src/generation/foliage/mesh/tree_mesh_build_foliage.d.ts.map +1 -1
- package/src/generation/foliage/mesh/tree_mesh_build_foliage.js +454 -415
- package/src/generation/foliage/presets/make_tree_species_preset.d.ts.map +1 -1
- package/src/generation/foliage/presets/make_tree_species_preset.js +870 -837
- package/src/generation/foliage/skeleton/crown_envelope_evaluate.js +121 -121
- package/src/generation/foliage/skeleton/tree_skeleton_compute_pipe_radii.d.ts +10 -7
- package/src/generation/foliage/skeleton/tree_skeleton_compute_pipe_radii.d.ts.map +1 -1
- package/src/generation/foliage/skeleton/tree_skeleton_compute_pipe_radii.js +206 -179
- package/src/generation/foliage/skeleton/tree_skeleton_grow.d.ts.map +1 -1
- package/src/generation/foliage/skeleton/tree_skeleton_grow.js +1871 -1104
- package/src/shade/playground/foliage_wind/foliage_world.d.ts +6 -0
- package/src/shade/playground/foliage_wind/foliage_world.d.ts.map +1 -1
- package/src/shade/playground/foliage_wind/foliage_world.js +602 -593
- package/src/shade/playground/foliage_wind/index.html +260 -254
- package/src/shade/playground/foliage_wind/main.js +275 -263
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +1 -1
- package/src/shade/renderer/hiz/HierarchicalZBuffer.d.ts +3 -3
- package/src/shade/renderer/hiz/HierarchicalZBuffer.d.ts.map +1 -1
- package/src/shade/renderer/hiz/HierarchicalZBuffer.js +350 -294
- package/src/shade/renderer/hiz/generate_downsampler_code.d.ts +0 -2
- package/src/shade/renderer/hiz/generate_downsampler_code.d.ts.map +1 -1
- package/src/shade/renderer/hiz/generate_downsampler_code.js +99 -100
- package/src/shade/renderer/hiz/hzb_pick_alignment.d.ts +15 -0
- package/src/shade/renderer/hiz/hzb_pick_alignment.d.ts.map +1 -0
- package/src/shade/renderer/hiz/hzb_pick_alignment.js +148 -0
- package/src/shade/renderer/hiz/hzb_plan_reduction_steps.d.ts +28 -0
- package/src/shade/renderer/hiz/hzb_plan_reduction_steps.d.ts.map +1 -0
- package/src/shade/renderer/hiz/hzb_plan_reduction_steps.js +58 -0
- package/src/shade/renderer/hiz/shader_hzb_reduce_any.d.ts +5 -5
- package/src/shade/renderer/hiz/shader_hzb_reduce_any.d.ts.map +1 -1
- package/src/shade/renderer/hiz/shader_hzb_reduce_any.js +57 -67
- package/src/shade/renderer/hiz/shader_hzb_reduce_mip0_clip.d.ts +3 -3
- package/src/shade/renderer/hiz/shader_hzb_reduce_mip0_clip.d.ts.map +1 -1
- package/src/shade/renderer/hiz/shader_hzb_reduce_mip0_clip.js +111 -112
- package/src/shade/renderer/hiz/shader_hzb_spd.d.ts +5 -0
- package/src/shade/renderer/hiz/shader_hzb_spd.d.ts.map +1 -0
- package/src/shade/renderer/hiz/shader_hzb_spd.js +160 -0
- package/src/shade/renderer/light/GPULightCollection.d.ts +8 -0
- package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
- package/src/shade/renderer/light/GPULightCollection.js +67 -0
- package/src/shade/renderer/light/environment/FAR_FIELD_IRRADIANCE_SH_RESOURCE.d.ts +7 -0
- package/src/shade/renderer/light/environment/FAR_FIELD_IRRADIANCE_SH_RESOURCE.d.ts.map +1 -0
- package/src/shade/renderer/light/environment/FAR_FIELD_IRRADIANCE_SH_RESOURCE.js +13 -0
- package/src/shade/renderer/light/environment/shader_project_far_field_irradiance_sh.d.ts +10 -0
- package/src/shade/renderer/light/environment/shader_project_far_field_irradiance_sh.d.ts.map +1 -0
- package/src/shade/renderer/light/environment/shader_project_far_field_irradiance_sh.js +72 -0
- package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts +39 -0
- package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts.map +1 -0
- package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.js +90 -0
- package/src/shade/renderer/light/world_cluster/chunk_world_light_cluster_lookup.d.ts +12 -0
- package/src/shade/renderer/light/world_cluster/chunk_world_light_cluster_lookup.d.ts.map +1 -0
- package/src/shade/renderer/light/world_cluster/chunk_world_light_cluster_lookup.js +56 -0
- package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts +31 -0
- package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts.map +1 -0
- package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.js +196 -0
- package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.d.ts +10 -0
- package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.d.ts.map +1 -0
- package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.js +163 -0
- package/src/shade/renderer/light/world_cluster/shader_world_cluster_cull_lights.d.ts +4 -0
- package/src/shade/renderer/light/world_cluster/shader_world_cluster_cull_lights.d.ts.map +1 -0
- package/src/shade/renderer/light/world_cluster/shader_world_cluster_cull_lights.js +137 -0
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
- package/src/shade/renderer/particles/GPUParticleSystem.js +4 -3
- package/src/shade/renderer/particles/graph_particles_avboit.d.ts +4 -3
- package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles_avboit.js +28 -11
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts +9 -13
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.js +25 -20
- package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +21 -38
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/depth/chunk_query_depth_from_screen_space_bb.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/depth/chunk_query_depth_from_screen_space_bb.js +62 -62
- package/src/shade/renderer/shader/chunk/random/lowbias/chunk_hash_lowbias32_vec2u.d.ts +6 -0
- package/src/shade/renderer/shader/chunk/random/lowbias/chunk_hash_lowbias32_vec2u.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/random/lowbias/chunk_hash_lowbias32_vec2u.js +19 -0
- package/src/shade/renderer/shader/chunk/screen_space/chunk_ffx_sssr_get_mip_resolution.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/screen_space/chunk_ffx_sssr_get_mip_resolution.js +16 -10
- package/src/shade/renderer/shader/chunk/screen_space/chunk_ffx_sssr_hierarchical_raymarch.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/screen_space/chunk_ffx_sssr_hierarchical_raymarch.js +118 -117
- package/src/shade/renderer/texture/atlas/GPUTileAtlas3D.d.ts +41 -7
- package/src/shade/renderer/texture/atlas/GPUTileAtlas3D.d.ts.map +1 -1
- package/src/shade/renderer/texture/atlas/GPUTileAtlas3D.js +162 -58
- package/src/shade/renderer/volumetrics/GPUSceneVolumetrics.js +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +10 -12
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +583 -606
- package/src/shade/renderer/volumetrics/chunk_volumetrics_froxel_sample.d.ts +24 -0
- package/src/shade/renderer/volumetrics/chunk_volumetrics_froxel_sample.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi_sample.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +1 -1
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +640 -640
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +113 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +484 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts +50 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js +60 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts +25 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.js +47 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IrradianceCascadePlacement.d.ts +74 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IrradianceCascadePlacement.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/IrradianceCascadePlacement.js +173 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts +26 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +83 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_local_light.d.ts +31 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_local_light.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_local_light.js +113 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.d.ts +121 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.js +356 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.d.ts +16 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.js +191 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_classify_froxels.d.ts +16 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_classify_froxels.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_lighting_regimes.d.ts +23 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_lighting_regimes.d.ts.map +1 -0
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.js +1 -1
- package/src/engine/graphics3/decal/DecalAtlasFill.js +0 -32
- package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_froxel_centre_ws.js +0 -49
- package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.js +0 -50
- package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi_sample.js +0 -105
- package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.js +0 -80
- package/src/shade/renderer/volumetrics/gi/shader_volumetrics_gi.js +0 -51
- package/src/shade/renderer/volumetrics/gi/volumetrics_gi_resources.js +0 -39
- package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.js +0 -121
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.js +0 -237
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpriteAtlasFill.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/atlas/SpriteAtlasFill.js"],"names":[],"mappings":";;;;;;8BAMU,MAAM"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a {@link SpriteAtlas} fills the border around a patch.
|
|
3
|
+
*
|
|
4
|
+
* Two rules rather than one, because the correct fill depends on what the channel means and getting
|
|
5
|
+
* it wrong shows up only once the mip chain is built.
|
|
6
|
+
*
|
|
7
|
+
* @enum {number}
|
|
8
|
+
*/
|
|
9
|
+
export const SpriteAtlasFill = {
|
|
10
|
+
/**
|
|
11
|
+
* Colour weighted by coverage, and a gutter of nothing.
|
|
12
|
+
*
|
|
13
|
+
* The patch is stored **premultiplied** and its border is zero. Averaging that pair down a mip
|
|
14
|
+
* chain gives premultiplied colour times coverage at every level, which is what a sprite or
|
|
15
|
+
* decal fading out at its edge should look like. The same arrangement in *straight* alpha is
|
|
16
|
+
* where dark halos come from — an edge texel averaged against transparent black keeps its alpha
|
|
17
|
+
* and loses its colour.
|
|
18
|
+
*/
|
|
19
|
+
PremultipliedCoverage: 0,
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The nearest content texel, repeated outward.
|
|
23
|
+
*
|
|
24
|
+
* For channels that carry no coverage of their own — a normal, a roughness, a metalness — or
|
|
25
|
+
* straight-alpha sprites whose shader applies coverage separately, a zeroed gutter would drag a
|
|
26
|
+
* partially covered mip texel toward a meaningless value. Repeating the edge lets the mip chain
|
|
27
|
+
* average content against more of the same.
|
|
28
|
+
*/
|
|
29
|
+
EdgeExtend: 1,
|
|
30
|
+
};
|
|
@@ -100,6 +100,13 @@ export class TextureAtlas extends AbstractTextureAtlas {
|
|
|
100
100
|
* @param {number} y1
|
|
101
101
|
*/
|
|
102
102
|
private eraseArea;
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @param {Sampler2D} sampler
|
|
106
|
+
* @param {number} [padding]
|
|
107
|
+
* @return {AtlasPatch}
|
|
108
|
+
*/
|
|
109
|
+
compute_padding(_sampler: any, padding?: number): AtlasPatch;
|
|
103
110
|
/**
|
|
104
111
|
*
|
|
105
112
|
* @param {Sampler2D} sampler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextureAtlas.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/atlas/TextureAtlas.js"],"names":[],"mappings":"AAkBA;IAcI;;;;;;OAMG;IACH,mBALW,MAAM,cACN,cAAc,kBACd,MAAM,EA6ChB;IA9DD;;;OAGG;IACH,gBAAa;IAEb;;;;OAIG;IACH,sBAAsB;IAgBlB;;;;OAIG;IACH,eAA0B;IAE1B;;;OAGG;IACH,eAFU,OAAO,CAEkB;IAInC;;;;OAIG;IACH,2BAAgH;IAEhH;;;OAGG;IACH,eAAiD;IAEjD;;QAEI;;WAEG;;MAEN;IAGL;;;OAGG;IACH,yBAEC;IAED;;;;OAIG;IACH,kBAHW,SAAS,GACP,UAAU,GAAC,SAAS,CAYhC;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,gBAHW,UAAU,GACR,OAAO,CAQnB;IAED;;OAEG;IACH,cAqBC;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,GACJ,OAAO,CA0CnB;IAED;;;;OAIG;IACH,mBAqBC;IAED;;;;OAIG;IACH,mBAaC;IAED;;;;;;OAMG;IACH,kBAIC;IAED;;;;;OAKG;IACH,aAJW,SAAS,YACT,MAAM,GACL,UAAU,CAgCrB;IAED;;;;;OAKG;IACH,YAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,cAHW,UAAU,GACT,OAAO,CAiClB;IAED;;;OAGG;IACH,UAFa,OAAO,CAyBnB;IAED;;;;OAIG;IACH,aAqGC;IAED;;OAEG;IACH,cAsCC;IAyED;;OAEG;IACH,cASC;;CACJ;
|
|
1
|
+
{"version":3,"file":"TextureAtlas.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/atlas/TextureAtlas.js"],"names":[],"mappings":"AAkBA;IAcI;;;;;;OAMG;IACH,mBALW,MAAM,cACN,cAAc,kBACd,MAAM,EA6ChB;IA9DD;;;OAGG;IACH,gBAAa;IAEb;;;;OAIG;IACH,sBAAsB;IAgBlB;;;;OAIG;IACH,eAA0B;IAE1B;;;OAGG;IACH,eAFU,OAAO,CAEkB;IAInC;;;;OAIG;IACH,2BAAgH;IAEhH;;;OAGG;IACH,eAAiD;IAEjD;;QAEI;;WAEG;;MAEN;IAGL;;;OAGG;IACH,yBAEC;IAED;;;;OAIG;IACH,kBAHW,SAAS,GACP,UAAU,GAAC,SAAS,CAYhC;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,gBAHW,UAAU,GACR,OAAO,CAQnB;IAED;;OAEG;IACH,cAqBC;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,GACJ,OAAO,CA0CnB;IAED;;;;OAIG;IACH,mBAqBC;IAED;;;;OAIG;IACH,mBAaC;IAED;;;;;;OAMG;IACH,kBAIC;IAED;;;;;OAKG;IACH,yCAHW,MAAM,GACL,UAAU,CAIrB;IAED;;;;;OAKG;IACH,aAJW,SAAS,YACT,MAAM,GACL,UAAU,CAgCrB;IAED;;;;;OAKG;IACH,YAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,cAHW,UAAU,GACT,OAAO,CAiClB;IAED;;;OAGG;IACH,UAFa,OAAO,CAyBnB;IAED;;;;OAIG;IACH,aAqGC;IAED;;OAEG;IACH,cAsCC;IAyED;;OAEG;IACH,cASC;;CACJ;qCAlmBoC,2BAA2B;oBAN5C,kCAAkC;mBAFnC,0CAA0C;0BAMnC,yBAAyB;2BAGxB,iBAAiB;+BAbb,gDAAgD"}
|
|
@@ -268,6 +268,16 @@ export class TextureAtlas extends AbstractTextureAtlas {
|
|
|
268
268
|
* @param {number} [padding]
|
|
269
269
|
* @return {AtlasPatch}
|
|
270
270
|
*/
|
|
271
|
+
compute_padding(_sampler, padding = 4) {
|
|
272
|
+
return padding;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
*
|
|
277
|
+
* @param {Sampler2D} sampler
|
|
278
|
+
* @param {number} [padding]
|
|
279
|
+
* @return {AtlasPatch}
|
|
280
|
+
*/
|
|
271
281
|
add(sampler, padding = 4) {
|
|
272
282
|
|
|
273
283
|
assert.notNull(sampler, 'sampler');
|
|
@@ -518,7 +528,7 @@ export class TextureAtlas extends AbstractTextureAtlas {
|
|
|
518
528
|
The atlas's own pixels have changed, and everything that mirrors them -- a GPU texture,
|
|
519
529
|
a debug canvas -- decides whether to re-read by comparing this version. The bump belongs
|
|
520
530
|
here rather than in `paintPatch`, because that is the method subclasses override: one
|
|
521
|
-
that paints into `data` itself, as `
|
|
531
|
+
that paints into `data` itself, as `SpriteAtlas` does for its borders, never reaches the
|
|
522
532
|
copy helper that would otherwise have moved the version for it.
|
|
523
533
|
*/
|
|
524
534
|
this.__sampler.version++;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Border, in texels, for a patch of this size.
|
|
3
|
+
*
|
|
4
|
+
* Driven by the longer side, because one border value protects both axes and the atlas halves both
|
|
5
|
+
* together when it builds its mip chain.
|
|
6
|
+
*
|
|
7
|
+
* @param {number} width
|
|
8
|
+
* @param {number} height
|
|
9
|
+
* @returns {number}
|
|
10
|
+
*/
|
|
11
|
+
export function sprite_atlas_border(width: number, height: number): number;
|
|
12
|
+
/**
|
|
13
|
+
* The deepest mip level a patch with this border can be sampled at without reading a neighbour.
|
|
14
|
+
*
|
|
15
|
+
* **A patch's own border is not the whole guard.** Every patch in the atlas has a border of at least
|
|
16
|
+
* {@link SPRITE_ATLAS_BORDER_MINIMUM}, so whatever sits next to this one contributes at least one
|
|
17
|
+
* more texel of separation: content is `border + 1` texels apart at worst. At mip level `L` that
|
|
18
|
+
* separation is `(border + 1) / 2^L` texels, and it has to survive down to one — which is also what
|
|
19
|
+
* pays for patches not landing on power-of-two boundaries, so alignment is not claimed on top of it.
|
|
20
|
+
*
|
|
21
|
+
* Past this level the sampler is clamped rather than allowed to keep minifying, so a sprite seen from
|
|
22
|
+
* very far away aliases instead of bleeding. That is the trade, and it is the right way round: a
|
|
23
|
+
* shimmering sprite is still that sprite, a bleeding one is somebody else's texture.
|
|
24
|
+
*
|
|
25
|
+
* @param {number} border
|
|
26
|
+
* @returns {number}
|
|
27
|
+
*/
|
|
28
|
+
export function sprite_atlas_max_lod(border: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* How much of a patch's own size is spent on its border.
|
|
31
|
+
*
|
|
32
|
+
* A **proportional** border rather than a fixed one, and that is the point of it: the border is what
|
|
33
|
+
* decides how far a patch can be minified before its neighbours bleed into it, so sizing it in
|
|
34
|
+
* proportion makes that limit the same for every sprite whatever its resolution. At 1/64 every patch
|
|
35
|
+
* stops minifying at roughly the same ~64 px screen footprint, for a flat ~6.3% of atlas area.
|
|
36
|
+
*
|
|
37
|
+
* A fixed border does the opposite: generous for small patches and useless for large ones.
|
|
38
|
+
*
|
|
39
|
+
* @type {number}
|
|
40
|
+
*/
|
|
41
|
+
export const SPRITE_ATLAS_BORDER_RATIO: number;
|
|
42
|
+
/**
|
|
43
|
+
* The smallest border a patch may have, in texels.
|
|
44
|
+
*
|
|
45
|
+
* One, not more. A 64x64 sprite is common and needs four texels at the very most; eight would spend a
|
|
46
|
+
* tenth of the texture on gutter to protect mip levels at which the sprite is a handful of pixels on
|
|
47
|
+
* screen. One texel is also not really one — see {@link sprite_atlas_max_lod}.
|
|
48
|
+
*
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
export const SPRITE_ATLAS_BORDER_MINIMUM: number;
|
|
52
|
+
//# sourceMappingURL=sprite_atlas_border.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprite_atlas_border.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/atlas/sprite_atlas_border.js"],"names":[],"mappings":"AA2BA;;;;;;;;;GASG;AACH,2CAJW,MAAM,UACN,MAAM,GACJ,MAAM,CAUlB;AAED;;;;;;;;;;;;;;;GAeG;AACH,6CAHW,MAAM,GACJ,MAAM,CAOlB;AAlED;;;;;;;;;;;GAWG;AACH,wCAFU,MAAM,CAEgC;AAEhD;;;;;;;;GAQG;AACH,0CAFU,MAAM,CAE6B"}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { assert } from "
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* How much of a patch's own size is spent on its border.
|
|
5
|
-
*
|
|
6
|
-
* A **proportional** border rather than a fixed one, and that is the point of it: the border is what
|
|
7
|
-
* decides how far a patch can be minified before its neighbours bleed into it, so sizing it in
|
|
8
|
-
* proportion makes that limit the same for every
|
|
9
|
-
* stops minifying at roughly the same ~64 px screen footprint, for a flat ~6.3% of atlas area.
|
|
10
|
-
*
|
|
11
|
-
* A fixed border does the opposite: generous for small patches and useless for large ones.
|
|
12
|
-
*
|
|
13
|
-
* @type {number}
|
|
14
|
-
*/
|
|
15
|
-
export const
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The smallest border a patch may have, in texels.
|
|
19
|
-
*
|
|
20
|
-
* One, not more. A 64x64
|
|
21
|
-
* tenth of the texture on gutter to protect mip levels at which the
|
|
22
|
-
* screen. One texel is also not really one — see {@link
|
|
23
|
-
*
|
|
24
|
-
* @type {number}
|
|
25
|
-
*/
|
|
26
|
-
export const
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Border, in texels, for a patch of this size.
|
|
30
|
-
*
|
|
31
|
-
* Driven by the longer side, because one border value protects both axes and the atlas halves both
|
|
32
|
-
* together when it builds its mip chain.
|
|
33
|
-
*
|
|
34
|
-
* @param {number} width
|
|
35
|
-
* @param {number} height
|
|
36
|
-
* @returns {number}
|
|
37
|
-
*/
|
|
38
|
-
export function
|
|
39
|
-
assert.isNonNegativeInteger(width, 'width');
|
|
40
|
-
assert.isNonNegativeInteger(height, 'height');
|
|
41
|
-
|
|
42
|
-
return Math.max(
|
|
43
|
-
|
|
44
|
-
Math.ceil(Math.max(width, height) *
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* The deepest mip level a patch with this border can be sampled at without reading a neighbour.
|
|
50
|
-
*
|
|
51
|
-
* **A patch's own border is not the whole guard.** Every patch in the atlas has a border of at least
|
|
52
|
-
* {@link
|
|
53
|
-
* more texel of separation: content is `border + 1` texels apart at worst. At mip level `L` that
|
|
54
|
-
* separation is `(border + 1) / 2^L` texels, and it has to survive down to one — which is also what
|
|
55
|
-
* pays for patches not landing on power-of-two boundaries, so alignment is not claimed on top of it.
|
|
56
|
-
*
|
|
57
|
-
* Past this level the sampler is clamped rather than allowed to keep minifying, so a
|
|
58
|
-
* very far away aliases instead of bleeding. That is the trade, and it is the right way round: a
|
|
59
|
-
* shimmering
|
|
60
|
-
*
|
|
61
|
-
* @param {number} border
|
|
62
|
-
* @returns {number}
|
|
63
|
-
*/
|
|
64
|
-
export function
|
|
65
|
-
assert.isNonNegativeInteger(border, 'border');
|
|
66
|
-
assert.greaterThanOrEqual(border,
|
|
67
|
-
|
|
68
|
-
return Math.floor(Math.log2(border + 1));
|
|
69
|
-
}
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* How much of a patch's own size is spent on its border.
|
|
5
|
+
*
|
|
6
|
+
* A **proportional** border rather than a fixed one, and that is the point of it: the border is what
|
|
7
|
+
* decides how far a patch can be minified before its neighbours bleed into it, so sizing it in
|
|
8
|
+
* proportion makes that limit the same for every sprite whatever its resolution. At 1/64 every patch
|
|
9
|
+
* stops minifying at roughly the same ~64 px screen footprint, for a flat ~6.3% of atlas area.
|
|
10
|
+
*
|
|
11
|
+
* A fixed border does the opposite: generous for small patches and useless for large ones.
|
|
12
|
+
*
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
export const SPRITE_ATLAS_BORDER_RATIO = 1 / 64;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The smallest border a patch may have, in texels.
|
|
19
|
+
*
|
|
20
|
+
* One, not more. A 64x64 sprite is common and needs four texels at the very most; eight would spend a
|
|
21
|
+
* tenth of the texture on gutter to protect mip levels at which the sprite is a handful of pixels on
|
|
22
|
+
* screen. One texel is also not really one — see {@link sprite_atlas_max_lod}.
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
*/
|
|
26
|
+
export const SPRITE_ATLAS_BORDER_MINIMUM = 1;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Border, in texels, for a patch of this size.
|
|
30
|
+
*
|
|
31
|
+
* Driven by the longer side, because one border value protects both axes and the atlas halves both
|
|
32
|
+
* together when it builds its mip chain.
|
|
33
|
+
*
|
|
34
|
+
* @param {number} width
|
|
35
|
+
* @param {number} height
|
|
36
|
+
* @returns {number}
|
|
37
|
+
*/
|
|
38
|
+
export function sprite_atlas_border(width, height) {
|
|
39
|
+
assert.isNonNegativeInteger(width, 'width');
|
|
40
|
+
assert.isNonNegativeInteger(height, 'height');
|
|
41
|
+
|
|
42
|
+
return Math.max(
|
|
43
|
+
SPRITE_ATLAS_BORDER_MINIMUM,
|
|
44
|
+
Math.ceil(Math.max(width, height) * SPRITE_ATLAS_BORDER_RATIO)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The deepest mip level a patch with this border can be sampled at without reading a neighbour.
|
|
50
|
+
*
|
|
51
|
+
* **A patch's own border is not the whole guard.** Every patch in the atlas has a border of at least
|
|
52
|
+
* {@link SPRITE_ATLAS_BORDER_MINIMUM}, so whatever sits next to this one contributes at least one
|
|
53
|
+
* more texel of separation: content is `border + 1` texels apart at worst. At mip level `L` that
|
|
54
|
+
* separation is `(border + 1) / 2^L` texels, and it has to survive down to one — which is also what
|
|
55
|
+
* pays for patches not landing on power-of-two boundaries, so alignment is not claimed on top of it.
|
|
56
|
+
*
|
|
57
|
+
* Past this level the sampler is clamped rather than allowed to keep minifying, so a sprite seen from
|
|
58
|
+
* very far away aliases instead of bleeding. That is the trade, and it is the right way round: a
|
|
59
|
+
* shimmering sprite is still that sprite, a bleeding one is somebody else's texture.
|
|
60
|
+
*
|
|
61
|
+
* @param {number} border
|
|
62
|
+
* @returns {number}
|
|
63
|
+
*/
|
|
64
|
+
export function sprite_atlas_max_lod(border) {
|
|
65
|
+
assert.isNonNegativeInteger(border, 'border');
|
|
66
|
+
assert.greaterThanOrEqual(border, SPRITE_ATLAS_BORDER_MINIMUM, 'border');
|
|
67
|
+
|
|
68
|
+
return Math.floor(Math.log2(border + 1));
|
|
69
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecalSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/DecalSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DecalSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/DecalSystem.js"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;GAgBG;AACH;IAmHI;;;OAGG;IACH,4DAkCC;IAxJD,oDAAoC;IAyFpC;;;;OAIG;IACH,oBAEC;IAED;;OAEG;IACH,2BAEC;IAED;;;;OAIG;IACH,4BAEC;IAoDD,2CAUC;IAED,4CAgBC;IAED;;;;;;;;;;;;OAYG;IACH,YAJW,KAAK,aACL,WAAW,UACX,MAAM,QAmBhB;IAED;;;;OAIG;IACH,cAJW,KAAK,aACL,WAAW,UACX,MAAM,QAkBhB;IAqDD,6BAiDC;IAED;;OAEG;IACH,kCAkBC;;CACJ;AAED;;;;;;GAMG;AACH;IAYI;;OAEG;IACH,oBAFW,WAAW,EAMrB;IAED,yBAEC;;CACJ;uBAzbsB,kBAAkB;4BACb,iCAAiC;sBACvC,mCAAmC;gCALzB,mDAAmD"}
|