Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What are the prebaked or precomputed explosions or fractures from a programmer viewpoint ?

I would like to know how to achieve this in C++ and how this things are usually considered (they are animations? textures?), it would be perfect if there will be some examples available or someone that can picture a broad view about this.

I need to add a really small support for this in my code and i need an hint about how to start, i would like to do this on my own without other libraries.

share|improve this question
What do you mean by "precomputed explosions"? Prerendered particle effects or breaking objects into smaller parts and animating them? – snake5 Sep 27 '12 at 8:17
@snake5 breaking – Ken Sep 27 '12 at 8:20
up vote 1 down vote accepted

The general approach is to replace models with broken versions of those. There are two ways to go from here: manually building the broken versions or generating them. If you work with an artist, the first way is much easier than the second. Some of the modelling apps may even have tools that generate broken versions of meshes.

Generation is usually done by adding an extra material, slicing the mesh using planes, triangulating the created hole edge loops and applying the new material on those triangles. However, this sounds much easier than it actually is. For the right effect, the input mesh must have no visible holes (which means that, for example, bottoms of buildings must be closed). The difficulties in designing the algorithms and data layouts may arise in multimaterial setups where each part of mesh isn't closed while everything put together is.

Since generation is such an insane thing to attempt, it should only be done on procedurally generated meshes. For everything else, you will need an artist and there's no sane way around that.

Physics for everything is done as usual: generate convex hulls (libraries usually have something that will help with this) for each mesh and create the bodies.

share|improve this answer

Pre-baked fractures are typically simple object swaps.

Consider a vase getting hit by a bullet. Instead of having one vase, you have two: an intact one and one in pieces. When the bullet hits, you remove the intact vase from the scene and place the broken one in.

share|improve this answer
so i always need to compute physics for all the pieces that are falling? can you provide some articles about this from a programmer viewpoint? – Ken Sep 27 '12 at 8:19
Well, the dropping pieces could be animated by the artist in the modelling software if you want REALLY baked stuff, or you could use a physics library to do it in code. – Jari Komppa Sep 27 '12 at 8:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.