StereoMatching
StereoMatching

Reputation: 5019

Retrieve the value of gl_FragColor

This site(GPGPU programming with OpenGL ES 2.0) 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?

Upvotes: 1

Views: 262

Answers (1)

genpfault
genpfault

Reputation: 52083

The problem of mine is how to retrieve the value of gl_FragColor back to the cpu site(host)?

glReadPixels()

Upvotes: 2

Related Questions