@@ -12,7 +12,7 @@ layout(set = 0, binding = 1) uniform texture2D inputTexture;
1212
1313layout (set = 1 , binding = 0 ) uniform sampler inputSampler;
1414
15- layout (location = 0 ) in vec2 texCoordsOut ;
15+ layout (location = 0 ) in vec2 texCoords ;
1616
1717layout (location = 0 ) out vec4 frag;
1818
@@ -27,11 +27,11 @@ void main()
2727
2828 // compute luminosity values
2929 vec3 lum = vec3 (0.299 , 0.587 , 0.114 );
30- float lumTL = dot (lum, texture(sampler2D (inputTexture, inputSampler), vec2 (- 1.0 , - 1.0 ) * texelSize + texCoordsOut .xy).xyz);
31- float lumTR = dot (lum, texture(sampler2D (inputTexture, inputSampler), vec2 (+ 1.0 , - 1.0 ) * texelSize + texCoordsOut .xy).xyz);
32- float lumBL = dot (lum, texture(sampler2D (inputTexture, inputSampler), vec2 (- 1.0 , + 1.0 ) * texelSize + texCoordsOut .xy).xyz);
33- float lumBR = dot (lum, texture(sampler2D (inputTexture, inputSampler), vec2 (+ 1.0 , + 1.0 ) * texelSize + texCoordsOut .xy).xyz);
34- float lumCC = dot (lum, texture(sampler2D (inputTexture, inputSampler), texCoordsOut .xy).xyz);
30+ float lumTL = dot (lum, texture(sampler2D (inputTexture, inputSampler), vec2 (- 1.0 , - 1.0 ) * texelSize + texCoords .xy).xyz);
31+ float lumTR = dot (lum, texture(sampler2D (inputTexture, inputSampler), vec2 (+ 1.0 , - 1.0 ) * texelSize + texCoords .xy).xyz);
32+ float lumBL = dot (lum, texture(sampler2D (inputTexture, inputSampler), vec2 (- 1.0 , + 1.0 ) * texelSize + texCoords .xy).xyz);
33+ float lumBR = dot (lum, texture(sampler2D (inputTexture, inputSampler), vec2 (+ 1.0 , + 1.0 ) * texelSize + texCoords .xy).xyz);
34+ float lumCC = dot (lum, texture(sampler2D (inputTexture, inputSampler), texCoords .xy).xyz);
3535
3636 // compute blur direction
3737 vec2 dir;
@@ -43,13 +43,13 @@ void main()
4343
4444 // sample the texture in two locations along the computed direction to create an initial blurred color
4545 vec3 result1 = 0.5 * (
46- texture(sampler2D (inputTexture, inputSampler), dir * vec2 (1.0 / 3.0 - 0.5 ) + texCoordsOut .xy).xyz +
47- texture(sampler2D (inputTexture, inputSampler), dir * vec2 (2.0 / 3.0 - 0.5 ) + texCoordsOut .xy).xyz);
46+ texture(sampler2D (inputTexture, inputSampler), dir * vec2 (1.0 / 3.0 - 0.5 ) + texCoords .xy).xyz +
47+ texture(sampler2D (inputTexture, inputSampler), dir * vec2 (2.0 / 3.0 - 0.5 ) + texCoords .xy).xyz);
4848
4949 // sample the texture at additional points and blend them with the initial blur to refine the result
5050 vec3 result2 = result1 * 0.5 + 0.25 * (
51- texture(sampler2D (inputTexture, inputSampler), dir * vec2 (0.0 / 3.0 - 0.5 ) + texCoordsOut .xy).xyz +
52- texture(sampler2D (inputTexture, inputSampler), dir * vec2 (3.0 / 3.0 - 0.5 ) + texCoordsOut .xy).xyz);
51+ texture(sampler2D (inputTexture, inputSampler), dir * vec2 (0.0 / 3.0 - 0.5 ) + texCoords .xy).xyz +
52+ texture(sampler2D (inputTexture, inputSampler), dir * vec2 (3.0 / 3.0 - 0.5 ) + texCoords .xy).xyz);
5353
5454 // compute the minimum and maximum luminosity of the surrounding texels to use for edge detection
5555 float lumMin = min (lumCC, min (min (lumTL, lumTR), min (lumBL, lumBR)));
0 commit comments