afonsolage / projekto

Voxel game made with Bevy Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rework Voxel Rendering

afonsolage opened this issue · comments

After playing with height clipping on #50, it is clear now that some voxel meshing techniques used won't fit the game design. The game should have a top-view but also allow to enter inside buildings, caves and such, without revealing what isn't on visible range.

This could be done by simple doing an flood-fill to check player visibility and hide any voxel that is above all those voxels, but to hide the above voxels, no faces merging can be done. This lead a performance problem, where each voxel will have it's own face.

I can see some alternatives to explore here:

  • Don't use chunks at all and each voxel is an entity with it's own mesh and relies on Occlusion and Frustum Culling to don't render what isn't visible. This approach will allow more flexibility when hiding/showing voxels, but it can be performance intensive;
  • Same as above, but move all rendering to shader, so each voxel will be expanded to a cube inside the shader. I don't know if this is possible, but the performance will be a lot better;
  • Just don't do faces merging and keep everything else the same. This is the most straight forward approach and should be considered first.