Hi,
I really appreciate and enjoy the use of the new “CesiumCartographicPolygon” feature .
Similarly, do we have any tool available to flatten certain areas inside a polygon similar to the feature available in Autodesk Infraworks ?!!
(224) InfraWorks Flatten Terrain - YouTube
Hi @shefypattambi,
Glad to hear you’re making use of the Cartographic Polygon!
The short answer is no, we don’t currently have a tool to flatten areas inside a polygon. If this is something you’d like to see added to the plugin, I encourage you to submit an issue on the github repository for it, along with information about potential use cases for such a tool.
That being said, I was curious, so I took a look to see how you could achieve something similar in Unreal. It turns out it’s possible to visually flatten areas of terrain with a material, though it’s not a perfect solution since it doesn’t account for collision.
Before:
After:
Here’s the material layer blend:
For vertices inside the polygon, it offsets the absolute world Z position by its inverse, which puts the vertex at world zero, so it will be the same as the Georeference Origin height. If you want to offset the height at which terrain is flattened to, you’ll have to add your offset right after the OneMinus node.
You’ll also notice that the mesh normals are not flattened. There may be a way to fix this in the material.
As noted above, this method does not account for collision at all, since it’s all in the material. Actors will still collide with the original shape of the terrain.
Also, it still uses the original shape of the terrain for culling. Depending on how much you flatten, tiles might get culled while they’re still on screen. Prepare for various unexpected rendering behaviors if you try this.
If you decide you want to try out this material method, let me know how it goes! I’m sure there are a bunch of ways to improve on this.
-Alex
Edit 10/24/22 - Here’s a slightly more graceful version of the graph above. Does the same thing, but nodes are simplified and also exposes a height offset parameter.
As an additional tip, turning off Frustrum Culling on the tileset can help with the odd culling behavior.
Seriously, I urgently need this function in cesium.js, such as flat land for urban planning. Similar questions have been raised many times. I hope officials can consider an example! Thank you.
Hi @agallegos ,
Thank you for the detailed reply. Appreciate that. But unfortunately, I don’t know how to proceed with that method; since I am quite a newbie in Unreal. Also, collision is very important in my use case. So; I will export the flattened area from Autodesk Infraworks to unreal along with the ground textures and by using the “CesiumCartographicPolygon” I will remove the area coming under this flattened area. Once again thank you for the Cartographic polygon.It is very useful
I Alex, first of all thank you for your precious post. I tried to replicate your Material Layer but i have some problem; when i apply the material to Layer Polygon i obtained a strange column (it seems like the z value its infinite in up).
Did you have some trick to solve the problem?
Perhaps just check your Blueprint a bit more carefully. One difference from Alex’s that jumps out at me is that you’re multiplying by 0, whereas Alex multiplied by 100.
I kevin,
i tried different values but the result don’t change.
So this is the only way to flatten terrain and it has render culling problems without any fix?
Hello,May I ask a question?how flatten different area with different height without creating several overlay?For example,give a parameter “Height" to Cesium Cartographic Polygon,then the material can get the value.
Hi @Unreal_Miracle,
There’s currently no way to associate data with a cartographic polygon as you’re describing. It’s an interesting idea, though, and we’d welcome a pull request if you try implementing something like that in the plugin and get it working.