Colors above value 1 is now added to the bloomtexture, and will be used to get a glow effect in later stage.

This commit is contained in:
Tleety
2016-01-20 15:23:49 +01:00
parent 78a1037983
commit 86824f1b1f
5 changed files with 12 additions and 14 deletions
+2 -1
View File
@@ -27,6 +27,7 @@ void DrawFinalPass::InitializeFrameBuffers()
m_BloomFrameBuffer.AddResource(std::shared_ptr<BufferResource>(new Texture2D(&m_SceneTexture, GL_COLOR_ATTACHMENT0)));
m_BloomFrameBuffer.AddResource(std::shared_ptr<BufferResource>(new Texture2D(&m_BloomTexture, GL_COLOR_ATTACHMENT1)));
m_BloomFrameBuffer.Generate();
}
void DrawFinalPass::InitializeShaderPrograms()
@@ -79,8 +80,8 @@ void DrawFinalPass::Draw(RenderScene& scene)
continue;
}
}
m_BloomFrameBuffer.Unbind();
GLERROR("DrawFinalPass::Draw: END");
}
void DrawFinalPass::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type) const
+1 -1
View File
@@ -8,7 +8,7 @@ DrawFinalPassState::DrawFinalPassState()
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Enable(GL_DEPTH_TEST);
Enable(GL_CULL_FACE);
ClearColor(glm::vec4(200.f / 255, 0.f / 255, 200.f / 255, 0.f));
ClearColor(glm::vec4(155.f / 255, 0.f / 255, 155.f / 255, 0.f));
Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
+1 -3
View File
@@ -70,10 +70,8 @@ void FrameBuffer::Generate()
}
}
GLenum* bufferTextures = &attachments[0];
glDrawBuffers(1, bufferTextures);
glDrawBuffers(attachments.size(), bufferTextures);
if (GLenum frameBufferStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
LOG_ERROR("FrameBuffer incomplete: 0x%x\n", frameBufferStatus);
+2 -2
View File
@@ -99,8 +99,8 @@ void Renderer::Draw(RenderFrame& frame)
m_LightCullingPass->FillLightList(*scene);
m_LightCullingPass->CullLights(*scene);
m_DrawFinalPass->Draw(*scene);
m_DrawScreenQuadPass->Draw(m_DrawFinalPass->m_SceneTexture);
//m_DrawScreenQuadPass->Draw(m_DrawFinalPass->m_BloomTexture);
//m_DrawScreenQuadPass->Draw(m_DrawFinalPass->m_SceneTexture);
m_DrawScreenQuadPass->Draw(m_DrawFinalPass->m_BloomTexture);
//m_DrawScenePass->Draw(rq);
GLERROR("Renderer::Draw m_DrawScenePass->Draw");