pouët.net

zbuffer disabled when shader enabled

category: code [glöplog]
 
HEJ pouet people!

I got a problem in my lousy code, I enabled the zbuffer and it works perfectly when the shaders aren't enabled (front objects hides objects on the background as usual) but when the shaders are active (I press a key on my code) the zbuffer is instantly disabled and the objects are sorted by their order of creation :(

Any ideas of possible errors I did in teh shaders who can cause that error?

Zavie said it's perhaps because I didn't close properly a FBO but I think I'm ok (but I will try to look deeper in case of).

Thank in advance!
added on the 2011-10-07 10:44:02 by rez rez
Does your FBO have a depth-buffer?
added on the 2011-10-07 10:46:10 by raer raer
ermm, I think... NOT :D
added on the 2011-10-07 11:12:46 by rez rez
Hahaha.. if I had a nickel for every time I made that mistake...
added on the 2011-10-07 11:15:53 by ferris ferris
I got that to create my FBO (I didn't touched this part myself)

Code: FBO* GLSL::CreateFBO(int _Width,int _Height,GLenum _Format,GLenum _WrapMode,GLenum _FilteringMode) { return CreateFBOWithDepthBuffer(_Width,_Height,_Format,GL_INVALID_INDEX,_WrapMode,_FilteringMode); } FBO* GLSL::CreateFBOWithDepthBuffer(int _Width,int _Height,GLenum _Format,GLenum _DepthFormat,GLenum _WrapMode,GLenum _FilteringMode) { FBO* pResult=new FBO(_Width,_Height,_Format,_DepthFormat,_WrapMode,_FilteringMode); // create the FBO object if(m_pRootFBO!= NULL) m_pRootFBO->m_pPrevious=pResult; // link it to the list of existing FBOs pResult->m_pNext=m_pRootFBO; m_pRootFBO=pResult; return pResult; }


And I create the FBOs like following:

fbo_back=glsl.CreateFBO(screen_w,screen_h);

I'm sure I forgot something, but I'm too lame to know what :D
added on the 2011-10-07 11:20:38 by rez rez
Hehe. Me too. I actually HAD a z-Buffer, but forgot to glEnable it... ;D
added on the 2011-10-07 11:20:47 by raer raer
Try this
added on the 2011-10-07 11:22:13 by raer raer

login