dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
files/hyprland/shaders/monochrome.frag (567B)
1// Monochrome filter
2
3#version 300 es
4precision mediump float;
5
6in vec2 v_texcoord;
7uniform sampler2D tex;
8
9out vec4 fragColor;
10
11void main()
12{
13 vec4 pixColor = texture(tex, v_texcoord);
14
15 // Check https://en.wikipedia.org/wiki/Grayscale#Luma_coding_in_video_systems for which one to choose
16 float lum = dot(pixColor.rgb, vec3(0.299, 0.587, 0.114)); // BT.601
17 // float lum = dot(pixColor.rgb, vec3(0.2126, 0.7152, 0.0722)); // BT.709
18 // float lum = dot(pixColor.rgb, vec3(0.2627, 0.6780, 0.0593)); // BT.2100
19
20 fragColor = vec4(vec3(lum), pixColor.a);
21}