31 lines
667 B
GLSL
31 lines
667 B
GLSL
#version 430 core
|
|
in vec2 vTexPos;
|
|
out vec4 fColor;
|
|
|
|
uniform vec2 winSize;
|
|
uniform sampler2D screenTexture;
|
|
|
|
const float horOff = 1.0 / winSize.x;
|
|
//const float verOff = 1.0 / 600.0;
|
|
|
|
//const float kernel[9] = float[](
|
|
// 0.025,0.05,0.1, 0.2, 0.25, 0.2,0.1, 0.05, 0.025
|
|
// 0.1,0.1,0.1,0.1,0.2,0.1,0.1,0.1,0.1
|
|
// );
|
|
const float kernel[3] = float[](
|
|
0.25,0.5, 0.25
|
|
);
|
|
|
|
void main()
|
|
{
|
|
vec4 sampleTex[3];
|
|
for(int i=0; i<3; i++)
|
|
{
|
|
sampleTex[i] = vec4(texture(screenTexture, vTexPos + vec2((i-1)*horOff,0)));
|
|
}
|
|
vec4 col = vec4(0,0,0,0);
|
|
for (int i = 0; i < 3; i++)
|
|
col += sampleTex[i] * kernel[i];
|
|
fColor = col;
|
|
}
|