aboutsummaryrefslogtreecommitdiff
path: root/src/client/shader.cpp
diff options
context:
space:
mode:
authorx2048 <codeforsmile@gmail.com>2022-09-29 20:34:05 +0200
committerGitHub <noreply@github.com>2022-09-29 20:34:05 +0200
commit9df79a4b2d68979c3e15797d518d957787ba4e21 (patch)
tree027f372a420f1aa3aa72bf72de34c5e6062b9090 /src/client/shader.cpp
parent3978b9b8ed1c318c3f9a088beb331c26bca6de6b (diff)
downloadminetest-9df79a4b2d68979c3e15797d518d957787ba4e21.tar.xz
Bloom (#12791)
Adds configurable light exposure control and bloom effect (light bleeding) with client-side settings.
Diffstat (limited to 'src/client/shader.cpp')
-rw-r--r--src/client/shader.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/shader.cpp b/src/client/shader.cpp
index f46807864..ab9b23117 100644
--- a/src/client/shader.cpp
+++ b/src/client/shader.cpp
@@ -682,6 +682,13 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
)";
}
+ // map legacy semantic texture names to texture identifiers
+ fragment_header += R"(
+ #define baseTexture texture0
+ #define normalTexture texture1
+ #define textureFlags texture2
+ )";
+
// Since this is the first time we're using the GL bindings be extra careful.
// This should be removed before 5.6.0 or similar.
if (!GL.GetString) {
@@ -771,6 +778,12 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
shaders_header << "#define SOFTSHADOWRADIUS " << shadow_soft_radius << "\n";
}
+ if (g_settings->getBool("enable_bloom")) {
+ shaders_header << "#define ENABLE_BLOOM 1\n";
+ if (g_settings->getBool("enable_bloom_debug"))
+ shaders_header << "#define ENABLE_BLOOM_DEBUG 1\n";
+ }
+
shaders_header << "#line 0\n"; // reset the line counter for meaningful diagnostics
std::string common_header = shaders_header.str();