Advertisement
Guest User

MajinCry - ENB To Reshade - ESO

a guest
Nov 15th, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.81 KB | None | 0 0
  1. uniform bool bDoLevels
  2. <
  3.     ui_type = "input";
  4. > = true;
  5.  
  6. uniform bool bDoVibrance
  7. <
  8.     ui_type = "input";
  9. > = true;
  10.  
  11. uniform bool bDoCineonDPX
  12. <
  13.     ui_type = "input";
  14. > = true;
  15.  
  16. uniform bool bDoTechnicolor
  17. <
  18.     ui_type = "input";
  19. > = true;
  20.  
  21.  
  22. //begin NLA Brightness Vars
  23. uniform float fBrightness
  24. <
  25.     ui_type = "drag";
  26.     ui_min = 0.00;
  27.     ui_max = 1.00;
  28. > = 0.15;
  29.  
  30. uniform float fBrightnessCurve
  31. <
  32.     ui_type = "drag";
  33.     ui_min = 0.00;
  34.     ui_max = 10.00;
  35. > = 1.28;
  36.  
  37. uniform float fBrightnessMultiplier
  38. <
  39.     ui_type = "drag";
  40.     ui_min = 0.0;
  41.     ui_max = 1.0;
  42. > = 0.9;
  43.  
  44. uniform float fBrightnessTonemappingCurve
  45. <
  46.     ui_type = "drag";
  47.     ui_min = 0.0;
  48.     ui_max = 1.0;
  49. > = 0.5;
  50. //end
  51.  
  52.  
  53. //begin NLA Colour Vars
  54. uniform float fDesatR
  55. <
  56.     ui_type = "drag";
  57.     ui_min = 0.0;
  58.     ui_max = 1.0;
  59. > = 1.0;
  60.  
  61. uniform float fDesatG
  62. <
  63.     ui_type = "drag";
  64.     ui_min = 0.0;
  65.     ui_max = 1.0;
  66. > = 1.0;
  67.  
  68. uniform float fDesatB
  69. <
  70.     ui_type = "drag";
  71.     ui_min = 0.0;
  72.     ui_max = 1.0;
  73. > = 1.0;
  74.  
  75.  
  76. uniform float fGamma
  77. <
  78.     ui_type = "drag";
  79.     ui_min = 0.00;
  80.     ui_max = 5.00;
  81. > = 1.38;
  82.  
  83.  
  84. uniform float fRedFilter
  85. <
  86.     ui_type = "drag";
  87.     ui_min = 0.0;
  88.     ui_max = 1.0;
  89. > = 1.0;
  90.  
  91. uniform float fGreenFilter
  92. <
  93.     ui_type = "drag";
  94.     ui_min = 0.0;
  95.     ui_max = 1.0;
  96. > = 1.0;
  97.  
  98. uniform float fBlueFilter
  99. <
  100.     ui_type = "drag";
  101.     ui_min = 0.0;
  102.     ui_max = 1.0;
  103. > = 1.0;
  104. //end
  105.  
  106.  
  107. //begin NLA Tonemapping Vars
  108. uniform bool bDoNLATonemapping
  109. <
  110.     ui_type = "input";
  111. > = true;
  112.  
  113.  
  114. uniform float fTonemappingIntensityContrast
  115. <
  116.     ui_type = "drag";
  117.     ui_min = 0.0;
  118.     ui_max = 10.0;
  119. > = 1.3;
  120.  
  121. uniform float fTonemappingSaturation
  122. <
  123.     ui_type = "drag";
  124.     ui_min = 0.0;
  125.     ui_max = 10.0;
  126. > = 1.7;
  127.  
  128. uniform float fTonemappingCurve
  129. <
  130.     ui_type = "drag";
  131.     ui_min = 0.0;
  132.     ui_max = 10.0;
  133. > = 2.0;
  134.  
  135. uniform float fTonemappingOversaturation
  136. <
  137.     ui_type = "drag";
  138.     ui_min = 0.0;
  139.     ui_max = 999.0;
  140. > = 120.0;
  141. //end
  142.  
  143.  
  144. #include "ReShade.fxh"
  145.  
  146.  
  147. float3 PostProcessingPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
  148. {
  149.    
  150.     float3 f3Color = tex2D(ReShade::BackBuffer, texcoord).rgb; //Create our copy of the pixel data, and swizzle Reshade's screengrab into it.
  151.    
  152.    
  153.     //begin Paste01
  154.     float fGreyscale = dot(f3Color.xyz, float3(0.3, 0.59, 0.11));
  155.    
  156.     f3Color.r = lerp(fGreyscale, f3Color.r, fDesatR);
  157.     f3Color.g = lerp(fGreyscale, f3Color.g, fDesatG);
  158.     f3Color.b = lerp(fGreyscale, f3Color.b, fDesatB);
  159.    
  160.     f3Color.rgb = pow(f3Color, fGamma);
  161.    
  162.     f3Color.r = pow(f3Color.r, fRedFilter);
  163.     f3Color.g = pow(f3Color.g, fGreenFilter);
  164.     f3Color.b = pow(f3Color.b, fBlueFilter);
  165.     //end
  166.    
  167.    
  168.     //begin Paste02
  169.     f3Color.xyz *= fBrightness;
  170.     f3Color.xyz += 0.000001;
  171.    
  172.     float3 xncol = normalize(f3Color.xyz);
  173.     float3 scl = f3Color.xyz / xncol.xyz;
  174.    
  175.     scl = pow(scl, fTonemappingIntensityContrast);
  176.     xncol.xyz = pow(xncol.xyz, fTonemappingSaturation);
  177.     f3Color.xyz = scl*xncol.xyz;
  178.  
  179.     float   f3LumaMax = fTonemappingOversaturation;
  180.     f3Color.xyz = (f3Color.xyz * (1.0 + f3Color.xyz / f3LumaMax)) / (f3Color.xyz + fTonemappingCurve);
  181.    
  182.   float Y = dot(f3Color.xyz, float3(0.299, 0.587, 0.114)); //0.299 * R + 0.587 * G + 0.114 * B;
  183.     float U = dot(f3Color.xyz, float3(-0.14713, -0.28886, 0.436)); //-0.14713 * R - 0.28886 * G + 0.436 * B;
  184.     float V = dot(f3Color.xyz, float3(0.615, -0.51499, -0.10001)); //0.615 * R - 0.51499 * G - 0.10001 * B;
  185.    
  186.     Y = pow(Y, fBrightnessCurve);
  187.     Y = Y * fBrightnessMultiplier;
  188.     Y = Y / (Y + fBrightnessTonemappingCurve);
  189.    
  190.     float   desaturatefact = saturate(Y*Y*Y*1.7);
  191.    
  192.     U = lerp(U, 0.0, desaturatefact);
  193.     V = lerp(V, 0.0, desaturatefact);
  194.    
  195.     f3Color.xyz = V * float3(1.13983, -0.58060, 0.0) + U * float3(0.0, -0.39465, 2.03211) + Y;
  196.     //end
  197.    
  198.     //begin Paste03
  199.    
  200.     //end
  201.    
  202. }
  203.  
  204. technique FyTyPostProcessing
  205. {
  206.  
  207.     pass
  208.     {
  209.         VertexShader = PostProcessVS;
  210.         PixelShader = PostProcessingPass;
  211.     }
  212.    
  213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement