Cesium 自定义Material 系列 (四)
对于闪烁线效果 我们先定义一下他的interface, 方便使用的人知道他的调用参数
export interface PMaterialFlicker{
color?:any,
speed?:number,
}
对于轨迹图片我们叫 MaterialFlicker
```javascript
import { MaterialProperty } from "./MaterialProperty";
const defaultOption: PMaterialFlicker = {
color: Cesium.Color.AQUA,
speed: 20,
}
//闪烁效果
export class MaterialFlicker extends MaterialProperty {
protected _getType(option: any): string {
return "MaterialFlicker"
}
constructor(option=defaultOption) {
super(MaterialFlicker.prototype,defaultOption, option);
}
protected getSource(option: PMaterialFlicker): string {
return `uniform vec4 color;
uniform float speed;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float time = fract( czm_frameNumber * speed / 1000.0);
vec2 st = materialInput.st;
更多参考 https://xiaozhuanlan.com/topic/1756283904