1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add antialiasing filters (FXAA, SSAA) (#13253)

This commit is contained in:
x2048 2023-06-28 05:30:08 +02:00 committed by GitHub
parent 442d5fc75c
commit c09a3a52ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 230 additions and 17 deletions

View file

@ -780,6 +780,12 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
if (g_settings->getBool("enable_auto_exposure"))
shaders_header << "#define ENABLE_AUTO_EXPOSURE 1\n";
if (g_settings->get("antialiasing") == "ssaa") {
shaders_header << "#define ENABLE_SSAA 1\n";
u16 ssaa_scale = MYMAX(2, g_settings->getU16("fsaa"));
shaders_header << "#define SSAA_SCALE " << ssaa_scale << ".\n";
}
shaders_header << "#line 0\n"; // reset the line counter for meaningful diagnostics
std::string common_header = shaders_header.str();