code restructuring

This commit is contained in:
devZoGok
2021-10-19 19:06:42 +03:00
parent b6ab24f75b
commit 2ef63ec2c2
4 changed files with 56 additions and 37 deletions
+4 -4
View File
@@ -149,9 +149,6 @@ namespace vb01{
}
void Root::updateBloomFramebuffer(){
Material *material = guiPlane->getMaterial();
Shader *shader = material->getShader();
bool horizontal = false;
blurShader->use();
blurShader->setVec2(Vector2(width, height), "screen");
@@ -159,7 +156,7 @@ namespace vb01{
glBindFramebuffer(GL_FRAMEBUFFER, pingpongBuffers[horizontal]);
blurShader->setBool(horizontal, "horizontal");
if(i == 0)
glBindTexture(GL_TEXTURE_2D, *(material->getDiffuseMap(1)->getTexture()));
glBindTexture(GL_TEXTURE_2D, *(guiPlane->getMaterial()->getDiffuseMap(1)->getTexture()));
else
pingPongTextures[!horizontal]->select();
guiPlane->render();
@@ -167,6 +164,9 @@ namespace vb01{
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
Material *material = guiPlane->getMaterial();
Shader *shader = material->getShader();
shader->use();
shader->setVec2(Vector2(width, height), "screen");
shader->setBool(bloom, "bloom");