2022-02-05 19:25:44 +08:00
|
|
|
#version 330
|
|
|
|
|
2022-02-16 20:33:16 +08:00
|
|
|
uniform sampler2D tex;
|
2022-02-05 19:25:44 +08:00
|
|
|
uniform vec2 screenSize;
|
|
|
|
|
|
|
|
|
|
|
|
in vec2 fragPosScreen;
|
2022-02-16 20:33:16 +08:00
|
|
|
layout (location = 0) out float outputColor;
|
2022-02-05 19:25:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
void main() {
|
2022-02-16 20:33:16 +08:00
|
|
|
outputColor = 0;
|
2022-02-05 19:25:44 +08:00
|
|
|
|
|
|
|
for (int i = -3; i <= 3; i++)
|
|
|
|
for (int j = -3; j <= 3; j++)
|
2022-02-16 20:33:16 +08:00
|
|
|
outputColor += texture(tex, fragPosScreen + vec2(i, j) / screenSize).r;
|
2022-02-05 19:25:44 +08:00
|
|
|
|
2022-02-16 20:33:16 +08:00
|
|
|
outputColor /= 49.0;
|
|
|
|
outputColor *= outputColor;
|
2022-02-05 19:25:44 +08:00
|
|
|
}
|
|
|
|
|