From 0920572e703201368c9fbcc9108ce1888600ffa2 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 5 Nov 2024 16:11:05 +0000 Subject: shaders: improve corner AA in borders shader --- src/render/shaders/Textures.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/render/shaders/Textures.hpp') diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp index e99d0a49..b203ad04 100644 --- a/src/render/shaders/Textures.hpp +++ b/src/render/shaders/Textures.hpp @@ -1,6 +1,8 @@ #pragma once #include +#include +#include "SharedValues.hpp" inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVarName) -> std::string { return R"#( @@ -13,7 +15,9 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar pixCoord -= fullSize * 0.5 - radius; pixCoord += vec2(1.0, 1.0) / fullSize; // center the pix dont make it top-left - const float SMOOTHING_CONSTANT = 0.651724; // smoothing constant for the edge: more = blurrier, but smoother + // smoothing constant for the edge: more = blurrier, but smoother + const float SMOOTHING_CONSTANT = )#" + + std::format("{:.7f}", SHADER_ROUNDED_SMOOTHING_FACTOR) + R"#(; if (pixCoord.x + pixCoord.y > radius) { -- cgit v1.2.3