title: What does sampler2D store?
body: <p>I've read a texture example in <code>OpenGL 2.1</code>. The fragment shader looks like this:</p>
  
  <pre><code>#version 120
  
  uniform sampler2D texture;
  varying vec2 texcoord;
  
  void main(void)
  {
      gl_FragColor = texture2D(texture, texcoord);
  }
  </code></pre>
  
  <p>The <code>texcoord</code> is passed from vertex shader.</p>
  
  <p>The following C++ rendering code is used:</p>
  
  <pre><code>void render()
  {
      glActiveTexture(GL_TEXTURE0);
      glBindTexture(GL_TEXTURE_2D, texture_id);
      glUniform1i(unf_texture, 0);
  }
  </code></pre>
  
  <p>I am confused about some things. I have some question:</p>
  
  <ol>
  <li><p>In the fragment shader, the texture is passed a zero value (by <code>glUniform1i()</code>). Is the value really zero? Is the value something else? </p></li>
  <li><p>Is <code>glActiveTexture()</code> call really need?</p></li>
  <li><p>Why do we pass a zero value in <code>glUniform1i()</code>?</p></li>
  </ol>