How It Works
A Path is a chain of Nodes you can edit in the Scene view or during runtime. Remesh increases the resolution of that chain and adjusts the positions of the generated Nodes to create a smooth curve. Rendering stitches the curve into a triangle-based mesh by classifying groups of Nodes into one of three types of segments and minimizing the number of vertices needed for the mesh.
Segment types
Concave Up
A valley. Extra vertices along the dip so the mesh holds its shape.
Concave Down
A hill. A triangle fan from a center point under the peak.
Bridge
A flat span. A simple strip between the two edges.
How it was built
To develop Arctric Slopes, I needed a tool that could create smooth curves that held data along the curve. So, I started by creating a Node class, which holds a position and normal, then created a Path class that stores each Node in order. I then brainstormed and implemented an algorithm to smooth the transition between the normals of each node in the Path. Eventually, this became the algorithm that's used today.
The hard parts
Object Pooling
Nodes can be extremely expensive to create and destroy at large quantities, so I had to learn and implement object pooling.
Editor Scripting
This was one of my first projects that included editor scripting, so learning it and applying it was difficult.
Algorithm
Coming up with an algorithm to smoothly generate a curve along the rough path was extremely tolling, since it was math I had never learned before.