Monday, 20 May 2013

Retrieve the value of gl_FragColor

Retrieve the value of gl_FragColor

This site talk about how to use opengl es2.0 to do gpgpu The problem of mine is how to retrieve the value of gl_FragColor back to the cpu site(host)?
fragment shader
varying vec2 fragTexCoord;

void main() {       
    gl_FragColor = texture2D(tex, fragTexCoord);
}
cpu site
 //.......
    glDrawArrays(GL_TRIANGLES, 0, 3);

  //How could I get the value after draw?

No comments:

Post a Comment