ground primitive rendering weirdness

Hi,

I’ve been experimenting with rendering ground primitives on terrain. Things look great and flush from a high level, but once I zoom the view in and start to rotate, I get the weird lines and star patterns shown in the attached pics. This occurs on some computers and not on others. My 2012 Macbook Pro does not produce this behavior, but a friend’s 2015 Macbook Pro does. A 2009 MBP also exhibited the same behavior. For each computer the rendering either works or doesn’t work in all browsers tried. My current thought is it’s something to do with a difference in GPUs?

I’ve gotten these results with Cesium 1.14 and then just tried again today with Cesium 1.15. Same rendering problem:

From a high level:

Zooming in. Weirdness starts:

Continuing to zoom in and tilt:

I am adding the GroundPrimitive via a PolygonGeometry with an array of degrees with height (lng,lat,alt,lng,lat,alt,…)


var myGeom = new Cesium.GeometryInstance({

id: myId,

geometry: new Cesium.PolygonGeometry({

polygonHierarchy: {

positions: Cesium.Cartesian3.fromDegreesArrayHeights(myDegreeArrayWithHeights)

}

}),

attributes: {

color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.4))

}

});

myCesiumViewer.scene.groundPrimitives.add(new Cesium.GroundPrimitive({

geometryInstance: myGeom

}));

Has anyone else seen this or have any idea of the cause? Thanks for any info.

-Jamie

use following code.I hope to help you.
var primitive = new Cesium.GroundPrimitive({
  geometryInstance : myGeom,
  appearance : new Cesium.PerInstanceColorAppearance({
    flat : false,
    translucent : false
  })
});
scene.primitives.add(primitive);

Thanks for the reply. I tried to specify the appearance attribute on GroundPrimitive as you suggested above but the rendering problem still appears.

I also tried messing around with the PerInstanceColorAppearance.closed option, but that didn’t seem to have any effect either.

Another data point: the rendering problem seen in the images above becomes more dramatic the greater the vertical relief of the terrain. If the polygon is draped over an area going from low elevation to high elevation the entire image is often consumed in the type of lines and star patterns seen in the last two images.

Hi Jamie,

Could you post a sample set of points that causes this to happen? That will make it easier for us to track down the problem.

Thank you!

-Hannah

Definitely.

[-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]

Here is the array of [lng,lat,alt,lng,lat,alt…] that was sent into Cesium.Cartesian3.fromDegreesArrayHeights() to produce the PolygonGeometry seen in the images above. If you render this with a GroundPrimitive/PolygonGeometry and then zoom in to an edge of the square and tilt the view you (may, depending on your machine & GPU?) see what I’ve been seeing.

Great, thanks.

I didn’t see this issue on my machine, but I’ll create an issue on Github so someone else on the team can look into it. What is your OS and GPU? And what browser were you using?

-Hannah

I’ve seen it on a couple Macbook Pros. One of the MBPs that shows the problem is OSX 10.10.5 (Yosemite) with the following graphics info:

AMD Radeon R9 M370X:

Chipset Model: AMD Radeon R9 M370X

Type: GPU

Bus: PCIe

PCIe Lane Width: x8

VRAM (Total): 2048 MB

Vendor: ATI (0x1002)

Device ID: 0x6821

Revision ID: 0x0083

ROM Revision: 113-C5670E-777

gMux Version: 4.0.20 [3.2.8]

EFI Driver Version: 01.00.777

Displays:

Color LCD:

Display Type: Retina LCD

Resolution: 2880 x 1800 Retina

Retina: Yes

Pixel Depth: 32-Bit Color (ARGB8888)

Mirror: Off

Online: Yes

Built-In: Yes

Great! Thanks so much for all of the details.
I created an issue here: https://github.com/AnalyticalGraphicsInc/cesium/issues/3171

-Hannah

Some additional data: the below NVIDIA GPU from a 2009 MBP also produces the rendering problem with GroundPrimitive and fromDegreesArray:

NVIDIA GeForce 9400M:

Chipset Model: NVIDIA GeForce 9400M
Type: GPU
Bus: PCI
VRAM (Total): 256 MB
Vendor: NVIDIA (0x10de)
Device ID: 0x0863
Revision ID: 0x00b1
ROM Revision: 3427
Displays:
Color LCD:
Resolution: 1280 x 800
Pixel Depth: 32-Bit Color (ARGB8888)
Main Display: Yes
Mirror: Off
Online: Yes
Built-In: Yes
Display Connector:
Status: No Display Connected