summaryrefslogtreecommitdiff
path: root/src/render/shaders
diff options
context:
space:
mode:
authorFelix Dick <felix.dick@web.de>2022-09-29 21:10:05 +0200
committerFelix Dick <felix.dick@web.de>2022-09-29 21:10:05 +0200
commitb38e7b596f03dc6f7f6adec36df5bea2325642b5 (patch)
tree7c07b6e06d19aba1679c8cd3ac08bcd71bb400b2 /src/render/shaders
parent1424539e4d0a9bdd39f77a963e3589d69a74c446 (diff)
Don't pass bottomRight to textureShaders compute it within.
Diffstat (limited to 'src/render/shaders')
-rw-r--r--src/render/shaders/Textures.hpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp
index a541ec0a..42bd0856 100644
--- a/src/render/shaders/Textures.hpp
+++ b/src/render/shaders/Textures.hpp
@@ -6,6 +6,7 @@ inline static constexpr auto ROUNDED_SHADER_FUNC = [](const std::string colorVar
return R"#(
// branchless baby!
+ vec2 bottomRight = fullSize - radius;
vec2 pixCoord = v_texcoord - vec2(0.5);
pixCoord *= (vec2(lessThan(pixCoord, vec2(0.0))) * vec2(-2.0) + vec2(1.0)) * fullSize;
pixCoord -= (bottomRight - topLeft) * vec2(0.5);
@@ -59,7 +60,6 @@ varying vec4 v_color;
varying vec2 v_texcoord;
uniform vec2 topLeft;
-uniform vec2 bottomRight;
uniform vec2 fullSize;
uniform float radius;
@@ -88,7 +88,6 @@ void main() {
v_texcoord = texcoord;
})#";
-// this is texture rendering!!
inline const std::string TEXFRAGSRCRGBA = R"#(
precision mediump float;
varying vec2 v_texcoord; // is in 0-1
@@ -96,7 +95,6 @@ uniform sampler2D tex;
uniform float alpha;
uniform vec2 topLeft;
-uniform vec2 bottomRight;
uniform vec2 fullSize;
uniform float radius;
@@ -134,7 +132,6 @@ uniform sampler2D tex;
uniform float alpha;
uniform vec2 topLeft;
-uniform vec2 bottomRight;
uniform vec2 fullSize;
uniform float radius;
@@ -221,7 +218,6 @@ uniform samplerExternalOES texture0;
uniform float alpha;
uniform vec2 topLeft;
-uniform vec2 bottomRight;
uniform vec2 fullSize;
uniform float radius;