add wrap mode to kawase presets to fix dark border from sampling outside of image

This commit is contained in:
hunterk 2018-08-18 13:52:21 -05:00
parent 19b1796bdb
commit d96eccaf2f
5 changed files with 45 additions and 17 deletions

View file

@ -28,10 +28,10 @@ void main()
layout(location = 0) in vec2 vTexCoord; layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor; layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D Source; layout(set = 0, binding = 2) uniform sampler2D Source;
layout(set = 0, binding = 3) uniform sampler2D Original; layout(set = 0, binding = 3) uniform sampler2D Reference;
void main() void main()
{ {
FragColor = 1.0 - (1.0 - texture(Source, vTexCoord)) * (1.0 - texture(Original, vTexCoord)); FragColor = 1.0 - (1.0 - texture(Source, vTexCoord)) * (1.0 - texture(Reference, vTexCoord));
FragColor = pow(FragColor, vec4(2.2)); FragColor = pow(FragColor, vec4(2.2));
} }

View file

@ -8,26 +8,31 @@ shader1 = kawase/kawase0.slang
filter_linear1 = true filter_linear1 = true
srgb_framebuffer1 = true srgb_framebuffer1 = true
scale_type1 = source scale_type1 = source
wrap_mode1 = mirrored_repeat
shader2 = kawase/kawase1.slang shader2 = kawase/kawase1.slang
filter_linear2 = true filter_linear2 = true
srgb_framebuffer2 = true srgb_framebuffer2 = true
scale_type2 = source scale_type2 = source
wrap_mode2 = mirrored_repeat
shader3 = kawase/kawase1.slang shader3 = kawase/kawase1.slang
filter_linear3 = true filter_linear3 = true
srgb_framebuffer3 = true srgb_framebuffer3 = true
scale_type3 = source scale_type3 = source
wrap_mode3 = mirrored_repeat
shader4 = kawase/kawase2.slang shader4 = kawase/kawase2.slang
filter_linear4 = true filter_linear4 = true
srgb_framebuffer4 = true srgb_framebuffer4 = true
scale_type4 = source scale_type4 = source
wrap_mode4 = mirrored_repeat
shader5 = kawase/kawase3.slang shader5 = kawase/kawase3.slang
filter_linear5 = true filter_linear5 = true
srgb_framebuffer5 = true srgb_framebuffer5 = true
scale_type5 = source scale_type5 = source
wrap_mode5 = mirrored_repeat
shader6 = kawase/delinearize.slang shader6 = kawase/delinearize.slang
filter_linear6 = true filter_linear6 = true

View file

@ -8,46 +8,55 @@ shader1 = kawase/kawase0.slang
filter_linear1 = true filter_linear1 = true
srgb_framebuffer1 = true srgb_framebuffer1 = true
scale_type1 = source scale_type1 = source
wrap_mode1 = mirrored_repeat
shader2 = kawase/kawase1.slang shader2 = kawase/kawase1.slang
filter_linear2 = true filter_linear2 = true
srgb_framebuffer2 = true srgb_framebuffer2 = true
scale_type2 = source scale_type2 = source
wrap_mode2 = mirrored_repeat
shader3 = kawase/kawase2.slang shader3 = kawase/kawase2.slang
filter_linear3 = true filter_linear3 = true
srgb_framebuffer3 = true srgb_framebuffer3 = true
scale_type3 = source scale_type3 = source
wrap_mode3 = mirrored_repeat
shader4 = kawase/kawase3.slang shader4 = kawase/kawase3.slang
filter_linear4 = true filter_linear4 = true
srgb_framebuffer4 = true srgb_framebuffer4 = true
scale_type4 = source scale_type4 = source
wrap_mode4 = mirrored_repeat
shader5 = kawase/kawase4.slang shader5 = kawase/kawase4.slang
filter_linear5 = true filter_linear5 = true
srgb_framebuffer5 = true srgb_framebuffer5 = true
scale_type5 = source scale_type5 = source
wrap_mode5 = mirrored_repeat
shader6 = kawase/kawase4.slang shader6 = kawase/kawase4.slang
filter_linear6 = true filter_linear6 = true
srgb_framebuffer6 = true srgb_framebuffer6 = true
scale_type6 = source scale_type6 = source
wrap_mode6 = mirrored_repeat
shader7 = kawase/kawase5.slang shader7 = kawase/kawase5.slang
filter_linear7 = true filter_linear7 = true
srgb_framebuffer7 = true srgb_framebuffer7 = true
scale_type7 = source scale_type7 = source
wrap_mode7 = mirrored_repeat
shader8 = kawase/kawase6.slang shader8 = kawase/kawase6.slang
filter_linear8 = true filter_linear8 = true
srgb_framebuffer8 = true srgb_framebuffer8 = true
scale_type8 = source scale_type8 = source
wrap_mode8 = mirrored_repeat
shader9 = kawase/kawase7.slang shader9 = kawase/kawase7.slang
filter_linear9 = true filter_linear9 = true
srgb_framebuffer9 = true srgb_framebuffer9 = true
scale_type9 = source scale_type9 = source
wrap_mode9 = mirrored_repeat
shader10 = kawase/delinearize.slang shader10 = kawase/delinearize.slang
filter_linear10 = true filter_linear10 = true

View file

@ -1,35 +1,44 @@
shaders = 8 shaders = 9
shader0 = kawase/linearize.slang shader0 = ../stock.slang
srgb_framebuffer0 = true
scale_type0 = source scale_type0 = source
alias0 = Reference
shader1 = kawase/kawase0.slang shader1 = kawase/linearize.slang
filter_linear1 = true
srgb_framebuffer1 = true srgb_framebuffer1 = true
scale_type1 = source scale_type1 = source
shader2 = kawase/kawase1.slang shader2 = kawase/kawase0.slang
filter_linear2 = true filter_linear2 = true
srgb_framebuffer2 = true srgb_framebuffer2 = true
scale_type2 = source scale_type2 = source
wrap_mode2 = mirrored_repeat
shader3 = kawase/kawase1.slang shader3 = kawase/kawase1.slang
filter_linear3 = true filter_linear3 = true
srgb_framebuffer3 = true srgb_framebuffer3 = true
scale_type3 = source scale_type3 = source
wrap_mode3 = mirrored_repeat
shader4 = kawase/kawase2.slang shader4 = kawase/kawase1.slang
filter_linear4 = true filter_linear4 = true
srgb_framebuffer4 = true srgb_framebuffer4 = true
scale_type4 = source scale_type4 = source
wrap_mode4 = mirrored_repeat
shader5 = kawase/kawase3.slang shader5 = kawase/kawase2.slang
filter_linear5 = true filter_linear5 = true
srgb_framebuffer5 = true srgb_framebuffer5 = true
scale_type5 = source scale_type5 = source
wrap_mode5 = mirrored_repeat
shader7 = kawase/screen_combine.slang shader6 = kawase/kawase3.slang
shader6 = kawase/delinearize.slang
filter_linear6 = true filter_linear6 = true
srgb_framebuffer6 = true
scale_type6 = source
wrap_mode6 = mirrored_repeat
shader7 = kawase/delinearize.slang
filter_linear7 = true
shader8 = kawase/screen_combine.slang

View file

@ -11,26 +11,31 @@ shader2 = ../blurs/kawase/kawase0.slang
filter_linear2 = true filter_linear2 = true
srgb_framebuffer2 = true srgb_framebuffer2 = true
scale_type2 = source scale_type2 = source
wrap_mode2 = mirrored_repeat
shader3 = ../blurs/kawase/kawase1.slang shader3 = ../blurs/kawase/kawase1.slang
filter_linear3 = true filter_linear3 = true
srgb_framebuffer3 = true srgb_framebuffer3 = true
scale_type3 = source scale_type3 = source
wrap_mode3 = mirrored_repeat
shader4 = ../blurs/kawase/kawase1.slang shader4 = ../blurs/kawase/kawase1.slang
filter_linear4 = true filter_linear4 = true
srgb_framebuffer4 = true srgb_framebuffer4 = true
scale_type4 = source scale_type4 = source
wrap_mode4 = mirrored_repeat
shader5 = ../blurs/kawase/kawase2.slang shader5 = ../blurs/kawase/kawase2.slang
filter_linear5 = true filter_linear5 = true
srgb_framebuffer5 = true srgb_framebuffer5 = true
scale_type5 = source scale_type5 = source
wrap_mode5 = mirrored_repeat
shader6 = ../blurs/kawase/kawase3.slang shader6 = ../blurs/kawase/kawase3.slang
filter_linear6 = true filter_linear6 = true
srgb_framebuffer6 = true srgb_framebuffer6 = true
scale_type6 = source scale_type6 = source
wrap_mode6 = mirrored_repeat
shader7 = ../blurs/kawase/delinearize.slang shader7 = ../blurs/kawase/delinearize.slang
filter_linear7 = true filter_linear7 = true