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:
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. $$anonymous$$y 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.
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.
Sure thing, I just put points into an asset I found (really cheap and fast) called Curve Line Renderer. https://www.assetstore.unity3d.com/en/#!/content/20272
Curve Line Renderer (just dump ordered points into it)
Ceto for water
Text$$anonymous$$esh Pro for text
The map shader is my own personal one that allows for up to 16 textures
Currently I can load in the Europa Universalis map in like, 3 sec. There are some optimization done as well, and their scripts add a few more seconds to parse. I think the Warhammer mod takes the longest, but that's not optimized at all...
Answer by Kronnect · Dec 22, 2015 at 09:11 AM
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: http://youtu.be/bk9N98okodA
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.
Ah yeah, I forgot about this question haha. In the end I did figure out a solution as shown in this video: