I am trying to make a terrain engine like age of empires. Its 2D isometric.I plan to produce the terrain like this.
1.Render a base texture like grass
2.Render another texture on top like sand but control its alpha using an alpha texture(or map i think its called).
that makes it 2 passes for each tile.
Can somebody show me the code on how to do it using ARB extensions.i.e. the sequence of glTexEnvi() calls etc & the parameters reqd. etc.
I was initially planning to combine both the textures in just 1 pass with their alphas already set.say all pixels of both textures have their alpha set to 128…then i do this:-
//for 1st texture
glActiveTexture(…)
glBindTexture(…)
//for 2nd texture
glActiveTexture(…)
glBindTexture(…)
glBegin(GL_QUADS)
.
.
glMultiTexCoords2f(…) //for grass texture
glMultiTexCoords2f(…) //for sand texture
glVertex2i(…) //i repeat this 4 times for 4 vertices
…
glEnd()
But that does not give me much variation.Is their a better way to do this.I want to use max 2 texture units as this is just a 2d game.