Game engine

Terrain rendering

So, I've been having fun with some OpenGL, I'm working on a terrain engine, we'll see where it goes...

So far, I've got:

  • voxel terrain renderer, tesselated with marching cubes.

  • the signed density function is generated from a few octaves of simplex noise.

  • multithreaded chunk generation and tesselation with no world bounds.

  • triplanar mapping with a fixed directional light.


Currently, the chunks are of fixed size, and I can generate and render about 7^3 chunks around the player, while you're moving around.

Immediate future plans:

  • rewrite the ChunkManager to use the Octree to determine views in frustum, and apply LOD based on view distance. Currently I'm using a std::unordered_map hashed by chunk coordinates, which is not very fast. (I'm just for-looping around the player to get/generate visible chunks).

  • use LOD chunks to increase the view distance.

  • switch to Dual Contouring.

Also read:

  • A naive approach in rendering the chunks in a view frustum would result in this example in about 230 chunks. We can take advantage of the perspective, and render chunks at different level of details based on the distance to the camera. In the above example, we can considerably reduce the...