c++ - 检索 gl_FragColor 的值

标签 c++ opengl-es opengl-es-2.0

本站(GPGPU programming with OpenGL ES 2.0)讲如何用opengl es2.0做gpgpu 我的问题是如何检索的值 gl_FragColor 回到 cpu 站点(主机)?

片段着色器

varying vec2 fragTexCoord;

void main() {        
    gl_FragColor = texture2D(tex, fragTexCoord);
}

CPU 站点

 //.......
    glDrawArrays(GL_TRIANGLES, 0, 3);

  //How could I get the value after draw?

最佳答案

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

glReadPixels()

关于c++ - 检索 gl_FragColor 的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16653848/

相关文章:

c++ - 对 shared_ptr 的引用的 reinterpret_cast

java - OpenGL 扩展可用于不同的 Android 设备

android - opengl es,glActiveTexture时出错

android - 什么是 glVertexAttribPointer 数据

c++ - 命名空间中的私有(private)类

c++ - 点云库 - 如何将单个 RGB 值分配给整个点云?

带有 -Wshadow 警告的 C++ 结构化绑定(bind)?

objective-c - 从Blender导出模型以在iOS App中使用

android - 有什么方法可以将使用 opengles 1.1 渲染的游戏录制到带有 MediaCodec 的视频中吗?

ios - OpenGLES 2.0 错误的深度缓冲位