hi,Community
I want to realize glow effect in cesium like three.js does , to data visualization on the globe map
I think PostProcessStage should OK ,but cesium have not layer . so bloom or other effect will effect globe map too, bloom postStage and BlurStage can’t use czm_selected()
i tried below code ,failed
var bstage = Cesium.PostProcessStageLibrary.createBlurStage() ;
// Shade selected model with highlight. var fragmentShaderSource = "uniform sampler2D colorTexture;\n" + "uniform sampler2D bloomTexture;\n" + "varying vec2 v_textureCoordinates;\n" + "uniform vec4 highlight;\n" + "void main() {\n" + " vec4 color = texture2D(colorTexture, v_textureCoordinates);\n" + "vec4 bloom = texture2D(bloomTexture, v_textureCoordinates);\n" + " if (czm_selected()) {\n" + " vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n" + " gl_FragColor = vec4(highlighted, 1.0);\n" + // " gl_FragColor = vec4(1.0);\n" + // " gl_FragColor = bloom + color;\n" + " } else { \n" + " gl_FragColor = color;\n" + " }\n" + "}\n"; var highlightStage = new Cesium.PostProcessStage({ fragmentShader: fragmentShaderSource, uniforms: { highlight: function () { return new Cesium.Color(1.0, 0.0, 0.0, 0.5); }, }, }); var stage = scene.postProcessStages.add( new Cesium.PostProcessStageComposite({ stages : [highlightStage] }) ); // scene.postProcessStages.bloom.enabled = true; stage.selected = [ ];
can somebody help me reliaze the effect ,thanks a lot