我正在为我的阵列投射项目使用openGL es2.0 3D纹理扩展。 但我只有黑屏。有我的纹理代码。它在GL_TEXTURE_WRAP_S_OES和GL_TEXTURE_WRAP_T_OES中显示错误。我不知道如何解决这个问题。
glGenTextures(1,&textureID);
glBindTexture(GL_TEXTURE_3D_OES,textureID);
glTexImage3DOES(GL_TEXTURE_3D_OES,0,GL_RGB,XDIM,YDIM,ZDIM,0,GL_RGB,GL_UNSIGNED_BYTE,pData);
// set the texture parameters
glTexParameteri(GL_TEXTURE_3D_OES,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D_OES,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_3D_OES,GL_TEXTURE_WRAP_S_OES,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_3D_OES,GL_TEXTURE_WRAP_T_OES,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_3D_OES,GL_TEXTURE_WRAP_R_OES,GL_CLAMP_TO_EDGE);
//set the mipmap levels (base and max)
glTexParameteri(GL_TEXTURE_3D_OES,GL_TEXTURE_BASE_LEVEL,0);
glTexParameteri(GL_TEXTURE_3D_OES,GL_TEXTURE_MAX_LEVEL,4);
//generate mipmaps
glGenerateMipmap(GL_TEXTURE_3D_OES);
//delete the volume data allocated on heap
delete[]pData;