summaryrefslogtreecommitdiffstats
path: root/src/RenderConfigs.cpp
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-12-05 00:26:50 +0100
committerLaG1924 <lag1924@gmail.com>2021-12-05 00:26:50 +0100
commit93a5385cb03482d09108edef1433a9f470bf1e4a (patch)
treeb2b3a92b847e2539b0ff5df13e54a030e524dedc /src/RenderConfigs.cpp
parentAdded SSAO (diff)
downloadAltCraft-93a5385cb03482d09108edef1433a9f470bf1e4a.tar
AltCraft-93a5385cb03482d09108edef1433a9f470bf1e4a.tar.gz
AltCraft-93a5385cb03482d09108edef1433a9f470bf1e4a.tar.bz2
AltCraft-93a5385cb03482d09108edef1433a9f470bf1e4a.tar.lz
AltCraft-93a5385cb03482d09108edef1433a9f470bf1e4a.tar.xz
AltCraft-93a5385cb03482d09108edef1433a9f470bf1e4a.tar.zst
AltCraft-93a5385cb03482d09108edef1433a9f470bf1e4a.zip
Diffstat (limited to '')
-rw-r--r--src/RenderConfigs.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/RenderConfigs.cpp b/src/RenderConfigs.cpp
index d185c79..88166a5 100644
--- a/src/RenderConfigs.cpp
+++ b/src/RenderConfigs.cpp
@@ -155,6 +155,24 @@ Gbuffer::Gbuffer(size_t geomW, size_t geomH, size_t lightW, size_t lightH) {
Gal::Format::R8G8B8A8,
Gal::Filtering::Bilinear);
+ std::vector<std::pair<std::string_view, std::shared_ptr<Gal::Texture>>> ssaoBlurTextures = {
+ {"blurInput", ssaoPass->GetResultTexture()},
+ };
+
+ std::vector<std::pair<std::string_view, Gal::Type>> ssaoBlurParameters = {
+ {"blurScale", Gal::Type::Int32},
+ };
+
+ ssaoBlurPass = std::make_unique<PostProcess>(LoadPixelShader("/altcraft/shaders/frag/blur"),
+ ssaoBlurTextures,
+ ssaoBlurParameters,
+ lightW,
+ lightH,
+ Gal::Format::R8G8B8A8,
+ Gal::Filtering::Bilinear);
+
+ ssaoBlurPass->SetShaderParameter("blurScale", 2);
+
std::vector<std::pair<std::string_view, Gal::Type>> lightingParameters = {
{"renderBuff", Gal::Type::Int32},
};
@@ -166,7 +184,7 @@ Gbuffer::Gbuffer(size_t geomW, size_t geomH, size_t lightW, size_t lightH) {
{"worldPos", worldPos},
{"addColor", addColor},
{"light", light},
- {"ssao", ssaoPass->GetResultTexture()},
+ {"ssao", ssaoBlurPass->GetResultTexture()},
};
lightingPass = std::make_unique<PostProcess>(LoadPixelShader("/altcraft/shaders/frag/light"),