CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.94k stars 3.49k forks source link

Primitive ordering regression #6569

Open hpinkos opened 6 years ago

hpinkos commented 6 years ago

In Cesium 1.29, the using raiseToTop makes the polyline render on top of the billboard and label. However, in Cesium 1.30 this is no longer the case.

Reported by @erezy

https://groups.google.com/forum/#!topic/cesium-dev/ywyFR5GSi_c

var viewer = new Cesium.Viewer('cesiumContainer',{
    sceneMode: Cesium.SceneMode.SCENE2D 
});

var polylines = new Cesium.PolylineCollection();
polylines.add({
  positions : Cesium.Cartesian3.fromDegreesArray([
    -75.10, 39.57,
    -77.02, 38.53,
    -80.50, 35.14,
    -80.12, 25.46]),
  width : 2,
   material : new Cesium.Material({
    fabric : {
        type : 'Color',
        uniforms : {
            color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)
        }
    }
})
});

var billboards = new Cesium.BillboardCollection();
billboards.add({
  position : Cesium.Cartesian3.fromDegrees(-77.02, 38.53),
  image : '../images/Cesium_Logo_overlay.png'
});
var labels = new Cesium.LabelCollection();
labels.add({
  position : Cesium.Cartesian3.fromDegrees(-80.50, 35.14),
    text : 'A label',
    fillColor: Cesium.Color.BLUE
});

var primitives = viewer.scene.primitives;
primitives.add(labels);
primitives.add(billboards);  // Add collection
primitives.add(polylines);

primitives.raiseToTop(polylines);
erezy commented 5 years ago

Hi @hpinkos , do you have news on this issue? are you still working on it?

hpinkos commented 5 years ago

@erezy no sorry, we haven't had a chance to look into this. I'm guessing the regression came with this PR: https://github.com/AnalyticalGraphicsInc/cesium/pull/4886