Skip to main content
gamedev.net
🔒 Locked

Framebuffer Object does not attach texture

Started by Osaic 0 replies 1.2k views
Original Post
Osaic
Osaic
Hi,

I have looked for a solution the last couple of days, but did not find any, so I hope you guys can.

I have a simple framebuffer implementation, but it does not work as it should. gDEBugger tells me, that the "Texture Type is unknown", when I look at the FBO Color Attachment. The texture itself is there and also viewable in gDEBugger.

glGenTextures(1, &sceneTexture);	glBindTexture(GL_TEXTURE_2D, sceneTexture);	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, windowWidth, windowHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);	glBindTexture(GL_TEXTURE_2D, 0);    glGenFramebuffers(1, &frameBuffer);    glGenRenderbuffers(1, &depthBuffer);        glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);    glBindRenderbuffer(GL_RENDERBUFFER, depthBuffer);        glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, windowWidth, windowHeight);	glBindRenderbuffer(GL_RENDERBUFFER, 0);    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer);    	glDrawBuffer(GL_COLOR_ATTACHMENT0);	glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sceneTexture, 0);   /* Test if FBO is complete, yes it is, no error. */		glBindFramebuffer(GL_FRAMEBUFFER, 0);


This is very strange, as it is the default implementation for initializing a FBO.

I use GLFW, gl3w and OpenGL 3.2 in this particular project. Maybe one of these have a problem with FBOs.
Osaic
Osaic
I found out, that this must have to do with gl3w. When I use glew it works.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.