What Branches Of Mathematics Does A Voxel Engine Require?

Started by
3 comments, last by Ryan_001 12 years ago
What kinds of mathematics does a fully complete game engine require (voxels for graphics, comparable to the video below)? I realize there is calculus and advanced algebra, but any specific branches to completely brush up on and remember, or any other branches?



Please, excuse me if this question has been asked before, I just couldn't find something on the world wide web that would explain the mathematics behind voxels and voxel subdivision and also a complete engine.

C dominates the world of linear procedural computing, which won't advance. The future lies in MASSIVE parallelism.

Advertisement
If you look at your screen with a magnifying glass, you'll notice it's composed of small squares or dots.

These are called pixels.

A pixel is single element of (usually) rectangular grid:+-+-+-
| | |
+-+-+-
| | |


A voxel is 3D equivalent. Instead of small squares, you have boxes.

There is no real mathematics behind it, no more than it takes to draw a cross word puzzle or tic-tac-toe board.

Voxels are problematic due to storage. To represent complex object at sufficient resolution, one needs vastly more storage than is available today. A petabyte (1 million gigabytes) would be quite a good start.

So voxel handling techniques deal mostly with solving this problem. While storage is cheap, we cannot access it fast enough.

Simple voxel manipulation doesn't complicate, it simply splits world into equal rectangular chunks and only draws those that are visible. Stuff presented in video comes closer to cutting edge, so there's a combination of techniques.


Background needed to implement such engines is covered by standard low-end CS curriculum which covers computer graphics, linear algebra and computer architectures.

Some other applicable semi-mathematical fields would be information theory (encoding, entropy) and compression.

Voxels are, at least today, an engineering problem, since the hardware we have isn't capable of working with them directly. As far as their structure goes, they are absurdly simple - just a bunch of boxes.
As Antheus said, voxels tend to take up a lot of space. Butif you want to draw every voxel alone, it's also very tough on visualization time. (Lots of polygons)

Usually, voxels are raycast or have an isosurface created for each cell in a scalar field.

Minecraft is an example of a recent game that pulls off drawing every visible cell edge of every visible voxel in real time.

Voxels are basically very simple stuff that, when you want to optimize it, can become indefinitely complex.

Common optimizations include culling, surface approximations, octree or kd trees, polygon-aided raycasting and obviously compression.
A also good and well known technique I've used is callLists. I used them for particles, but it would do the job. FYI, call lists are bascily precompiled polygon/object information into the graphics card to speed up your program, and if all your doing is drawing tiny cubes. This will help speed up the process for the graphics card, so it wont try to kill it's self. ;)

Also one more thing to add is draw with triangles!
Check out my open source code projects/libraries! My Homepage You may learn something.
I did a voxel engine a while back for a TIGSource competition:
[media]
[/media]
The entire thing is done using ray casting/tracing in a pixel shader, and ran fine on my 9800 gtx. Unless your voxels are large, translating them into polygons can be memory intensive. Also voxels are only memory intensive if you plan on working with them in an uncompressed form. I went with a tile system reminiscent of old-school 2d games (which is pretty much just artist directed VQ compression), and stored both the map and tiles in about 64 megs (4k 16x16x16 tiles, and a 256x256x256 map). I could've squeezed it into much less but I didn't feel the need.

The real drawback IMO of voxels is animation. Much like old school 2d sprites, you need to hand animate every frame. Where-as a polygonal models can have a near infinite frames of animation, and even have dynamically generated animation, voxels are much more restrictive in this area.

This topic is closed to new replies.

Advertisement