我想通过 glReadPixels 使用 GL_FLOAT 纹理 获取值。
我的 Android 设备支持 OES_texture_float。但是,附加GL_FLOAT纹理时出现错误。
在Android的OpenGL ES 2.0中,将GL_FLOAT纹理附加到FBO是不可能的?还是取决于硬件?
我的部分代码是:
Init:
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D,texture);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,texWidth,texHeight,0,GL_RGB,GL_FLOAT,NULL);
FBO 附:
glBindFramebuffer(GL_FRAMEBUFFER,framebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,texture,0);
checkGlError("FBO Settings");
// glGetError() return 0x502.
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
// glCheckFramebufferStatus() return 0.
如果有人有一些见解,我会很感激。