Today’s progress of attempting to mesh-split the chunks based on angles- very very very very broken.
On a simple mesh like this everything seems decently fine. The only oddity is that the farthest corner (purple line) didn’t split despite it having the same two triangles to compare.
-ohh cause… cause the code I’m using to check them is if they’re connected by another vertex… and I just split the vertex it needs…
oh no that’s why this is all broken probably
Wow that was literally the problem, edges now split perfectly- triangle normals are still super broken though.
each 3 colored lines is the vertex normal grouped together. You’ll notice random verts are skewed towards a specific direction though. From the previous picture half of all the triangles have correct normals, while the rest exactly have one normal skewed in this direction for some reason.
Additionally, all bottom faces are skewed in this direction, none are pointing straight. BUT, all of these skews seem random- like they’re being influenced by a lot of other triangle norms in calculation and not just a singular bias.
I did check to see if the initialization of the normals changed anything since maybe some weren’t being assigned, but nah nothing is influenced by that. My code is available here in the “GetChunkMesh” function if anyone wants to take a gander at this oddity.
Update 2: I now realize edge splitting does not work when multiple intersecting triangles are using the same vertex. I managed to get normals working but it is impossible to keep edges from being split.
I realize now I literally need to start with all verts disconnected, and then only merge ones within the opposite angle limit. The complete opposite of edge-split.
Thankfully most of the code does not change but now I have to scrap the entire vertex merge algorithm I did a few days back. BUT, that also means this algorithm will be faster since it doesn’t need to do multiple operations. It is working on 8x more vertices though.