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(); });