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:
@@ -132,18 +132,17 @@ void main()
|
||||
totalLighting.Specular += result.Specular;
|
||||
}
|
||||
|
||||
|
||||
//sceneColor += Input.DiffuseColor;
|
||||
vec4 fragment = Input.DiffuseColor * (totalLighting.Diffuse + totalLighting.Specular) * texel * Color;
|
||||
bloomColor = vec4(0.3, 0.8, 0.6, 1.0);
|
||||
//bloomColor = vec4(0.3, 0.8, 0.6, 1.0);
|
||||
sceneColor = vec4(fragment.xyz, 1.0);
|
||||
//These if statements should be removed.
|
||||
/*
|
||||
if(fragment.x > 0.5 || fragment.y > 0.5 || fragment.z > 0.5) {
|
||||
bloomColor = fragment;
|
||||
|
||||
if(fragment.x > 1 || fragment.y > 1 || fragment.z > 1) {
|
||||
bloomColor = vec4(fragment.xyz, 1.0);
|
||||
} else {
|
||||
bloomColor = vec4(0.3, 0.5, 0.8, 1.0);
|
||||
}*/
|
||||
bloomColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
//sceneColor += Input.DiffuseColor * (totalLighting.Diffuse) * texel * Color;
|
||||
//sceneColor += Input.DiffuseColor + vec4(0.0, LightGrids.Data[currentTile].Amount/3, 0, 1);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user