Gauntlets of Recursion (+3)

Times, trials, and turbulence.

Voxels voxels voxels…

I more or less restarted the renderer today. I spoke to a professor at my university who is teaching the 4th year Graphics course about my project, and he advised me to take a different approach. I realized that rather than casting out rays from the camera to detect voxels, it would be more efficient to process the voxels and transform them to screen coordinates for drawing instead. This is analogous to how 3D hardware also works: you hand it all of the geometry, and it renders it.

From a brute-force perspective, this is far slower, since you need to process *every* voxel in the map, which can be well over a million voxels. The trick is to implement optimizations such as spatial space subdivision (read: quadtrees or BSPs) and LOD (level of detail). Right now the renderer is at the point where I can hand it a point in 3D space of the world, and it will transform it to a pixel location on the screen. Additionally, I am now implementing quadtrees, which will allow large parts of the map that is not visible to the camera to be culled out extremely quickly, thus speeding up the speed of the renderer. Here are a couple of screenshots, showing the same map with 1, 2, and 3 divisions of the quadtree.

vl_img2.PNG vl_img3.PNG vl_img4.PNG

(1, 2, and 3 quadtree divisions)

 

The images look a little ‘pixely’ because I’m drawing a single pixel per voxel currently rather than a real voxel. This will be coming soon, after I get front-to-back sorting and some visibility tests in. Then, sometime soon, turning it into a darn game. šŸ˜‰

Leave a comment