I have a heightmap describing my terrain.
Highest Polygon is located at Y: 1.0f, Lowest: 0.0f
Furthermore Let’s say I have two textures I want to apply to my terrain. A red one and a blue one.
In addition I want all polygons where at least one vertex is at Y: 1.0f to apply the red texture.
Everyone else has to apply the blue texture.
What is the easiest way in OpenGL to achieve that?
I am working on an iPhone project… so it has to be a solution that works with OpenGL ES 1.1. (3D Textures don’t).
Furthermore it is important to note that my terrain is dynamic. Meaning the Y coordinates of the vertices change all the time. But only when they hit the top level (Y: 1.0f) I want them to appear red.
I’ve read about multitexturing… but I dont know if thats the best approach to achieve what I need.