More code mess.
Technicolor effect 3 strip (2 strip after it). 3 Strip method collides with SSS as both will increase red saturation in skin, so be aware of that.
3Strip a bit more funky.
GUI ELEMENTS
Code: Select all
bool Section_TC <
string UIName = "------Technicolor Effect----";
> = {false};
bool use_technicolor <
string UIName="Enable Technicolor";
> = {false};
float3 colStrengthD <
string UIName="Technicolor Color Strength Day";
string UIWidget="Color";
> = {0.5, 0.5, 0.5};
float brightnessD <
string UIName="Technicolor Brightness Day";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float techStrengthD <
string UIName="Technicolor Amount Day";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float3 colStrengthN <
string UIName="Technicolor Color Strength Night";
string UIWidget="Color";
> = {0.5, 0.5, 0.5};
float brightnessN <
string UIName="Technicolor Brightness Night";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float techStrengthN <
string UIName="Technicolor Amount Night";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float3 colStrengthI <
string UIName="Technicolor Color Strength Interior";
string UIWidget="Color";
> = {0.5, 0.5, 0.5};
float brightnessI <
string UIName="Technicolor Brightness Interior";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float techStrengthI <
string UIName="Technicolor Amount Interior";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
Code: Select all
////////////////////////////////////
// Technicolor //
////////////////////////////////////
//By prod80 [ http://www.nexusmods.com/skyrim/users/6440158/ ]
//Source: Rework of this Final Cut effect: http://pistolerapost.com/tech/2strip.html
if (use_technicolor==true)
{
float3 colStrength = lerp( lerp( colStrengthN, colStrengthD, ENightDayFactor ), colStrengthI, EInteriorFactor );
float brightness = lerp( lerp( brightnessN, brightnessD, ENightDayFactor ), brightnessI, EInteriorFactor );
float techStrength = lerp( lerp( techStrengthN, techStrengthD, ENightDayFactor ), techStrengthI, EInteriorFactor );
float3 source = saturate( color.rgb );
float3 temp = 1-source.rgb;
float3 target = temp.grg;
float3 target2 = temp.bbr;
float3 temp2 = source.rgb * target.rgb;
temp2.rgb *= target2.rgb;
temp.rgb = temp2.rgb * colStrength.rgb;
temp2.rgb *= brightness;
target.rgb = temp.grg;
target2.rgb = temp.bbr;
temp.rgb = source.rgb - target.rgb;
temp.rgb += temp2.rgb;
temp2.rgb = temp.rgb - target2.rgb;
color.rgb = lerp( source.rgb, temp2.rgb, techStrength );
}
2 STRIP
------------------------------------------------------------------------------------------------
GUI ELEMENTS
Code: Select all
bool Section_TC2 <
string UIName = "------Technicolor 2 Strip---";
> = {false};
bool use_t2s <
string UIName="Enable Technicolor 2 Strip";
> = {false};
float3 rChannelD <
string UIName="Technicolor 2s Red Day";
string UIWidget="Color";
> = {1, 0.165, 0};
float3 gChannelD <
string UIName="Technicolor 2s Green Day";
string UIWidget="Color";
> = {0.294, 1, 0};
float3 bChannelD <
string UIName="Technicolor 2s Blue Day";
string UIWidget="Color";
> = {0.0588, 0.902, 0};
float3 rChannelN <
string UIName="Technicolor 2s Red Night";
string UIWidget="Color";
> = {1, 0.165, 0};
float3 gChannelN <
string UIName="Technicolor 2s Green Night";
string UIWidget="Color";
> = {0.294, 1, 0};
float3 bChannelN <
string UIName="Technicolor 2s Blue Night";
string UIWidget="Color";
> = {0.0588, 0.902, 0};
float3 rChannelI <
string UIName="Technicolor 2s Red Interior";
string UIWidget="Color";
> = {1, 0.165, 0};
float3 gChannelI <
string UIName="Technicolor 2s Green Interior";
string UIWidget="Color";
> = {0.294, 1, 0};
float3 bChannelI <
string UIName="Technicolor 2s Blue Interior";
string UIWidget="Color";
> = {0.0588, 0.902, 0};
float strip2vibD <
string UIName="Technicolor 2s Saturation Boost Day";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float strip2vibN <
string UIName="Technicolor 2s Saturation Boost Night";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float strip2vibI <
string UIName="Technicolor 2s Saturation Boost Interior";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {0.3};
float techStrength2D <
string UIName="Technicolor 2s Amount Day";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float techStrength2N <
string UIName="Technicolor 2s Amount Night";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
float techStrength2I <
string UIName="Technicolor 2s Amount Interior";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
float UIStep=0.001;
> = {1.0};
Code: Select all
float3 HUEToRGB(in float H)
{
float R = abs(H * 6 - 3) - 1;
float G = 2 - abs(H * 6 - 2);
float B = 2 - abs(H * 6 - 4);
return saturate(float3(R,G,B));
}
float Epsilon = 1e-10;
float3 RGBToHCV(in float3 RGB)
{
// Based on work by Sam Hocevar and Emil Persson
float4 P = (RGB.g < RGB.b) ? float4(RGB.bg, -1.0, 2.0/3.0) : float4(RGB.gb, 0.0, -1.0/3.0);
float4 Q = (RGB.r < P.x) ? float4(P.xyw, RGB.r) : float4(RGB.r, P.yzx);
float C = Q.x - min(Q.w, Q.y);
float H = abs((Q.w - Q.y) / (6 * C + Epsilon) + Q.z);
return float3(H, C, Q.x);
}
float3 RGBToHSL(in float3 RGB)
{
float3 HCV = RGBToHCV(RGB);
float L = HCV.z - HCV.y * 0.5;
float S = HCV.y / (1 - abs(L * 2 - 1) + Epsilon);
return float3(HCV.x, S, L);
}
float3 HSLToRGB(in float3 HSL)
{
float3 RGB = HUEToRGB(HSL.x);
float C = (1 - abs(2 * HSL.z - 1)) * HSL.y;
return (RGB - 0.5) * C + HSL.z;
}
Code: Select all
////////////////////////////////////
// Technicolor 2-Strip //
////////////////////////////////////
//By prod80, based on PS Channel Mixer effect [ http://www.nexusmods.com/skyrim/users/6440158/ ]
if ( use_t2s == true )
{
float3 rChannel = lerp( lerp( rChannelN, rChannelD, ENightDayFactor ), rChannelI, EInteriorFactor );
float3 gChannel = lerp( lerp( gChannelN, gChannelD, ENightDayFactor ), gChannelI, EInteriorFactor );
float3 bChannel = lerp( lerp( bChannelN, bChannelD, ENightDayFactor ), bChannelI, EInteriorFactor );
float strip2vib = lerp( lerp( strip2vibN, strip2vibD, ENightDayFactor ), strip2vibI, EInteriorFactor );
float techStrength2 = lerp( lerp( techStrength2N, techStrength2D, ENightDayFactor ), techStrength2I, EInteriorFactor );
color.rgb = saturate( color.rgb );
float t2stripRed = dot( color.rgb, rChannel.rgb / dot( rChannel.rgb, 1 ));
float t2stripGreen = dot( color.rgb, gChannel.rgb / dot( gChannel.rgb, 1 ));
float t2stripBlue = dot( color.rgb, bChannel.rgb / dot( bChannel.rgb, 1 ));
float3 t2scolor = float3( t2stripRed, t2stripGreen, t2stripBlue );
t2scolor.rgb = saturate( t2scolor.rgb );
t2scolor.rgb = RGBToHSL( t2scolor.rgb );
t2scolor.g = t2scolor.g + (( 1.0f - t2scolor.g ) * ( strip2vib * t2scolor.g ));
t2scolor.rgb = HSLToRGB( t2scolor.rgb );
color.rgb = lerp( color.rgb, t2scolor.rgb, techStrength2 );
}