Add border_texture_scale for border shaders

This commit is contained in:
nfp0 2022-05-08 00:30:43 +01:00
parent 013ff5aace
commit 1460ef4f01
3 changed files with 9 additions and 3 deletions

View file

@ -10,7 +10,8 @@ shader1 = "shader-files/border-auto-scale.slang"
filter_linear1 = "true"
wrap_mode1 = "clamp_to_border"
parameters = "GRID_STRENGTH"
parameters = "border_texture_scale;GRID_STRENGTH"
border_texture_scale = 2.5
GRID_STRENGTH = 0.15
textures = "BORDER"

View file

@ -5,11 +5,14 @@ layout(push_constant) uniform Push
vec4 OutputSize;
vec4 SourceSize;
vec4 OriginalSize;
float border_texture_scale;
} params;
#pragma parameter border_texture_scale "Border Scale" 4.0 1.0 20.0 0.005
vec2 middle = vec2(0.5, 0.5);
vec2 screen_scale = params.OutputSize.xy * params.SourceSize.zw;
vec2 border_scale = vec2(800, 400) * (params.SourceSize.y / params.OriginalSize.y);
vec2 border_scale = vec2(3200, 1600) * (params.SourceSize.y / params.OriginalSize.y) / params.border_texture_scale;
layout(std140, set = 0, binding = 0) uniform UBO
{

View file

@ -6,13 +6,15 @@ layout(push_constant) uniform Push
vec4 SourceSize;
vec4 OriginalSize;
float video_scale;
float border_texture_scale;
} params;
#pragma parameter video_scale "Video Scale" 3.0 2.0 20.0 1.0
#pragma parameter border_texture_scale "Border Scale" 4.0 1.0 20.0 0.005
vec2 middle = vec2(0.5, 0.5);
vec2 screen_scale = params.OutputSize.xy * params.SourceSize.zw;
vec2 border_scale = vec2(800, 400) * params.video_scale;
vec2 border_scale = vec2(3200, 1600) * params.video_scale / params.border_texture_scale;
layout(std140, set = 0, binding = 0) uniform UBO
{