I'm assigning canvases (images) to rectangle primitives. When I have one canvas overlapping another, the canvas that is below is partially hidden by the canvas that is on top (see attached snapshot). The part that is partially hidden corresponds to the section of the canvas on top that is transparent. I have to use primitives instead of entities because I have to constantly update the material with the updated canvas and the updates cause flickering when using entities. I'm thinking of replacing the rectangle primitive with the custom singleTileImageryProvider that takes a canvas to see if that solves the issue. Is this a z fight issue? Is there a workaround to avoid the issue?
The code when assigning the canvas to the rectangle primitive is below:
var oRectangle = Cesium.Rectangle.fromDegrees(args.data.geoTL.x, args.data.geoBR.y, args.data.geoBR.x, args.data.geoTL.y);
var material = Cesium.Material.fromType('Image', {image: args.data.image}); //--------------> canvas
var options = {
rectangle: oRectangle,
ellipsoid: Cesium.Ellipsoid.WGS84,
asynchronous: false,
show: true,
id:
args.id,
material: material
};
var multiPointRectangle = new Cesium.RectanglePrimitive(options);
viewer.scene.primitives.add(multiPointRectangle);
Thanks,
Alberto