mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Bloom (#12791)
Adds configurable light exposure control and bloom effect (light bleeding) with client-side settings.
This commit is contained in:
parent
3978b9b8ed
commit
9df79a4b2d
16 changed files with 422 additions and 118 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue