PixelGuys / Cubyz

Voxel sandbox game with a large render distance, procedurally generated content and some cool graphical effects.
GNU General Public License v3.0
434 stars 55 forks source link

Consider greedy meshing or similar. #133

Open IntegratedQuantum opened 12 months ago

IntegratedQuantum commented 12 months ago

This is especially interesting for transparent blocks, like water or fog. This could bring down the number of triangles rendered. Greedy meshing might be problematic however due to creating pixel errors at T junctions.

However greedy meshing might need special cases for lighting #61.

IntegratedQuantum commented 3 months ago

Alright, so it seems that overall the fragment shader cost of greedy meshing, at least with the variant I implemented in https://github.com/PixelGuys/Cubyz/compare/greedy_meshing, is quite high. While I was able to offset some of that cost with a depth prepass, overall the speedup is only around 0-20% on my GPU, and it's actually slower on my laptop. So ultimately it's not really worth it, which is why I decided to deprioritize this.