2023-09-15 03:37:07 -05:00
|
|
|
@vs vs
|
|
|
|
in vec2 aPos;
|
|
|
|
in vec2 aTexCoords;
|
|
|
|
|
|
|
|
out vec2 TexCoords;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0);
|
|
|
|
TexCoords = aTexCoords;
|
|
|
|
}
|
|
|
|
@end
|
2023-05-12 13:22:05 -05:00
|
|
|
|
2023-09-15 03:37:07 -05:00
|
|
|
@fs fs
|
|
|
|
in vec2 TexCoords;
|
2023-05-12 13:22:05 -05:00
|
|
|
out vec4 frag_color;
|
|
|
|
|
2023-09-15 03:37:07 -05:00
|
|
|
uniform texture2D diffuse;
|
|
|
|
uniform sampler smp;
|
2023-05-12 13:22:05 -05:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2023-09-15 03:37:07 -05:00
|
|
|
frag_color = texture(sampler2D(diffuse,smp), TexCoords);
|
2023-05-30 15:41:02 -05:00
|
|
|
return;
|
2023-09-15 03:37:07 -05:00
|
|
|
/* vec2 screensize = textureSize(diffuse,0);
|
2023-05-24 20:45:50 -05:00
|
|
|
|
2023-09-15 03:37:07 -05:00
|
|
|
vec4 color = texture(sampler2D(diffuse,smp), TexCoords);
|
2023-05-24 20:45:50 -05:00
|
|
|
float avg = 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b;
|
|
|
|
frag_color = vec4(avg,avg,avg,1.0);
|
|
|
|
float lc = screensize.y/2.0;
|
2023-05-12 13:22:05 -05:00
|
|
|
float line = TexCoords.y * lc;
|
|
|
|
float line_intensity = mod(float(line),2);
|
|
|
|
|
|
|
|
float off = line_intensity * 0.0005;
|
|
|
|
vec4 shift = vec4(off,0,0,0);
|
|
|
|
vec4 color_shift = vec4(0.001,0,0,0);
|
|
|
|
float r = color.r + color_shift.r + shift.r;
|
|
|
|
float g = color.g - color_shift.g + shift.g;
|
|
|
|
float b = color.b;
|
|
|
|
|
|
|
|
frag_color = vec4(r, g*0.99, b, 1.0) * clamp(line_intensity, 0.85, 1.0);
|
2023-09-15 03:37:07 -05:00
|
|
|
*/
|
2023-05-12 13:22:05 -05:00
|
|
|
}
|
2023-09-15 03:37:07 -05:00
|
|
|
@end
|
|
|
|
|
|
|
|
@program crt vs fs
|