Now when I try to run the program with the new driver, I get GL_FRAMEBUFFER_UNSUPPORTED when I try to create my framebuffer. Anyone have any experience with this error?
glGenTextures(1,&_texHandle); glBindTexture(GL_TEXTURE_CUBE_MAP,_texHandle); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); for(uint side = 0;side<6;side++){ glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+side, 0, GL_RGBA, resolution, resolution, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); } glGenerateMipmap(GL_TEXTURE_CUBE_MAP);//I don't need mipmaps, but I thought this might help my error. glBindTexture(GL_TEXTURE_CUBE_MAP,0); GLCHECKERROR(); GLuint framebuffer; glGenFramebuffers(1,&framebuffer); glBindFramebuffer(GL_DRAW_FRAMEBUFFER,framebuffer); glm::mat4 proj = OpenGL::PerspectiveProject(90,1,1,0.1f,1000); GLint viewport[4]; glGetIntegerv(GL_VIEWPORT,viewport); for(uint side=0;side<6;side++){ glm::mat4 view; switch(side){ case 0: view = OpenGL::LookAt(glm::vec3(0,0,0),glm::vec3(1,0,0),glm::vec3(0,-1,0));break; case 1: view = OpenGL::LookAt(glm::vec3(0,0,0),glm::vec3(-1,0,0),glm::vec3(0,-1,0));break; case 2: view = OpenGL::LookAt(glm::vec3(0,0,0),glm::vec3(0,1,0),glm::vec3(0,0,1));break; case 3: view = OpenGL::LookAt(glm::vec3(0,0,0),glm::vec3(0,-1,0),glm::vec3(0,0,-1));break; case 4: view = OpenGL::LookAt(glm::vec3(0,0,0),glm::vec3(0,0,1),glm::vec3(0,-1,0));break; case 5: view = OpenGL::LookAt(glm::vec3(0,0,0),glm::vec3(0,0,-1),glm::vec3(0,-1,0));break; } //+x/-x/+y/-y/+z/-z glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_CUBE_MAP_POSITIVE_X+side,_texHandle,0); OpenGL::CheckFramebufferError(GL_DRAW_FRAMEBUFFER); //GL_UNSUPPORTED_FRAMEBUFFER}
I saw this on opengl.org, but I'm not sure if it applies to me. How can I tell if my texture is 'complete'? I've set the min/max filters and even called generate mipmaps.
Quote:
Warning: NVIDIA's OpenGL driver has a known issue with using incomplete textures. If the texture is not texture complete, the FBO itself will be considered GL_FRAMEBUFFER_UNSUPPORTED, or will have GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT. This is a driver bug, as the OpenGL specification does not allow implementations to return either of these values simply because a texture is not yet complete. Until this is resolved in NVIDIA's drivers, it is advised to make sure that all textures have mipmap levels, and that all glTexParameteri values are properly set up for the format of the texture. For example, integral textures are not complete if the mag and min filters have any LINEAR fields.