LumixEngine/data/pipelines/ssao_blit.shd

22 lines
505 B
Text
Raw Normal View History

2019-09-26 22:48:35 +02:00
include "pipelines/common.glsl"
2021-02-22 21:19:03 +01:00
compute_shader [[
layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
2019-09-26 22:48:35 +02:00
layout (binding=0) uniform sampler2D u_ssao_buf;
2021-02-22 21:19:03 +01:00
layout (binding=1, rgba8) uniform image2D u_gbuffer2;
layout(std140, binding = 4) uniform Data {
vec4 u_size;
};
2019-09-26 22:48:35 +02:00
void main()
{
2021-02-22 21:19:03 +01:00
ivec2 ij = ivec2(gl_GlobalInvocationID.xy);
float ssao = texture(u_ssao_buf, vec2(ij) / u_size.xy).x;
vec4 v = imageLoad(u_gbuffer2, ij);
v.z *= ssao;
imageStore(u_gbuffer2, ij, v);
2019-09-26 22:48:35 +02:00
}
]]