What Branches Of Mathematics Does A Voxel Engine Require?
Crossbones+ - Reputation: 810
Posted 15 April 2012 - 11:24 AM
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.
Members - Reputation: 2409
Posted 15 April 2012 - 11:56 AM
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.
Members - Reputation: 1130
Posted 16 April 2012 - 10:46 AM
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.
Members - Reputation: 328
Posted 16 April 2012 - 12:30 PM
Also one more thing to add is draw with triangles!
Prime Members - Reputation: 2457
Posted 16 April 2012 - 05:05 PM
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.