summaryrefslogtreecommitdiff
path: root/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/effects/upscale.glsl
diff options
context:
space:
mode:
authorNippy <nippy@Nippy-Mac-mini.local>2026-10-09 17:23:53 +0200
committerNippy <nippy@Nippy-Mac-mini.local>2026-10-09 17:23:53 +0200
commit9d5be1660d8f74038ebed3d74fdbc809e43787ae (patch)
tree4cb46c3765be87ca4c5219f2f714425d7dfddb56 /raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/effects/upscale.glsl
parentdeb4b8a9c407832c35100a643bd7a592589c9679 (diff)
downloadRaveOS-PKGBUILD-9d5be1660d8f74038ebed3d74fdbc809e43787ae.tar.gz
RaveOS-PKGBUILD-9d5be1660d8f74038ebed3d74fdbc809e43787ae.zip
gnome fix
Diffstat (limited to 'raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/effects/upscale.glsl')
-rw-r--r--raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/effects/upscale.glsl26
1 files changed, 15 insertions, 11 deletions
diff --git a/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/effects/upscale.glsl b/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/effects/upscale.glsl
index 5cc06ec..3d743df 100644
--- a/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/effects/upscale.glsl
+++ b/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/effects/upscale.glsl
@@ -2,13 +2,14 @@ uniform sampler2D tex;
uniform int factor;
uniform float width;
uniform float height;
+uniform float opacity_factor;
#define CORRECTION 2.25
-#define SIZE_ADDITION 3
+#define SIZE_ADDITION 3.0
vec4 get_texture_at_position(vec2 position) {
vec2 raw_position = position + vec2(CORRECTION, CORRECTION);
- vec2 raw_uv = raw_position / vec2(width + SIZE_ADDITION, height + SIZE_ADDITION);
+ vec2 raw_uv = raw_position / vec2(max(1.0, width + SIZE_ADDITION), max(1.0, height + SIZE_ADDITION));
return texture2D(tex, raw_uv);
}
@@ -20,38 +21,41 @@ ivec2 get_corrected_position() {
}
void main() {
+ vec4 source_color = texture2D(tex, cogl_tex_coord0_in.st);
ivec2 corrected_position = get_corrected_position();
+ int safe_factor = max(1, factor);
- vec2 adjusted_position = corrected_position / factor;
+ vec2 adjusted_position = vec2(corrected_position / safe_factor);
- cogl_color_out = get_texture_at_position(adjusted_position);
+ vec4 effect_color = get_texture_at_position(adjusted_position);
+ cogl_color_out = mix(source_color, effect_color, opacity_factor);
// round
- if (distance(corrected_position, (floor(adjusted_position) + 0.5) * factor) < factor / 2.5) {
+ if (distance(vec2(corrected_position), (floor(adjusted_position) + 0.5) * float(safe_factor)) < float(safe_factor) / 2.5) {
//cogl_color_out = get_texture_at_position(adjusted_position);
} else {
//cogl_color_out = vec4(0, 0, 0, 1);
}
// square
- if (mod(corrected_position.x, factor) >= 2 && mod(corrected_position.y, factor) >= 2) {
+ if (mod(float(corrected_position.x), float(safe_factor)) >= 2.0 && mod(float(corrected_position.y), float(safe_factor)) >= 2.0) {
//cogl_color_out = get_texture_at_position(adjusted_position);
} else {
//cogl_color_out = vec4(0, 0, 0, 1);
}
// local mix
- vec4 color = vec4(0);
+ vec4 color = vec4(0.0);
int count = 0;
for (int i = -1; i <= 1; i++) {
for (int j = -1; j <= 1; j++) {
- vec2 lookup_position = adjusted_position + vec2(i, j);
- if (all(greaterThanEqual(lookup_position, vec2(0, 0))) &&
- all(lessThan(lookup_position, vec2(width, height) / factor))) {
+ vec2 lookup_position = adjusted_position + vec2(float(i), float(j));
+ if (all(greaterThanEqual(lookup_position, vec2(0.0, 0.0))) &&
+ all(lessThan(lookup_position, vec2(width, height) / float(safe_factor)))) {
color += get_texture_at_position(lookup_position);
count += 1;
}
}
}
//cogl_color_out = color / count;
-} \ No newline at end of file
+}