summaryrefslogtreecommitdiff
path: root/src/render/shaders
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-30 12:46:17 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-30 12:46:17 +0200
commit48eb2e0d6fd756ec181b722c526f13453fa9c123 (patch)
tree67158a41ff97f28909adaa37e71d34865c817ed4 /src/render/shaders
parent179562b646851c06ee79fa4a5e2e7386885cee0e (diff)
Added window dimming
Diffstat (limited to 'src/render/shaders')
-rw-r--r--src/render/shaders/Textures.hpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp
index 13cdc92a..da02e51f 100644
--- a/src/render/shaders/Textures.hpp
+++ b/src/render/shaders/Textures.hpp
@@ -205,6 +205,9 @@ uniform float radius;
uniform int discardOpaque;
+uniform int applyTint;
+uniform vec3 tint;
+
uniform int primitiveMultisample;
uniform int ignoreCorners;
@@ -217,6 +220,12 @@ void main() {
return;
}
+ if (applyTint == 1) {
+ pixColor[0] = pixColor[0] * tint[0];
+ pixColor[1] = pixColor[1] * tint[1];
+ pixColor[2] = pixColor[2] * tint[2];
+ }
+
vec2 pixCoord = fullSize * v_texcoord;
)#" + ROUNDED_SHADER_FUNC("pixColor") +
@@ -238,6 +247,9 @@ uniform float radius;
uniform int discardOpaque;
+uniform int applyTint;
+uniform vec3 tint;
+
uniform int primitiveMultisample;
uniform int ignoreCorners;
@@ -249,10 +261,17 @@ void main() {
}
vec4 pixColor = vec4(texture2D(tex, v_texcoord).rgb, 1.0);
+
+ if (applyTint == 1) {
+ pixColor[0] = pixColor[0] * tint[0];
+ pixColor[1] = pixColor[1] * tint[1];
+ pixColor[2] = pixColor[2] * tint[2];
+ }
vec2 pixCoord = fullSize * v_texcoord;
- )#" + ROUNDED_SHADER_FUNC("pixColor") + R"#(
+ )#" + ROUNDED_SHADER_FUNC("pixColor") +
+ R"#(
gl_FragColor = pixColor * alpha;
})#";
@@ -319,6 +338,9 @@ uniform float radius;
uniform int discardOpaque;
+uniform int applyTint;
+uniform vec3 tint;
+
uniform int primitiveMultisample;
uniform int ignoreCorners;
@@ -331,9 +353,16 @@ void main() {
return;
}
+ if (applyTint == 1) {
+ pixColor[0] = pixColor[0] * tint[0];
+ pixColor[1] = pixColor[1] * tint[1];
+ pixColor[2] = pixColor[2] * tint[2];
+ }
+
vec2 pixCoord = fullSize * v_texcoord;
- )#" + ROUNDED_SHADER_FUNC("pixColor") + R"#(
+ )#" + ROUNDED_SHADER_FUNC("pixColor") +
+ R"#(
gl_FragColor = pixColor * alpha;
})#";