From 5a53b682f06b1f48a3a99d9a8bfbf570b5d2a6f8 Mon Sep 17 00:00:00 2001 From: "ramapcsx2.code" Date: Sun, 22 Dec 2013 15:36:47 +0000 Subject: [PATCH] GSdx: Added a simple scanlines filter (2nd one activated by F7). No tweaking done yet. It shows how to get scanlines that aren't affected by input resolution or scaling. A good next step would be determining the exact number of dark lines to show :) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5770 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/res/convert.fx | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/plugins/GSdx/res/convert.fx b/plugins/GSdx/res/convert.fx index 045a2cbd55..4703813c7e 100644 --- a/plugins/GSdx/res/convert.fx +++ b/plugins/GSdx/res/convert.fx @@ -115,6 +115,17 @@ float4 ps_crt(PS_INPUT input, int i) return sample_c(input.t) * saturate(mask[i] + 0.5f); } +float4 ps_scanlines(PS_INPUT input, int i) +{ + float4 mask[2] = + { + float4(1, 1, 1, 0), + float4(0, 0, 0, 0) + }; + + return sample_c(input.t) * saturate(mask[i] + 0.5f); +} + #if SHADER_MODEL >= 0x400 uint ps_main1(PS_INPUT input) : SV_Target0 @@ -171,13 +182,14 @@ PS_OUTPUT ps_main5(PS_INPUT input) // triangular return output; } -PS_OUTPUT ps_main6(PS_INPUT input) // diagonal +PS_OUTPUT ps_main6(PS_INPUT input) // diagonal (repurposed for scanlines for now) { PS_OUTPUT output; - + uint4 p = (uint4)input.p; - output.c = ps_crt(input, (p.x + (p.y % 3)) % 3); + output.c = ps_scanlines(input, p.y % 2); // scanlines + //output.c = ps_crt(input, (p.x + (p.y % 3)) % 3); // diagonal return output; } @@ -240,14 +252,15 @@ PS_OUTPUT ps_main5(PS_INPUT input) // triangular return output; } -PS_OUTPUT ps_main6(PS_INPUT input) // diagonal +PS_OUTPUT ps_main6(PS_INPUT input) // diagonal (repurposed for scanlines for now) { PS_OUTPUT output; - + int4 p = (int4)input.p; - output.c = ps_crt(input, (p.x + (p.y % 3)) % 3); - + output.c = ps_scanlines(input, p.y % 2); // scanlines + //output.c = ps_crt(input, (p.x + (p.y % 3)) % 3); // diagonal + return output; }