Archive for March, 2010


Parts Of The Voxel Engine: LookMaps

In this post I want to look in detail at LookMaps.

Click on the example below to see how look maps work:
noodlesColourPicker.jpg

Since some Voxel models can have 10,000+ voxels (or 3d pixels) it could be very intensive to for example tint every single voxel.

To put it into perspective imagine looping through 10,000+ colours and calculating their new colour every single frame, and then along with that also calculating new positions for 10,000+ particles. Traditionally this is how things would be done each particle contains it’s own colour.

Instead what I’ve done with the Voxel Engine is create a separate look map. A look map is essentially an array of colours and then each voxel (or 3d pixel) has an index that points to a colour in a look map.

Think of an image on the internet most likely every single pixel in the image is not going to be a completely different colour but instead colours are repeated. This is the basic idea behind the “look map” to have a colour pallette to create an image.

In the above example you may have noticed that when you were clicking on different colour swatches you would see the colours in the voxel model also change. We were essentially changing colour values in the look map without changing the index at which each voxel is pointing at.

Look Maps Do More

Ok so every single Voxel Model has a LookMap. During the rendering process what actually happens is that when the renderer is rendering a model it will grab that models look map and tell it to render “something” at a specific 2d position.

So what that means is that the LookMap actually performs the physical rendering. This allows us to do some amazing things…

For instance in the above example you can see small squares not pixels being rendered. What’s actually happening is that this models look map is a “FillRectLookMap”. Essentially instead of rendering pixels (PixelLookMap) it’s rendering rectangles or squares.

Of course there is also a “BitmapLookMap”. Check out the example below where instead of drawing pixels or rectangles we are drawing bitmaps:
noodlesBitmapPicker.jpg

Again since we are using lookmaps we can quickly and easily change which bitmap is being rendered for which voxel. Another note is that because we only have 10 bitmaps to render and entire model we are using a lot less memory than each Voxel having it’s own BitmapData that would be rendered.

_Posted in R&D, Voxel Engine

1 Comment


Voxel Engine Self-Portrait

At this point in the development cycle for the Voxel Engine I find it’s a good time to just play around with the engine. This way the engine gets debugged and I also get to see what works and what doesn’t work from a coding perspective.

Adrian and Pablo really wanted me to make a drawing app. So the recording above is what I’ve got so far. It’s not perfect but I think you can get some pretty nice results using it.

I’d also like to mention that my nose isn’t that crazy and I have quite a bit more facial hair.

_Posted in R&D, Voxel Engine

1 Comment


Parts of the Voxel Engine

I thought it was time to talk about the Voxel Engine and how it all works.

Below is a diagram describing the different pieces of the voxel engine:

There are four major parts to the Voxel Engine:

  • VoxContainers
  • Lookmaps
  • Renderers
  • Z-Sorters

(more…)

_Posted in R&D, Voxel Engine

No Comments