Skip to content

Commit

Permalink
Use texelFetch to get frame color and ignore border
Browse files Browse the repository at this point in the history
Tried to come up with better way to get the color of the frame and if I understood texelFetch correctly it should gather the correct pixel now and even exclude the border in case your windows have some.
  • Loading branch information
pijulius authored Jun 1, 2024
1 parent 4deef66 commit 3fbe856
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/gl/shaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const char blit_shader_glsl[] = GLSL(330,
vec4 default_post_processing(vec4 c) {
float additional_opacity = 1;
if (frame_opacity_fsc && frame_opacity > 0 && frame_opacity < 1) {
vec4 frame_color = texture(tex, vec2(0.01, 0.01));
vec4 frame_color = texelFetch(tex, ivec2(border_width + 1, border_width + 1), 0);
float color_diff = max(max(c.r - frame_color.r, c.g - frame_color.g), c.b - frame_color.b);
if (color_diff < 0)
color_diff *= -1;
Expand Down

0 comments on commit 3fbe856

Please sign in to comment.