mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 20:14:59 +01:00
Vulkan: scene rendering (D1–D7) on a scene walk shared with GL (N6a, N6b)
This commit is contained in:
18
shaders/vk14/postfx_ssao_blur.frag
Normal file
18
shaders/vk14/postfx_ssao_blur.frag
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 460 core
|
||||
#define STAGE_FRAGMENT 1
|
||||
#define LAYOUT_POST 1
|
||||
#include "common.glsl"
|
||||
layout(location = 14) in vec2 f_coords;
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
#pragma texture(ssao_tex, 0, R)
|
||||
layout(set = POST_SET, binding = POST_TEXTURE_FIRST + 0) uniform sampler2D ssao_tex;
|
||||
|
||||
void main() {
|
||||
vec2 texel = 1.0 / vec2(textureSize(ssao_tex, 0));
|
||||
float sum = 0.0;
|
||||
for (int x = -2; x < 2; ++x)
|
||||
for (int y = -2; y < 2; ++y)
|
||||
sum += texture(ssao_tex, f_coords + vec2(x, y) * texel).r;
|
||||
out_color = vec4(sum / 16.0);
|
||||
}
|
||||
Reference in New Issue
Block a user