Cesium: Overlapping billboards blended incorrectly

Created on 5 Apr 2017  路  9Comments  路  Source: CesiumGS/cesium

The icon blending issues fixed in #5066 can still be reproduced with a lot of overlapping icons.

Take the following Sandcastle snippet:

var viewer = new Cesium.Viewer('cesiumContainer');

var altitude = 75000;
var count = 5000;
var opacity = 1.0;
var degrees = 1;

for (var i = 0; i < count; i++) {
    viewer.entities.add({
        position : Cesium.Cartesian3.fromDegrees(Math.random() * degrees, Math.random() * degrees),
        billboard :{
            image : 'http://maps.google.com/mapfiles/kml/shapes/parks.png',
            scale : 0.5,
            color : new Cesium.Color(1.0, 1.0, 1.0, opacity)
        }
    });
}

viewer.camera.flyTo({
    destination : Cesium.Cartesian3.fromDegrees(degrees / 2, degrees / 2, altitude)
});

At the provided altitude, icon borders bleed into other icons:
screen shot 2017-04-05 at 2 42 52 pm

If you zoom out, the icon borders no longer overlap.

category - billboards type - bug

All 9 comments

@schmidtk thanks for the report and code example.

@emackey any ideas?

This is a somewhat fleeting glimpse of the bug, only viewable from very few angles and distances. It looks like it starts to happen right along a frustum boundary.

@bagnell as a test, I tried setting OPAQUE_FRUSTUM_NEAR_OFFSET (in Scene.js) to exactly 1.0, and sure enough, this reproduce case goes away. I believe that means this is actually a lingering effect of #5083, where the edges of the trees are not quite at the same depth as the interior of each tree. The teeny depth offset is enough, from this particular view angle & distance, to cause the bad edge behavior against other trees.

@bagnell could we use the same frustum for both opaque & translucent, with a slight overlap, but just use a clipping plane (or non-1.0 depth clear value) to prevent overlap in the translucent pass?

We are affected by this bug as well. It seems that there are also times when a billboard can be between frustums and only render it's 'outline', where the 'outline' is just pixels that have non-zero and non-one alpha in the texture. At a glance, it seems that the billboard has disappeared.

Here are some images of a billboard moving away from the camera along the terrain and through the frustum boundaries.

billboardclose

billboardmid

billboardhalfmid
billboardfar

Thanks for the extra details @ZacLiveEarth! Could you attach that icon to this issue so we can use it for testing?

Pretty much any png with anti-aliased edges will do. The tree icon above, for example, should work just fine.

@ZacLiveEarth Gotcha, thanks =)

Appears fixed
image

@hpinkos Confirmed, thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thw0rted picture thw0rted  路  4Comments

pjcozzi picture pjcozzi  路  4Comments

JacksonBates picture JacksonBates  路  3Comments

hanbollar picture hanbollar  路  4Comments

thw0rted picture thw0rted  路  4Comments