I have a similar issue. I have a bunch of circles, and if they overlap the alpha levels increase until the terrain is hidden and it looks ugly. I'd like it to appear as if the circles merge together seamlessly with the pixels keeping the constant low alpha level.
The materials example has not enlightened me as of yet. I tried to make a custom appearance with a renderState blending solution but it did not seem to respond.
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var appearance = new Cesium.PerInstanceColorAppearance({
flat: true,
renderState: {
blending: {
enabled: true,
equationRgb: Cesium.BlendEquation.MIN,
equationAlpha: Cesium.BlendEquation.MIN,
functionSourceRgb: Cesium.BlendFunction.ONE,
functionSourceAlpha: Cesium.BlendFunction.ONE,
functionDestinationRgb: Cesium.BlendFunction.ZERO,
functionDestinationAlpha: Cesium.BlendFunction.ZERO
}
},
});
// Two rectangles in a primitive, each with a different color
var instance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 50.0)
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
}
});
var anotherInstance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(0.0, 0.0, 1.0, 0.5))
}
});
var rectanglePrimitive = scene.primitives.add(new Cesium.Primitive({
geometryInstances : [instance, anotherInstance],
appearance : appearance
}));
Any direction or example would be very helpful.