Flatten the ground surface or Terrain inside a polygon

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.

1 Like