Voxel Planets

Overview

Building procedural planet generators and renderers has been a favorite hobby of mine in the past. Poor Man's Sky is a simpler web version you can try out now, but I have some others I have been working on, such as this one, Voxel Planets! While PMS is a displaced spherified cube using quadtrees, Voxel Planets is a 3D mineable planet using octrees and the marching cubes algorithm to allow the planet to be represented volumetrically. This means caves and overhangs are possible!

Each node in the planet octree stores a 3D array of density values (generated by procedural noise). The marching cubes algorithm is used to traverse this array by "marching" over each 1x1x1 cube to generate a surface mesh. The top right image is a table of the 15 possible triangulations for each cube (there is 256 possible options initially, but can be greatly reduced based on the fact that most are just reflected or rotated versions of eachother). The highlighted corners in the table designate points inside the surface (with a positive density).

You can check out the source for the whole project below! Mining currently doesn't work because I have transferred all the generation to the GPU and have been experimenting with different things. Past versions have working mining tho so you can just revert if you are interested in that. Hope this is helpful and not too messy! GLHF

Github Project