diff --git a/crt/crt-guest-dr-venom.slangp b/crt/crt-guest-dr-venom.slangp index f89d232..2abd06c 100644 --- a/crt/crt-guest-dr-venom.slangp +++ b/crt/crt-guest-dr-venom.slangp @@ -1,4 +1,4 @@ -shaders = 10 +shaders = 11 shader0 = shaders/guest/lut/lut.slang filter_linear0 = false @@ -61,8 +61,14 @@ scale_type8 = source scale8 = 1.0 float_framebuffer8 = true -shader9 = shaders/guest/crt-guest-dr-venom.slang +shader9 = shaders/guest/linearize_scanlines.slang filter_linear9 = true -scale_type9 = viewport -scale_x9 = 1.0 -scale_y9 = 1.0 +scale_type9 = source +scale9 = 1.0 +float_framebuffer9 = true + +shader10 = shaders/guest/crt-guest-dr-venom.slang +filter_linear10 = true +scale_type10 = viewport +scale_x10 = 1.0 +scale_y10 = 1.0 diff --git a/crt/shaders/guest/linearize_scanlines.slang b/crt/shaders/guest/linearize_scanlines.slang new file mode 100644 index 0000000..9163dea --- /dev/null +++ b/crt/shaders/guest/linearize_scanlines.slang @@ -0,0 +1,39 @@ +#version 450 + +layout(push_constant) uniform Push +{ + vec4 SourceSize; + vec4 OriginalSize; + vec4 OutputSize; + uint FrameCount; + float SCANLINE_GAMMA; +} params; + +#pragma parameter SCANLINE_GAMMA "Scanline Spike Removal" 12.0 1.0 15.0 0.5 +#define SCANLINE_GAMMA params.SCANLINE_GAMMA + +layout(std140, set = 0, binding = 0) uniform UBO +{ + mat4 MVP; +} global; + +#pragma stage vertex +layout(location = 0) in vec4 Position; +layout(location = 1) in vec2 TexCoord; +layout(location = 0) out vec2 vTexCoord; + +void main() +{ + gl_Position = global.MVP * Position; + vTexCoord = TexCoord; +} + +#pragma stage fragment +layout(location = 0) in vec2 vTexCoord; +layout(location = 0) out vec4 FragColor; +layout(set = 0, binding = 2) uniform sampler2D AfterglowPass; + +void main() +{ + FragColor = vec4(pow(vec3(texture(AfterglowPass, vTexCoord).rgb), vec3(SCANLINE_GAMMA)),1.0/SCANLINE_GAMMA); +} \ No newline at end of file diff --git a/presets/crt-guest-dr-venom-kurozumi.slangp b/presets/crt-guest-dr-venom-kurozumi.slangp index e58c0b3..ce83557 100644 --- a/presets/crt-guest-dr-venom-kurozumi.slangp +++ b/presets/crt-guest-dr-venom-kurozumi.slangp @@ -1,4 +1,4 @@ -shaders = "10" +shaders = "11" shader0 = "../crt/shaders/guest/lut/lut.slang" filter_linear0 = "false" @@ -51,10 +51,17 @@ filter_linear8 = "false" scale_type8 = "source" scale8 = "1.000000" -shader9 = "../crt/shaders/guest/crt-guest-dr-venom.slang" -filter_linear9 = "true" -scale_type9 = "viewport" -scale9 = "1.000000" +shader9 = ../crt/shaders/guest/linearize_scanlines.slang +filter_linear9 = true +scale_type9 = source +scale9 = 1.0 +float_framebuffer9 = true + +shader10 = ../crt/shaders/guest/crt-guest-dr-venom.slang +filter_linear10 = true +scale_type10 = viewport +scale_x10 = 1.0 +scale_y10 = 1.0 textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3" SamplerLUT1 = "../crt/shaders/guest/lut/sony_trinitron1.png" diff --git a/presets/crt-guest-dr-venom-ntsc-composite.slangp b/presets/crt-guest-dr-venom-ntsc-composite.slangp index 33161d1..2554188 100644 --- a/presets/crt-guest-dr-venom-ntsc-composite.slangp +++ b/presets/crt-guest-dr-venom-ntsc-composite.slangp @@ -1,4 +1,4 @@ -shaders = 11 +shaders = 12 shader0 = ../ntsc/shaders/ntsc-pass1-composite-2phase.slang shader1 = ../ntsc/shaders/ntsc-pass2-2phase-gamma.slang @@ -73,8 +73,14 @@ scale_type9 = source scale9 = 1.0 float_framebuffer9 = true -shader10 = ../crt/shaders/guest/crt-guest-dr-venom.slang +shader10 = ../crt/shaders/guest/linearize_scanlines.slang filter_linear10 = true -scale_type10 = viewport -scale_x10 = 1.0 -scale_y10 = 1.0 +scale_type10 = source +scale10 = 1.0 +float_framebuffer10 = true + +shader11 = ../crt/shaders/guest/crt-guest-dr-venom.slang +filter_linear11 = true +scale_type11 = viewport +scale_x11 = 1.0 +scale_y11 = 1.0