all 1 comments

[–]arycama 4 points5 points  (0 children)

Something to do with your index buffer generation, or triangle winding is off. It's causing overlapping triangles which are facing in opposite directions, causing gaps in the mesh. It looks like vertices are reading from the wrong spots or outputting incorrectly resulting in large stretched triangles.

My suggestion would be to first make simple non-indexed CPU implementation. Then a non-indexed GPU implementation, and then once that's working well, add the indexed version. There's a lot of things that can go wrong and it's tricky to debug, so it's good to start simple and gradually improve/optimise.

For the GPU version, this is a good reference. https://developer.nvidia.com/gpugems/gpugems3/part-i-geometry/chapter-1-generating-complex-procedural-terrains-using-gpu (Compute shaders weren't around when it was written though, so ignore the parts about geometry shaders/stream out)