SHARE
TWEET

Untitled

a guest Mar 1st, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Amateur port to ReShade v3.x by XIIICaesar.
  2. //
  3. // Ported by IDDQD.
  4. // Original code from Shadertoy
  5. //
  6. // VHS Tape Noise: Vladmir Storm (https://www.shadertoy.com/view/MlfSWr)
  7. // VCR Distortion: ryk (https://www.shadertoy.com/view/ldjGzV)
  8. // VHS Distortion: drmelon (https://www.shadertoy.com/view/4dBGzK)
  9. // Dirty old CRT: Klowner (https://www.shadertoy.com/view/MsXGD4)
  10. // NTSC Codec: UltraMoogleMan (https://www.shadertoy.com/view/ldXGRf)
  11. //
  12. // Posted by Matsilagi and further optimized for ReShade by crosire, MartyMcFly and Ganossa
  13. // http://reshade.me/forum/shader-presentation/1258-vhs-shader
  14. //
  15. // Do not distribute without giving credit to the original author(s).
  16.  
  17. uniform int sNoiseMode <
  18.     ui_type = "combo";
  19.     ui_items = "VHS_N1.jpg\0VHS_N2.jpg\0VHS_N3.jpg\0";
  20.     ui_tooltip = "Swap between several noise textures.";
  21. > = 2;
  22. uniform bool bUseTapeNoise <
  23.     ui_tooltip = "Tape noise that scrolls trough the screen.";
  24. > = true;
  25. uniform bool bUseVCRDistort <
  26.     ui_tooltip = "VCR Distortion";
  27. > = true;
  28. uniform bool bUseDirtyCRT <
  29.     ui_tooltip = "Dirty CRT Shader, adds color distortion";
  30. > = true;
  31. uniform bool bUseVHSDistort <
  32.     ui_tooltip = "Analogical signal distortion";
  33. > = false;
  34. uniform bool bVHSDistortGammaFix <
  35.     ui_tooltip = "Fixes the darkening of the NTSC Shader";
  36. > = false;
  37. uniform bool bUseNTSCFilter <
  38.     ui_tooltip = "NTSC Shader, decreases color (good for VHSDistortion with GammaFix)";
  39. > = false;
  40.  
  41. #if (sNoiseMode == 0)
  42. texture texnoise2  < source = "VHS_N1.jpg";  > {Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;};
  43. #elif (sNoiseMode == 1)
  44. texture texnoise2  < source = "VHS_N2.jpg";  > {Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;};
  45. #else
  46. texture texnoise2  < source = "VHS_N3.jpg";  > {Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;};
  47. #endif
  48.  
  49. sampler2D SamNoise
  50. {
  51.     Texture = texnoise2;
  52.     MinFilter = LINEAR;
  53.     MagFilter = LINEAR;
  54.     MipFilter = NONE;
  55.     AddressU = Wrap;
  56.     AddressV = Wrap;
  57. };
  58.  
  59. // Useful Constants
  60. static const float Pi = 3.1415926535;
  61. static const float Pi2 = 6.283185307;
  62.  
  63. // NTSC Constants
  64. static const float4 A = 0.5;
  65. static const float4 B = 0.5;
  66. static const float P = 1.0;
  67. static const float CCFrequency = 3.59754545;
  68. static const float YFrequency = 6.0;
  69. static const float IFrequency = 1.2;
  70. static const float QFrequency = 0.6;
  71. static const float NotchHalfWidth = 2.0;
  72. static const float ScanTime = 52.6;
  73. static const float MaxC = 2.1183;
  74. static const float4 MinC = -1.1183;
  75. static const float4 CRange = 3.2366;
  76.  
  77. uniform float Timer < source = "timer"; >;
  78.  
  79. #define t Timer.x*0.001
  80. #define t2 Timer*0.001
  81.  
  82. #include "ReShade.fxh"
  83.  
  84. float4 CompositeSample(float2 texcoord)
  85.  {
  86.     float2 InverseRes = 1.0 / ReShade::ScreenSize.xy;
  87.     float2 InverseP = float2(P, 0.0) * InverseRes;
  88.    
  89.     // UVs for four linearly-interpolated samples spaced 0.25 texels apart
  90.     float2 C0 = texcoord;
  91.     float2 C1 = texcoord + ReShade::PixelSize.x * 0.25;
  92.     float2 C2 = texcoord + ReShade::PixelSize.x * 0.50;
  93.     float2 C3 = texcoord + ReShade::PixelSize.x * 0.75;
  94.     float4 Cx = float4(C0.x, C1.x, C2.x, C3.x);
  95.     float4 Cy = float4(C0.y, C1.y, C2.y, C3.y);
  96.  
  97.     float3 Texel0 = tex2D(ReShade::BackBuffer, C0).rgb;
  98.     float3 Texel1 = tex2D(ReShade::BackBuffer, C1).rgb;
  99.     float3 Texel2 = tex2D(ReShade::BackBuffer, C2).rgb;
  100.     float3 Texel3 = tex2D(ReShade::BackBuffer, C3).rgb;
  101.    
  102.     // Calculated the expected time of the sample.
  103.     float4 T = Cy * ReShade::ScreenSize.x + 0.5 + Cx;
  104.  
  105.     const float3 YTransform = float3(0.299, 0.587, 0.114);
  106.     const float3 ITransform = float3(0.595716, -0.274453, -0.321263);
  107.     const float3 QTransform = float3(0.211456, -0.522591, 0.311135);
  108.  
  109.     float Y0 = dot(Texel0.xyz, YTransform);
  110.     float Y1 = dot(Texel1.xyz, YTransform);
  111.     float Y2 = dot(Texel2.xyz, YTransform);
  112.     float Y3 = dot(Texel3.xyz, YTransform);
  113.     float4 Y = float4(Y0, Y1, Y2, Y3);
  114.  
  115.     float I0 = dot(Texel0.xyz, ITransform);
  116.     float I1 = dot(Texel1.xyz, ITransform);
  117.     float I2 = dot(Texel2.xyz, ITransform);
  118.     float I3 = dot(Texel3.xyz, ITransform);
  119.     float4 I = float4(I0, I1, I2, I3);
  120.  
  121.     float Q0 = dot(Texel0.xyz, QTransform);
  122.     float Q1 = dot(Texel1.xyz, QTransform);
  123.     float Q2 = dot(Texel2.xyz, QTransform);
  124.     float Q3 = dot(Texel3.xyz, QTransform);
  125.     float4 Q = float4(Q0, Q1, Q2, Q3); 
  126.  
  127.     float4 W = 6.283185307 * 3.59754545 * 52.6;
  128.     float4 Encoded = Y + I * cos(T * W) + Q * sin(T * W);
  129.     return (Encoded + 1.1183) / 3.2366;
  130. }
  131.  
  132. float4 NTSCCodec(float2 texcoord)
  133. {
  134.     float4 YAccum = 0.0;
  135.     float4 IAccum = 0.0;
  136.     float4 QAccum = 0.0;
  137.     float QuadXSize = ReShade::ScreenSize.x * 4.0;
  138.     float TimePerSample = ScanTime / QuadXSize;
  139.    
  140.     // Frequency cutoffs for the individual portions of the signal that we extract.
  141.     // Y1 and Y2 are the positive and negative frequency limits of the notch filter on Y.
  142.     //
  143.     float Fc_y1 = (CCFrequency - NotchHalfWidth) * TimePerSample;
  144.     float Fc_y2 = (CCFrequency + NotchHalfWidth) * TimePerSample;
  145.     float Fc_y3 = YFrequency * TimePerSample;
  146.     float Fc_i = IFrequency * TimePerSample;
  147.     float Fc_q = QFrequency * TimePerSample;
  148.     float Pi2Length = Pi2 / 82.0;
  149.     float4 NotchOffset = float4(0.0, 1.0, 2.0, 3.0);
  150.     float4 W = Pi2 * CCFrequency * ScanTime;
  151.     for(float n = -41.0; n < 42.0; n += 4.0)
  152.     {
  153.         float4 n4 = n + NotchOffset  + 0.00001;
  154.         float4 CoordX = texcoord.x + ReShade::PixelSize.x * n4 * 0.25;
  155.         float4 CoordY = texcoord.y;
  156.         float2 TexCoord = float2(CoordX.r, CoordY.r);
  157.         float4 C = CompositeSample(TexCoord) * CRange + MinC;
  158.         float4 WT = W * (CoordX  + A * CoordY * 2.0 * ReShade::ScreenSize.x + B);
  159.  
  160.         float4 SincYIn1 = Pi2 * Fc_y1 * n4;
  161.         float4 SincYIn2 = Pi2 * Fc_y2 * n4;
  162.         float4 SincYIn3 = Pi2 * Fc_y3 * n4;
  163.  
  164.         float4 SincY1 = sin(SincYIn1) / SincYIn1;
  165.         float4 SincY2 = sin(SincYIn2) / SincYIn2;
  166.         float4 SincY3 = sin(SincYIn3) / SincYIn3;
  167.         if(SincYIn1.x == 0.0) SincY1.x = 1.0;
  168.         if(SincYIn1.y == 0.0) SincY1.y = 1.0;
  169.         if(SincYIn1.z == 0.0) SincY1.z = 1.0;
  170.         if(SincYIn1.w == 0.0) SincY1.w = 1.0;
  171.         if(SincYIn2.x == 0.0) SincY2.x = 1.0;
  172.         if(SincYIn2.y == 0.0) SincY2.y = 1.0;
  173.         if(SincYIn2.z == 0.0) SincY2.z = 1.0;
  174.         if(SincYIn2.w == 0.0) SincY2.w = 1.0;
  175.         if(SincYIn3.x == 0.0) SincY3.x = 1.0;
  176.         if(SincYIn3.y == 0.0) SincY3.y = 1.0;
  177.         if(SincYIn3.z == 0.0) SincY3.z = 1.0;
  178.         if(SincYIn3.w == 0.0) SincY3.w = 1.0;
  179.         //float4 IdealY = (2.0 * Fc_y1 * SincY1 - 2.0 * Fc_y2 * SincY2) + 2.0 * Fc_y3 * SincY3;
  180.         float4 IdealY = (2.0 * Fc_y1 * SincY1 - 2.0 * Fc_y2 * SincY2) + 2.0 * Fc_y3 * SincY3;
  181.         float4 FilterY = (0.54 + 0.46 * cos(Pi2Length * n4)) * IdealY;     
  182.        
  183.         float4 SincIIn = Pi2 * Fc_i * n4;
  184.         float4 SincI = sin(SincIIn) / SincIIn;
  185.         if (SincIIn.x == 0.0) SincI.x = 1.0;
  186.         if (SincIIn.y == 0.0) SincI.y = 1.0;
  187.         if (SincIIn.z == 0.0) SincI.z = 1.0;
  188.         if (SincIIn.w == 0.0) SincI.w = 1.0;
  189.         float4 IdealI = 2.0 * Fc_i * SincI;
  190.         float4 FilterI = (0.54 + 0.46 * cos(Pi2Length * n4)) * IdealI;
  191.        
  192.         float4 SincQIn = Pi2 * Fc_q * n4;
  193.         float4 SincQ = sin(SincQIn) / SincQIn;
  194.         if (SincQIn.x == 0.0) SincQ.x = 1.0;
  195.         if (SincQIn.y == 0.0) SincQ.y = 1.0;
  196.         if (SincQIn.z == 0.0) SincQ.z = 1.0;
  197.         if (SincQIn.w == 0.0) SincQ.w = 1.0;
  198.         float4 IdealQ = 2.0 * Fc_q * SincQ;
  199.         float4 FilterQ = (0.54 + 0.46 * cos(Pi2Length * n4)) * IdealQ;
  200.        
  201.         YAccum = YAccum + C * FilterY;
  202.         IAccum = IAccum + C * cos(WT) * FilterI;
  203.         QAccum = QAccum + C * sin(WT) * FilterQ;
  204.     }
  205.    
  206.     float Y = YAccum.r + YAccum.g + YAccum.b + YAccum.a;
  207.     float I = (IAccum.r + IAccum.g + IAccum.b + IAccum.a) * 2.0;
  208.     float Q = (QAccum.r + QAccum.g + QAccum.b + QAccum.a) * 2.0;
  209.    
  210.     float3 YIQ = float3(Y, I, Q);
  211.  
  212.     float3 OutRGB = float3(dot(YIQ, float3(1.0, 0.956, 0.621)), dot(YIQ, float3(1.0, -0.272, -0.647)), dot(YIQ, float3(1.0, -1.106, 1.703)));      
  213.    
  214.     return float4(OutRGB, 1.0);
  215. }
  216.  
  217.  
  218. void PS_VHS(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 GetOut : SV_Target)
  219. {  
  220.     float4 origcolor;
  221.    
  222.     origcolor=tex2D(ReShade::BackBuffer, texcoord);
  223.    
  224.     origcolor = NTSCCodec(texcoord);
  225.  
  226.     origcolor = pow(origcolor,0.5);
  227.    
  228.     GetOut = origcolor;
  229. }
  230.  
  231. //random hash
  232. float4 hash42(float2 p){
  233.    
  234.     float4 p4 = frac(float4(p.xyxy) * float4(443.8975,397.2973, 491.1871, 470.7827));
  235.     p4.x += dot(p4.wzxy, p4+19.19);
  236.     return frac(float4(p4.x * p4.y, p4.x*p4.z, p4.y*p4.w, p4.x*p4.w));
  237. }
  238.  
  239.  
  240. float hash( float n ){
  241.     return frac(sin(n)*43758.5453123);
  242. }
  243.  
  244. // 3d noise function (iq's)
  245. float n( in float3 x ){
  246.     float3 p = floor(x);
  247.     float3 f = frac(x);
  248.     f = f*f*(3.0-2.0*f);
  249.     float n = p.x + p.y*57.0 + 113.0*p.z;
  250.     float res = lerp(lerp(lerp( hash(n+  0.0), hash(n+  1.0),f.x),
  251.                         lerp( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y),
  252.                     lerp(lerp( hash(n+113.0), hash(n+114.0),f.x),
  253.                         lerp( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z);
  254.     return res;
  255. }
  256.  
  257. //tape noise
  258. float nn(float2 p){
  259.  
  260.  
  261.     float y = p.y;
  262.    
  263.     float v = (n( float3(y*0.01 +t*2.0,             1., 1.0) ) + .0)
  264.              *(n( float3(y*.011+1000.0+t*2.0,   1., 1.0) ) + .0)
  265.              *(n( float3(y*.51+421.0+t*2.0,     1., 1.0) ) + .0)  
  266.         ;
  267.     v*= hash42(   float2(p.x +t*0.01, p.y) ).x +.3 ;
  268.  
  269.     return v;
  270. }
  271.  
  272. void PS_VHS3(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 OutGet : SV_Target)
  273. {
  274.     float4 uv = 0.0;
  275.     uv.xy = texcoord.xy;
  276.     uv.w = 0.0;
  277.     float4 origcolor2= tex2Dlod(ReShade::BackBuffer, uv);
  278.    
  279.     float linesN = 240; //fields per seconds
  280.     float one_y = ReShade::ScreenSize.y / linesN; //field line
  281.     uv.xy = floor(uv.xy*ReShade::ScreenSize.xy/one_y)*one_y;
  282.  
  283.     float col = nn(-uv.xy);
  284.  
  285.     origcolor2 += dot(col,0.233);
  286.    
  287.     OutGet = origcolor2;
  288. }
  289.  
  290. float noise(float2 p)
  291. {
  292.     float sampless = tex2D(SamNoise,float2(1.,2.*cos(t2))*t2*8. + p*1.).x;
  293.     sampless *= sampless;
  294.     return sampless;
  295. }
  296.  
  297. float onOff(float a, float b, float c)
  298. {
  299.     return step(c, sin(t2 + a*cos(t2*b)));
  300. }
  301.  
  302. float ramp(float y, float start, float end)
  303. {
  304.     float inside = step(start,y) - step(end,y);
  305.     float fact = (y-start)/(end-start)*inside;
  306.     return (1.-fact) * inside;
  307.    
  308. }
  309.  
  310. float stripes(float2 uv)
  311. {
  312.     float noi = noise(uv*float2(0.5,1.) + float2(1.,3.));
  313.     return ramp((uv.y*4.0 + t2/2.+sin(t2 + sin(t2*0.63)) % 2.0),0.5,0.6)*noi;
  314. }
  315.  
  316. float3 getVideo(float2 uv)
  317. {
  318.     float2 look = uv;
  319.     float window = 1.0/(1.0+20.0*(look.y-(t2/4.0 % 2.2))*(look.y-(t2/4.0 % 2.0))); //this was broken
  320.     look.x = look.x + sin(look.y*10. + t2)/500.*onOff(4.,4.,.3)*(1.+cos(t2*80.))*window;
  321.     float vShift = 5.4*onOff(2.,3.,.9)*(sin(t2)*sin(t2*20.) + (0.5 + 0.1*sin(t2*200.)*cos(t2)));
  322.     look.y = (look.y + vShift % 2.0); //this too
  323.     float3 video = tex2D(ReShade::BackBuffer,look).rgb;
  324.     return video;
  325. }
  326.  
  327. float2 screenDistort(float2 uv)
  328. {
  329.     uv -= float2(.5,.5);
  330.     uv = uv*1.2*(1./1.2+2.*uv.x*uv.x*uv.y*uv.y);
  331.     uv += float2(.5,.5);
  332.     return uv;
  333. }
  334.  
  335. void PS_VHS4(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 OutGet2 : SV_Target)
  336. {
  337.     float4 origcolor3=tex2Dlod(ReShade::BackBuffer, float4(texcoord, 0, 0));
  338.     texcoord = screenDistort(texcoord);
  339.     float3 video = getVideo(texcoord);
  340.     float vigAmt = 3.+.3*sin(t2 + 5.*cos(t2*5.));
  341.     float vignette = (1.-vigAmt*(texcoord.y-0.5)*(texcoord.y-0.5))*(1.0-vigAmt*(texcoord.x-0.5)*(texcoord.x-0.5));
  342.    
  343.     //video += stripes(texcoord);
  344.     video += noise(texcoord*2.)/2.;
  345.     video *= vignette;
  346.  
  347.     origcolor3.xyz = video;
  348.    
  349.     OutGet2 = origcolor3;
  350. }
  351.  
  352. float rand(float2 co)
  353. {
  354.         float a = 12.9898;
  355.         float b = 78.233;
  356.         float c = 43758.5453;
  357.         float dst= dot(co.xy ,float2(a,b));
  358.         float snm= dst % 3.14; //this was broken aswell
  359.         return frac(sin(snm) * c);
  360. }
  361.  
  362. void PS_VHS5(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 OutGet3 : SV_Target)
  363. {
  364.     float4 origcolor4=tex2D(ReShade::BackBuffer, texcoord);
  365.     float magnitude = 0.0009;
  366.    
  367.     // Set up offset
  368.     float2 offsetRedUV = texcoord;
  369.     offsetRedUV.x = texcoord.x + rand(float2(t2*0.03,texcoord.y*0.42)) * 0.001;
  370.     offsetRedUV.x += sin(rand(float2(t2*0.2, texcoord.y)))*magnitude;
  371.    
  372.     float2 offsetGreenUV = texcoord;
  373.     offsetGreenUV.x = texcoord.x + rand(float2(t2*0.004,texcoord.y*0.002)) * 0.004;
  374.     offsetGreenUV.x += sin(t2*9.0)*magnitude;
  375.    
  376.     float2 offsetBlueUV = texcoord;
  377.     offsetBlueUV.x = texcoord.y;
  378.     offsetBlueUV.x += rand(float2(cos(t2.x*0.01),sin(texcoord.y)));
  379.    
  380.     // Load Texture
  381.     float r = tex2D(ReShade::BackBuffer, offsetRedUV).r;
  382.     float g = tex2D(ReShade::BackBuffer, offsetGreenUV).g;
  383.     float b = tex2D(ReShade::BackBuffer, texcoord).b;
  384.    
  385.     #if bVHSDistortGammaFix
  386.     origcolor4 += float4(r,g,b,0);
  387.    
  388.     OutGet3 = origcolor4;
  389.    
  390.     #else
  391.    
  392.     OutGet3 = float4(r,g,b,1.0);
  393.     #endif
  394. }
  395.  
  396. float scanline(float2 uv) {
  397.     return sin(ReShade::ScreenSize.y * uv.y * 0.7 - t2 * 10.0);
  398. }
  399.  
  400. float slowscan(float2 uv) {
  401.     return sin(ReShade::ScreenSize.y * uv.y * 0.02 + t2 * 6.0);
  402. }
  403.  
  404. float2 colorShift(float2 uv) {
  405.     return float2(
  406.         uv.x,
  407.         uv.y + sin(t2)*0.02
  408.     );
  409. }
  410.  
  411. float noise2(float2 uv) {
  412.     return clamp(tex2D(SamNoise, uv.xy + t2*6.0).r +
  413.         tex2D(SamNoise, uv.xy - t2*4.0).g, 0.96, 1.0);
  414. }
  415.  
  416. // from https://www.shadertoy.com/view/4sf3Dr
  417. // Thanks, Jasper
  418. float2 crt(float2 coord, float bend)
  419. {
  420.     // put in symmetrical coords
  421.     coord = (coord - 0.5) * 2.0;
  422.  
  423.     coord *= 0.5;  
  424.    
  425.     // deform coords
  426.     coord.x *= 1.0 + pow((abs(coord.y) / bend), 2.0);
  427.     coord.y *= 1.0 + pow((abs(coord.x) / bend), 2.0);
  428.  
  429.     // transform back to 0.0 - 1.0 space
  430.     coord  = (coord / 1.0) + 0.5;
  431.  
  432.     return coord;
  433. }
  434.  
  435. float2 colorshift(float2 uv, float amount, float rand) {
  436.    
  437.     return float2(
  438.         uv.x,
  439.         uv.y + amount * rand  
  440.     );
  441. }
  442.  
  443. float2 scandistort(float2 uv) {
  444.     float scan1 = clamp(cos(uv.y * 2.0 + t2), 0.0, 1.0);
  445.     float scan2 = clamp(cos(uv.y * 2.0 + t2 + 4.0) * 10.0, 0.0, 1.0) ;
  446.     float amount = scan1 * scan2 * uv.x;
  447.    
  448.     uv.x -= 0.05 * lerp(tex2D(SamNoise, float2(uv.x, amount)).r * amount, amount, 0.9);
  449.  
  450.     return uv;
  451.      
  452. }
  453.  
  454. float vignette(float2 uv) {
  455.     uv = (uv - 0.5) * 0.98;
  456.     return clamp(pow(abs(cos(uv.x * 3.1415)), 1.2) * pow(abs(cos(uv.y * 3.1415)), 1.2) * 50.0, 0.0, 1.0);
  457. }
  458.  
  459. void PS_VHS6(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 OutGet3 : SV_Target)
  460. {
  461.     float4 uv = 0.0;
  462.     uv.xy = texcoord.xy;
  463.     uv.w = 0.0;
  464.     float2 sdUv = scandistort(uv.xy);
  465.     float2 crtUv = crt(sdUv, 2.0);
  466.    
  467.     float4 color = float4(0, 0, 0, 0);
  468.    
  469.     //float rand_r = sin(t2 * 3.0 + sin(t2)) * sin(t2 * 0.2);
  470.     //float rand_g = clamp(sin(t2 * 1.52 * uv.y + sin(t2)) * sin(t2* 1.2), 0.0, 1.0);
  471.     float4 randss = tex2D(SamNoise, float2(t2 * 0.01, t2 * 0.02));
  472.    
  473.     color.r = tex2D(ReShade::BackBuffer, crt(colorshift(sdUv, 0.025, randss.r), 2.0)).r;
  474.     color.g = tex2D(ReShade::BackBuffer, crt(colorshift(sdUv, 0.01, randss.g), 2.0)).g;
  475.     color.b = tex2D(ReShade::BackBuffer, crt(colorshift(sdUv, 0.024, randss.b), 2.0)).b;   
  476.        
  477.     float4 scanlineColor = scanline(crtUv);
  478.     float4 slowscanColor = slowscan(crtUv);
  479.    
  480.     OutGet3 = lerp(color, lerp(scanlineColor, slowscanColor, 0.5), 0.05) *
  481.         vignette(texcoord) *
  482.         noise2(texcoord);  
  483.     //fragColor = float4(vignette(uv));
  484.     //float2 scan_dist = scandistort(uv);
  485.     //fragColor = float4(scan_dist.x, scan_dist.y,0.0, 1.0);
  486. }
  487.  
  488. technique VHSReShade
  489. {
  490. //  #if (bUseNTSCFilter == 1)
  491.     pass NTSCFilter
  492.     {
  493.         VertexShader = PostProcessVS;
  494.         PixelShader = PS_VHS;
  495.     }
  496. //  #endif
  497.  
  498.     #if (bUseVCRDistort == 1)
  499.     pass VCRDistort
  500.     {
  501.         VertexShader = PostProcessVS;
  502.         PixelShader = PS_VHS4;
  503.     }
  504.     #endif
  505.    
  506.     #if (bUseVHSDistort == 1)
  507.     pass VHSDistort
  508.     {
  509.         VertexShader = PostProcessVS;
  510.         PixelShader = PS_VHS5;
  511.     }
  512.     #endif
  513.    
  514.     #if (bUseDirtyCRT == 1)
  515.     pass DirtyCRT
  516.     {
  517.         VertexShader = PostProcessVS;
  518.         PixelShader = PS_VHS6;
  519.     }
  520.     #endif
  521.    
  522.     #if (bUseTapeNoise == 1)
  523.     pass TapeNoise
  524.     {
  525.         VertexShader = PostProcessVS;
  526.         PixelShader = PS_VHS3;
  527.     }
  528.     #endif
  529.    
  530. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top