Each of these generated triangles stores the spatial co-
ordinates, the texture information and any other infor-
mation needed for rendering. In addition, it is nec-
essary to output for each new triangle two pieces of
information:
• A number indicating the tessellation depth for the
triangle.
• A number coding the tessellation patterns that
have been applied, keeping this information in
patternIn f o.
The need of storing these two values is due to the
fact that we must know how a particular triangle was
created in order to know how we should modify it
when swapping to a lower level of detail. On the one
hand, the depth value will simply indicate how many
tessellation steps have affected a particular triangle.
On the other, the patternIn f o number is used to store
all the patterns that have been applied to refine a trian-
gle. This value is obtained following Equation 1. In
this equation appliedPattern refers to the type of the
latest pattern, the one that we have used to create this
triangle. The value numberO f Patterns refers to the
number of available patterns that we can apply in our
tessellation algorithm. In our case we will use the 7
patterns presented in Figure 2 and, as a consequence,
numberO f Patterns will be equal to 7.
patternIn f o = patternIn f o + appliedPattern · numberO f Patterns
depth
(1)
This patternIn f o value will not be the same for all
the triangles belonging to the same parent. When tes-
sellating a triangle, for example with the pattern used
when the hypotenuse and both legs are refined (see
pattern 1 in Figure 2), four triangles are output. Nev-
ertheless, only one of these triangles will be needed
when diminishing the detail. Three of them will be
discarded and the other one will be modified to recre-
ate the geometry of the parent triangle. Therefore, the
patternIn f o value will be calculated with Equation 1
for the triangle that survives and will be 0 for the ones
that will be eliminated. We will see the coarsening
process in more detail in the following subsection.
3.1.1 Coarsening the Mesh
A different process should be applied when dimin-
ishing the detail of the mesh. The depth and
patternIn f o values presented above are the elements
that enable our algorithm to recover less detailed ap-
proximations without having to start again from the
coarsest approximation. It is important to underline
that this is one of the main features of the method we
are proposing.
The first step would be to find out whether the pro-
cessing triangle can be discarded or if it is the triangle
in charge of retrieving the geometry of the parent tri-
angle. A positive patternIn f o value indicates that it
is the latter case, the triangle will calculate the spatial
coordinates of its parent triangle.
In order to retrieve the spatial coordinates of the
parent triangle we must know which pattern was ap-
plied to create the existing triangle. This is due to the
fact that for each pattern we will perform different cal-
culations for retrieving the three vertices of the parent
triangle. In this situation the patternIn f o value helps
us to know which pattern was applied, as the latest
pattern can be obtained with the next equation:
latestPattern =
patternIn f o
numberO f Patterns
depth−1
(2)
Once we know which pattern was applied, we cal-
culate the position of the vertices and we output the
new geometry with the new patternIn f o value ob-
tained with Equation 3. The way we calculated this
value assures that we will be able to continue coars-
ening the mesh or refining it without any problem.
patternIn f o = patternIn f o − latestPattern · numberO f Patterns
depth−1
(3)
3.2 Camera Movement
We have described how the tessellation process works
but we have considered that the location of the plane
splitting the area where the mesh is and is not tessel-
lated remains unaltered. Nevertheless, in a real case
this line keeps moving all the time as it is usually re-
lated to the camera position.
In these cases, a slightly different process is ap-
plied to correct the appropriate triangles. This algo-
rithm checks each triangle to see whether, with the
new criterion, their parent triangle would need a dif-
ferent tessellation. In that case, the algorithm will
coarsen the triangles and refine them again. It is
important to underline that both processes (coarsen-
ing and refining again) are executed at the same time
and can be continuously executed while the camera is
moving. In this particular case the depth value is very
important as it enable us to know how many tessella-
tion coarsements and refinements must be executed in
those areas that are affected by the camera movement.
4 RESULTS
In this section we will study the performance of our
tessellation method. Our scheme was programmed
with GLSL and C++ on a Windows Vista Operating
TESSELLATING OCEAN SURFACES
321