Game Development Reference
In-Depth Information
Indices
You may have noticed that we need to render each triangle with a new set of vertices,
which can lead to a lot of vertices sitting in exactly the same place. This is fairly ineffi-
cient at high triangle counts, and takes up a lot of memory, especially when you have
multiple blocks of information stored within a vertex. We can get around this using a
concept similar to array indexing. We will start by providing an array of vertices to the
GPU; however, instead of defining the order to draw the triangles in the same array,
we just provide single vertex entries for each point.
The GPU then uses this alongside an array of indices to define the layout of the tri-
angles. We will save a lot of memory by defining each point by a single integer rather
than a full vertex for each triangle corner.
Search WWH ::




Custom Search