diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-16 21:10:16 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-16 21:10:16 +0200 |
| commit | cb2989cec50dc15ff0dab16888b38a25f2d4f081 (patch) | |
| tree | 160f5cf0ea6966370766ce2388a8398aae8093fd /src/render | |
| parent | 16afa2c42200e7a7d8b45602f584986094c92721 (diff) | |
fix fade corner artifacts
Diffstat (limited to 'src/render')
| -rw-r--r-- | src/render/shaders/Textures.hpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp index d01e7775..13cdc92a 100644 --- a/src/render/shaders/Textures.hpp +++ b/src/render/shaders/Textures.hpp @@ -34,8 +34,7 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar distances = distances / 4.0; - gl_FragColor = )#" + colorVarName + R"#( * distances; - return; + )#" + colorVarName + R"#( = )#" + colorVarName + R"#( * distances; } } } else if (pixCoord[1] > bottomRight[1]) { @@ -66,8 +65,7 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar distances = distances / 4.0; - gl_FragColor = )#" + colorVarName + R"#( * distances; - return; + )#" + colorVarName + R"#( = )#" + colorVarName + R"#( * distances; } } } @@ -102,8 +100,7 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar distances = distances / 4.0; - gl_FragColor = )#" + colorVarName + R"#( * distances; - return; + )#" + colorVarName + R"#( = )#" + colorVarName + R"#( * distances; } } } else if (pixCoord[1] > bottomRight[1]) { @@ -134,8 +131,7 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar distances = distances / 4.0; - gl_FragColor = )#" + colorVarName + R"#( * distances; - return; + )#" + colorVarName + R"#( = )#" + colorVarName + R"#( * distances; } } } @@ -176,11 +172,13 @@ void main() { return; } + vec4 pixColor = v_color; + vec2 pixCoord = fullSize * v_texcoord; - )#" + ROUNDED_SHADER_FUNC("v_color") + R"#( + )#" + ROUNDED_SHADER_FUNC("pixColor") + R"#( - gl_FragColor = v_color; + gl_FragColor = pixColor; })#"; inline const std::string TEXVERTSRC = R"#( |
