# Cesium 1.22 shadows feature

**URL:** <https://community.cesium.com/t/cesium-1-22-shadows-feature/4184>\
**Category:** CesiumJS\
**Created:** [June 2, 2016, 1:57pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184 "2016-06-02T13:57:54Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![MP11](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@MP11](https://community.cesium.com/u/MP11)\
**Post date:** [June 2, 2016, 1:57pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/1 "2016-06-02T13:57:54Z")

</div>

I was going through Cesium new [release 1.22](https://cesiumjs.org/2016/06/01/Cesium-version-1.22-released/) and tried to implement its [shadows](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Shadows.html&label=Showcases) feature. I minimized the sample code to following to know how it works.

```auto
var viewer = new Cesium.Viewer('cesiumContainer', {
    shadows : true,
});

var woodTower = viewer.entities.add({
    name : 'Wood Tower',
    height : 0.0,
    model : {
        uri : 'SampleData/models/WoodTower/Wood_Tower.gltf'
    }
});

var locations = {
    Exton : {
        longitude : -1.31968,
        latitude : 0.698874,
        height : 74.14210186070714,
        date : 2457522.154792
    },
};

woodTower.position = Cesium.Cartesian3.fromRadians(locations.Exton.longitude, locations.Exton.latitude, woodTower.height);

function setEntity(entity) {
    viewer.trackedEntity = entity;
    viewer.clock.currentTime = new Cesium.JulianDate(2457530.154792);
    viewer.clock.multiplier = 1.0;
}
setEntity(woodTower);

```

It works fine if ‘Wood\_Tower.gltf’ is loaded, but does not work if I change it to :

```auto
var woodTower = viewer.entities.add({
    name : 'Green1 extruded polygon',
    polygon : {
        hierarchy : Cesium.Cartesian3.fromDegreesArray([-109.0, 42.0,
                                                        -111.0, 42.0,
                                                        -112.0, 40.0]),
        extrudedHeight: 500000.0,
        material : Cesium.Color.GREEN
    }
});

```

```auto

```

What am I missing in it?

Any help is much appreciated!

---

<div class="post-metadata">

**Author:** ![sean\_lilley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sean_lilley/32/2083_2.png) [@sean\_lilley](https://community.cesium.com/u/sean_lilley)\
**Post date:** [June 2, 2016, 6:04pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/2 "2016-06-02T18:04:23Z")

</div>

Right now we don’t have shadows support for non-model entities, though we do have a branch where this is working: [https://github.com/AnalyticalGraphicsInc/cesium/tree/shadows-entity](https://github.com/AnalyticalGraphicsInc/cesium/tree/shadows-entity). We weren’t sure how often users would enable shadows for shapes, so we decided to leave it out of this release. If you decide to check it out, make sure to also set castShadows and receiveShadows to true in the polygon because shadows are off by default for non-model entities. I’ll keep this thread up-to-date if we decide merge that branch into master.

---

<div class="post-metadata">

**Author:** ![MP1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mp1/32/1987_2.png) [@MP1](https://community.cesium.com/u/MP1)\
**Post date:** [June 4, 2016, 3:30pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/3 "2016-06-04T15:30:18Z")

</div>

Hi Sean,

I tried this with new cesium-shadows-entity checkout:

var cesiumAir = viewer.entities.add({

name : ‘Green1 extruded polygon’,

polygon : {

hierarchy : Cesium.Cartesian3.fromDegreesArray([-109.0, 42.0,

-111.0, 42.0,

-112.0, 40.0]),

extrudedHeight: 500000.0,

material : Cesium.Color.GREEN,

castShadows : true,

receiveShadows : true,

},

});

But this does not work ☹

Could you please post an example where this works?

---

<div class="post-metadata">

**Author:** ![Greg\_Angevine](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Greg\_Angevine](https://community.cesium.com/u/Greg_Angevine)\
**Post date:** [June 5, 2016, 6:44pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/4 "2016-06-05T18:44:35Z")

</div>

Hi Sean, shadows for shapes is very important to many urban visualizations. Please include this in the next release.

Thanks,

Greg

---

<div class="post-metadata">

**Author:** ![sean\_lilley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sean_lilley/32/2083_2.png) [@sean\_lilley](https://community.cesium.com/u/sean_lilley)\
**Post date:** [June 6, 2016, 8:11pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/5 "2016-06-06T20:11:02Z")

</div>

Hi Greg, we are very likely going to ship it in the next release. Check out [https://github.com/AnalyticalGraphicsInc/cesium/pull/3928](https://github.com/AnalyticalGraphicsInc/cesium/pull/3928) for details.

---

<div class="post-metadata">

**Author:** ![sean\_lilley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sean_lilley/32/2083_2.png) [@sean\_lilley](https://community.cesium.com/u/sean_lilley)\
**Post date:** [June 6, 2016, 8:25pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/6 "2016-06-06T20:25:54Z")

</div>

Hi Pat, right now the shadow implementation is geared towards views that are closer to Earth with more realistic sized objects. However we will look into making it work for cases like your example as well.

Here is an example that shows a polygon with shadows on the shadows-entity branch: [http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/shadows-entity/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=c41f2d61156b266190efd06e0508569c](http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/shadows-entity/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=c41f2d61156b266190efd06e0508569c)

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [June 6, 2016, 8:26pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/7 "2016-06-06T20:26:49Z")

</div>

I think it’s also important to point out that “urban visualization” will be covered by 3D Tiles, which will absolutely support shadows and this had more to do with trying to avoid bloat in the Entity API.

---

<div class="post-metadata">

**Author:** ![Greg\_Angevine](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Greg\_Angevine](https://community.cesium.com/u/Greg_Angevine)\
**Post date:** [July 1, 2016, 5:09pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/8 "2016-07-01T17:09:08Z")

</div>

Hi Sean, did shadowing for shapes make it into 1.23?

Thanks,

Greg

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [July 1, 2016, 5:18pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/9 "2016-07-01T17:18:30Z")

</div>

Hello Greg,

It looks like entity shadows was not quite ready for the 1.23 release.

Keep an eye on this PR [https://github.com/AnalyticalGraphicsInc/cesium/pull/4005](https://github.com/AnalyticalGraphicsInc/cesium/pull/4005)

It should be ready by the 1.24 release.

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![Greg\_Angevine](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Greg\_Angevine](https://community.cesium.com/u/Greg_Angevine)\
**Post date:** [July 1, 2016, 5:19pm UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/10 "2016-07-01T17:19:53Z")

</div>

Great, thanks Hannah!

---

<div class="post-metadata">

**Author:** ![Greg\_Angevine](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Greg\_Angevine](https://community.cesium.com/u/Greg_Angevine)\
**Post date:** [August 12, 2016, 3:29am UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/11 "2016-08-12T03:29:30Z")

</div>

Hi Hannah, might you know if the entity shadows logic will be released in 1.25? I didn’t see it in the release notes for 1.24.

Best,

Greg

---

<div class="post-metadata">

**Author:** ![Poul\_Sorensen](https://avatars.discourse-cdn.com/v4/letter/p/fbc32d/32.png) [@Poul\_Sorensen](https://community.cesium.com/u/Poul_Sorensen)\
**Post date:** [August 12, 2016, 11:40am UTC](https://community.cesium.com/t/cesium-1-22-shadows-feature/4184/12 "2016-08-12T11:40:27Z")

</div>

Greg, you can see that release 1.24 was 01AUG, [https://cesiumjs.org/2016/08/01/Cesium-version-1.24-released/](https://cesiumjs.org/2016/08/01/Cesium-version-1.24-released/). and the PR [https://github.com/AnalyticalGraphicsInc/cesium/pull/4005](https://github.com/AnalyticalGraphicsInc/cesium/pull/4005) mentioned was merged 9 dayes ago, ergo it can not be in 1.24 🙂

So i would assume you can use it in 1.25 🙂
