读取纹理数据

  • glReadPixels
float *buff = new float[TEXTURE_WIDTH * TEXTURE_HEIGHT* COLOR_CHANNELS];
glReadPixels(0, 0, TEXTURE_WIDTH , TEXTURE_HEIGHT, GL_RGB, GL_FLOAT, buff);
  • glGetTexImage
float *buff = new float[TEXTURE_WIDTH * TEXTURE_HEIGHT* COLOR_CHANNELS];
glBindTexture(GL_TEXTURE_2D, textureID);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_FLOAT, buff);

参考

04-27 16:41