Skip to main content
GameDev.net gamedev.net
🔒 Locked

Destructible Terrain

Started by asvsfs Jul 2, 2009 at 11:05 PM 12 replies 3.9k views
Original Post
asvsfs
asvsfs
hi i wanted to build a destructible terrain that will destroy with explosion but i dont have any idea how to do that ... i'm using directx and Bullet Physics Engine..
Codeka
Codeka
It depends on how you're representing your terrain. Is it a heightfield, or something else?
asvsfs
asvsfs
i dont know that which one is better for this
...
i usually use heightfield
Codeka
Codeka
Well, if you use heightfields, the usual way is to just decrease the hights of the terrain around the explosion and regenerate your vertex buffer. By applying a "scorched" texture, you get a bit more realism. It won't be perfect, for example, on the side of a mountain, but most people wouldn't actually notice - depending on the size of the craters you want to create, I guess.

Another technique that is becoming more common is to create a voxel-based terrain, which allows for explosions almost implicitely. The main difficulty of voxel terrains is rendering them - you have to convert the voxels to triangle in a manner that is efficient.
asvsfs
asvsfs
thx for reply

is there any demo ,source code ,or something about this? specially for voxel based terrain
Acid-Chris
Acid-Chris
Hi,

PolyVox, a member in the OGRE community wrote an application for fully destructible levels using the voxel rendering technology. Perhaps you can contact him about details.

Here's the link to his work:
http://www.ogre3d.org/forums/viewtopic.php?f=11&t=27394

best regards
asvsfs
asvsfs
actually i want fully destructible terrain that works nice and real time then i can show a Precise explosion on it...
RobM
RobM
You could try stencilling out areas of the (non-deformed) terrain that are supposed to have been deformed, then in a second pass, draw in complex craters as seperate objects. I intend to do something similar with my terrain but haven't got round to implementing it yet.
theOcelot
theOcelot
Quote:
Original post by Acid-Chris
Hi,

PolyVox, a member in the OGRE community wrote an application for fully destructible levels using the voxel rendering technology. Perhaps you can contact him about details.

Here's the link to his work:
http://www.ogre3d.org/forums/viewtopic.php?f=11&t=27394

best regards


Actually, he's a member of this community too. He has a whole website for his stuff here: Thermite3D.
Matt_D
Matt_D
Quote:
Original post by asvsfs
actually i want fully destructible terrain that works nice and real time then i can show a Precise explosion on it...


lets get some actual details

- how big is your terrain going to be? (im going to assume that your world space is in some ratio of meters)
- what resolution do you intend to have, in terms of polygons per meter.
- will you be representing terrain using a height-map? or other?
- how "destructable" do you actually mean?
- how are you representing the terrain within bullet?
- is the destruction persistent?
- will your terrain be using some sort of space partitioning?
- how do you render your terrain?
- what other graphical effects will you be using to show "deformation"
- how do players deform the terrain?
- can you see the deformation happen in slow motion? or will you hide the transition to the deformed state using particles?
- will there be a point at which no more deformation is possible?
- what happens if players destroy the terrain so much that there is basically a hole in the floor? is there a sea level? or a maxmium distance down?
- what happens if players get stuck in holes and cant get out?
- what do you use to edit your original terrain?

its unlikely that bullet will provide out of the box support for deformable meshes.
also, have you ever done anything like this before?



your never as good as they say you were, never as bad as they say you was.
asvsfs
asvsfs
actually i've never done anything like this before and im not experienced with bullet i saw some kind of dynamic terrain bullet support i think it'll come handy for me .. im going to build a rocket simulation and i needed a destructible terrain its not huge terrain well maybe not very small and i thought that i can use voxel terrain but i want when terrain get hit its voxels(for example,its elements at all)throws out in different directions .... and the reason i dont want to use voxel in such thing is performance ... i couldn't find anything nice on net.. actually voxel terrain from thermit3d is great and very impressive but i think its not good for this kind of work not just because of performance but for the way it shows destruction ...i saw a sample microsoft directx sdk march 2009 i think it was deferredparticles and it have nice explosion and nice particles but its not on a terrain... at the end for now im thinking of way to do that that i call it element-drive rendering every model in this way consist of sub elements that build the whole model and for example a house consist of woods and woods are built of some kind of smaller part

and we dont treat them as a rigid body… their position and vertices don’t get processing until with need them they will stores in buffer and when we predict that somethings going to hit(in this kind we have upto 20 frame or many more frames… to compute its path for example rocket). for example for a house we will add vertices and build elements we need from buffers and we compute center of mass for elements that throwing out and gravity and their collision just with terrain and some other object not all of them and themselves(and we can delete particles after explosion anytime we want ) … this is what I think for this kind of simulation and I think it have enough realistic Compared to the process it needs but it needs lot of work and just a idea(and i dont know if its possible completely! or there is already better way to do that).. for now im planning to just change my height map to build the effect until I finished other parts of this simulation because im not experienced and it’s a research work …
Matt_D
Matt_D
i dont think you answered any of the questions.

it sounds like you want to use a heightmap for your terrain, but how will you go from a heightmap, to a vertex list? will you use a shader to compute this?

ignoring any buildings, etc, you havent detailed how the terrain deforms, this is important.

your never as good as they say you were, never as bad as they say you was.
asvsfs
asvsfs
for now i thought to change my height map i dont know if its possible in real time...
and change its height for example in a radius that explosion happen
and for questions i have a large terrain and nice destruction on it!
and i need to know which kind of terrain is better for me!(height map ,voxel,...)
and yes it is persistent
and about space partitioning i dont make a decision for that! but i think for performance it would be better
about rendering i dont have any idea .. usual ways
i want when terrain get hit its particle throw out! or something like that
and about deforming its deform with a rocket explosion
about slow motion ..yes!
maximum distance would be better for now
there is no player to get stuck in hole (at least for now but if he get he can destroy more to open his way!)
and editor for editing terrain is there any difference in that?

[Edited by - asvsfs on July 5, 2009 7:52:05 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.