# Cesium Cartographic Polygon

**URL:** <https://community.cesium.com/t/cesium-cartographic-polygon/15128>\
**Category:** Cesium for Unreal\
**Created:** [September 3, 2021, 6:57am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128 "2021-09-03T06:57:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![shefypattambi](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/shefypattambi/32/3476_2.png) [@shefypattambi](https://community.cesium.com/u/shefypattambi)\
**Post date:** [September 3, 2021, 6:57am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/1 "2021-09-03T06:57:55Z")

</div>

Hello,  
How can I use this new feature “Cesium Cartographic Polygon” in Unreal?

---

<div class="post-metadata">

**Author:** ![agallegos](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/agallegos/32/4464_2.png) [@agallegos](https://community.cesium.com/u/agallegos)\
**Post date:** [September 3, 2021, 3:50pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/2 "2021-09-03T15:50:50Z")

</div>

Hi @shefypattambi,

Thanks for asking! The Cesium Cartographic Polygon actor, released in Cesium for Unreal 1.6.0, can be used to mask out or apply material effects to areas of terrain. We’re currently working on creating tutorials for this feature. In the meantime, the basic process is:

1. Add a Cesium Cartographic Polygon actor to the level. You can find the actor by searching in the Place Actors panel.
2. The actor looks like a square spline with four corners. Drag out these corners to your desired shape. You can add new points to the spline by holding the _alt_ key down while dragging a point.  
 ![image](https://global.discourse-cdn.com/cesium/original/2X/7/75b3915226c420a8e5ec0476620be4dd80f95373.jpeg)
3. Once you have the shape you want, click on Cesium World Terrain in your World Outliner and add a CesiumPolygonRasterOverlay component.
4. Select the new component. In the details panel, you’ll see an array called Polygons. Add an element to that array and set the CesiumCartographicPolygon you previously added. The tileset should automatically update with that area masked out. If it doesn’t, select the tileset again and refresh it.  
 ![image](https://global.discourse-cdn.com/cesium/original/2X/2/23b12218abe05d714ff1a41164f2f9cfe7e72ed2.jpeg)

By default, the Polygon Raster Overlay is set to mask out terrain. You can also use it to apply material effects. That process is a little more complicated. I recommend you start by duplicating the “MI\_CesiumThreeOverlaysAndClipping” material instance included in `CesiumForUnreal Content/Materials/Instances`.

If you open that, you can see the material is made of several Material Layers. To customize, you can create new Material Layers and Material Layer Blends and set them here.

 ![image](https://global.discourse-cdn.com/cesium/original/2X/9/93a30edfd75eb1421b6164b838fae4d49bad6e8c.jpeg)

Just make sure to set the Material Layer Key of the CesiumPolygonRasterOverlay to the name of your new material layer, and you’ll probably want to uncheck the “Exclude Tiles Inside” parameter, or else tiles might appear missing.

After you’ve made your material, you should set the “Material” parameter under Cesium | Rendering on the terrain tileset to your new material.

I hope this helps! Let me know if you have any further questions. This will be covered more comprehensively in an upcoming clipping tutorial, and after that a material editing tutorial.

---

<div class="post-metadata">

**Author:** ![V2i](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/v2i/32/6162_2.png) [@V2i](https://community.cesium.com/u/V2i)\
**Post date:** [September 5, 2021, 10:33pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/3 "2021-09-05T22:33:27Z")

</div>

Hi @agallegos ,

We just tried out this process and noticed that some tiles within the polygon aren’t excluded correctly at close distances including the tiles collisions. Is this a limitation of the tool or is this just a beta tool at the moment?

 ![Capture2](https://global.discourse-cdn.com/cesium/original/2X/2/286e2c8f9d2362c81ec074483039c9cc8a7be317.jpeg)

 ![Capture](https://global.discourse-cdn.com/cesium/original/2X/8/8a1bc3b4f1a40deaae1c54ec4df741b96e3f2d12.jpeg)

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [September 6, 2021, 12:22am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/4 "2021-09-06T00:22:22Z")

</div>

Hi @V2i,

This looks like a bug in the interaction of clipping with the water effect. I wrote an issue for it:

> <https://github.com/CesiumGS/cesium-unreal/issues/630>
>
> !\[image\](https://user-images.githubusercontent.com/924374/132145362-d82e9511-542…5-4677-a373-c795909510eb.png)
> 
> I think this is caused by the Water layer being above the clipping layer in the layer stack, and the water layer ignoring the opacity mask when rendering water.

If you don’t need the water effect, you can work around it by turning off Cesium → Rendering → Enable Water Mask in the tileset actor’s Details. If you do need the water effect, you can work around the problem as follows:

1. Find the MI\_CesiumThreeOverlaysAndClippingAndWater material instance under CesiumForUnreal Content → Masterials → Instances in the Content Browser and double click it to to open it
2. Go to the “Layer Parameters” tab, and drag the “Clipping” layer to the very top of the stack.
3. Save and let UE recompile reshaders
4. If the problem isn’t already fixed, click the Tileset Actor in the World Outline, and click the “Refresh Tileset” button near the top of the details panel.

Kevin

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [September 6, 2021, 12:26am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/5 "2021-09-06T00:26:56Z")

</div>

I forgot to mention, though, since you mentioned collisions. The clipping is a purely visual effect. You will stil collide with the hidden parts of the meshes. Tiles that are _entirely_ inside the clipping region will not be loaded at all, so you won’t collide with those. But the partial tiles will still be fully colidable.

We hope to address this in a future release, but as far as we know, Unreal Engine doesn’t provide any way for us to do this other than by manually performing an expensive cut of the meshes on the CPU at runtime.

---

<div class="post-metadata">

**Author:** ![V2i](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/v2i/32/6162_2.png) [@V2i](https://community.cesium.com/u/V2i)\
**Post date:** [September 7, 2021, 11:42pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/6 "2021-09-07T23:42:32Z")

</div>

Thanks for the help @Kevin_Ring ,

Just a follow up question. We have been provided photogrammetry dataset from Aerometrex. We tried clipping this data but due to it not being quantized data it is not supported. Is there an estimated timeline where clipping non-quantized data will be released/worked on?

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [September 8, 2021, 12:31am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/7 "2021-09-08T00:31:21Z")

</div>

There’s a PR in cesium-native that adds really basic support for raster overlays (including clipping) on arbitrary 3D Tiles:

> <https://github.com/CesiumGS/cesium-native/pull/327>
>
> This builds on #326 and adds the ability to use raster overlaps (including for c…lipping) on 3D Tiles instead of just on terrain.

There are definitely some caveats right now, though. I hope to get a production quality version of this into the product within the next release or two, so October or November. That’s a goal not a promise, of course.

---

<div class="post-metadata">

**Author:** ![V2i](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/v2i/32/6162_2.png) [@V2i](https://community.cesium.com/u/V2i)\
**Post date:** [September 8, 2021, 12:47am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/8 "2021-09-08T00:47:48Z")

</div>

Good to know it’s been worked on. We will check out the PR when we can. Thanks for the estimated goal timeline.

---

<div class="post-metadata">

**Author:** ![agallegos](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/agallegos/32/4464_2.png) [@agallegos](https://community.cesium.com/u/agallegos)\
**Post date:** [September 8, 2021, 1:12pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/9 "2021-09-08T13:12:07Z")

</div>

A post was split to a new topic: [Georeference Origin Height not at 0,0,0](https://community.cesium.com/t/georeference-origin-height-not-at-0-0-0/15189)

---

<div class="post-metadata">

**Author:** ![ketion](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ketion/32/3476_2.png) [@ketion](https://community.cesium.com/u/ketion)\
**Post date:** [September 14, 2021, 7:09am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/10 "2021-09-14T07:09:27Z")

</div>

We hope to provide support for photogrammetry dataset as soon as possible,thanks!

---

<div class="post-metadata">

**Author:** ![agallegos](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/agallegos/32/4464_2.png) [@agallegos](https://community.cesium.com/u/agallegos)\
**Post date:** [January 20, 2022, 4:28pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/11 "2022-01-20T16:28:14Z")

</div>

A post was split to a new topic: [Cartographic Polygon Exclude Tiles Inside not working](https://community.cesium.com/t/cartographic-polygon-exclude-tiles-inside-not-working/16979)

---

<div class="post-metadata">

**Author:** ![agallegos](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/agallegos/32/4464_2.png) [@agallegos](https://community.cesium.com/u/agallegos)\
**Post date:** [March 8, 2022, 9:14pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/12 "2022-03-08T21:14:20Z")

</div>

A post was split to a new topic: [Can’t add a Cartographic Polygon to a tileset in UE5](https://community.cesium.com/t/cant-add-a-cartographic-polygon-to-a-tileset-in-ue5/17626)

---

<div class="post-metadata">

**Author:** ![pkq111](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/pkq111/32/19673_2.png) [@pkq111](https://community.cesium.com/u/pkq111)\
**Post date:** [January 15, 2024, 9:01am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/13 "2024-01-15T09:01:15Z")

</div>

Can it be applied to Cesium3DTileset? I only found the example applied to Cesium World Terrain

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [January 17, 2024, 12:44am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/14 "2024-01-17T00:44:35Z")

</div>

Yes. Cesium World Terrain is represented by a Cesium3DTileset Actor in Unreal Engine.

---

<div class="post-metadata">

**Author:** ![Yin\_Yu](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/yin_yu/32/21623_2.png) [@Yin\_Yu](https://community.cesium.com/u/Yin_Yu)\
**Post date:** [January 23, 2024, 1:39pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/15 "2024-01-23T13:39:05Z")

</div>

I got a problem, it looks like it works but when look at “lighting only” the masked area is still there, which seems to be affecting the lighting of the building that I have overlayed

 ![1.PNG](https://global.discourse-cdn.com/cesium/original/3X/8/d/8dd0fc962e45bdc0cc4cfe89a4918f8871f5115f.jpeg)  
 ![2.PNG](https://global.discourse-cdn.com/cesium/original/3X/7/5/759aa814d7f6dff630533e04846da7fec72fd5f4.jpeg)

---

<div class="post-metadata">

**Author:** ![Fabrice\_Cityscape](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/fabrice_cityscape/32/21649_2.png) [@Fabrice\_Cityscape](https://community.cesium.com/u/Fabrice_Cityscape)\
**Post date:** [January 24, 2024, 3:15pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/16 "2024-01-24T15:15:06Z")

</div>

Same issue

 ![Cesium_issue](https://global.discourse-cdn.com/cesium/original/3X/a/c/ac1bbafad1304b4b13e22c24b6c607c866a49d60.jpeg)

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [February 1, 2024, 4:42am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/17 "2024-02-01T04:42:21Z")

</div>

The clipping works by setting the “Opacity Mask” material output to zero in the excluded area. I’m surprised to hear that Unreal would use such parts of the model for lighting, but, if it does, I’m not aware of anything we can do about that.

---

<div class="post-metadata">

**Author:** ![Yin\_Yu](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/yin_yu/32/21623_2.png) [@Yin\_Yu](https://community.cesium.com/u/Yin_Yu)\
**Post date:** [February 1, 2024, 1:56pm UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/18 "2024-02-01T13:56:56Z")

</div>

so only epic can do something about it ?

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [February 2, 2024, 3:31am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/19 "2024-02-02T03:31:49Z")

</div>

I don’t know everything about Unreal Engine. I certainly don’t have deep knowledge of its lighting systems. But if Unreal, under some lighting setup (you haven’t really described your lighting setup), is lighting based on parts of the model with an opacity mask of 0, that _sounds_ like a bug to me. I could easily be wrong, though.

---

<div class="post-metadata">

**Author:** ![Yin\_Yu](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/yin_yu/32/21623_2.png) [@Yin\_Yu](https://community.cesium.com/u/Yin_Yu)\
**Post date:** [February 2, 2024, 9:28am UTC](https://community.cesium.com/t/cesium-cartographic-polygon/15128/20 "2024-02-02T09:28:48Z")

</div>

my lighting system is very basic, with the cesium light setup, if you try to cut out a piece in cesium, and you look at the lighting pass and wireframe pass it should still be there, but the other passes are fine

 ![LightingOnly](https://global.discourse-cdn.com/cesium/original/3X/9/a/9a00603f8f544489a6fd221d32bdffaecd73156b.png)  
 ![ScreenShot00000](https://global.discourse-cdn.com/cesium/original/3X/3/1/3162953da7516b175870a3e1722661c993e73074.jpeg)  
 ![ScreenShot00001](https://global.discourse-cdn.com/cesium/original/3X/e/9/e9d9b593db362d16f2996a741ba2470a98d820f8.jpeg)  
 ![ScreenShot00002](https://global.discourse-cdn.com/cesium/original/3X/1/1/11058888915cd033ddfffeb6ff73cb2b27a9467c.jpeg)  
 ![ScreenShot00005](https://global.discourse-cdn.com/cesium/original/3X/d/4/d4b2ef49275a04b83e38215a0aa4ede0410fda0a.jpeg)

[Next page](https://community.cesium.com/t/cesium-cartographic-polygon/15128.md?page=2)
