- Home /
How can I make my adjacent meshes' edges line up?
I have a terrain system that uses a grid of meshes, which increase and decrease in detail as the camera gets closer. However, when there is 2 different level meshes next to each other, this happens:
I want to have the high detailed mesh deform it's edges so that the meshes line up. I figured that if I got every other vertex along the edge and made it's y value the average of the 2 adjacent vertices, it would smooth out, but I have no clue how to program this.
Each mesh is just a quad (4 verts and 2 tris) that has been subdivided 3-5 times, depending on the detail level, and deformed based on a height map.
I have about 3 years of C# experience, but I'm relatively new to procedural meshes, so explanations and example code would also be appreciated greatly.
Answer by AlwaysSunny · Mar 08, 2015 at 09:05 PM
"if I got every other vertex along the edge and made it's y value the average of the 2 adjacent vertices, it would smooth out"
Yeah, I remember doing some of this. What a headache! ;)
What you've stated is the only solution with which I'm familiar.
OnAnyChangeInLOD...
ForEach pair of neighbors...
if different LOD...
Stitch()
Your stitch method takes two meshes, determines their relationship, and uses that relationship to determine which edge of each mesh to work on. Then, you've already figured out the algorithm for yourself! Just gotta make it happen! Good luck,
Your answer
Follow this Question
Related Questions
C# Proceducal Mesh terrain 2 Answers
Vertex Colors not smooth enough? 0 Answers
What is wrong with this mesh editing code? 0 Answers
Creating a convex MESH (not collider) 2 Answers
How to cut a hole in a wall? 3 Answers