From 01d82c16c91fe5407fb10b8d5f56027d46e84833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com> Date: Mon, 4 Aug 2025 10:19:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=89=E7=85=A7=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1=E6=8B=96=E5=8A=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Global/efflect/Sunshine/index.js | 14 ++++++++++++++ src/Global/efflect/Sunshine/timeLIne.js | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Global/efflect/Sunshine/index.js b/src/Global/efflect/Sunshine/index.js index 4e37fee..f1b1a59 100644 --- a/src/Global/efflect/Sunshine/index.js +++ b/src/Global/efflect/Sunshine/index.js @@ -52,6 +52,14 @@ export default class Sunshine { that.viewer.clock.currentTime = Cesium.JulianDate.fromDate(now); that.viewer.clock.multiplier = that.options.speed; that.viewer.shadowMap.softShadows = that.options.softShadow; + that.viewer.shadowMap.cascadesEnabled = true + that.viewer.shadowMap.size = 2048; + that.viewer.shadowMap.numberOfCascades = 4; // 增加级联层数(默认3层) + that.viewer.shadowMap.maximumDistance = 5000; // 扩大阴影渲染距离 + const lightCamera = that.viewer.shadowMap._lightCamera; + lightCamera.frustum.near = 0.1; // 缩小近平面距离 + lightCamera.frustum.far = 10000; // 扩大远平面距离 + that.viewer.shadowMap.normalOffset = true; // 避免深度冲突导致的阴影闪烁 that.edit(true) } @@ -218,6 +226,12 @@ export default class Sunshine { this.entity = null this.timeLine.clear() + this.viewer.shadowMap.cascadesEnabled = false + this.viewer.shadowMap.size = 1024; + this.viewer.shadowMap.numberOfCascades = 3; // 增加级联层数(默认3层) + const lightCamera = this.viewer.shadowMap._lightCamera; + this.viewer.shadowMap.normalOffset = false; // 避免深度冲突导致的阴影闪烁 + if (this._DialogObject && !this._DialogObject.isDestroy) { this._DialogObject.close() this._DialogObject = null diff --git a/src/Global/efflect/Sunshine/timeLIne.js b/src/Global/efflect/Sunshine/timeLIne.js index 082a999..c7dfa3f 100644 --- a/src/Global/efflect/Sunshine/timeLIne.js +++ b/src/Global/efflect/Sunshine/timeLIne.js @@ -33,7 +33,9 @@ export default class TimeLine { that.startTime = Date.now() - ((that.manualPosition || 0) * 86400 * 1000 / that.speed); that.timeline.addEventListener('mousedown', (e) => { - that.isDragging = true; + if (e.srcElement.className === 'handle') { + that.isDragging = true; + } e.preventDefault(); });