title: OpenGL using shaders on textures
body: <p>I have two images, and with the help of the instruction here:
  <a href="http://en.wikibooks.org/wiki/OpenGL_Programming/Intermediate/Textures" rel="nofollow">http://en.wikibooks.org/wiki/OpenGL_Programming/Intermediate/Textures</a></p>
  
  <p>I was able store them separately, into two separate textures, and upload them into video memory:</p>
  
  <pre><code> gluBuild2DMipmaps(GL_TEXTURE_2D, 4, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
  </code></pre>
  
  <p>Now, how would I access these textures with shaders to multiply these two textures?</p>
  
  <p>For example, I found this example, about multiplication using shaders:
  <a href="http://www.opengl.org/wiki/Texture_Combiners" rel="nofollow">http://www.opengl.org/wiki/Texture_Combiners</a></p>
  
  <pre><code>//Vertex shader
   #version 110
   attribute vec4 InVertex;
   attribute vec2 InTexCoord0;
   attribute vec2 InTexCoord1;
   uniform mat4 ProjectionModelviewMatrix;
   varying vec2 TexCoord0;
   varying vec2 TexCoord1;    //Or just use TexCoord0
   //------------------------
   void main()
   {
     gl_Position = ProjectionModelviewMatrix * InVertex;
     TexCoord0 = InTexCoord0;
     TexCoord1 = InTexCoord1;
   }
   //------------------------
   //Fragment shader
   #version 110
   uniform sampler2D Texture0;
   uniform sampler2D Texture1;
   //------------------------
   varying vec2 TexCoord0;
   varying vec2 TexCoord1;    //Or just use TexCoord0
   //------------------------
   void main()
   {
      vec4 texel = texture2D(Texture0, TexCoord0);
      texel *= texture2D(Texture1, TexCoord1);
      gl_FragColor = texel;
   }
  </code></pre>
  
  <p>But how would I make the textures that I've uploaded in a form of Vertex, so that I can use this Fragment shaders to accomplish this multiplication.</p>
  
  <p>All I did was generated gluBuild2DMipmaps, but now I don't know how to apply Vertex/Fragment shaders to my texture?</p>