z-order i3dm and VectorData-Polygons

1. A concise explanation of the problem you're experiencing.

I have added vector data polygons (*.vctr) and i3dm data to the scene. The pixels of i3dm data are overlayed by vector data. But I expect to see the trees as they are, without the red color from vector data.

I tried to change the order of primitives.add, but it does not change the draw order.

Can I configure something to change the z-order?

I found a todo "Future work Polygon z-order": https://github.com/AnalyticalGraphicsInc/cesium/pull/4665 may be it is a known issue?

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

var viewer = new Cesium.Viewer('cesiumContainer', {
        terrainProvider: Cesium.createWorldTerrain()
  });

var flstTileset = new Cesium.Cesium3DTileset({
    url: ‘https://raw.githubusercontent.com/vitjok/testfile/master/vectordata/
});
flstTileset.style = new Cesium.Cesium3DTileStyle({
    color: ‘rgba(255, 0, 0, 0.3)’
});
var vctr = viewer.scene.primitives.add(flstTileset);

var treeTileset = new Cesium.Cesium3DTileset({
    url: ‘https://raw.githubusercontent.com/vitjok/testfile/master/i3dm/
});
var tree = viewer.scene.primitives.add(treeTileset);

viewer.zoomTo(flstTileset);

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I want to see the Polygons on the terrain and the trees over the terrain and over the Polygons.

4. The Cesium version you're using, your operating system and browser.

Cesium 1.46
Windows 10
Chrome 67.0.3396.87

code example in Sandcastle: https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=vZLBSgMxEIZfJexlt1AStfRS1yLoUVBo0cte0mTaRrNJmcymtOK7m+22uFXEmyEQMjP/zDeTRIksGtgCshvmYMvuIJim5s8HW5Grw/XOO5LGAeZD9l45dlwEiMn8hD4aDTg5iRWCJHjxaPW8CykGlavoY3CdDhdTzaUNNDcWAtB54e4Y3R+dxbFcg3bC8jXRJkyEQLnlK0PrZtEEQJXowBFXvhbR0Kt/EwSBlimDqGVIlCKCIo9akhR55Q4cPQIeaGfhd45Z6z6RKG99ajXH1UIWV+PxkF10m48Gp9xth1FRO9NuuDwocMA3aGpDJkLgUuuih/A1GUKAf5yMGela9Lnb+n9w9xA77qTswvfe13P/vbFsmJWHEU875FtTbzxSi15wnpDqjU0fJohFo97Sc6gQWlkpTqJSm8iMvqmyb/+xypiyMoTkWTbWzsweqmxaihR/JrNeauNWjxHQyl0bsr6cPnRGznkp0vWniry3C4m9jJ8

Hi Maximus,

We have added geometry z-ordering in Cesium 1.46, however as you pointed out, it has no made it’s way into vector tiles yet (as they are still experimental). 3D Tiles Issue #69 covers adding it to the specification, I’ll bump that issue with this request.

Thanks,

Gabby

Hi Gabby,

I just noticed, that the sample does not work anymore (in current Version I have to append tileset.json to the url option).

And then (more important) I noticed a post about ClassificationType.TERRAIN https://cesiumjs.org/forum/#!msg/cesium-dev/1ptAh6n82KM/1kEFweikAQAJ (by Dan Bagnell).

This option seams to fix the issue.

Sample code:

var viewer = new Cesium.Viewer('cesiumContainer', {
        terrainProvider: Cesium.createWorldTerrain()
        });

var flstTileset = new Cesium.Cesium3DTileset({
    classificationType: Cesium.ClassificationType.TERRAIN,
    url: 'https://raw.githubusercontent.com/vitjok/testfile/master/vectordata/tileset.json'
});
flstTileset.style = new Cesium.Cesium3DTileStyle({
    color: 'rgba(255, 0, 0, 0.3)'
});
var vctr = viewer.scene.primitives.add(flstTileset);

var treeTileset = new Cesium.Cesium3DTileset({
    url: 'https://raw.githubusercontent.com/vitjok/testfile/master/i3dm/tileset.json'
});
var tree = viewer.scene.primitives.add(treeTileset);

viewer.zoomTo(flstTileset);

Thanks,
Maximus

Perfect, thanks for the update! Setting the classification type to terrain will indeed work in this case, good thinking.