Wrong framebuffer status (return 36054) when try to do depth attachment

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Wrong framebuffer status (return 36054) when try to do depth attachment

a_shuang
Here is the code setting up a framebuffer for shadow mapping, yet it returns 36054 when checking the framebuffer status. Any ideas?

//bind framebuffer for shadow mapping
gl.glGenFramebuffers(1, framebuff);
gl.glBindFramebuffer(GL4.GL_FRAMEBUFFER, framebuff.get(0));

gl.glGenTextures(1, textureBuff);

gl.glBindTexture(GL4.GL_TEXTURE_2D, textureBuff.get(0));
gl.glTexStorage2D(GL4.GL_TEXTURE_2D, 1, GL4.GL_DEPTH_COMPONENT32F, displayWidth, displayHeight);
gl.glTexParameteri(GL4.GL_TEXTURE_2D, GL4.GL_TEXTURE_MAG_FILTER, GL4.GL_LINEAR);
gl.glTexParameteri(GL4.GL_TEXTURE_2D, GL4.GL_TEXTURE_MIN_FILTER, GL4.GL_LINEAR);
gl.glTexParameteri(GL4.GL_TEXTURE_2D, GL4.GL_TEXTURE_WRAP_S, GL4.GL_CLAMP_TO_EDGE);
gl.glTexParameteri(GL4.GL_TEXTURE_2D, GL4.GL_TEXTURE_WRAP_T, GL4.GL_CLAMP_TO_EDGE);

gl.glTexParameteri(GL4.GL_TEXTURE_2D, GL4.GL_TEXTURE_COMPARE_MODE, GL4.GL_COMPARE_REF_TO_TEXTURE);
gl.glTexParameteri(GL4.GL_TEXTURE_2D, GL4.GL_TEXTURE_COMPARE_FUNC, GL4.GL_LEQUAL);
gl.glFramebufferTexture(GL4.GL_FRAMEBUFFER, GL4.GL_DEPTH_ATTACHMENT, textureBuff.get(0), 0);
gl.glDrawBuffer(GL4.GL_NONE);

if(gl.glCheckFramebufferStatus(GL4.GL_FRAMEBUFFER) != GL4.GL_FRAMEBUFFER_COMPLETE)
    return gl.glCheckFramebufferStatus(GL4.GL_FRAMEBUFFER);
Reply | Threaded
Open this post in threaded view
|

Re: Wrong framebuffer status (return 36054) when try to do depth attachment

gouessej
Administrator
I answered to your question on StackOverflow.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Wrong framebuffer status (return 36054) when try to do depth attachment

a_shuang
gouessej wrote
I answered to your question on StackOverflow.
Checked. Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Wrong framebuffer status (return 36054) when try to do depth attachment

gouessej
Administrator