How to create smooth map border lines from point

Hey guys,

I had a question concerning the best way to smooth out lines that represent borders on a map. Currently I have the following:

alt text

My current implementation includes finding all of the points (pixels) for a border on a PNG texture that represents the map and then creating triangle meshes from them. As you can see however, my lines aren’t very smooth and I’m wondering what would be the best route (algorithm) to smooth them up.

Note also that for each province I render a border, so really the border that you see in the image is made up of two sides. Any smoothing algorithm will need to keep both sides of the border in sync (the thickness of the border is also controlled by a BorderWidth variable).

Also (side question), when I apply a normal map to the terrain I get this weird shadow in the “Scene” View…, not sure if that’s normal but I thought I’d slip in that question.

Thanks!

Not sure where my comment went... trying again. So in the image above the lines are actually a mesh to simulate dynamic borders. My biggest issue was how I was drawing that mesh. In the end I came up with a way to draw lines to represent sides of the border. Here are the results. https://www.youtube.com/watch?v=myu94gqPzHE

It would be very useful if you came back with an Answer to your question and how you solved it. Your video just show results, it does not answer the question. I'd be happy to hear how you choose to do it.

1 Answer

1

Instead of drawing the lines into the texture, have you thought of creating a mesh that adapts to the terrain itself like Terrain Grid System does ? Check out this video: Terrain Grid System overview (1/2) - YouTube

Ah yeah, I forgot about this question haha. In the end I did figure out a solution as shown in this video: https://www.youtube.com/watch?v=myu94gqPzHE

I added that comment in the wrong place. In the image above I am using a mesh. The biggest difference however with your approach and my approach is that I'm using an image to drive the way the borders are generated for modding purposes. So in my video example you see the map of Europe driven by a heightmap/province map.