From e05143ad731d7c990dcbb2488dee1d1e8f329e64 Mon Sep 17 00:00:00 2001 From: fukunee Date: Sat, 19 Sep 2026 04:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=9A?= =?UTF-8?q?=E7=B2=BE=E7=81=B5=E9=99=8D=E9=87=87=E6=A0=B7=E3=80=81=E5=83=8F?= =?UTF-8?q?=E7=B4=A0=E6=AF=94=E9=99=8D=E4=BD=8E=E3=80=81=E9=BA=82=E7=9A=AE?= =?UTF-8?q?=E6=B3=95=E7=BA=BF=E9=99=8D=E5=88=86=E8=BE=A8=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 时间轴文字精灵超采样 SS 4→2,显存省 75% - Three.js 像素比上限 2→1.5,Cesium resolutionScale 1.5→1.0 - 麂皮法线贴图 1024×1280→512×640,启动逐像素计算省 75% --- src/core/App.js | 2 +- src/scene/CesiumGlobe.js | 2 +- src/scene/binder.js | 2 +- src/utils/labels.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/App.js b/src/core/App.js index a71d087..56dd92e 100644 --- a/src/core/App.js +++ b/src/core/App.js @@ -64,7 +64,7 @@ export class App { _initRenderer() { const canvas = document.getElementById('scene'); this.renderer = new THREE.WebGLRenderer({ canvas, antialias: true }); - this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); + this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 1.5)); this.renderer.setSize(window.innerWidth, window.innerHeight); this.renderer.shadowMap.enabled = true; this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; diff --git a/src/scene/CesiumGlobe.js b/src/scene/CesiumGlobe.js index b3c08dd..6b84ef6 100644 --- a/src/scene/CesiumGlobe.js +++ b/src/scene/CesiumGlobe.js @@ -226,7 +226,7 @@ export class CesiumGlobe { scene.globe.maximumScreenSpaceError = 2.0; // 默认细分,最省性能 scene.globe.tileCacheSize = 600; // 更大的瓦片缓存,减少细节刷新 scene.fxaa = false; // 关闭抗锯齿后处理,省一个全屏通道 - viewer.resolutionScale = 1.5; // 1.5 倍超采样,替代 FXAA 提供更锐利的抗锯齿 + viewer.resolutionScale = 1.0; // 关闭超采样(DPR 已提供足够分辨率),省填充率 scene.maximumRenderTimeChange = Infinity; // 配合 requestRenderMode:静止时停止重绘,大幅省电省帧 // 卫星影像 diff --git a/src/scene/binder.js b/src/scene/binder.js index 54e2ec0..6348f7a 100644 --- a/src/scene/binder.js +++ b/src/scene/binder.js @@ -234,7 +234,7 @@ function makeLeatherNormalMap() { // 内侧绒面法线:密集细绒毛(高频噪点) function makeSuedeNormalMap() { - const w = 1024, h = 1280; + const w = 512, h = 640; // 降分辨率省 75% 逐像素计算,视觉几乎无差 const c = document.createElement('canvas'); c.width = w; c.height = h; const ctx = c.getContext('2d', { willReadFrequently: true }); diff --git a/src/utils/labels.js b/src/utils/labels.js index 67f82b7..3688d74 100644 --- a/src/utils/labels.js +++ b/src/utils/labels.js @@ -1,7 +1,7 @@ import * as THREE from 'three'; // 超采样倍数:文字以更高分辨率栅格化,拉近/放大后依然清晰 -const SS = 4; +const SS = 2; // 折行:尽量均分两行(标题较短),均分不满足时逐字折行 function wrapText(ctx, text, maxW) {