How can I use this new feature “Cesium Cartographic Polygon” in Unreal?
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:
- Add a Cesium Cartographic Polygon actor to the level. You can find the actor by searching in the Place Actors panel.
- 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.
- Once you have the shape you want, click on Cesium World Terrain in your World Outliner and add a CesiumPolygonRasterOverlay component.
- 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.
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
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.
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.
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?
This looks like a bug in the interaction of clipping with the water effect. I wrote an issue for it:
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:
- Find the MI_CesiumThreeOverlaysAndClippingAndWater material instance under CesiumForUnreal Content → Masterials → Instances in the Content Browser and double click it to to open it
- Go to the “Layer Parameters” tab, and drag the “Clipping” layer to the very top of the stack.
- Save and let UE recompile reshaders
- 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.
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.
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?
There’s a PR in cesium-native that adds really basic support for raster overlays (including clipping) on arbitrary 3D Tiles:
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.
Good to know it’s been worked on. We will check out the PR when we can. Thanks for the estimated goal timeline.
A post was split to a new topic: Georeference Origin Height not at 0,0,0
We hope to provide support for photogrammetry dataset as soon as possible,thanks!