# Geometry 'slicing' artifact

**URL:** <https://community.cesium.com/t/geometry-slicing-artifact/767>\
**Category:** CesiumJS\
**Created:** [October 8, 2013, 4:35am UTC](https://community.cesium.com/t/geometry-slicing-artifact/767 "2013-10-08T04:35:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver\_Lade](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@Oliver\_Lade](https://community.cesium.com/u/Oliver_Lade)\
**Post date:** [October 8, 2013, 4:35am UTC](https://community.cesium.com/t/geometry-slicing-artifact/767/1 "2013-10-08T04:35:07Z")

</div>

While rendering some fairly basic primitives, I’m getting a strange artifact that looks like there’s something slicing through the geometries.

[![](https://lh3.googleusercontent.com/-2yqP1jWBoLM/UlOJPp6F88I/AAAAAAAAxi8/8d6Ko29vzSM/s320/slicing-flat.JPG)](https://lh3.googleusercontent.com/-2yqP1jWBoLM/UlOJPp6F88I/AAAAAAAAxi8/8d6Ko29vzSM/s1600/slicing-flat.JPG)

With terrain on, a similar thing happens, but it’s more obvious as the terrain appears to cut through the 2D geometry too.

[![](https://lh5.googleusercontent.com/-OCnUUYdN0jk/UlOHt_i6BAI/AAAAAAAAxiw/T4fSTRPk7yQ/s320/slicing.JPG)](https://lh5.googleusercontent.com/-OCnUUYdN0jk/UlOHt_i6BAI/AAAAAAAAxiw/T4fSTRPk7yQ/s1600/slicing.JPG)

It appears as a line whose width and angle are dependent on the position of the camera. The width of the line seems to increase as the gets higher (or as I middle-click pan up and tilt down), it’s always perpendicular to the direction of the camera across the plane of the ellipsoid, and as I zoom in it gets further away.

Do you know what this might be? Have we set something up incorrectly?

We’re creating the geometries like:

```
  var poly = new Cesium.GeometryInstance({

    geometry: new Cesium.PolygonGeometry({

      polygonHierarchy: { positions: vertices },

      height: height

    }),

    id: args.id,

    attributes: {

      color: Cesium.ColorGeometryInstanceAttribute.fromColor(DEFAULT_COLOR)

    }

  });

```

Then wrap that in a primitive:

```
    new Primitive({

      geometryInstances: poly,

      appearance: new Cesium.EllipsoidSurfaceAppearance()

    });

    scene.getPrimitives().add(primitive);
```

---

<div class="post-metadata">

**Author:** ![Oliver\_Lade](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@Oliver\_Lade](https://community.cesium.com/u/Oliver_Lade)\
**Post date:** [October 8, 2013, 7:40am UTC](https://community.cesium.com/t/geometry-slicing-artifact/767/2 "2013-10-08T07:40:28Z")

</div>

I’ve done some work cleaning up our primitive creation, but the problem remains. We now create geometry with:

new GeometryInstance({

```
    id: parseInt(args.id),

    geometry: new Cesium.PolygonGeometry({

      polygonHierarchy: {positions: vertices},

      height: minTerrainHeight + altitude,

      extrudedHeight: minTerrainHeight + altitude + extrusionHeight

    })

  });

```

And primitives with:

```
    if (!is3d) {

      appearance = new Cesium.EllipsoidSurfaceAppearance();

    } else {

      appearance = new Cesium.MaterialAppearance({closed: true, flat: true});

    }

    appearance.material.uniforms.color = color;

```

The artifact doesn’t appear to affect the 2D geometries with the EllipsoidSurfaceAppearance.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [October 9, 2013, 11:42am UTC](https://community.cesium.com/t/geometry-slicing-artifact/767/3 "2013-10-09T11:42:31Z")

</div>

Hi Oliver,

Your code is OK. This is a known-issue with translucent objects due to how we eliminate z-fighting for massive view distances. Opaque objects do not have this artifact. If you are curious about the details, see these slides (Slides 29 and 30 in particular):

> [Cesium: The Platform for 3D Geospatial](http://cesium.agi.com/massiveworlds/index.html#UsingMultipleFrustumsforMassiveWorlds)

We can minimize the artifact a bit more by reducing frustum overlap, but fully eliminating it in the general case is hard. Recently, I almost solved it with stenciling, but it didn’t turn out as expected. I hope to think about it again, but it will be a few months out.

As for the screenshot with terrain, Kevin may have more to add.

Patrick
