qskinny/playground/parrots/shaders/blur-vulkan.frag

26 lines
609 B
GLSL
Raw Normal View History

2023-12-04 11:48:11 +00:00
#version 440
2023-12-07 10:24:47 +00:00
layout( location = 0 ) in vec2 coord;
layout( location = 0 ) out vec4 fragColor;
2023-12-04 11:48:11 +00:00
2023-12-07 10:24:47 +00:00
layout( binding = 1 ) uniform sampler2D source;
2023-12-04 11:48:11 +00:00
2023-12-07 10:24:47 +00:00
layout( std140, binding = 0 ) uniform buf
2023-12-04 11:48:11 +00:00
{
2023-12-07 10:24:47 +00:00
mat4 matrix;
float opacity;
2023-12-04 11:48:11 +00:00
} ubuf;
void main()
{
2023-12-07 10:24:47 +00:00
vec2 delta = vec2( 0.01, 0.01 );
2023-12-04 11:48:11 +00:00
2023-12-07 10:24:47 +00:00
fragColor =(
0.0538 * texture( source, coord - 3.182 * delta )
+ 0.3229 * texture( source, coord - 1.364 * delta )
+ 0.2466 * texture( source, coord )
+ 0.3229 * texture( source, coord + 1.364 * delta )
+ 0.0538 * texture( source, coord + 3.182 * delta )
) * ubuf.opacity;
2023-12-04 11:48:11 +00:00
}