mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-24 16:39:13 +01:00
Vulkan: parity with GL (P1–P7), shared GPU culling records (N6c), threaded command recording and render thread (M1, M4)
This commit is contained in:
33
shaders/vk14/postfx_bloom_up.frag
Normal file
33
shaders/vk14/postfx_bloom_up.frag
Normal file
@@ -0,0 +1,33 @@
|
||||
#version 460 core
|
||||
#define STAGE_FRAGMENT 1
|
||||
#define LAYOUT_POST 1
|
||||
#include "common.glsl"
|
||||
// one step up the bloom chain: the level below (half as large, with all the levels under it already added) blurred up with
|
||||
// a 3x3 tent filter and added to this level of the way down
|
||||
|
||||
layout(location = 14) in vec2 f_coords;
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
#pragma texture(lower_tex, 0, RGB)
|
||||
layout(set = POST_SET, binding = POST_TEXTURE_FIRST + 0) uniform sampler2D lower_tex;
|
||||
|
||||
#pragma texture(current_tex, 1, RGB)
|
||||
layout(set = POST_SET, binding = POST_TEXTURE_FIRST + 1) uniform sampler2D current_tex;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 texel = 1.0 / vec2(textureSize(lower_tex, 0));
|
||||
vec2 uv = f_coords;
|
||||
|
||||
vec3 sum = texture(lower_tex, uv).rgb * 4.0;
|
||||
sum += (texture(lower_tex, uv + texel * vec2(0.0, 1.0)).rgb
|
||||
+ texture(lower_tex, uv + texel * vec2(-1.0, 0.0)).rgb
|
||||
+ texture(lower_tex, uv + texel * vec2(1.0, 0.0)).rgb
|
||||
+ texture(lower_tex, uv + texel * vec2(0.0, -1.0)).rgb) * 2.0;
|
||||
sum += texture(lower_tex, uv + texel * vec2(-1.0, 1.0)).rgb
|
||||
+ texture(lower_tex, uv + texel * vec2(1.0, 1.0)).rgb
|
||||
+ texture(lower_tex, uv + texel * vec2(-1.0, -1.0)).rgb
|
||||
+ texture(lower_tex, uv + texel * vec2(1.0, -1.0)).rgb;
|
||||
|
||||
out_color = vec4(texture(current_tex, uv).rgb + sum / 16.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user