CesiumGS / CesiumGS/cesium

GroundPrimitive rendering artifacts

Open
#3,171 14 comments 0 reactions 0 assignees View on GitHub
category - polygons/geometry type - bug
Dominant language
JavaScript
Stars
15.8k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

Reported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/6qt-wb-SohY

![image](https://cloud.githubusercontent.com/assets/3451886/10984670/fe7ca16c-83e8-11e5-9042-d64785128019.png)

This might be either mac or AMD specific. I wasn't able to reproduce this on my machine, but this user saw it on a Macbook Pro with an AMD GPU. It occurs when zooming in and viewing the polygon from certain angles. See the forum post for more details.

```
var viewer = new Cesium.Viewer('cesiumContainer');

var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({
url : '//assets.agi.com/stk-terrain/world',
requestWaterMask : true,
requestVertexNormals : true
});
viewer.terrainProvider = cesiumTerrainProviderMeshes;

var pos = [-106.70223205,40.50751048,3108,-106.70231189,40.50719517,3100,-106.7023843,40.50697001,3094,-106.70243232,40.50681935,3090,-106.70250271,40.5066019,3083,-106.70259377,40.50619344,3073,-106.70263983,40.50604864,3069,-106.70268295,40.50579201,3062,-106.70271371,40.50564398,3057,-106.70273965,40.50557274,3053,-106.70276796,40.50531077,3045,-106.70279042,40.50523906,3044,-106.70281277,40.50516771,3043,-106.70285192,40.50504112,3040,-106.70285105,40.50498227,3039,-106.70286683,40.50486993,3038,-106.70288338,40.5047512,3037,-106.70290059,40.50469215,3036,-106.70291193,40.50465355,3036,-106.70292889,40.5045959,3036,-106.70296262,40.50448086,3035,-106.70301364,40.50430164,3035,-106.70304165,40.50420326,3035,-106.70305836,40.50414445,3035,-106.70306945,40.50410539,3035,-106.70309699,40.50400864,3035,-106.703119,40.50393048,3035,-106.70311333,40.50382028,3035,-106.70311326,40.50375577,3035,-106.70310217,40.50366658,3036,-106.70309663,40.5035588,3036,-106.7031076,40.50351989,3036,-106.70310223,40.50347508,3037,-106.70311321,40.50343588,3037,-106.70312416,40.50339683,3037,-106.70314046,40.50333886,3038,-106.70317261,40.50328907,3037,-106.70318312,40.50325271,3037,-106.70323643,40.50319025,3037,-106.70326295,40.50315917,3037,-106.70330982,40.50305671,3037,-106.70333013,40.50298569,3037,-106.70334527,40.50293273,3037,-106.70339025,40.50277541,3037,-106.70340503,40.50272411,3037,-106.70343897,40.50260833,3037,-106.7034534,40.50255908,3037,-106.70347202,40.50249932,3036,-106.70348591,40.50245481,3035,-106.70350443,40.50239484,3034,-106.70351826,40.50235006,3033,-106.7035411,40.50227685,3032,-106.70355447,40.50223604,3031,-106.70349261,40.50221506,3031,-106.70309123,40.50207977,3034,-106.70200464,40.50176103,3036,-106.70087057,40.50172853,3035,-106.700331,40.5018247,3033,-106.69873514,40.50176053,3037,-106.69851119,40.50169164,3038,-106.69836038,40.50152504,3039,-106.69807085,40.50141102,3040,-106.69774118,40.50130369,3041,-106.69750227,40.50120541,3044,-106.69678538,40.50114025,3043,-106.69638718,40.50110116,3041,-106.69560964,40.50088376,3042,-106.69536529,40.50081604,3042,-106.69500127,40.50072198,3040,-106.69484808,40.50068738,3039,-106.69467942,40.50064713,3038,-106.69449011,40.50115032,3036,-106.69434659,40.50147135,3035,-106.6938443,40.50243353,3041,-106.69350654,40.50297144,3051,-106.6929781,40.50382496,3085,-106.69278407,40.50409533,3089,-106.69279539,40.50429847,3090,-106.69274412,40.50472061,3093,-106.69234961,40.50559242,3091,-106.69139427,40.50701375,3079,-106.69111443,40.50740422,3078,-106.69089001,40.50771678,3076,-106.69107519,40.50775148,3077,-106.69135232,40.50780339,3079,-106.69340584,40.50795246,3101,-106.69534761,40.50801909,3124,-106.69626365,40.50793214,3138,-106.69712806,40.50785158,3147,-106.69775128,40.5078214,3146,-106.69790381,40.50783061,3147,-106.6981772,40.50791936,3148,-106.69891842,40.50822559,3149,-106.69924123,40.50836704,3148,-106.6999645,40.50863474,3144,-106.700285,40.50866932,3141,-106.70037259,40.50867131,3141,-106.70042119,40.50865747,3141,-106.70074046,40.50862013,3139,-106.70090489,40.50865367,3137,-106.70128863,40.50868389,3135,-106.70141291,40.50870639,3133,-106.70162049,40.50874742,3130,-106.70166649,40.50874076,3130,-106.70173136,40.50874534,3128,-106.70179559,40.50875389,3127,-106.7018538,40.50877897,3127,-106.70191239,40.50880195,3126,-106.70199749,40.50880949,3125,-106.70206303,40.5088092,3124,-106.70207731,40.50875908,3124,-106.70208575,40.50865554,3123,-106.70208719,40.50857644,3122,-106.70206234,40.50851386,3121,-106.70204609,40.50834978,3120,-106.70202152,40.50828782,3119,-106.70201622,40.50823352,3119,-106.7020374,40.50816088,3118,-106.70203956,40.50808012,3117,-106.70206062,40.50800797,3117,-106.70207459,40.50796008,3116,-106.70208849,40.50791261,3116,-106.70210864,40.50784577,3115,-106.70213527,40.50775779,3113,-106.70214837,40.50771513,3112,-106.70216142,40.50767258,3112,-106.70217444,40.50763016,3111,-106.7021939,40.50756674,3109,-106.70220682,40.50752462,3109];

var myGeom = new Cesium.GeometryInstance({
geometry: new Cesium.PolygonGeometry({
polygonHierarchy: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights(pos)
}
}),
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.4))
}
});

viewer.scene.groundPrimitives.add(new Cesium.GroundPrimitive({
geometryInstance: myGeom
}));

viewer.scene.camera.setView({destination: Cesium.Cartesian3.fromDegrees(-106.7022, 40.5075, 10000)});
```

Contributor guide

Open the contributing guide

Research direction

Start with the provided Cesium Viewer example, especially CesiumTerrainProvider, PolygonGeometry, and viewer.scene.groundPrimitives.add. Reproduce the artifacts while zooming and changing viewing angles, using the linked forum report for additional context and testing on the reported Mac/AMD setup. Done means the supplied GroundPrimitive polygon renders without the reported artifacts.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.