Originally Posted by

**T101**
Surely you are *rendering* triangle strips, but presumably your source data is not a triangle strip but a two-dimensional array?

The grid block suggestion is to use a course version of the original map (sort of like a mipmap in construction) to keep track of the min/max.

Let's say, for example that you have a grid of 1000 x 1000 height values. Suppose you split it up (conceptually) into blocks of 100x100.

Before the first time you render the object, you'll have to calculate the min/max of all of these blocks, so you have to walk through all 1 million grid points:

outer loop: walk through all grid blocks

inner loop: for the grid block, calculate the minium and maximum height value

To get the total min/max, you need to get the maximum of the maxima per gridblock, and the minimum of the minima per gridblock.

So far there is no advantage.

However, if a height in a grid block changes, you only need to recalculate that one grid block, and subsequently do the same max of max and min of min calculations. In this specific example that saves you almost 90% of the calculations.

You could even add more layers into it, to reduce the necessary recalculations.

You might treat the block, or the entire heightfield, as a box of the original width and length, and a height equal to the difference between the maximum and minimum height value.