
---This message removed because I have a job now.---
But this post is about the voxel renderer I've been writing in-between looking for a job. It's the same basic algorithm as the one I wrote, um, probably a couple of years back now. In case you don't go back that far, that means it's fully 3d with 6 degrees of freedom and interpolation, at the cost of being extremely memory hungry. These days, however, I know when to apply a bit of maths and get something that's pretty close to correct (as opposed to twiddling numbers until it looks alright). I also got it performing a bit better and figured out how to calculate normals. It's only about 350 lines of code, excluding the bits of Rendjin I used (it's so handy).
The picture is of accurate mode at 512x512 res, rendering a 256^3 voxel grid (though oddly enough that doesn't seem to make that much difference) containing 256 spheres. The colour is the normal vector. 5.5fps on a 2.8ghz pentium D, entirely in software.
I like the way the spheres sort of merge together, it's quite interesting. Normally the interpolation gives you flat surfaces, so you could be forgiven for thinking they were standard polygons. But when the spheres intersect things are a bit less predictable, and the interpolation actually gives you curved surfaces. The edges (if you will) of a voxel will always be straight lines, but given 4 straight lines (for example) it's not always possible to construct a flat surface, so you get a curved one. Hard to explain, but it's pretty cool.
|