Hi @Moulderca, welcome to the community!
By design, CesiumCartographicPolygon
is fixed to the globe. While you can reposition it at runtime, you’d have to refresh the CesiumPolygonRasterOverlay
for the changes to take place, which would not provide the smooth experience that you’re describing.
However, you can try a different method that involves two steps:
1. Implement a CesiumTileExcluder
CesiumTIleExcluder
is an interface that allows you to prevent tiles from loading depending on your own specified logic. For example, you can exclude tiles whose bounds fall completely outside of a box positioned at an Unreal world position (as opposed to a long / lat). And this box can move around the world at runtime.
We unfortunately do not have documentation at this time, but our Cesium for Unreal Samples project contains an example excluder that implements the behavior I described above.
However, the exclusion alone does not perfectly clip tiles. Because it works with the bounds of tiles, it can load tiles that are both in and outside of the box, in ways where your excluder will give you this:
So to get that perfect crisp clipping, the next step is…
2. Modifying the material
You’ll have to create a copy of the default tileset material instance (MI_CesiumThreeOverlaysAndClipping
). Then, create a new material layer. You’ll use this new material layer to replace the existing “raster overlay” one.
The clipping behavior works by looking for a red value in the material layer. If it’s red, then that area should be clipped (hidden). Otherwise, the original pixels will be left visible.
So, to create a circular clipped area in your custom material layer, you’ll want to output a red value if the distance from the circle’s center is greater than your desired radius. This should result in similar clipping to what you already did with CesiumCartographicPolygon
.
This should be enough to get you started, but let us know if you have any followup questions.