Introduction
This is a basic introduction to what voxels are, what they are not and their general use cases.
What is a voxel in theory?
To quote Wikipedia:
In 3D computer graphics, a voxel represents a value on a regular grid in three-dimensional space.
— Wikipedia on Voxels
Since most people don't have a good understanding/foundation of math (in this case: linear algebra), let's explain this piece by piece.
A voxel represents a value...
An individual voxel can be absolutely anything. Yes, anything.
There could even be another grid of voxels 'inside' each voxel!
...on a regular grid...
A grid of voxels containing colours.
Taking the definition from Wikipedia...
A regular grid is a tessellation of n-dimensional Euclidean space by congruent parallelotopes (e.g. bricks). [...]
...and breaking it down:
Tessellation
The grid is formed by dividing space into cells.n-dimensional
The grid has at least one dimension.
But since we are in 3D space, at least three.Euclidian space
The axes are at 90° degree angles to each other, everywhere.Congruent
Every cell in the grid has exactly the same shape.Parallelotopes
- The cells are shaped like boxes.
- Each opposing side has the same area/shape.
- Their edges in a given axis are parallel.
Now you might think that the cells of the grid are the voxels, but that is not the case! The voxels are theoretically on the corners where the cells meet, they are neither inside the cells nor are they the cells; a voxel is a point sample, not a little cube.
In practice you will usually notice this when either rounding or off-by-one errors occur.
...in three-dimensional space.
- There must be at least three-dimensions, so as to form a volume.
- Adding more spatial dimensions turns the voxels hyper-volumetric,
making them hypervoxels (there is no shorthand or acronym for this). - Adding a time-dimension turns them into temporal voxels,
making them toxels.
That is the definition of a voxel; and if that all sounded complicated... well that's because it is! Mathematics are like that sometimes.
Let us continue with voxels in practice...
What is a voxel in practice?
As noted in the theory section, a voxel can be anything...
- Numerical things, like density, color and direction.
- Labelled things such as states, types, names, etc. etc.
- Structured things: text, an item, or some other object.
...and this is without taking the encoding, be it in-memory or on-disk, into account. The only limit is your imagination... and the size of your memory/disk!
TODO: This section needs more content.
What is not a voxel?
If values are generated in a two-dimensional grid and expanded into a third dimension on-demand, such as during rendering, you are not using voxels.
That's just a plain old heightmap pretending to be voxels!
Important:
This does not mean that columns of values arranged in a grid, like run-length encoded data might be, are not voxels!
The way that voxels are stored does not matter as long as the grid is indexable.
What are voxels used for?
Many things, but three of them stick out:
Since you are visiting this wiki, you might already know what you intend to use voxels for; if not, please take some time to think about it, otherwise just read on ahead! :)
For making art made of voxels,
we highly recommend checking out MagicaVoxel,
which is currently considered to be the best voxel-editor you can get; it's completely free!
Perhaps share your creation?