Looking for good voxel articles...
I have been looking for a few good articles on voxels, I was wondering if anyone had any luck with this.
http://gamasutra.com (Game Developer Magazine) is always my favorite place to just "browse" for misc articles. Usually, I'll go there looking for something specific, and stumble on a completely different and unrelated article that catches my interest.
"Oh hey, an article on pixel shaders, I always wondered how those worked."
or
"cell shading, now thats something that adds a stylish look- lets read that first".
Articles by Paul Steed (id Software modeller) really helped me out with Varium. Although the Gamasutra site may not give you specific info and how-tos, they pointed me to other resources, like Pauls Steeds now defunct "Thinking Outside the Box" articles at the equally defunct
http://www.loonygames.com/content/archives/
http://www.flipcode.com is another interesting place to just "browse". Gamasutra has a better search engine built in, so its usually the first place I go.
Sorry this response is so broad, but without knowing specifically what you are looking for its kind of hard to just make a list of resources. (just general info of what Voxel is?) Its kind of like saying, "I am looking for a few good articles on poloygon-based maps"
Ok then, I am looking for articles with source code on how to program a voxel terrain engine. The area of voxels is not very large, but id like to see a bit of code so I can get a better understanding of it. I have searched gamasutra and gamedev.net and found a few articles, but no real "How-To's". As for polygon maps I could have pointed you to some good sites, I love 3d graphics/art :) .
Here's a
link to the patent that Novalogic received for their voxel terrain engine.
Getting a patent on certain code can be ethically dangerous. I mean, a really specific engine (like in this case) is okay, but something like 3d polygon rendering is very mathematical. I mean, it's actually pretty simple. You just make an invisible line to each vertex of your model from the viewpoint and through your view-screen plane. Then, you just remember the points where the imaginary lines intersect the viewing plane by converting them to a 2d coordinate system on your viewing plane. Now you basically flattened out your image to 2d. You then program your code to connect the dots on your 2d viewing surface. Then you just fill-in the different triangles with the appropriate color, unless you're texture-mapping. That I haven't tried to figure out yet. Matrix calculations are needed very heavily for that (especially if you want perspective-correct textures) and I haven't taken "Linear Algebra" yet. I'm taking Calculus 2 at my college right now. I basically figured that all out by thinking about it, not by reading about it. I mean, I of course had to take Geometry, but yeah. There are a lot of short-cuts, like "clipping" out un-needed vertices and stuff. The translation of the 3d triangles onto the 2d viewing surface and the texturing of the triangles is done with hardware nowadays, but us people with Pocket PCs aren't so lucky!
I found that the best way to understand and develop a Comanche-like voxel engine (back in 1997 in Turbo Pascal!) was to take an evolutionary approach.
I started off with simple things like a Wolf3D engine and 2D bitmap rotator, and as these were developed to include more features, the algorithms for a voxel engine came naturally.
You'll need to understand concepts such as:
- Sine/Cosine graphs
- Heightmaps
- Linear interpolation
- Perspective projection
- Affine texture mapping
Like myself, you may even come to understand most of these without even knowing what they're called!
*smack* I forgot about gamedev.net
Novalogics patent is pretty well known. Although to what extent it is enforced, I have no idea. They don't have a list of uber-hits like id Software. But a few of Novalogics games are among the most recognised in the industry.
jont wrote:
You'll need to understand concepts such as:
- Sine/Cosine graphs
- Heightmaps
- Linear interpolation
- Perspective projection
- Affine texture mapping
Like myself, you may even come to understand most of these without even knowing what they're called!
What the hell is all that? lol, man thats complete overkill. Depending on what you are doing, and from what perspective you view your map (Terrain), 80% of that can be done away with. Counter Sheep uses the basics, but looks ok... In fact I dont think there is a single sin, cos or tan call in the whole game.
-Brendan
Ok thanks a bunch, ill look into some of these articles you guys suggested. I actually have my own ideas on how coding of voxel terrain would work, but usually theres more optimised ways, this is why I asked. As for the sin/cos stuff, you would only really need this if your rotating your landscape. I am guessing counter sheep doesnt rotate terrain?(Sorry I havent played it but I have a lowly sh3)
I also read gamasutra on a daily basis.......
no, no rotation, static generation before gameplay!
-B
brendan":2q1ph1x9]
For realtime rendering of voxel terrain, which seems to be what Dillrye wants to do, those topics are relevant. The terrains in Counter Sheep, Argentum, MSR, etc are essentially just regular 2d bitmaps - though the bitmap might've been prerendered by a voxel engine. I think Dillrye is interested in realtime voxel rendering, i.e rendering the terrain every frame (e.g Chopper Alley). (Btw just tried CS - good stuff
)
Dillrye: I've done a couple voxel engines before, but i remember doing one in Qbasic a while ago... Speed was pretty good (for Qbasic, that is...) on a 486 so it might be useful for optimisation tips
Shouldn't be too hard to do a cool ppc voxel engine anyway i suppose, main things to tackle would probably be overdraw and mem reqs.
overdraw
Ah, the source of all evil
Whichever variant you go for, "rasteriser" or polygonal (with a polygon rasteriser), there should be no need for any overdraw at least until you start plotting entities onto the terrain.
If you want a "cheap" voxel system there was a "mars" demo kicking around with source (it's really old, but it's pretty portable working code at least).
If I were to do a terrain system on the PocketPCs, I'd look at a rasteriser based version (ray-cast the first pixel at the bottom and interpolate up) rather than going for a full polygon engine with all of the complications it brings (like LOD issues, etc).
New Gang Warfare screenshots looking very nice, T1.
As you can see above the Phantom wrote a Voxel engine but can't share the source. A few hints & suggestions would help though. He also did a demo which ran on PocketPC which looks very like the above shots exclusing the moving objects.
I tried writing a mesh / polygon based landscape with generated terrain ( ie: no height map neded ) which proved to be too slow once I made the map really big so the voxel approach is the way to go so I'm watching this thread with interest.
The level of detail in Jacco's demo is way above what I achieved and I never even tackled reflections.
Conan:leve of detail in voxel engines is always higher, but they tend to have some nasty problems especially when camera is close to landscape.
Main problem with voxel engine is stability... it doesn't look right when you move... it can be seen very well in phantom's game. It's hard to make a nice texture-mapped voxel engine that doesn't make you feel very much like "eee.. it's shaking"
but voxels are very cheap to draw and therefore on low end systems they're the perfect 3d landscape for many things...
alternative is heightmap based polygon terrain engine.. with some lod and v.fast texture mappers it should work just fine... althrought slower then voxel esp on arm cpus.
Yeah, but with a polygonal terrain it's possible to put caves in it.
Also, I am pretty sure that the Argentum engine is more than just a bitmap once it's rendered. I mean, the hills can overlap the units that are behing them, thereby making it look very realistic. Also, the shadows from different units are wrapped realistically around the terrain/hills.
A 3D voxel terrain is drawn as follows:
- Start with a 'mariokart landscape': A tilted polygon with perspective.
- Each pixel should not only have a color but also a height.
- Start with the closest row of pixels, and draw bars to represent the height.
- Subsequent lines of pixels are clipped against already drawn lines.
Those are the basics. All 3D stuff is applied to the initial tilted polygon. If you can rotate that polygon, you can rotate the voxel landscape.
Mireks remark about unstable graphics is not true IMHO; a voxel landscape can be drawn with great accuracy, especially when you add filtering (bilerp) for heights. The key is the stepsize of the 'z'; up close you should take small steps, farther away larger steps. The Nokia game that I showed uses quite large steps to get a high speed, the game runs at over 30fps on the 100Mhz ARM9 of the 7650 (it's screen is smaller though, so that helps).
If you need more info and cool shots, look here:
http://www.appeal.be/AW/html/outcast_gdc_2.htm
it's technical info to Appeal's Outcast, a game that uses voxels in a very advanced way. That also answers the question about how picky Novalogic is going to be about those patented voxels.

Phantom, I didnt read into the Novalogic patent yet, but do you think they will go after developers such as yourself?
Thats an excellent article.
Its kind of like the PostMortem articles at Gamasutra (Game Developer Magazine), except it offers more in depth detail about their decisions and the technology.
This covers alot of area that developers must deal with on a daily basis (modulation is important), as it is a constant struggle to keep the balance of speed and [visual/audio] quality. Its not easy, whether it is voxel, poly or tile.
I didn't notice anything that was specific about Novalogics patent though.
I've only played a few of Novalogics games. F22 was badass, as you could zoom between canyon walls or soar up through the upper atmosphere.
Comanche sucked though- Jane's Longbow 2 was superior in its gameplay and technical accuracy. Longbow only lacked terrain detail but made up for it in depth. Nothing like trying to bring your copter into control as your tail prop gets knocked out, forcing you into a rapidly spinning spiral.
I don't think so. I asked Appeal about this and they said that they didn't make any arrangements either, and they had quite a bit more exposure than the average PPC developer.
(I was replying to DillRye

)
I read that whole series of pages and didn't see any legal discussion at all. I couldn't find any on their website at all.
Dan East
Outcast: Sweet looking game, though! And all in software! They were doing this in software (focus-blur, even!) well before games like SplinterCell and others had to have high-end hardware! Wow. This game is pretty sweet-sounding. I am downloading the demo now.
Have been playing around with a Voxel renderer which currently has the voxels as rectangles (so no interpolation), and a thought struck me before I did interpolation. Currently I have big Lego bricks at the front of the screen.
If you are scanning left to right you could interpolate between heightmap samples, but you'd just get straight lines between them with linear interpolation. Or x^2 interpolation or something.
But why not use sampling theory to smooth out the heightmap on the screen, basically near to the front you are taking samples at a frequency higher than the original 'signal'.
Because a heightmap sampled at (say) 100cm per reading cannot represent frequencies higher than 200cm, you could put a lowpass filter on the sampler as you scan across the screen. Basically a bit like damping.
So instead of a contour which looks Legoy like this:
__------__------____
You get a gradual curve which is more what you want to get rid of the Lego brick effect. Of course the filter would be very different (almost zero) on the horizon, it's only for very close Voxels where you'd get a lot of damping
Thing is I'm having problems getting my head around this - has anyone ever done anything similar with their Voxel engines (or literally anything to do with graphics)? Is it hard to do a IIR filter in fixed point?
Conan wrote:
I tried writing a mesh / polygon based landscape with generated terrain ( ie: no height map neded ) which proved to be too slow once I made the map really big so the voxel approach is the way to go..
How big is 'really big'? It sounds like you might be zbuffering the entire set of polys each frame - if so, that kind of brute force approach wouldn't really be suitable for large sections of terrain. You might want to look into some kind of scene management to narrow down the set of visible polys, using a span-based renderer, or LOD-based geometry. I dunno how easy it'd be to implement something like that into pocket gl though. Could just reduce the draw distance or use a more overhead view, i guess.
Also, while voxels are less expensive, there might be similar performance issues if the maps are very large. (Large voxel terrains can have rather hefty mem reqs too, although there are workarounds)
Robotbeat wrote:
Also, I am pretty sure that the Argentum engine is more than just a bitmap once it's rendered. I mean, the hills can overlap the units that are behing them, thereby making it look very realistic. Also, the shadows from different units are wrapped realistically around the terrain/hills.
Shadow-casting and sprites overlapped by hills can be calculated by storing a z-value (i.e depth) for each pixel in the terrain bitmap. Take a look at MSR, which uses bitmaps prerendered in Bryce for its terrain - bikes still cast shadows and go behind hills, etc
A book called Black Art of 3D Game Programming by Andre La Mothe has a whole chapter about voxel graphics. I haven't read through that chapter yet, but it looks good. He also provides complete code examples in C.
Hey I thought I saw that book for free in pdf format(legitimatly released). Am I thinking of the same book, and if so, where might I find the pdfs?
I doubt a free pdf is available, but it's worth the money. It was written in 1995 before 3D acceleration so it explains how to build an entire 3D engine that's all very portable to the pocket pc.
The book released as a set of free pdfs is 'Graphics Programming Black Book' by Michael Abrash. Very useful resource - can't remember if it has any voxel-related info but its definitely well worth the download anyway.
Among my collection of downloaded stuff I do have an OpenGL voxel source from a Russian chap. If you want me to e-mail it let me know. It's ok code but all the comments are Russian.
HA, I wonder if google would be good at translating source code ;). I would love to look at the source, can you mail it to my pocketmatrix name @drcreations.net? I would really appreciate it.
Quite possibly the most dead-simple way of doing 'Voxel' terrain comes from Tim Clarke's old Mars demo -
http://www.dcs.ed.ac.uk/home/mxr/gfx/MarsInfo
There's certainly more advanced ways to do it, but this did the trick back in the day...
The demo code is on it's way from my AOL account.