How to show shadow for polygon

589 views
Skip to first unread message

sunhui...@gmail.com

unread,
Jul 10, 2018, 4:59:59 AM7/10/18
to cesium-dev


1. A concise explanation of the problem you're experiencing.
I am trying to show shadow in Sandcastle. I set shadows and terrainShadows in Cesium Viewer, and I add new Cesium.Primitive including shadows to viewer.scene.primitives.


2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
I click "Custom styling" button. No shadow for polygon.
And if we set "terrainShadows: Cesium.ShadowMode.ENABLED". After we zoom in, then the poly will disappear.



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



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

Win10, latest Chrome

patrick.h...@gmail.com

unread,
Jul 13, 2018, 4:29:14 AM7/13/18
to cesium-dev
I am also having this problem.

How to enable shadows for geojson data sources?
Here is a sandcastle.

Omar Shehata

unread,
Jul 13, 2018, 1:22:12 PM7/13/18
to cesium-dev
So there's two things here:

1. You need to enable shadows on the entity (as seen in the Shadows sandcastle example).

So in both yo.ur cases you would need to do:

entity.polygon.shadows = Cesium.ShadowMode.ENABLED

In the callback after it's added.

2. For very large objects, like those continent-sized polygons, shadows don't seem to render. This is a bug in Cesium. See this GitHub issue.

Contributions are of course always appreciated!

Xavier Tassin

unread,
Jul 17, 2018, 8:39:23 AM7/17/18
to cesium-dev
Polygons do not receive shadows, at all, as shown in this example https://goo.gl/c1oFMt
Reply all
Reply to author
Forward
0 new messages