From 502d05e1f4ca15c537d017265435dcb9fda5b075 Mon Sep 17 00:00:00 2001 From: hunterk Date: Fri, 11 Jan 2019 14:26:38 -0600 Subject: [PATCH] add threshold parameter to kawase blur for use in blooms --- blurs/kawase/kawase0.slang | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blurs/kawase/kawase0.slang b/blurs/kawase/kawase0.slang index 4ffb8c7..b21785b 100644 --- a/blurs/kawase/kawase0.slang +++ b/blurs/kawase/kawase0.slang @@ -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); } \ No newline at end of file