Files
armorpaint/base/shaders/smaa_blend_weight.vert.glsl
T

30 lines
692 B
GLSL
Raw Normal View History

2023-02-08 14:40:15 +01:00
#version 450
2024-08-15 20:29:14 +02:00
uniform vec2 screen_size;
uniform vec2 screen_size_inv;
2023-02-08 14:40:15 +01:00
2023-02-15 17:16:58 +01:00
in vec2 pos;
2024-08-15 20:29:14 +02:00
out vec2 tex_coord;
2023-02-08 14:40:15 +01:00
out vec2 pixcoord;
out vec4 offset0;
out vec4 offset1;
out vec4 offset2;
const int SMAA_MAX_SEARCH_STEPS = 16;
void main() {
const vec2 madd = vec2(0.5, 0.5);
2024-08-15 20:29:14 +02:00
tex_coord = pos.xy * madd + madd;
2023-02-08 14:40:15 +01:00
2024-08-15 20:29:14 +02:00
pixcoord = tex_coord * screen_size;
2023-02-08 14:40:15 +01:00
2024-08-15 20:29:14 +02:00
offset0 = screen_size_inv.xyxy * vec4(-0.25, -0.125, 1.25, -0.125) + tex_coord.xyxy;
offset1 = screen_size_inv.xyxy * vec4(-0.125, -0.25, -0.125, 1.25) + tex_coord.xyxy;
2023-02-08 14:40:15 +01:00
2024-08-15 20:29:14 +02:00
offset2 = screen_size_inv.xxyy *
2023-02-08 14:40:15 +01:00
(vec4(-2.0, 2.0, -2.0, 2.0) * float(SMAA_MAX_SEARCH_STEPS)) +
vec4(offset0.xz, offset1.yw);
gl_Position = vec4(pos.xy, 0.0, 1.0);
}