aboutsummaryrefslogtreecommitdiff
path: root/src/Engine/Engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Engine/Engine.cpp')
-rw-r--r--src/Engine/Engine.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Engine/Engine.cpp b/src/Engine/Engine.cpp
index 37cafd8..20a295f 100644
--- a/src/Engine/Engine.cpp
+++ b/src/Engine/Engine.cpp
@@ -34,6 +34,7 @@ namespace Donut
m_ShaderProgram = Ref<Shader>(Shader::Create("Assets/Shaders/ComputeTextureQuad.glsl"));
m_ComputeProgram = CreateComputeProgram("Assets/Shaders/Geodesic.glsl");
+ m_BlurShader = Ref<Shader>(Shader::Create("Assets/Shaders/Blur.glsl"));
m_CameraUBO = UniformBuffer::Create(128, 1);
m_DiskUBO = UniformBuffer::Create(sizeof(float) * 5, 2); // Added density parameter
@@ -96,6 +97,24 @@ namespace Donut
RenderCommand::EnableDepthTest();
}
+ void Engine::DrawBlurPass()
+ {
+ RenderCommand::SetViewport(0, 0, m_Width, m_Height);
+
+ m_BlurShader->Bind();
+ m_QuadVAO->Bind();
+
+ m_Texture->Bind(0);
+ m_BlurShader->SetInt("u_ScreenTexture", 0);
+ m_BlurShader->SetFloat2("u_Resolution", glm::vec2(m_Width, m_Height));
+ m_BlurShader->SetFloat("u_BlurStrength", m_BlurStrength);
+ m_BlurShader->SetFloat("u_GlowIntensity", m_GlowIntensity);
+
+ RenderCommand::DisableDepthTest();
+ RenderCommand::DrawArrays(6);
+ RenderCommand::EnableDepthTest();
+ }
+
void Engine::DispatchCompute(const Camera& cam)
{
int cw = GetComputeWidth();