add threshold parameter to kawase blur for use in blooms

This commit is contained in:
hunterk 2019-01-11 14:26:38 -06:00
parent 12b0d8eb8f
commit 502d05e1f4

View file

@ -10,8 +10,11 @@ layout(push_constant) uniform Push
vec4 OriginalSize;
vec4 OutputSize;
uint FrameCount;
float bloom_threshold;
} params;
#pragma parameter bloom_threshold "Glow Threshold" 0.0 0.0 1.0 0.05
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
@ -47,7 +50,9 @@ vec4 reSample(float d, vec2 uv, sampler2D decal)
return color;
}
#include "../../misc/colorspace-tools.h"
void main()
{
FragColor = reSample(0., vTexCoord, Source);
FragColor = vec4(YIQtoRGB(RGBtoYIQ(reSample(0., vTexCoord, Source).rgb) - vec3(params.bloom_threshold, 0.,0.)), 1.0);
}