issue #10

3d: Part V

By Alias

 

Alright, has everyone here heard of a landscape engine? No?!?! Well, we'll see about that!

Last issue we covered voxels, which are 3D versions of pixels, and can be used to create stunningly high-detail sprites without too much overhead or loss of speed. As nice as they are, they are not as fast as they could be if we remove some abstraction.

Voxel-based landscapes...

 

The voxel model we presented last time was an incredibly general model - too general for a lot of purposes, in fact. If you're making, say, a flight sim, or a game like Delta Force, you want to have a big, broad voxel map the size of Rhode Island, but you don't have that much memory. The ability to have true-3D voxels is useless, so if we could just find a way to do a height-map, we could completely forget our previous method and have whatever kind of terrain we want.

Wait a minute! We CAN do a height map! Look at programs like 3D-Lands and the voxel.bas. They are prime examples of simple height maps at work. Since there are so many programs like that out there, I will not bother to write one. Have a look at them and see what you think. Keep in mind that there are many different kinds of landscape voxels. I will go through a simple list and description of the most prominent kinds:

  • 3D Landscape - This is like the example program VOXEL.BAS. All the 3D points are calculated based on their height and drawn as enlarged pixels, the same way as the example program last month. This has the advantage of speed, but it is still very general and can have gaps in places with great height difference.

 

 

Check out this 3d landscape!

 
 
  • Ray-tracing - Yes, the same method as Wolfenstein, only backwards. A ray is sent out to the edge of the map or the farthest visible point - whichever's nearer - and is traced back to the player. As it is traced, the heights of the map where the beam lies are drawn. This is much more accurate than the simple 3D landscape, but it is much slower. Usually, there is reduced image quality to compensate for the slow speed.
  • Filtered (or weighted) ray-tracing - Same method as above, but weighted averages are taken to make the landscape less blocky and more accurate, with less jumping.
  • Precalculation - This method uses VERY specialized arrays to precalculate the exact location of each pixel. This is not the fastest method but it is EXTREMELY accurate. The downsde is that by the time you have the tables in place, you have no memory left for anything less, unless you reduce image quality, leaving you where you would be with any other method.
  • True Fake - 3D Lands is a True Fake landscape engine. It does not use isometric projection but simply skews the image so that it looks kind of 3D. The height illusion is acheived by changing the Y values. the big advantage here is that it's really fast and has next to no overhead, but quality is very limited and rotation is impossible.
  • Isometric - I have not seen this method used in a true landscape program yet. It involves isometric projection (covered in the last installment of this article) of the points and simple height adjustment. It is slightly slower than a True Fake, but has rotation and can properly scale.

Phew! that's a lot to cover. I know I said I would cover list voxels this time, but I have been awfully busy, and have not been able to prepare. As for the DQB version of the voxel editor, I won't be doing it. All of the mail I recieved about it said that I should not port it to directQB, and since there is no demand for it, I will just let it stay the way it is. See you next time, with list voxels, and finally, in the fourth installment, isometric projection!

What the heck does sinusodial mean anyway? Find out from Alias here.

Download the voxel landscape generator

Back to Top