2021-04-10 09:14:16 +00:00
|
|
|
#version 330 core
|
|
|
|
|
2023-04-07 06:17:37 +00:00
|
|
|
out vec2 texcoord;
|
|
|
|
out vec4 pos_pos;
|
2021-04-10 09:14:16 +00:00
|
|
|
|
2021-08-22 23:05:41 +00:00
|
|
|
uniform sampler2D color_tex;
|
2021-04-10 09:14:16 +00:00
|
|
|
|
|
|
|
const float FXAA_SUBPIX_SHIFT = 1.0/4.0;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2021-08-31 16:00:36 +00:00
|
|
|
vec2 pos = vec2(gl_VertexID % 2, gl_VertexID / 2) * 4.0 - 1.0;
|
2023-04-07 06:17:37 +00:00
|
|
|
texcoord = pos * 0.5 + 0.5;
|
2021-08-31 16:00:36 +00:00
|
|
|
|
2021-08-22 23:05:41 +00:00
|
|
|
vec2 rcpFrame = 1.0 / textureSize(color_tex, 0);
|
2023-04-07 06:17:37 +00:00
|
|
|
pos_pos.xy = texcoord;
|
|
|
|
pos_pos.zw = texcoord - (rcpFrame * (0.5 + FXAA_SUBPIX_SHIFT));
|
2021-08-31 16:00:36 +00:00
|
|
|
|
|
|
|
gl_Position = vec4(pos, 0.0, 1.0);
|
2021-04-10 09:14:16 +00:00
|
|
|
}
|