I want to send a dynamic texture to the fragment shader of post processing stage. The "dynamic" means the texture will be modified periodically. But I don't know how to do. The examples in the document only show how to send scale and vector data to fragment shader.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
The texture need to be modified, so I suppose I have to use a function to return the texture I want in the uniforms block?
viewer.scene.postProcessStages.add(new Cesium.PostProcessStage({
fragmentShader: fragmentShaderSource,
uniforms: {
myTexture: function () {
// what should I do here?
}
}
}));
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I made a particle system in WebGL, and the particles will be rendered to a texture(canvas) first. I want to inject these particles by making use of post processing stage, because it provides the depth texture of Cesium so that I can render the particles correctly.
4. The Cesium version you're using, your operating system and browser.
Cesium 1.53
Could you help me? Thanks.