/*
* @Descripttion:
* @version: 1.0
* @Author: tanzheng
* @Date: 2024-1-22 15:30:42
*/
/**
*
* 封装天气场景
* 雪天
*/
class Snow{
constructor(viewer){
}
//创建雪
createSnow(){
this.collection = viewer.scene.postProcessStages;
this._snow = new Cesium.PostProcessStage({
name: 'czm_snow',
fragmentShader: this.getSnow()
});
this.collection.add(this._snow);
viewer.scene.skyAtmosphere.hueShift = -0.8;
viewer.scene.skyAtmosphere.saturationShift = -0.7;
viewer.scene.skyAtmosphere.brightnessShift = -0.33;
viewer.scene.fog.density = 0.001;
viewer.scene.fog.minimumBrightness = 0.8;
}
//获得雪的shader
getSnow(){
var fs= "uniform sampler2D colorTexture;\n\
varying vec2 v_textureCoordinates;\n\
\n\
float snow(vec2 uv,float scale)\n\
{\n\
Cesium 封装雪效果
于 2024-01-28 11:40:04 首次发布