# CartographicPolygon Clipping Cause TerrainTile Rendering Abnormal

**URL:** <https://community.cesium.com/t/cartographicpolygon-clipping-cause-terraintile-rendering-abnormal/36628>\
**Category:** Cesium for Unreal\
**Created:** [November 15, 2024, 12:29pm UTC](https://community.cesium.com/t/cartographicpolygon-clipping-cause-terraintile-rendering-abnormal/36628 "2024-11-15T12:29:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![qhl](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/qhl/32/14000_2.png) [@qhl](https://community.cesium.com/u/qhl)\
**Post date:** [November 15, 2024, 12:29pm UTC](https://community.cesium.com/t/cartographicpolygon-clipping-cause-terraintile-rendering-abnormal/36628/1 "2024-11-15T12:29:16Z")

</div>

When add two imagelayer(RasterOverlayComponent)，one imagelayer’s MaterialLayerkey is Overlay0, the other’s MaterialLayerKey is Overlay1, CartographicPolygon Clipping cause terraintile rendering abnormal；But if only add one imagelayer(RasterOverlayComponent), after CartographicPolygon Clipping, terraintile rendering is normal. I think this is a bug, How Can Fix it?

 ![image](https://global.discourse-cdn.com/cesium/original/3X/c/8/c834532a706617c8832bee51453d526a25a6d94c.jpeg)  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/1/f/1f72f77d000eed0602acf30e62deecc75dfca7ce.jpeg)

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [November 18, 2024, 4:20pm UTC](https://community.cesium.com/t/cartographicpolygon-clipping-cause-terraintile-rendering-abnormal/36628/2 "2024-11-18T16:20:41Z")

</div>

Hi @qhl, welcome to the community!

Thank you for the bug report. I wonder if this is similar to a post from another user:

> [@CesiumWorldTerrain With Multi RasterOverlays Rendering Error](https://community.cesium.com/t/cesiumworldterrain-with-multi-rasteroverlays-rendering-error/36636):
>
> Dear Cesium Team, We are currently using Cesium version 2.6, and everything was running smoothly. However, after upgrading to version 2.10, we encountered some unexpected issues. The specific behavior is as follows: When we added a WMS RasterOverlay to a CesiumWorldTerrain, everything worked fine. However, after adding a CesiumPolygonRasterOverlay to the CesiumWorldTerrain, the texture rendering for the previously added WMS RasterOverlay became incorrect. If we remove the CesiumPolygonRasterO…

Can you please confirm the version of Cesium for Unreal you’re using? It’ll help to have this so we can confirm if they’re the same bug. In any case, I’ve opened a Github issue below so that we can track this problem.

> <https://github.com/CesiumGS/cesium-unreal/issues/1551>
>
> Reported on the forum here:
> \- https://community.cesium.com/t/cartographicpolygo…n-clipping-cause-terraintile-rendering-abnormal/36628
> \- https://community.cesium.com/t/cesiumworldterrain-with-multi-rasteroverlays-rendering-error/36636
> 
> I was able to reproduce this myself in UE 5.3, v2.10.0 by doing the following:
> 
> \- In CesiumForUnrealSamples, go to 02\_CesiumMelbourne.
> \- Add the WMS overlay from this \[Sandcastle\](https://sandcastle.cesium.com/?src=Web%20Map%20Service%20(WMS).html) to Cesium World Terrain, with key Overlay1.
> \- Zoom out and go to an area where the WMS is showing (over some of the blue dots). Rebase the georeference origin for convenience.
> \- Add a Cartographic Polygon over the area rendering the WMS. Then add it to a Polygon Raster Overlay on Cesium World Terrain.
> 
> You'll see some weird glitchy artifacts in the area affected by the polygon. When you remove the WMS, the artifacts won't disappear right away, but you can refresh and the clipping will appear as normal.
> 
> !\[image\](https://github.com/user-attachments/assets/386de257-d627-4114-bef3-8c6e0aa04ef5)
> 
> For curiosity's sake, I tried it the other way around, by adding the WMS after the polygon overlay. The polygon clipping works, but the WMS shows up as this blocky blue gradient over a lot of the tiles. 🤔 
> 
> !\[image\](https://github.com/user-attachments/assets/4d47aa13-df6c-42fe-b72b-97b7df296d47)
> 
> I have not tested this, but this reportedly happens as far back as v2.8.0. The behavior works as expected in v2.6.0. It might be prudent to check if this happens with v2.7.0 -- that release introduces some CesiumPolygonRasterOverlay bugfixes, as well as custom ellipsoids.

---

<div class="post-metadata">

**Author:** ![qhl](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/qhl/32/14000_2.png) [@qhl](https://community.cesium.com/u/qhl)\
**Post date:** [November 19, 2024, 6:10am UTC](https://community.cesium.com/t/cartographicpolygon-clipping-cause-terraintile-rendering-abnormal/36628/4 "2024-11-19T06:10:56Z")

</div>

Hi @janine, we are currently upgrading to Cesium version 2.10。Looking forward to your next reply, thanks!

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [November 21, 2024, 3:57pm UTC](https://community.cesium.com/t/cartographicpolygon-clipping-cause-terraintile-rendering-abnormal/36628/5 "2024-11-21T15:57:08Z")

</div>

Hi @qhl, we just opened a pull request that should fix this problem!

> <https://github.com/CesiumGS/cesium-unreal/pull/1554>
>
> This is a PR into #1552 so merge that first.
> This depends on CesiumGS/cesium-na…tive#1003 so merge that first, too.
> 
> Fixes #1551

If you want to try out the fix, you can find instructions for installing a pre-release version here:

> <https://github.com/CesiumGS/cesium-unreal/blob/main/Documentation/using-prerelease-packages.md>

Otherwise, you can wait for next month’s official release to try it out. Thanks!
