Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uniform bool bDoLevels
- <
- ui_type = "input";
- > = true;
- uniform bool bDoVibrance
- <
- ui_type = "input";
- > = true;
- uniform bool bDoCineonDPX
- <
- ui_type = "input";
- > = true;
- uniform bool bDoTechnicolor
- <
- ui_type = "input";
- > = true;
- //begin NLA Brightness Vars
- uniform float fBrightness
- <
- ui_type = "drag";
- ui_min = 0.00;
- ui_max = 1.00;
- > = 0.15;
- uniform float fBrightnessCurve
- <
- ui_type = "drag";
- ui_min = 0.00;
- ui_max = 10.00;
- > = 1.28;
- uniform float fBrightnessMultiplier
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 1.0;
- > = 0.9;
- uniform float fBrightnessTonemappingCurve
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 1.0;
- > = 0.5;
- //end
- //begin NLA Colour Vars
- uniform float fDesatR
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 1.0;
- > = 1.0;
- uniform float fDesatG
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 1.0;
- > = 1.0;
- uniform float fDesatB
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 1.0;
- > = 1.0;
- uniform float fGamma
- <
- ui_type = "drag";
- ui_min = 0.00;
- ui_max = 5.00;
- > = 1.38;
- uniform float fRedFilter
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 1.0;
- > = 1.0;
- uniform float fGreenFilter
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 1.0;
- > = 1.0;
- uniform float fBlueFilter
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 1.0;
- > = 1.0;
- //end
- //begin NLA Tonemapping Vars
- uniform bool bDoNLATonemapping
- <
- ui_type = "input";
- > = true;
- uniform float fTonemappingIntensityContrast
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 10.0;
- > = 1.3;
- uniform float fTonemappingSaturation
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 10.0;
- > = 1.7;
- uniform float fTonemappingCurve
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 10.0;
- > = 2.0;
- uniform float fTonemappingOversaturation
- <
- ui_type = "drag";
- ui_min = 0.0;
- ui_max = 999.0;
- > = 120.0;
- //end
- #include "ReShade.fxh"
- float3 PostProcessingPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
- {
- float3 f3Color = tex2D(ReShade::BackBuffer, texcoord).rgb; //Create our copy of the pixel data, and swizzle Reshade's screengrab into it.
- //begin Paste01
- float fGreyscale = dot(f3Color.xyz, float3(0.3, 0.59, 0.11));
- f3Color.r = lerp(fGreyscale, f3Color.r, fDesatR);
- f3Color.g = lerp(fGreyscale, f3Color.g, fDesatG);
- f3Color.b = lerp(fGreyscale, f3Color.b, fDesatB);
- f3Color.rgb = pow(f3Color, fGamma);
- f3Color.r = pow(f3Color.r, fRedFilter);
- f3Color.g = pow(f3Color.g, fGreenFilter);
- f3Color.b = pow(f3Color.b, fBlueFilter);
- //end
- //begin Paste02
- f3Color.xyz *= fBrightness;
- f3Color.xyz += 0.000001;
- float3 xncol = normalize(f3Color.xyz);
- float3 scl = f3Color.xyz / xncol.xyz;
- scl = pow(scl, fTonemappingIntensityContrast);
- xncol.xyz = pow(xncol.xyz, fTonemappingSaturation);
- f3Color.xyz = scl*xncol.xyz;
- float f3LumaMax = fTonemappingOversaturation;
- f3Color.xyz = (f3Color.xyz * (1.0 + f3Color.xyz / f3LumaMax)) / (f3Color.xyz + fTonemappingCurve);
- float Y = dot(f3Color.xyz, float3(0.299, 0.587, 0.114)); //0.299 * R + 0.587 * G + 0.114 * B;
- float U = dot(f3Color.xyz, float3(-0.14713, -0.28886, 0.436)); //-0.14713 * R - 0.28886 * G + 0.436 * B;
- float V = dot(f3Color.xyz, float3(0.615, -0.51499, -0.10001)); //0.615 * R - 0.51499 * G - 0.10001 * B;
- Y = pow(Y, fBrightnessCurve);
- Y = Y * fBrightnessMultiplier;
- Y = Y / (Y + fBrightnessTonemappingCurve);
- float desaturatefact = saturate(Y*Y*Y*1.7);
- U = lerp(U, 0.0, desaturatefact);
- V = lerp(V, 0.0, desaturatefact);
- f3Color.xyz = V * float3(1.13983, -0.58060, 0.0) + U * float3(0.0, -0.39465, 2.03211) + Y;
- //end
- //begin Paste03
- //end
- }
- technique FyTyPostProcessing
- {
- pass
- {
- VertexShader = PostProcessVS;
- PixelShader = PostProcessingPass;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement