mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-26 01:11:32 +11:00
Add border_texture_scale for border shaders
This commit is contained in:
parent
013ff5aace
commit
1460ef4f01
|
@ -10,7 +10,8 @@ shader1 = "shader-files/border-auto-scale.slang"
|
||||||
filter_linear1 = "true"
|
filter_linear1 = "true"
|
||||||
wrap_mode1 = "clamp_to_border"
|
wrap_mode1 = "clamp_to_border"
|
||||||
|
|
||||||
parameters = "GRID_STRENGTH"
|
parameters = "border_texture_scale;GRID_STRENGTH"
|
||||||
|
border_texture_scale = 2.5
|
||||||
GRID_STRENGTH = 0.15
|
GRID_STRENGTH = 0.15
|
||||||
|
|
||||||
textures = "BORDER"
|
textures = "BORDER"
|
||||||
|
|
|
@ -5,11 +5,14 @@ layout(push_constant) uniform Push
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
|
float border_texture_scale;
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
|
#pragma parameter border_texture_scale "Border Scale" 4.0 1.0 20.0 0.005
|
||||||
|
|
||||||
vec2 middle = vec2(0.5, 0.5);
|
vec2 middle = vec2(0.5, 0.5);
|
||||||
vec2 screen_scale = params.OutputSize.xy * params.SourceSize.zw;
|
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
|
layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,13 +6,15 @@ layout(push_constant) uniform Push
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
float video_scale;
|
float video_scale;
|
||||||
|
float border_texture_scale;
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
#pragma parameter video_scale "Video Scale" 3.0 2.0 20.0 1.0
|
#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 middle = vec2(0.5, 0.5);
|
||||||
vec2 screen_scale = params.OutputSize.xy * params.SourceSize.zw;
|
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
|
layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue