Blocks

Hi all,

My goal is to build a game running on Android and allowing my children to build their world :wink:

Since the target platform is a device with limited GPU capabilities, I spent hours to make some optimizations :

  • use a texture atlas to limit the number of shader and texture switches to the bare minimum
  • build a new custom shader that supports the atlas (with Ambient Occlusion and scrolling textures)
  • abandon the current lighting implementation in favor of Minecraft-like lightning
  • optimized code base :
    • heavy rework of the chunkmanager and the two pagers
    • solved the triggerAdjacentChunkUpdates issue by prefetching neighbour chunks before rendering
    • optimized code parts that were heavily used (related essentially to chunk meshing)
      There is still room for optimization. I’d like to reduce the number of triangles thanks to greedy meshing, but it is not easy with the way the mesh is currently generated (and combined with AO). I’ll probably limit that to only cube shapes.

I also implemented some basic water simulation.

I’ll try to contribute all of this to the code base, although it is becoming difficult due to the amount of changes and due to some peculiarities of my projet.
If you see priorities among all of these changes, please tell me.

Thanks Remy for the codebase !

A couple of screenshots :

Minecraft-like lightning with Ambiant Occlusion (a light deep in the cave):

A single texture atlas is used for all blocks (including the water) :

Lighting during the night :

Basic water simulation :

16 Likes