title: Does glsl texture2d disable blending?
body: <p>I try to blend several deformations of a texture, each time in a different color, but the colors are not blended.</p>
  
  <p>When I change only one line in my fragment shader: to use vec4 instead of texture2D, the colors are blended perfectly.</p>
  
  <p>My code:</p>
  
  <pre><code>// set color mask to red only
  glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_TRUE);
  // draw
  glDrawElements(GL_TRIANGLES, deformation_grid-&gt;mesh().triangles().size(),
          GL_UNSIGNED_SHORT, deformation_grid-&gt;mesh().triangles().data());
  
  // set color mask to green only
  glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_TRUE);
  // draw
  glDrawElements(GL_TRIANGLES, deformation_grid-&gt;mesh().triangles().size(),
          GL_UNSIGNED_SHORT, deformation_grid-&gt;mesh().triangles().data());
  </code></pre>
  
  <p>My Fragment shader:</p>
  
  <pre><code>const char fragment_shader[] = "precision highp float;\n"
      "uniform sampler2D u_texture;\n"
      "varying vec2 v_uv;\n"
      "void main() {\n"
      "  vec4 texColor = vec4(texture2D(u_texture, v_uv).rgb, 0.5);\n"
      "  vec4 oneColor = vec4(1.0, 1.0, 1.0, 0.5);\n"
      "  gl_FragColor = texColor;\n"
      "}\n";
  </code></pre>
  
  <p>I would expect to always get yellow, but I actually get yellow when I set </p>
  
  <pre><code>gl_FragColor = oneColor
  </code></pre>
  
  <p>and green when I set</p>
  
  <pre><code>gl_FragColor = texColor
  </code></pre>
  
  <p>Changing the alpha value in glColorMask() and in the fragment shader didn't have any effect.</p>
  
  <p>Does texture2D disable the blending that is set by glColorMask?
  If it does, how can I avoid it?</p>