17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-28 16:57:29 +01:00

Sample the fog cells in their middle across the view and dither the output

This commit is contained in:
2026-10-17 00:11:27 +02:00
parent aa522d7376
commit e8dbaf70a9
7 changed files with 47 additions and 22 deletions

View File

@@ -99,6 +99,8 @@ std::pair<GLuint, std::string> gl::shader::process_source(const std::string &fil
else if (type == GL_GEOMETRY_SHADER) str += "#define STAGE_GEOMETRY 1\n";
else if (type == GL_COMPUTE_SHADER) str += "#define STAGE_COMPUTE 1\n";
str += "vec4 FBOUT(vec4 x) { return " + (Global.gfx_shadergamma ? std::string("vec4(pow(x.rgb, vec3(1.0 / 2.2)), x.a)") : std::string("x")) + "; }\n";
// whether the colour written to the window is encoded by the shader (FBOUT) or left to the sRGB framebuffer (dither.glsl)
str += std::string("#define OUTPUT_GAMMA ") + (Global.gfx_shadergamma ? "1" : "0") + "\n";
str += read_file(basedir + filename);