Friday, August 30, 2013

Game Dev 3: Voxel Terrain and Perlin Noise

I meant to post this about two weeks ago. I've been working on getting basic cube voxel terrain up and working. So today I present to you: Perlin noise! The colors present chunks of voxels that are being generated and displayed. I'm using 2D perlin noise to act as a height map.


You may notice I've got a FPS meter. I've created a basic font system from scratch that will let me write to the screen dynamically.

Each chunk is 16x16x128 voxels, and there are 64 total voxels, each colored with one of the 64 colors I'm using from a basic 6-bit color palette.

In other words... this is a fairly complicated scene! I did basic occlusion culling by marking voxels that were completely surrounded by neighbors. Essentially, I "hollowed" out what you see here. I also set up Face culling. This scene is about 10 million triangles, meaning that I am getting about 770 million triangles a second on my NVIDIA 660 GTX. Not bad!

On my TODO list: make some interesting terrain using layers of noise, include random seeds and enable dynamic loading of chunks from disk!

No comments:

Post a Comment