Hacker News new | past | comments | ask | show | jobs | submit login
Simple voxel explanation
9 points by Mongark on Apr 26, 2016 | hide | past | web | favorite | 6 comments
Hi everione! Can someone explain to me how in the h works a voxel engine?? I'm a razonable programmer, but if you could explain in details wold be great. Thank you!

So, instead of dealing with flat triangles with get rasterized to picture elements (pixels), a voxel engine deals with volume elements (voxels).

The crudest form of this would be something like Minecraft, where the world is literally made out of cubes. More advanced work would be something like what Ken Silverman did back during the Build engine days, a modern example of which can be seen here: http://advsys.net/ken/voxlap/pnd3d.htm .

The current state of the art appears to be something like voxel quest ( http://www.voxelquest.com/ ) or Atomontage Engine ( http://www.atomontage.com/ ).


If you want to learn a bit about voxel engines, Flipcode had a decent series on landscape engines: http://www.flipcode.com/archives/Realtime_Voxel_Landscape_En... .

Basically, the main problem is raycasting into a scene. To learn more about that, I'd look into octrees as a start ( https://en.wikipedia.org/wiki/Octree ).

Voxels are the 3d equivalent of pixels: little cubes in space. A voxel engine renders a lot of cubes quickly. When everything you are rendering is an aligned cube of the same size, there are a lot of easy options you can apply, like not rendering faces of cubes that are next to each other.

That's the basic gist. Everything beyond that is optimization.

"A Pixel Is Not A Little Square, A Pixel Is Not A Little Square, A Pixel Is Not A Little Square! (And a Voxel is Not a Little Cube)"

From: Technical Memo 6 Alvy Ray Smith, July 17, 1995

Link: http://alvyray.com/Memos/CG/Microsoft/6_pixel.pdf

Voxels, in most voxel engines, are cubes and not points in 3-space. Likewise, in most modern retro-styled pixel art games, the intent really is for the pixels—from the game engine's perspective, not the display's—to be squares. Often a game's pixel is rendered using a square grid of multiple display pixels per engine pixel.

You might want to take a look at Craft[0] which is a simple clone of Minecraft implemented in C, that should get you the basic idea of a voxel engine since the codebase is quite minimal for the available features.

[0] https://github.com/fogleman/Craft

Very thank you to all of yours!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact