Allow heightfield color/material layers to be of different resolutions than the height layer.

If I'm reading this correctly, you're suggesting that the foreach (intersection) could be put inside the if (height) at the top.  The trick is that any or all of height/color/material can be true, and we want to process the color even if the height is false.