Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlapping billboards blended incorrectly #5185

Closed
schmidtk opened this issue Apr 5, 2017 · 9 comments
Closed

Overlapping billboards blended incorrectly #5185

schmidtk opened this issue Apr 5, 2017 · 9 comments

Comments

@schmidtk
Copy link

schmidtk commented Apr 5, 2017

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.

@pjcozzi
Copy link
Contributor

pjcozzi commented Apr 6, 2017

@schmidtk thanks for the report and code example.

@emackey any ideas?

@emackey
Copy link
Contributor

emackey commented Apr 6, 2017

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?

@ZacLiveEarth
Copy link

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.

@ZacLiveEarth
Copy link

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

billboardclose

billboardmid

billboardhalfmid
billboardfar

@hpinkos
Copy link
Contributor

hpinkos commented Feb 26, 2018

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

@ZacLiveEarth
Copy link

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

@hpinkos
Copy link
Contributor

hpinkos commented Feb 26, 2018

@ZacLiveEarth Gotcha, thanks =)

@hpinkos
Copy link
Contributor

hpinkos commented Sep 19, 2019

Appears fixed
image

@hpinkos hpinkos closed this as completed Sep 19, 2019
@schmidtk
Copy link
Author

@hpinkos Confirmed, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants