Compare commits

..
2 Commits
Author SHA1 Message Date
fukunee 79737ec0a8 Reduce tile and texture cache footprint
Cut globe tile cache, imagery detail level and page texture caches to lower memory and GPU use.
2026-11-15 11:31:22 +08:00
fukunee 44afc48083 Adjust loading screen layout spacing
Replace the flex gap with a negative margin so the loading
text sits closer to the ring, whose canvas has excess
bottom whitespace.
2026-09-19 19:20:26 +08:00
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -233,7 +233,7 @@ export class CesiumGlobe {
// 精细化渲染:高清 + 精细地形 // 精细化渲染:高清 + 精细地形
scene.globe.maximumScreenSpaceError = 2.0; // 地形细分 scene.globe.maximumScreenSpaceError = 2.0; // 地形细分
scene.globe.tileCacheSize = 600; // 更大的瓦片缓存,减少细节刷新 scene.globe.tileCacheSize = 300; // 瓦片缓存,平衡内存与细节刷新
scene.fxaa = true; // 后处理抗锯齿(MSAA 默认已 4x) scene.fxaa = true; // 后处理抗锯齿(MSAA 默认已 4x)
viewer.useBrowserRecommendedResolution = false; // 按设备像素比渲染,高分屏清晰 viewer.useBrowserRecommendedResolution = false; // 按设备像素比渲染,高分屏清晰
viewer.resolutionScale = 1.0; viewer.resolutionScale = 1.0;
@@ -277,7 +277,7 @@ export class CesiumGlobe {
const imagery = new Cesium.UrlTemplateImageryProvider({ const imagery = new Cesium.UrlTemplateImageryProvider({
url: IMAGERY_URL, url: IMAGERY_URL,
credit: 'Imagery © Esri, Maxar, Earthstar Geographics', credit: 'Imagery © Esri, Maxar, Earthstar Geographics',
maximumLevel: 19, maximumLevel: 15,
tileDiscardPolicy: discardNotAvailableTile, tileDiscardPolicy: discardNotAvailableTile,
}); });
const imageryLayer = new Cesium.ImageryLayer(imagery, { const imageryLayer = new Cesium.ImageryLayer(imagery, {
+2 -1
View File
@@ -67,7 +67,7 @@ html, body {
#loading { #loading {
position: fixed; inset: 0; z-index: 1000; position: fixed; inset: 0; z-index: 1000;
display: flex; flex-direction: column; align-items: center; justify-content: center; display: flex; flex-direction: column; align-items: center; justify-content: center;
gap: 26px; gap: 0;
background: #14100d; background: #14100d;
transition: opacity 0.6s ease; transition: opacity 0.6s ease;
} }
@@ -82,6 +82,7 @@ html, body {
font-size: 13px; font-size: 13px;
letter-spacing: 0.2em; letter-spacing: 0.2em;
color: rgba(224, 196, 106, 0.8); color: rgba(224, 196, 106, 0.8);
margin-top: -100px; /* 上移靠近加载环(环在 500×500 画布中央,底部有大量留白) */
} }
/* 顶部标题 */ /* 顶部标题 */
+2 -2
View File
@@ -296,7 +296,7 @@ function downscale(src) {
// 启动时只为“当前可见窗口”生成真实纹理,其余页面用共享占位纹理; // 启动时只为“当前可见窗口”生成真实纹理,其余页面用共享占位纹理;
// 浏览中按需生成,离开窗口的纹理自动释放,控制显存占用。 // 浏览中按需生成,离开窗口的纹理自动释放,控制显存占用。
const MAX_CACHED_PAGES = 40; // 最多缓存 40 页(80 张)真实纹理 const MAX_CACHED_PAGES = 30; // 最多缓存 30 页(60 张)真实纹理
const texCache = new Map(); // id -> { entry, front, back, refs, lastUsed } const texCache = new Map(); // id -> { entry, front, back, refs, lastUsed }
let placeholder = null; let placeholder = null;
@@ -392,7 +392,7 @@ export function releasePageTextures(entry) {
// —— 低分辨率纹理池(时间轴卡片用,显示尺寸小,省显存与上传带宽)—— // —— 低分辨率纹理池(时间轴卡片用,显示尺寸小,省显存与上传带宽)——
const TEX_LOW_W = 256; const TEX_LOW_W = 256;
const TEX_LOW_H = 358; const TEX_LOW_H = 358;
const MAX_CACHED_PAGES_LOW = 40; const MAX_CACHED_PAGES_LOW = 30;
const texCacheLow = new Map(); const texCacheLow = new Map();
let placeholderLow = null; let placeholderLow = null;