Download (Windows Installer)


Overview

This screensaver applies the marching tetrahedrons algorithm to produce some blob-like entities which move around the screen. All of the surface construction code is executed on the CPU.

During development, I found that increasing the grid size did not scale very will as a method of increasing the smoothness of the mesh (O(n^3), where n is the resolution of the grid). Instead, I apply a surface subdivision to the mesh after it has been constructed, smoothing everything out while not using up too much CPU.

Unfortunately, the mesh produced by the marching tetrahedrons algorithm is quite messy (I think marching cubes is better), and does not lend itself very well to surface subdivision. To solve this problem, I apply a "mesh fixing" process to the mesh after it is constructed and before it is subdivided. This "mesh fixing" basically snaps together vertices that are less than a certain distance from each other in to the same vertex. The result of applying this procedure is a mesh where most of the polygons have roughly the same area.


Development Screenshots


This is the cube grid with the actual tetrahedrons drawn in wireframe



Haha, had the normals wrong at this point, but I do have a surface being rendered!



Plotting the cube corners with green dots. Fixed the normal problem. There's my surface.



So made the surface material blue... Guess there's not much different from above.



Finally got back to work on this, got smooth shading working yay!



Look! Awesomeness! Finally.



And throw in a dash of colour...



Yes! Made it smooth!! Saved by the Gradient Vector!



Check that smoothness out! Time to do fun stuff with this soon.



Been a while... but look! Flawless! Threw some fun specular and fresnel lighting for extra awesomeness.