Post Processing
对场景后期的处理,实际上是传入 Fragment Shader,对片元进行处理
API
PostProcessStageCollection
负责管理 PostProcessStage 和 PostProcessStageComposite,初始化时挂在于scene.postProcessStages;
PostProcessStage
scene.postProcessStages.add( new Cesium.PostProcessStage({ // 指定片元着色器 fragmentShader: fs,
// 对片元着色器传值 uniforms: {}, }));PostProcessStageComposite
按照既定顺序进行场景处理
scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ inputPreviousStageTexture : false, stages : [ new Cesium.PostProcessStage({ fragmentShader : fs, }),
new Cesium.PostProcessStage({ fragmentShader : fs, }),
// 也支持传入其他的 PostProcessStageComposite ]});PostProcessStageLibrary
预设了场景处理的方案,例如 Cesium.PostProcessStageLibrary.createBlackAndWhiteStage()