summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorFelix Dick <felix.dick@web.de>2022-10-01 02:45:36 +0200
committerFelix Dick <felix.dick@web.de>2022-10-01 03:14:13 +0200
commit6fe103cf06e99e4cd8c03e616b5a939067e7e165 (patch)
tree74803b9e64ab64b40249628c79c7b4f9fe1e40da /src/render
parent71733f68eff805f78a73ada389064d23f1bb0d79 (diff)
Cut the number of pixels that call length() in half.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/shaders/Textures.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp
index 1e8281d0..de5f0358 100644
--- a/src/render/shaders/Textures.hpp
+++ b/src/render/shaders/Textures.hpp
@@ -7,11 +7,11 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar
// branchless baby!
highp vec2 pixCoord = vec2(gl_FragCoord);
- pixCoord -= topLeft + fullSize / vec2(2.0);
- pixCoord *= vec2(lessThan(pixCoord, vec2(0.0))) * vec2(-2.0) + vec2(1.0);
- pixCoord -= fullSize * vec2(0.5) - vec2(radius);
+ pixCoord -= topLeft + fullSize * 0.5;
+ pixCoord *= vec2(lessThan(pixCoord, vec2(0.0))) * -2.0 + 1.0;
+ pixCoord -= fullSize * 0.5 - radius;
- if (all(greaterThan(pixCoord, vec2(0.0)))) {
+ if (pixCoord.x + pixCoord.y > radius) {
if (ignoreCorners == 1)
discard;