   Weight Multitexturing
  HiI''m trying to implement an effect on my terrain which involves using multiple textures. I can easily multitexture a polygon, but what i''d like to be able to do is blend the two textures over each other with different weights at each vertex.To try and explain this further, say I have a single quad. I want the top of this quad to be 100% of texture 1 and 0% of texture 2. I''d like the bottom of the quad to be 0% of texture 1 and 100% of texture 2, with the two textures then blended over the rest of the polygon.------------    <--- 100% Tex1, 0% Tex2||||||    <--- 50% Tex1, 50% Tex2||||------------    <--- 0% Tex1, 100% Tex2Is there a way to do this? Cheers,James Pollocks2007516@student.rmit.edu.au 
  I found a solution:glActiveTextureARB(GL_TEXTURE0_ARB);   glEnable(GL_TEXTURE_2D);   glBindTexture(GL_TEXTURE_2D, tex1);   glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glActiveTextureARB(GL_TEXTURE1_ARB);   glEnable(GL_TEXTURE_2D);   glBindTexture(GL_TEXTURE_2D, tex2);   // Interpolate between texture0 and texture1   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);   glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_INTERPOLATE_EXT);   // First source is the previous texture   glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT);   glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR);   // Second source is the current texture   glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE);   glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);   // Third source is the primary color''s alpha   glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_PRIMARY_COLOR_EXT);   glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_ONE_MINUS_SRC_ALPHA); 