08.11
Destroyable Objects on the Fly
The reality in the game industry is very important in these days after a lot of development in the hardware devices that increased year after year. The new GPUs in the market can now support to process millions of vertices per second, what about destroyable objects in the game? How can be implemented? Well, a complexity exists behind the scene; most games will have at least some sort of feedback, such as decal texture, or particle system showing dust or smoke. Other games have a prepared destroyed posture for their objects that are visible when the object reaches some limits like windows and tables. Games rarely do this though, because of the complexity of modifying geometry in real time, also extra preparation necessary by artists to create damage geometry.
Well, there is simple solution to this problem, it calls Decal Tessellation is a simple solution to this problem. The idea behind this solution is to take displacement map texture, project it onto geometry and tessellate the geometry in real time; this will make the geometry to look as a physically damaged geometry. The tessellation that makes it possible to implement this technique in real time.
OpenGL 4.0 and Direct3D 11 have APIs for hardware tessellation, and the GPU must support hardware tessellation also.
Hardware Tessellation
You can observe the pipeline process figure that shows you the Direct3D 11 pipeline which includes the tessellator
stages. The vertex shader is sitting on at the top of the pipeline. The vertex is responsible all vertex transformations, this includes the transformation to clip space before the rasterization step.
What is belong to the tessellation, the input mesh is called a control mesh or control cage, since it’s made of control points (also called patches). The simplest patches are just triangles.
The vertex shader can transform the control mesh, as in the case of animation. Otherwise it passes the control onto the next stage. After the vertex stage comes the hull shader which has two roads that run in different phases.
- The control point phase runs once per control point.
- The patch-constant phase runs once per patch.
The first phase (control point) can be used for doing further transformations of the control points, then it passes the vertices to the next stage. While the patch-constant phase hull shader is responsible for setting the tessellation factors. The factors are set for each edge of the patch. They determine how much tessellation can be made on the mesh by breaking it into triangles).
The rendering performance is influenced by the tessellation factors in an obvious manner. Then the hull shader comes after the tessellator stage. The tessellator is a fixed function stage that generates the new vertices that make up the tessellated patch.
After that the domain shader receives the new transformed vertices which gets called once per tessellated vertex. The vertices of the patch get evaluated in this stage. As an example, if displacement mapping is used by the patch, the domain shader fetches the height values from the displacement map and translates the vertices. If the patch is a Bezier patch (parametric patch), then the domain shader will do some mathematical calculations to transform the vertices to their world space position.
After processing the patch surface, the vertices will be transformed into clip space by the domain shader. The next stages will execute the rest as a non-tessellated rendering, with vertices passed to the geometry shader then followed by the pixel shader which gets executed for each pixel.




