Underground wall objects with clipping planes show with weird texture (barcode-like)

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

Wall’s, when placed underground combined with clipping planes, show weird texture (parallel blackish lines)

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

viewer.entities.add({
    name : "My Wall",
    wall : {
        positions : Cesium.Cartesian3.fromDegreesArrayHeights(points),
        material : "white.png",
        minimumHeights: Array(profile.points.length).fill(-10)
    },
});

//Creatinh clipping planes

// Create center points for each clipping plane
var clippingPlanes = ;
for (var i = 0; i < pointsLength; ++i) {
var nextIndex = (i + 1) % pointsLength;
var midpoint = Cesium.Cartesian3.add(points[i], points[nextIndex], new Cesium.Cartesian3());
midpoint = Cesium.Cartesian3.multiplyByScalar(midpoint, 1, midpoint);

var up = Cesium.Cartesian3.normalize(midpoint, new Cesium.Cartesian3());
var right = Cesium.Cartesian3.subtract(points[nextIndex], midpoint, new Cesium.Cartesian3());
right = Cesium.Cartesian3.normalize(right, right);

var normal = Cesium.Cartesian3.cross(right, up, new Cesium.Cartesian3());
normal = Cesium.Cartesian3.normalize(normal, normal);

// Compute distance by pretending the plane is at the origin
var originCenteredPlane = new Cesium.Plane(normal, 0.0);
var distance = Cesium.Plane.getPointDistance(originCenteredPlane, midpoint);

clippingPlanes.push(new Cesium.ClippingPlane(normal, distance));

}
globe.clippingPlanes = new Cesium.ClippingPlaneCollection({
planes : clippingPlanes,
edgeWidth: 1.0,
edgeColor: Cesium.Color.WHITE,
enabled : true
});


``

And it looks like (it was supposed to look juste white... I also tested with different images and the results are all similar)

![Screen Shot 2019-09-17 at 6.58.21 AM.png|1298x1174](upload://465NIixZkuZ7iOU1nGEoPvTtLj9.png)

![Screen Shot 2019-09-17 at 6.47.17 AM.png|1326x1248](upload://tsJkyiReoZESP2fxyjW8AWzOFa8.png)

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

I would like to show underground objects with clipping planes

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

1.6.1, MacOs Mojave, Google Chrome

Thank you guys!

Sorry for the black background guys. I also have a weird-looking polylineVolume

Screen Shot 2019-09-17 at 7.59.51 AM.png

Thanks for reporting this. There are a couple of open issues with underground rendering in CesiumJS right now, see: https://github.com/AnalyticalGraphicsInc/cesium/issues/5665

We are planning on improving this soon. If you can put together a full code example we can run on Sandcastle (https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html), that’d help a lot in making sure we cover this case. You can put together your example there, then press “share” in the top and copy/paste the link you get here.

Sure thing, will do that Omar. Now, is there any relation between the poor rendering of the polylineVolume (upper ground) and the underground object?

So here goes the attachement. I actually found a work around for my case but for most underground objects it won’t work. In my case, the top edge of my wall was at height 0, and that’s what causes it to either not appear at all or render with the weird texture. Now, if the geometry is near ground level, setting the height to 0.01 does the trick and the texture gets rendered as it was supposed to.

Wall.html (3.65 KB)

I can’t seem to recreate the broken texture with the code you provided (but I can see that it doesn’t render unless you move the height to above 0).

The problem would be for underground objects that aren’t close to the surface then, right?