void Bamboo::RN_Deferred::ItlPostRenderChildren() { // todo:: fault? ItlGetGraphicCore()->GetShaderManager()->PushActiveShader(); //remove the fbo (THIS fbo) from the bound_fbos stack ItlPopFBO(); ItlPopViewportInformation(); //if there was a SceneObject_FBO bound in the SceneObject_Tree, rebind the previous bound fbo if (ItlIsNestedFBO()) { GLuint previous_bound = ItlGetTopFBO(); glBindFramebuffer(GL_FRAMEBUFFER, previous_bound); } else glBindFramebuffer(GL_FRAMEBUFFER, 0); int iOldWidth, iOldHeight; ItlGetTopViewportInformation(iOldWidth, iOldHeight); //restore viewport params glViewport(0, 0, iOldWidth, iOldHeight); }
/*! * This method is called internally AFTER rendering the children, * and unbinds the fbo. */ void Bamboo::RN_FBO::ItlPostRenderChildren() { //if mipmapping is activated, update mipmaps if (m_bMipMapped) { // get texture manager Bamboo::TextureManager *pTextureManager = ItlGetGraphicCore()->GetTextureManager(); assert (pTextureManager != NULL); pTextureManager->UseTexture(m_szColorTextureName); glGenerateMipmap(GL_TEXTURE_2D); pTextureManager->UnuseTexture(m_szColorTextureName); } //remove the fbo (THIS fbo) from the bound_fbos stack ItlPopFBO(); ItlPopViewportInformation(); //if there was a SceneObject_FBO bound in the SceneObject_Tree, rebind the previous bound fbo if (ItlIsNestedFBO()) { GLuint previous_bound = ItlGetTopFBO(); glBindFramebuffer(GL_FRAMEBUFFER, previous_bound); } else glBindFramebuffer(GL_FRAMEBUFFER, 0); int iOldHeight, iOldWidth; ItlGetTopViewportInformation(iOldWidth, iOldHeight); //restore viewport params glViewport(0, 0, iOldWidth, iOldHeight); }