starandserpent / java-TerraServer

Terra - Voxel octree of chunks, made for Rituals of the old
MIT License
18 stars 2 forks source link

Greedy meshing performance issue. #54

Closed Pilvinen closed 5 years ago

Pilvinen commented 5 years ago

There seems to be something in the naive portion of greedy meshing - the first pass - which is taking a lot longer (about 10x) than is usually common.

The naive greedy meshing should move through the voxel data in one swift pass without having to save any additional data.

We should look into why the first pass is taking ~200 ms on the average instead of the expected 20-60 ms range.

If we calculate

Pilvinen commented 5 years ago

Naive greedy meshing now takes 8 ms on the average, but I'm not actually seeing by eye the 1000 / 8 = 125 chunks per second generation rate which I should be seeing when I'm using only the naive greedy mesher.

Instead I'm seeing about 8 chunks per second.

This means that we have another bottle neck somewhere down the line. I'm opening a new ticket for that.

The full greedy mesher probably could still use some optimizations so I'll leave this ticket open for now.

Pilvinen commented 5 years ago

1941 chunks. 9.8 million triangles.

Full greedy meshing now takes 9 ms per chunk on the average.

Issue is considered resolved for now.