Added SSAO

This commit is contained in:
Antoine Pilote
2023-03-05 13:00:12 -05:00
parent e23f6ac14e
commit 47985f507a
12 changed files with 379 additions and 11 deletions

View File

@@ -90,7 +90,10 @@ namespace Nuake {
}
finalOutput = framebuffer.GetTexture().get();
// SSAO
sceneEnv->mSSAO->Resize(framebuffer.GetSize());
sceneEnv->mSSAO->Draw(mGBuffer.get(), mProjection, mView);
// Copy final output to target framebuffer
mToneMapBuffer->QueueResize(framebuffer.GetSize());
mToneMapBuffer->Bind();
@@ -253,6 +256,8 @@ namespace Nuake {
shadingShader->SetUniformMat4f("u_View", mView);
shadingShader->SetUniformVec3("u_EyePosition", scene.GetCurrentCamera()->Translation);
shadingShader->SetUniformTex("m_SSAO", scene.GetEnvironment()->mSSAO->GetOuput()->GetTexture().get(), 9);
Ref<Environment> env = scene.GetEnvironment();
auto view = scene.m_Registry.view<TransformComponent, LightComponent, ParentComponent>();