hi,friend, I want to Transport a picture to uniform sample2D pic in postProcessStage ,now i have rgb array or jpg in textureUnit1
You can pass in a uniforms object, see the docs:
https://cesiumjs.org/Cesium/Build/Documentation/PostProcessStage.html
For example, I modified the post process Sandcastle here to add another texture:
So instead of:
viewer.scene.postProcessStages.add(new Cesium.PostProcessStage({
fragmentShader : fragmentShaderSource
}));
``
I had:
viewer.scene.postProcessStages.add(new Cesium.PostProcessStage({
fragmentShader : fragmentShaderSource,
uniforms : {
customTexture : ‘…/images/bumpmap.png’
}
}));
``
You can then access this in the shader by declaring the uniform:
uniform sampler2D customTexture;
``
Does that help?
oh, actually, I plan to render the scene to in a textureUnit in my frameBufferObj,then i want transport the texture to postprocessStage . then ,how to define the custom value.
viewer.scene.postProcessStages.add(new Cesium.PostProcessStage({
fragmentShader : fragmentShaderSource,
uniforms : {
customTexture : here,what’s the value.
}
}));