OT: Destructable landscape.

I know this is OT but, i was curious if any one knew of any help topics, or tutorials on a destructable style map, (Dynamicaly of course).

If you’re using some sort of image to create landscape all you need is to color given pixel darker, the next frame it’ll be lower

That is a good idea, (Kind of like dynamic burns or dark mapping) but im actualy looking for a way to actualy create and remove new verts and polys to actualy deform hte landscape.

Start lobbying for proper displacement mapping.

Pardon my stupidity but. HUH? what is that?


Displacement mapping is basically the same technique that has been used by programmers for eons under the name ‘height mapping’.

Real hardware support for that would be cool … do deform the landscape you could simply update a region of the displacement map and let the hardware do the rest.

GFfx can to my knowledge only do a kludgy emulation of ‘presampled’ displacement mapping, or in other words height mapping with a fixed grid … which is a two pass operation with temporary data (puke!).

R300 capabilities remain to be seen, but I suspect the same thing.

I just realize that this DM thing may be a bit off topic, so …
Without DM, do some basic (non-hw-)height mapping and move vertices around for deformation. That’s a well enough understood process and it should be fairly easy to find tutorials on the subject

It’s the same for the R300.

It sounds to me that he’s more interested in doing stuff like red faction. This is basically just a CSG subtract, with clever texturing for the holes you create. The CSG literature is where I’d start looking for anything besides putting some divets and craters in a terrain mesh.

Originally posted by zeckensack:

Holy poop on a stick! That’s some pretty landscaping. Gonna have to read that paper tonight.

If you’re interested in CLOD with dynamic hight maps then ROAM-like algos might be interesting since they support quick recalculations of the precomputed error metrics.

Originally posted by dabeav:
I know this is OT but, i was curious if any one knew of any help topics, or tutorials on a destructable style map, (Dynamicaly of course).

I’m surprised nobody mentioned blowing holes in the landscape. You cant do cavern like holes with DM. You cant do hang over rocks either. Otherwise, it’s pretty straightforward.


Well my original idea was to (blow holes) into the landscape. But the algorithm to breakapart polys on a per frame basis into large holes, is proving to be more hassle then its worth. I think i will simply go with a push the existing verts around algorithm, and simply multitexture the ones that have been moved with another texture. Thanx everyone.


You could also keep your landscape in some nice volumetric format where it is easy to subtract holes, and then use marching cubes to retriangulate the part that has changed. It should be pretty straightforward, if you can fit it in the memory.

One thing though, the marching cubes algo is patented, so I’m not sure if you are allowed to use that, at least in a commercial app. Doesn’t seem to bother lots of other people anyways.


I’ve always wondered how Red-Faction does the destructable buildings and such. What is CSG subtraction and where could i find more info about it?



Check this out:

Just out of interest people, surely displacement mapping of a landscape (by the GPU) makes collision detection\motion path planning much more difficult?

You would need to keep a copy of the displacement map in system memory and reconstruct the geometry around the bollides in order to perform these calculations.

I’m not sure its such a good idea for landscaping.

Everything depends on what kind of collision test you’re using & where you are doing displacement stuff GPU| |CPU.

You have to do exactly the same thing without displacement mapping. Keep a height map in system memory. But that’s no big deal, you only have to reference four points or so, lerp position, lerp normal, voilá.

Hardware DM is only good for rendering, you can potentially eliminate lod calculations and all the hassle that comes with it (‘stitching’, anyone?).

Of course there’s no win for physics, that’s not the purpose of displacement mapping. Neither is it the purpose of vertex shaders or anything else modern graphics chips do for that matter.

I had completely different idea on how to make destructable world, however i didn’t test it and as usually new methods have many drawbacks.
It allows to keep your level like usually static, with BSP, PVS, whatever you use unchanged. At same time you can cut out say spheres out of your geometry, without any CSG complicated math.
When a bomb explodes at some point you would only save what sphere should be cut out.

Ok, ok how ?
Actually it would be CSG, but using some kind of trick with stencil buffer. Similar to how shadow volumes with stencil buffer algorithms don’t depend o how complex visual result would be. It depends only on input’s geometry complexity, not output’s.
There’s a demonstration of CSG using stencil buffer on Delphi3D site (stencilcsg.zip) http://www.delphi3d.net/listfiles.php?category=6

Using this technique you could draw your levels like usually adding/subtracting what you want on the fly!

What do you think about that?