title: Getting the color of the back buffer in GLSL
body: <p>I am trying to extract the color behind my shader fragment. I have searched around and found various examples of people doing this as such:</p>
  
  <pre><code>vec2 position = ( gl_FragCoord.xy / u_resolution.xy );
  vec4 color = texture2D(u_backbuffer, v_texCoord);
  </code></pre>
  
  <p>This makes sense. However nobody has shown an example where you pass in the back buffer uniform.</p>
  
  <p>I tried to do it like this:</p>
  
  <pre><code>int backbuffer = glGetUniformLocation(self.shaderProgram-&gt;program_, "u_backbuffer");
  GLint textureID;
  glGetIntegerv(GL_FRAMEBUFFER_BINDING, &amp;textureID);//tried both of these one at a time
  glGetIntegerv(GL_RENDERBUFFER_BINDING, &amp;textureID);//tried both of these one at a time
  glUniform1i(backbuffer, textureID);
  </code></pre>
  
  <p>But i just get black. This is in cocos2d iOS FYI</p>
  
  <p>Any suggestions?</p>