mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2025-02-17 07:27:43 +11:00
move geom interlacing detection toggle to param
This commit is contained in:
parent
96744d986d
commit
daa0e8ff3d
1 changed files with 4 additions and 12 deletions
|
@ -20,6 +20,7 @@ layout(push_constant) uniform Push
|
||||||
float SHARPER;
|
float SHARPER;
|
||||||
float scanline_weight;
|
float scanline_weight;
|
||||||
float CURVATURE;
|
float CURVATURE;
|
||||||
|
float interlace_detect;
|
||||||
} registers;
|
} registers;
|
||||||
|
|
||||||
layout(std140, set = 0, binding = 0) uniform UBO
|
layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
|
@ -42,6 +43,7 @@ layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
#pragma parameter DOTMASK "CRTGeom Dot Mask Toggle" 0.3 0.0 0.3 0.3
|
#pragma parameter DOTMASK "CRTGeom Dot Mask Toggle" 0.3 0.0 0.3 0.3
|
||||||
#pragma parameter SHARPER "CRTGeom Sharpness" 1.0 1.0 3.0 1.0
|
#pragma parameter SHARPER "CRTGeom Sharpness" 1.0 1.0 3.0 1.0
|
||||||
#pragma parameter scanline_weight "CRTGeom Scanline Weight" 0.3 0.1 0.5 0.05
|
#pragma parameter scanline_weight "CRTGeom Scanline Weight" 0.3 0.1 0.5 0.05
|
||||||
|
#pragma parameter interlace_detect "CRTGeom Interlacing Simulation" 1.0 0.0 1.0 1.0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CRT-interlaced
|
CRT-interlaced
|
||||||
|
@ -75,9 +77,6 @@ layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
// Use the older, purely gaussian beam profile; uncomment for speed
|
// Use the older, purely gaussian beam profile; uncomment for speed
|
||||||
#define USEGAUSSIAN
|
#define USEGAUSSIAN
|
||||||
|
|
||||||
// Use interlacing detection; may interfere with other shaders if combined
|
|
||||||
#define INTERLACED
|
|
||||||
|
|
||||||
// Macros.
|
// Macros.
|
||||||
#define FIX(c) max(abs(c), 1e-5);
|
#define FIX(c) max(abs(c), 1e-5);
|
||||||
#define PI 3.141592653589
|
#define PI 3.141592653589
|
||||||
|
@ -198,11 +197,7 @@ void main()
|
||||||
stretch = maxscale();
|
stretch = maxscale();
|
||||||
TextureSize = vec2(registers.SHARPER * registers.SourceSize.x, registers.SourceSize.y);
|
TextureSize = vec2(registers.SHARPER * registers.SourceSize.x, registers.SourceSize.y);
|
||||||
|
|
||||||
#ifdef INTERLACED
|
|
||||||
ilfac = vec2(1.0, clamp(floor(registers.SourceSize.y/200.0), 1.0, 2.0));
|
ilfac = vec2(1.0, clamp(floor(registers.SourceSize.y/200.0), 1.0, 2.0));
|
||||||
#else
|
|
||||||
ilfac = vec2(1.0, clamp(floor(registers.SourceSize.y/1000.0), 1.0, 2.0));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The size of one texel, in texture-coordinates.
|
// The size of one texel, in texture-coordinates.
|
||||||
one = ilfac / TextureSize;
|
one = ilfac / TextureSize;
|
||||||
|
@ -355,11 +350,8 @@ void main()
|
||||||
|
|
||||||
// Of all the pixels that are mapped onto the texel we are
|
// Of all the pixels that are mapped onto the texel we are
|
||||||
// currently rendering, which pixel are we currently rendering?
|
// currently rendering, which pixel are we currently rendering?
|
||||||
#ifdef INTERLACED
|
|
||||||
vec2 ilvec = vec2(0.0, ilfac.y > 1.5 ? mod(float(registers.FrameCount), 2.0) : 0.0);
|
vec2 ilvec = vec2(0.0, ilfac.y * registers.interlace_detect > 1.5 ? mod(float(registers.FrameCount), 2.0) : 0.0);
|
||||||
#else
|
|
||||||
vec2 ilvec = vec2(0.0, ilfac.y);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
vec2 ratio_scale = (xy * TextureSize - vec2(0.5, 0.5) + ilvec) / ilfac;
|
vec2 ratio_scale = (xy * TextureSize - vec2(0.5, 0.5) + ilvec) / ilfac;
|
||||||
vec2 uv_ratio = fract(ratio_scale);
|
vec2 uv_ratio = fract(ratio_scale);
|
||||||
|
|
Loading…
Add table
Reference in a new issue