 It works! Nearly. I've got it rendering an octree of voxels. Generating the volume was actually the hard bit, because most of the renderer worked as it was.
Here's the first working shot:
That's 8 voxels, so it's not exactly sparse, and it's debatable whether it's an octree, but it was a start.
Some more work on generating stuff and a confusing bug (and a couple of days) later, I snapped this shot:
That's a 1024^3 volume, larger than I'd managed to get before. And that's despite using floats instead of shorts and duplicating radii up to 8 times. I tried 2048^3 but I hit the vista 32bit limit of 2gb memory per process. I didn't run out of physical memory though ;-). I like my laptop. It's a bit of a worry, because it's something like a best case scenario for memory usage. And you can see there's some artefacts with the large volume. I know why that is, and I hope to get around it by switching back to tetrahedral interpolation.
Performance could be better. Big volumes get more expensive slightly quicker than they used to, and it's slower over all. Still room for improvement though. With normal vector calculations, it's doing 6ish fps at 512x512 for the 2^3 volume and 4ish fps for the 1024^3. Which doesn't sound that different until you look at it as a percentage. Even so, it scales very well.
Before things look remotely interesting, I need some more robust ways of adding and subtracting stuff. Preferably in real time. At the moment I can only generate a single negative sphere.
|