views:

95

answers:

2

From what I gathered he used sparse voxel octrees and raycasting. It doesn't seem like he used opengl or direct3d and when I look at the game Voxelstein it appears that miniature cubes are actually being drawn instead of just a bunch of 2d square. Which caught me off guard I'm not sure how he is doing that without opengl or direct3d.

I tried to read through the source code but it was difficult for me to understand what was going on. I would like to implement something similar and would like the algorithm to do so.

I'm interested in how he performed rendering, culling, occlusion, and lighting. Any help is appreciated.

+3  A: 

I've not looked at the algorithm itself, just from the screenshots:

it appears that miniature cubes are actually being drawn instead of just a bunch of 2d square

Yep, that's how ray-tracing works. It doesn't draw 2d squares, it traces rays. If you trace your rays against many miniature cubes, you'll see many miniature cubes. The scene is represented by many miniature cubes (voxels), hence you see them when you look closer. It would be nice to actually smooth the data somehow (trace against smoothed energy function) to make them look smoother.

I'm interested in how he performed rendering

by ray-tracing

culling

no need for culling when ray-tracing

occlusion

voxel-voxel occlusion is handled naturally by ray-tracing. If he draws sprites he can use a Z-buffer generated by the ray-tracer.

and lighting

It's possible to approximate the local normal by looking at nearby cells and looking which are occupied and which are not. Then performing the lighting calculation.

Any help is appreciated.

Thank you.

ybungalobill
+1  A: 

The algorithm is closer to ray-casting than ray-tracing. You can get an explanation from Ken Silverman himself here:

http://www.jonof.id.au/forum/index.php?topic=30.0

In short: on a grid, store an rle list of surface voxels for each x,y stack of voxels (if z means 'up'). Assuming 4 degrees of freedom, ray-cast across it for each vertical line on the screen, and maintain a list of visible spans which is clipped as each cube is drawn. For 6 degrees of freedom, do something similar but with scanlines which are tilted in screenspace.

zep