功能描述
添加自定义material,利用shader和贴图实现轨迹线效果。
贴图
自定义材质
export class PolylineTrailMaterialProperty {
constructor(options) {
options = Cesium.defaultValue(options, Cesium.defaultValue.EMPTY_OBJECT)
```this._definitionChanged = new Cesium.Event()
this._color = undefined
this._colorSubscription = undefined
this._time = performance.now()
this.color = options.color
this.duration = options.duration
this.trailImage = options.trailImage```
}
}
Object.defineProperties(PolylineTrailMaterialProperty.prototype, {
isConstant: {
get: function () {
return false
},
},
definitionChanged: {
get: function () {
return this._definitionChanged
},
},
color: Cesium.createPropertyDescriptor('color'),
})
PolylineTrailMaterialProperty.prototype.getType = function () {
return 'PolylineTrail'
}
PolylineTrailMaterialProperty.prototype.getValue = function (time, result) {
if (!Cesium.defined(result)