Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //++++++++++++++++++++++++++++++++++++++++++++//
- // ENBSeries Effect file //
- // visit http://enbdev.com for updates //
- // Copyright (c) 2007-2012 Boris Vorontsov //
- // Modified by Michael Tichenor (IndigoNeko) //
- //++++++++++++++++++++++++++++++++++++++++++++//
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
- // --JawZ-- Mixed enbeffect.fx //
- // Code blend between Boris, HD6 and ENB Evolved enbeffect.fx //
- // Nexus profile - http://skyrim.nexusmods.com/users/196978 //
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
- /****************************************************************/
- /***Kermles' Post Processing 6 based on work/ideas by --Jawz--,**/
- /*******HeliosDoubleSix, saltr, IndigoNeko, dpeasant, and *******/
- /************************Boris Vorontsov*************************/
- /****************************************************************/
- //////////////////////////////////////////////////////////////////////////////////////////////////////////
- //PS If I accidentally have left code in here that you think is yours and you have not been credited//////
- //please let me know! I can be found on ENB forums and Skyrim Nexus under the name Kermles :) Please//////
- //don't hesitate to contact me for anything you need! Or just to say hi! :D///////////////////////////////
- //////////////////////////////////////////////////////////////////////////////////////////////////////////
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // MAIN EFFECT ACTIVATION
- #define POSTPROCESS 2 // Choose which post-processing effect to use
- //#define APPLYGAMECOLORCORRECTION // This only applies to the PP 5 effects
- //#define ENB_FLIPTECHNIQUE // This will tunr every effect in here off.
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // SECONDARY EFFECT ACTIVATION
- // Dammit how do I flip it? Why don't all floats and defines use the same DNI calls? Raaaage!
- //#define ENABLE_FLIP_INT_EXT_FACTOR // Flips the interior and exterior factor, so that interior settings affect exteriors and vice versa.
- #define ENABLE_FLIP_NITE_DAY_FACTOR // Flips the day and night factor, so that day settings affect nights and vice versa.
- #define HD6_BLOOM_DEBLUEIFY // Removes blue tint from bloom, most apparent in distant fog
- #define HD6_BLOOM_DEFUZZ // Old weird serendipitous code to defuzz bloom
- #define ENABLE_ENB_PALETTE // Enable ENB Palette Mapping. "UsePaletteTexture" must be enabled in enbseries.ini
- // #define ENABLE_ENB_BLOOM // Enable ENB Bloom.
- #define DIFFUSE_BLOOM // More precise bloom that doesn't bloom the whole screen as HD6 bloom tends to do.
- // #define COMBINE_BLOOM // If enabled ENB will use both the ENB bloom and Vanilla bloom together.
- // #define HD6_BLOOM_CRISP // HD6 - BLOOM v1 - alternate crisp bloom, no hazey mud.
- // #define HD6_BLOOM_SCREEN // HD6 - BLOOM v2 - alternate bloom (using screen mode) I have abadoned this code.
- #define USE_BLOOM_HSV // Use HSV color correction for bloom. See ENB Bloom settings below.
- // #define USE_BLOOM_LERP // Use interpolation for bloom, shifting the final colors towards the bloom colors.
- // #define USE_BLOOM_ADD // Use addition for bloom, adding it to final color. WARNING: EXPERIMENTAL.
- #define JZ_BLOOM_COLORIZATION // With this enabled you can adjust the colorization of the bloom.
- #define ENABLE_HSV // Enable HSV color correction. See HSV Color Correction settings below.
- #define USE_HSV_SMOOTH // Use smoothstep color controls for overall color control.
- #define USE_HSV_CURVE // Use power curve color controls for overall color control.
- #define USE_HSV_EQUALIZER // Use Color Equalizer system for specific color control.
- #define JZ_COLOR_FILTER // Adjusts the RGB values seperately, Red, Green and Blue.
- // #define ENABLE_LETTERBOX_BARS // Enable cinematic bars (black bars at top and bottom).
- // #define ENABLE_INTERLACE_VERTICAL // Enable vertical interlacing (vertical striping).
- // #define ENABLE_INTERLACE_HORIZONTAL // Enable horizontal interlacing (horizontal striping).
- // #define ENABLE_VIGNETTE // Enable vignette effect (black ring around screen).
- // #define ENABLE_SEPIATONE // Enable sepia tone effect (turns everything orange).
- // #define ENABLE_GRAIN // Enable grain effect (puts speckles on screen).
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // INTERNAL PARAMETERS BEGINS HERE, CAN BE MODIFIED
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // HD6_BLOOM_DEBLUEIFY
- // Red, Green, Blue
- float3 bsatd = float3( 1.0, 0.74, 0.64 ); // Daytime Deblueify
- // Red, Green, Blue
- float3 bsatn = float3( 1.0, 0.74, 0.64 ); // Nighttime Deblueify
- // Red, Green, Blue
- float3 bsati = float3( 1.0, 0.74, 0.64 ); // Interior Deblueify
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // Palette mixer settings - Must have "UsePaletteTexture" enabled in the enbseries.ini file for these settings have an effect.
- float palmixDay=1.0; // Controls the intensity of the enbpalette.bmp
- float palmixNight=0.7; // Controls the intensity of the enbpalette.bmp
- float palmixInterior=1.0; // Controls the intensity of the enbpalette.bmp
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // COLOR SETTINGS
- //NOTE; IF YOU SET BOTH RED, GREEN AND BLUE AT THE SAME VALUE IT WILL ACT AS AN BRIGHTNESS COMMAND. SAME GOES FOR MAGENTA, CYAN AND YELLOW.
- // Red, Green, Blue
- float3 EColorFilterDay = float3 ( 1.0, 1.0, 1.0 ); // Adjusts the RGB values seperately, Red, Green and Blue.
- float3 EColorFilterNight = float3 ( 0.95, 1.05, 1.1 ); // Adjusts the RGB values seperately, Red, Green and Blue.
- float3 EColorFilterInterior = float3 ( 1.0, 1.0, 1.0 ); // Adjusts the RGB values seperately, Red, Green and Blue.
- float3 EColorFilterSubDay = float3 ( 0.0, 0.0, 0.0 ); // Subtract the RGB values seperately, Red, Green and Blue.
- float3 EColorFilterSubNight = float3 ( 0.0, 0.0, 0.0 ); // Subtract the RGB values seperately, Red, Green and Blue.
- float3 EColorFilterSubInterior = float3 ( 0.0, 0.0, 0.0 ); // Subtract the RGB values seperately, Red, Green and Blue
- // DAY
- float MAGENTADay = 1.0; // Adds specified amount of magenta color
- float MAGENTAsubDay = 0.0; // Subtracts specified amount of magenta color
- float CYANDay = 1.0; // Adds specified amount of cyan color
- float CYANsubDay = 0.0; // Subtracts specified amount of cyan color
- float YELLOWDay = 1.0; // Adds specified amount of yellow color
- float YELLOWsubDay = 0.0; // Subtracts specified amount of yellow color
- // NIGHT
- float MAGENTANight = 1.0; // Adds specified amount of magenta color
- float MAGENTAsubNight = 0.0; // Subtracts specified amount of magenta color
- float CYANNight = 1.0; // Adds specified amount of cyan color
- float CYANsubNight = 0.0; // Subtracts specified amount of cyan color
- float YELLOWNight = 1.0; // Adds specified amount of yellow color
- float YELLOWsubNight = 0.0; // Subtracts specified amount of yellow color
- // INTERIOR
- float MAGENTAInterior = 1.0; // Adds specified amount of magenta color
- float MAGENTAsubInterior = 0.0; // Subtracts specified amount of magenta color
- float CYANInterior = 1.0; // Adds specified amount of cyan color
- float CYANsubInterior = 0.0; // Subtracts specified amount of cyan color
- float YELLOWInterior = 1.0; // Adds specified amount of yellow color
- float YELLOWsubInterior = 0.0; // Subtracts specified amount of yellow color
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // ENB Bloom Day settings.
- float fBloomIntensityMultDay = 1.0; // Controls brightness of bloom. Higher values are brighter.
- float fBloomIntensityModDay = 0.0; // Controls brightness of bloom. Higher values are brighter.
- float fBloomIntensityCurveDay = 1.0; // Controls brightness curve of bloom. Higher values make midranges darker.
- float fBloomIntensitySmoothDay = 0.0; // Controls brightness contrast of bloom. Makes darks darker and brights brighter.
- float fBloomIntensityMaxDay = 10.0; // Controls brightness maximum of bloom.
- float fBloomSaturationMultDay = 1.0; // Controls the saturation of bloom. Higher values are more colorful.
- float fBloomSaturationCurveDay = 1.0; // Controls the saturation curve of bloom. Higher values reduce midrange colors.
- float fBloomSaturationSmoothDay = 0.0; // Controls the saturation contrast of bloom. Reduces subtle coloring.
- // ENB Bloom Night settings.
- float fBloomIntensityMultNight = 1.0; // Controls brightness of bloom. Higher values are brighter.
- float fBloomIntensityModNight = 0.0; // Controls brightness of bloom. Higher values are brighter.
- float fBloomIntensityCurveNight = 1.0; // Controls brightness curve of bloom. Higher values make midranges darker.
- float fBloomIntensitySmoothNight = 0.0; // Controls brightness contrast of bloom. Makes darks darker and brights brighter.
- float fBloomIntensityMaxNight = 10.0; // Controls brightness maximum of bloom.
- float fBloomSaturationMultNight = 1.0; // Controls the saturation of bloom. Higher values are more colorful.
- float fBloomSaturationCurveNight = 1.0; // Controls the saturation curve of bloom. Higher values reduce midrange colors.
- float fBloomSaturationSmoothNight = 0.0; // Controls the saturation contrast of bloom. Reduces subtle coloring.
- // ENB Bloom Interior settings.
- float fBloomIntensityMultInterior = 1.0; // Controls brightness of bloom. Higher values are brighter.
- float fBloomIntensityModInterior = 0.0; // Controls brightness of bloom. Higher values are brighter.
- float fBloomIntensityCurveInterior = 1.0; // Controls brightness curve of bloom. Higher values make midranges darker.
- float fBloomIntensitySmoothInterior = 0.0; // Controls brightness contrast of bloom. Makes darks darker and brights brighter.
- float fBloomIntensityMaxInterior = 10.0; // Controls brightness maximum of bloom.
- float fBloomSaturationMultInterior = 1.0; // Controls the saturation of bloom. Higher values are more colorful.
- float fBloomSaturationCurveInterior = 1.0; // Controls the saturation curve of bloom. Higher values reduce midrange colors.
- float fBloomSaturationSmoothInterior = 0.0; // Controls the saturation contrast of bloom. Reduces subtle coloring.
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // BLOOM COLORIZATION SETTINGS
- //NOTE; IF YOU SET BOTH RED, GREEN AND BLUE AT THE SAME VALUE IT WILL ACT AS AN AMOUNT COMMAND. SAME GOES FOR MAGENTA, CYAN AND YELLOW VALUES.
- // DAY Red, Green, Blue
- float3 bloommultDay = float3( 1.0, 1.0, 1.0 ); // Increase Red, Green and Blue bloom colors seperately
- float3 bloomsubDay = float3( 0.0, 0.0, 0.0 ); // Alters appearance of the Red, Green and Blue bloom colors
- float MAGENTAbloomDay = 1.0; // Increases the amount of magenta color there is in bloom
- float CYANbloomDay = 1.0; // Increases the amount of cyan color there is in bloom
- float YELLOWbloomDay = 1.0; // Increases the amount of yellow color there is in bloom
- // NIGHT Red, Green, Blue
- float3 bloommultNight = float3( 1.0, 1.0, 1.0 ); // Increase Red, Green and Blue bloom colors seperately
- float3 bloomsubNight = float3( 0.0, 0.0, 0.0 ); // Alters appearance of the Red, Green and Blue bloom colors
- float MAGENTAbloomNight = 1.0; // Increases the amount of magenta color there is in bloom
- float CYANbloomNight = 1.0; // Increases the amount of cyan color there is in bloom
- float YELLOWbloomNight = 1.0; // Increases the amount of yellow color there is in bloom
- // INTERIOR Red, Green, Blue
- float3 bloommultInterior = float3( 1.0, 0.9, 2.6 ); // Increase Red, Green and Blue bloom colors seperately
- float3 bloomsubInterior = float3( 0.0, 0.0, -0.02 ); // Alters appearance of the Red, Green and Blue bloom colors
- float MAGENTAbloomInterior = 1.0; // Increases the amount of magenta color there is in bloom
- float CYANbloomInterior = 1.0; // Increases the amount of cyan color there is in bloom
- float YELLOWbloomInterior = 1.0; // Increases the amount of yellow color there is in bloom
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // Diffuse Bloom Day settings.
- float REDDay = 0.8; // Controls the red level in the diffuse bloom
- float GREENDay = 0.8; // Controls the green level in the diffuse bloom
- float BLUEDay = 0.8; // Controls the blue level in the diffuse bloom
- float SatDay = 1.2; // Controls the saturation of the diffuse bloom
- float LumaDay = 1.1; // Controls the Luminosity/brightness of the diffuse bloom
- float PowDay = 3.0; // Dampens the bloom, making it less visible
- float Pow2Day = 0.0001; // Dampens the bloom, making it less visible
- // Diffuse Bloom Night settings.
- float REDNight = 1.0; // Controls the red level in the diffuse bloom
- float GREENNight = 1.0; // Controls the green level in the diffuse bloom
- float BLUENight = 1.0; // Controls the blue level in the diffuse bloom
- float SatNight = 1.0; // Controls the saturation of the diffuse bloom
- float LumaNight = 1.0; // Controls the Luminosity/brightness of the diffuse bloom
- float PowNight = 4.0; // Dampens the bloom, making it less visible
- float Pow2Night = 0.0001; // Dampens the bloom, making it less visible
- // Diffuse Bloom Interior settings.
- float REDInterior = 1.0; // Controls the red level in the diffuse bloom
- float GREENInterior = 1.0; // Controls the green level in the diffuse bloom
- float BLUEInterior = 1.0; // Controls the blue level in the diffuse bloom
- float SatInterior = 1.0; // Controls the saturation of the diffuse bloom
- float LumaInterior = 1.0; // Controls the Luminosity/brightness of the diffuse bloom
- float PowInterior = 1.0; // Dampens the bloom, making it less visible
- float Pow2Interior = 0.0001; // Dampens the bloom, making it less visible
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // HD6 BLOOM CRISP - Alternate crisp bloom, no hazey mud.
- //DAY
- float3 LumCoeffDay = ( 0.2125, 0.7154, 0.0721 ); // Increases brightness around "bloomy" spots
- float3 AvgLuminDay = ( 0.5, 0.5, 0.5 ); // Increases contrast around "bloomy" spots
- float TrigDay = 0.0; // Limits what triggers a bloom
- float SBrightDay = 0.5; // Limits bloom to superbright spots only
- float CBrightnessDay = 1.0; // Adjust the bloom brightness
- float CContrastDay = 1.1; // Adjust the bloom contrast
- float CSaturationDay = 1.0; // Adjust the bloom saturation
- float BrightnessModDay = 0.0; // Compensate the brightness when no bloom is used
- float BrightnessMultDay = 1.0; // Compensate the brightness when no bloom is used
- float CompSBDay = 1.0; // Limits where the bloom will "bloom"
- float BloomStrDay = 1.0; // How strong the bloom will be
- float BloomBlendDay = 0.5; // How much blend there will be between ENB and Vanilla bloom
- float BlendCompDay = 1.0; // Compensate for brightening caused by above bloom blend
- //NIGHT
- float3 LumCoeffNight = ( 0.2125, 0.7154, 0.0721 ); // Increases brightness around "bloomy" spots
- float3 AvgLuminNight = ( 0.5, 0.5, 0.5 ); // Increases contrast around "bloomy" spots
- float TrigNight = 0.0; // Limits what triggers a bloom
- float SBrightNight = 0.7; // Limits bloom to superbright spots only
- float CBrightnessNight = 1.0; // Adjust the bloom brightness
- float CContrastNight = 1.1; // Adjust the bloom contrast
- float CSaturationNight = 1.0; // Adjust the bloom saturation
- float BrightnessModNight = 0.0; // Compensate the brightness when no bloom is used
- float BrightnessMultNight = 1.0; // Compensate the brightness when no bloom is used
- float CompSBNight = 1.0; // Limits where the bloom will "bloom"
- float BloomStrNight = 1.0; // How strong the bloom will be
- float BloomBlendNight = 0.5; // How much blend there will be between ENB and Vanilla bloom
- float BlendCompNight = 1.0; // Compensate for brightening caused by above bloom blend
- //INTERIOR
- float3 LumCoeffInterior = ( 0.2125, 0.7154, 0.0721 ); // Increases brightness around "bloomy" spots
- float3 AvgLuminInterior = ( 0.5, 0.5, 0.5 ); // Increases contrast around "bloomy" spots
- float TrigInterior = 0.18; // Limits what triggers a bloom
- float SBrightInterior = 0.7; // Limits bloom to superbright spots only
- float CBrightnessInterior = 1.0; // Adjust the bloom brightness
- float CContrastInterior = 1.1; // Adjust the bloom contrast
- float CSaturationInterior = 0.8; // Adjust the bloom saturation
- float BrightnessModInterior = 0.0; // Compensate the brightness when no bloom is used
- float BrightnessMultInterior = 1.0; // Compensate the brightness when no bloom is used
- float CompSBInterior = 1.0; // Limits where the bloom will "bloom"
- float BloomStrInterior = 1.0; // How strong the bloom will be
- float BloomBlendInterior = 0.5; // How much blend there will be between ENB and Vanilla bloom
- float BlendCompInterior = 1.0; // Compensate for brightening caused by above bloom blend
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // HSV Color Correction settings.
- // HSV Daytime Settings
- float fColorSaturationMultDay = 0.9; // Controls the color saturation multiplier. Range: 0.0 (greyscale) to 2.0 (hypercolor).
- float fColorSaturationModDay = 0.0; // Controls the color saturation. Range: -1 to 1. Default: 0.0
- float fColorSaturationCurveDay = 1.0; // Controls the color saturation curve. Default: 1.0.
- float fColorSaturationSmoothDay = 0.0; // Controls the color saturation contrast. Default: 0.0.
- float fColorIntensityMultDay = 1.0; // Controls the color intensity multiplier. Default: 1.0
- float fColorIntensityModDay = 0.0; // Controls the color brightness. Range: -1 to 1. Default: 0.0
- float fColorIntensityCurveDay = 1.0; // Controls the color intensity curve. Default: 1.0
- float fColorIntensitySmoothDay = 0.0; // Controls the color intensity contrast. Default: 0.0.
- float fColorHueMultDay = 1.0; // Controls the color hue multiplier. Default: 1.0
- float fColorHueModDay = 0.0; // Controls the color hue. Range: -1 to 1. Default: 0.0
- float fColorHueCurveDay = 1.0; // Controls the color hue curve. Default: 1.0.
- float fColorHueSmoothDay = 0.0; // Controls the color hue contrast. Default: 0.0.
- // HSV Nighttime Settings
- float fColorSaturationMultNight = 1.0; // Controls the color saturation multiplier. Range: 0.0 (greyscale) to 2.0 (hypercolor).
- float fColorSaturationModNight = 0.0; // Controls the color saturation. Range: -1 to 1. Default: 0.0
- float fColorSaturationCurveNight = 1.0; // Controls the color saturation curve. Default: 1.0.
- float fColorSaturationSmoothNight = 0.0; // Controls the color saturation contrast. Default: 0.0.
- float fColorIntensityMultNight = 1.0; // Controls the color intensity multiplier. Default: 1.0
- float fColorIntensityModNight = 0.0; // Controls the color brightness. Range: -1 to 1. Default: 0.0
- float fColorIntensityCurveNight = 1.0; // Controls the color intensity curve. Default: 1.0
- float fColorIntensitySmoothNight = 0.0; // Controls the color intensity contrast. Default: 0.0.
- float fColorHueMultNight = 1.0; // Controls the color hue multiplier. Default: 1.0
- float fColorHueModNight = 0.0; // Controls the color hue. Range: -1 to 1. Default: 0.0
- float fColorHueCurveNight = 1.0; // Controls the color hue curve. Default: 1.0.
- float fColorHueSmoothNight = 0.0; // Controls the color hue contrast. Default: 0.0.
- // HSV Interior Settings
- float fColorSaturationMultInterior = 1.0; // Controls the color saturation multiplier. Range: 0.0 (greyscale) to 2.0 (hypercolor).
- float fColorSaturationModInterior = 0.0; // Controls the color saturation. Range: -1 to 1. Default: 0.0
- float fColorSaturationCurveInterior = 1.0; // Controls the color saturation curve. Default: 1.0.
- float fColorSaturationSmoothInterior = 0.0; // Controls the color saturation contrast. Default: 0.0.
- float fColorIntensityMultInterior = 1.0; // Controls the color intensity multiplier. Default: 1.0
- float fColorIntensityModInterior = 0.0; // Controls the color brightness. Range: -1 to 1. Default: 0.0
- float fColorIntensityCurveInterior = 1.0; // Controls the color intensity curve. Default: 1.0
- float fColorIntensitySmoothInterior = 0.0; // Controls the color intensity contrast. Default: 0.0.
- float fColorHueMultInterior = 1.0; // Controls the color hue multiplier. Default: 1.0
- float fColorHueModInterior = 0.0; // Controls the color hue. Range: -1 to 1. Default: 0.0
- float fColorHueCurveInterior = 1.0; // Controls the color hue curve. Default: 1.0.
- float fColorHueSmoothInterior = 0.0; // Controls the color hue contrast. Default: 0.0.
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // HSV Equalizer settings.
- // Adjust multiplier and modifier of specific color saturations. Default: 0.0
- float fColorSaturationMultRed = 0.0;
- float fColorSaturationMultOrange = 0.0;
- float fColorSaturationMultYellow = 0.0;
- float fColorSaturationMultGreen = 0.0;
- float fColorSaturationMultCyan = 0.0;
- float fColorSaturationMultBlue = 0.0;
- float fColorSaturationMultMagenta = 0.0;
- float fColorSaturationModRed = 0.0;
- float fColorSaturationModOrange = 0.0;
- float fColorSaturationModYellow = 0.0;
- float fColorSaturationModGreen = 0.0;
- float fColorSaturationModCyan = 0.0;
- float fColorSaturationModBlue = 0.0;
- float fColorSaturationModMagenta = 0.0;
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // Letterbox settings.
- float fLetterboxBarHeightDay = 0.02; // Controls the height of cinematic bars. Default: 0.1.
- float fLetterboxBarHeightNight = 0.02; // Controls the height of cinematic bars. Default: 0.1.
- float fLetterboxBarHeightInterior = 0.02; // Controls the height of cinematic bars. Default: 0.1.
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // Vertical Interlace settings.
- float fInterlaceVerticalWidthDay = 1.0; // Controls the width of interlace bars in pixels. Default: 1.0.
- float fInterlaceVerticalWidthNight = 1.0; // Controls the width of interlace bars in pixels. Default: 1.0.
- float fInterlaceVerticalWidthInterior = 1.0; // Controls the width of interlace bars in pixels. Default: 1.0.
- // Horizontal Interlace settings.
- float fInterlaceHorizontalWidthDay = 1.0; // Controls the width of interlace bars in pixels. Default: 1.0.
- float fInterlaceHorizontalWidthNight = 1.0; // Controls the width of interlace bars in pixels. Default: 1.0.
- float fInterlaceHorizontalWidthInterior = 1.0; // Controls the width of interlace bars in pixels. Default: 1.0.
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // Vignette settings Day.
- float fVignetteRadiusDay = 0.25; // Controls how large the radius of the vignette is. Larger numbers make the ring larger.
- float fVignetteSharpnessDay = 0.025; // Controls how sharp the edge of the vignette is. Larger numbers make edge of the ring sharper.
- float fVignetteCurveDay = 2.0; // Controls the blending of the vignette.
- float2 fVignetteCenterDay = float2( 0.5, 0.5 ); // Controls the position of the vignette center on the screen.
- float2 fVignetteScaleDay = float2( 1.0, 1.0 ); // Controls the horizontal and vertical scaling of vignette.
- // Vignette settings Night.
- float fVignetteRadiusNight = 0.25; // Controls how large the radius of the vignette is. Larger numbers make the ring larger.
- float fVignetteSharpnessNight = 0.025; // Controls how sharp the edge of the vignette is. Larger numbers make edge of the ring sharper.
- float fVignetteCurveNight = 2.0; // Controls the blending of the vignette.
- float2 fVignetteCenterNight = float2( 0.5, 0.5 ); // Controls the position of the vignette center on the screen.
- float2 fVignetteScaleNight = float2( 1.0, 1.0 ); // Controls the horizontal and vertical scaling of vignette.
- // Vignette settings Interior.
- float fVignetteRadiusInterior = 0.25; // Controls how large the radius of the vignette is. Larger numbers make the ring larger.
- float fVignetteSharpnessInterior = 0.025; // Controls how sharp the edge of the vignette is. Larger numbers make edge of the ring sharper.
- float fVignetteCurveInterior = 2.0; // Controls the blending of the vignette.
- float2 fVignetteCenterInterior = float2( 0.5, 0.5 ); // Controls the position of the vignette center on the screen.
- float2 fVignetteScaleInterior = float2( 1.0, 1.0 ); // Controls the horizontal and vertical scaling of vignette.
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // Sepia Tone settings Day.
- float3 fSepiaColorDay = float3( 1.0, 0.85 , 0.7 ); // Controls color of sepia tone.
- float fSepiaDesaturationDay = 0.5; // Controls amount of sepia color applied to image.
- float fSepiaExposureDay = 1.2; // Controls exposure of sepia tone.
- // Sepia Tone settings Night.
- float3 fSepiaColorNight = float3( 1.0, 0.85 , 0.7 ); // Controls color of sepia tone.
- float fSepiaDesaturationNight = 0.5; // Controls amount of sepia color applied to image.
- float fSepiaExposureNight = 1.2; // Controls exposure of sepia tone.
- // Sepia Tone settings Interior.
- float3 fSepiaColorInterior = float3( 1.0, 0.85 , 0.7 ); // Controls color of sepia tone.
- float fSepiaDesaturationInterior = 0.5; // Controls amount of sepia color applied to image.
- float fSepiaExposureInterior = 1.2; // Controls exposure of sepia tone.
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // Grain settings Day.
- float fGrainIntensityDay = 0.1; // Controls the intensity of the grain effect.
- float fGrainSaturationDay = 0.25; // Controls the color saturation of the grain effect.
- float fGrainMotionDay = 0.05; // Controls how rapidly the grain effect changes over time.
- // Grain settings Night.
- float fGrainIntensityNight = 0.1; // Controls the intensity of the grain effect.
- float fGrainSaturationNight = 0.25; // Controls the color saturation of the grain effect.
- float fGrainMotionNight = 0.05; // Controls how rapidly the grain effect changes over time.
- // Grain settings Interior.
- float fGrainIntensityInterior = 0.025; // Controls the intensity of the grain effect.
- float fGrainSaturationInterior = 0.05; // Controls the color saturation of the grain effect.
- float fGrainMotionInterior = 0.025; // Controls how rapidly the grain effect changes over time.
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // MODIFY THESE VALUES BELOW TO TWEAK VARIOUS COLOR PROCESSING OPTIONS
- // SET ALL VALUES TO 1.0 AND IT WILL GETA "VANILLA LOOKING" COLOR PROCESSING.
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //POSTPROCESS v1 by ENB
- #if POSTPROCESS == 1
- //DAY
- float EAdaptationMinV1Day = 0.01;
- float EAdaptationMaxV1Day = 0.07;
- float EContrastV1Day = 0.95;
- float EColorSaturationV1Day = 1.2;
- float EToneMappingCurveV1Day = 6.0;
- //NIGHT
- float EAdaptationMinV1Night = 0.01;
- float EAdaptationMaxV1Night = 0.15;
- float EContrastV1Night = 0.95;
- float EColorSaturationV1Night = 1.0;
- float EToneMappingCurveV1Night = 6.0;
- //INTERIOR
- float EAdaptationMinV1Interior = 0.01;
- float EAdaptationMaxV1Interior = 0.15;
- float EContrastV1Interior = 0.95;
- float EColorSaturationV1Interior = 1.0;
- float EToneMappingCurveV1Interior = 6.0;
- #endif
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //POSTPROCESS v2 by ENB (modifications and tweaks by Bronze316)
- #if POSTPROCESS == 2
- //DAY
- float EBrightnessV2Day=1.00;
- float EAdaptationMinV2Day=0.23;
- float EAdaptationMaxV2Day=0.52;
- float EToneMappingCurveV2Day=1.250;
- float EIntensityContrastV2Day=1.125;
- float EColorSaturationV2Day=0.85;
- float EToneMappingOversaturationV2Day=1060.0;
- float HCompensateSatV2Day = 0.80;
- //NIGHT
- float EBrightnessV2Night=1.0;
- float EAdaptationMinV2Night=0.04;
- float EAdaptationMaxV2Night=0.06;
- float EToneMappingCurveV2Night=2.0;
- float EIntensityContrastV2Night=1.475;
- float EColorSaturationV2Night=1;
- float EToneMappingOversaturationV2Night=1650.0;
- float HCompensateSatV2Night = 0.1;
- //INTERIOR
- float EBrightnessV2Interior=1.0;
- float EAdaptationMinV2Interior=0.02;
- float EAdaptationMaxV2Interior=0.06;
- float EToneMappingCurveV2Interior=22.0;
- float EIntensityContrastV2Interior=1.3;
- float EColorSaturationV2Interior=1.2;
- float EToneMappingOversaturationV2Interior=1650.0;
- float HCompensateSatV2Interior = 1.3;
- #endif
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //POSTPROCESS v3 by ENB
- #if POSTPROCESS == 3
- //DAY
- float EAdaptationMinV3Day = 0.08;
- float EAdaptationMaxV3Day = 0.125;
- float EToneMappingCurveV3Day = 1.75;
- float EToneMappingOversaturationV3Day = 260.0;
- //NIGHT
- float EAdaptationMinV3Night = 0.05;
- float EAdaptationMaxV3Night = 0.125;
- float EToneMappingCurveV3Night = 4.0;
- float EToneMappingOversaturationV3Night = 60.0;
- //Interior
- // float EAdaptationMinV3Interior = 0.04;
- // float EAdaptationMaxV3Interior = 0.06;
- float EAdaptationMinV3Interior = 0.08;
- float EAdaptationMaxV3Interior = 0.10;
- // float EAdaptationMinV3Interior = 0.10;
- // float EAdaptationMaxV3Interior = 0.125;
- float EToneMappingCurveV3Interior = 4.0;
- float EToneMappingOversaturationV3Interior = 60.0;
- #endif
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //POSTPROCESS v4 by ENB
- #if POSTPROCESS == 4
- //DAY
- float EAdaptationMinV4Day = 0.2;
- float EAdaptationMaxV4Day = 0.125;
- float EBrightnessCurveV4Day = 0.7;
- float EBrightnessMultiplierV4Day = 0.45;
- float EBrightnessToneMappingCurveV4Day = 0.5;
- //NIGHT
- float EAdaptationMinV4Night = 0.2;
- float EAdaptationMaxV4Night = 0.125;
- float EBrightnessCurveV4Night = 0.7;
- float EBrightnessMultiplierV4Night = 0.45;
- float EBrightnessToneMappingCurveV4Night = 0.5;
- //Interior
- float EAdaptationMinV4Interior = 0.2;
- float EAdaptationMaxV4Interior = 0.125;
- float EBrightnessCurveV4Interior = 0.7;
- float EBrightnessMultiplierV4Interior = 0.45;
- float EBrightnessToneMappingCurveV4Interior = 0.5;
- #endif
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //POSTPROCESS v5 by HD6 based on Post-process v2
- #if POSTPROCESS == 5
- //DAY
- float EAdaptationMinV5Day = 0.12;
- float EAdaptationMaxV5Day = 0.29;
- float EToneMappingCurveV5Day = 1.0;
- float EIntensityContrastV5Day = 1.0;
- float EColorSaturationV5Day = 1.0;
- float HCompensateSatV5Day = 1.0;
- //NIGHT
- float EAdaptationMinV5Night = 0.12;
- float EAdaptationMaxV5Night = 0.29;
- float EToneMappingCurveV5Night = 1.0;
- float EIntensityContrastV5Night = 1.0;
- float EColorSaturationV5Night = 1.0;
- float HCompensateSatV5Night = 1.0;
- //Interior
- float EAdaptationMinV5Interior = 0.12;
- float EAdaptationMaxV5Interior = 0.29;
- float EToneMappingCurveV5Interior = 1.0;
- float EIntensityContrastV5Interior = 1.0;
- float EColorSaturationV5Interior = 1.0;
- float HCompensateSatV5Interior = 1.0;
- #endif
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //Improved Tonemapping post processing effects Copyright (c) 2012 Brodiggan Gale edited by Kermles
- #if POSTPROCESS == 6
- //DAY
- float EBrightnessV6Day = 2.0; //higher than normal values needed for shadow and brightspot to work correctly
- float EIntensityContrastV6Day = 1.7; //very powerful, be careful of high values
- float EColorSaturationV6Day = 1.15; //very powerful, be careful of high values
- float HCompensateSatV6Day = 5.0; //higher than normal values needed for shadow and brightspot to work correctly
- float EAdaptationMinV6Day = 0.54; //works differently than usual, be careful with too high/too low values
- float EAdaptationMaxV6Day = 0.554; //works differently than usual, be careful with too high/too low values
- float EAdaptationCompensateV6Day = 0.9; //darkening that happens after adaptation, higher is darker
- float EBrightnessMinV6Day = 0.0; //clamps rgb brightness, range 0-1
- float EBrightnessMaxV6Day = 1.0; //clamps rgb brightness, range 0-1
- float EToneMappingCurveV6Day = 12;
- float EToneMappingOversaturationV6Day = 500.0;
- float EHSVDesatCurveDay = 1.0444444; //intelligent desaturation, idea credit goes to saltr. higher is less saturated
- ///////////////////////////////////Red Green Blue
- float3 EMoodColorDay = float3(0.55, 0.3, 0.1);
- float EMoodAmountDay = 1.0; //higher is stronger, range 0-1
- float EMoodCurveDay = 4.0; //lower is stronger, be careful of going under 1.0
- /////////////////////////////////////Red Green Blue
- float3 EShadowColorDay = float3(0.0, 0.0, 0.55); //unlike other two color controls, colors shadows/dark spots only. max is 2.55
- float EShadowThresholdDay = 1.0; //lower is stronger, be careful of low values under 0.4
- float EShadowCurveDay = 16.0; //lower is stronger, be careful of low values under 4
- //////////////////////////////////////////Red Green Blue
- float3 EBrightSpotColorDay = float3(0.0, 0.25, 2.55);
- float EBrightSpotThresholdDay = 0.8; //lower is stronger, be careful of low values under 0.4
- float EBrightSpotCurveDay = 38.0; //lower is stronger, be careful of low values under 4
- //NIGHT
- float EBrightnessV6Night=3.8;
- float EIntensityContrastV6Night=1.5;
- float EColorSaturationV6Night = 1.3;
- float HCompensateSatV6Night = 3.5;
- float EAdaptationMinV6Night = 0.58;
- float EAdaptationMaxV6Night = 0.24;
- float EAdaptationCompensateV6Night = 1.0;
- float EBrightnessMinV6Night = 0.00;
- float EBrightnessMaxV6Night = 7.0;
- float EToneMappingCurveV6Night = 18.0;
- float EToneMappingOversaturationV6Night = 500.0;
- float EHSVDesatCurveNight = 1.244444;
- /////////////////////////////////////Red Green Blue
- float3 EMoodColorNight = float3(0.5, 0.2, 0.85);
- float EMoodAmountNight = 0.0;
- float EMoodCurveNight = 2.0;
- ///////////////////////////////////////Red Green Blue
- float3 EShadowColorNight = float3(0.0, 0.0, 0.55);
- float EShadowThresholdNight = 1.0;
- float EShadowCurveNight = 18.0;
- ////////////////////////////////////////////Red Green Blue
- float3 EBrightSpotColorNight = float3(2.55, 1.75, 1.0);
- float EBrightSpotThresholdNight = 0.6;
- float EBrightSpotCurveNight = 48.0;
- //Interior
- float EBrightnessV6Interior=4.5;
- float EIntensityContrastV6Interior=1.7;
- float EColorSaturationV6Interior = 1.35;
- float HCompensateSatV6Interior = 5.0;
- float EAdaptationMinV6Interior = 0.64;
- float EAdaptationMaxV6Interior = 0.14;
- float EAdaptationCompensateV6Interior =1.6;
- float EBrightnessMinV6Interior = 0.0;
- float EBrightnessMaxV6Interior = 5.0;
- float EToneMappingCurveV6Interior =18.0;
- float EToneMappingOversaturationV6Interior = 4500.0;
- float EHSVDesatCurveInt = 1.144444;
- ///////////////////////////////////Red Green Blue
- float3 EMoodColorInt = float3(0.3, 0.0, 1.55);
- float EMoodAmountInt = 1.0;
- float EMoodCurveInt = 4.0;
- /////////////////////////////////////Red Green Blue
- float3 EShadowColorInt = float3(0.0, 0.0, 2.55);
- float EShadowThresholdInt = 1.0;
- float EShadowCurveInt = 18.0;
- /////////////////////////////////////////Red Green Blue
- float3 EBrightSpotColorInt = float3(2.55, 0.4, 0.0);
- float EBrightSpotThresholdInt = 1.0;
- float EBrightSpotCurveInt = 36.0;
- #endif
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // Improved Tonemapping Functions
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // fitRange: Take an input value (x) on the range [a, b] and return a value mapped to the range [c, d].
- float fitRange (float a, float b, float x, float c, float d) {
- // if ( a == b ) return (c + d)/2; //Invalid input range, there is no 1 to 1 mapping of the range [a,b] to [c,d]. Since no particular value is valid, return the average of [c,d].
- // if ( c == d ) return c; //Invalid output range, there is no 1 to 1 mapping of the range [a,b] to [c,d]. Regardless of the input value (x), the output will be equal to (c) when mapped to this invalid range.
- return ((d - c) * (x - a) / (b - a)) + c;
- }
- // pCurve: Takes an input value (x) on the range [-1, 1] and a curve depth (n), fits values to a bell (ish) curve (actually a portion of the Lorentz curve if (n) is equal to pi, but close enough).
- // Returns values for x=[-1, 1] ranging from 0 to 1, peeking at 1 where x = 0 (and falling to 0 at x=-1 and x=1). Values outside this range are negative.
- // Note: (n) must be positive and non-zero. This function must not be passed any value for n <= 0.0.
- float pCurve (float x, float n) {
- return ((n + 1) / (n * (1 + (n * pow(x, 2))))) - (1/n);
- }
- // sCurve: Takes an input value (x) on the range [-1, 1] and a curve depth (n), fits values to a smooth s-curve.
- // Returns values for x=(-1, 1] ranging from 0 to 1, peeking at 1.0 where x = 1. Values outside this range are invalid.
- // Note: The range (-1, 1] for (x) does not include -1.0. This function must not be passed x = -1.0.
- float sCurve (float x, float n) {
- return 1 / (1 + pow((1 - x)/(1 + x), n));
- }
- // peakCurve: Wrapper for pCurve, takes an input value (x) on the range [a,b], along with a curve depth (n),
- // Checks for invalid values, fits (x) to the appropriate range, then calls pCurve.
- float peakCurve (float a, float b, float x, float n) {
- if (n <= 0.0) return -1.0; // check for invalid curve depth (n)
- x = fitRange(a, b, x, -1.0, 1.0);
- return pCurve(x, n);
- }
- // smoothCurve: Wrapper for sCurve, takes an input value (x) on the range [a,b], along with a curve depth (n).
- // Checks for invalid values, fits (x) to the appropriate range, then calls sCurve.
- float smoothCurve (float a, float b, float x, float n) {
- if (x <= a) return 0.0; //return 0.0 if x is below the range.
- if (x >= b) return 1.0; //return 1.0 if x is below the range.
- x = fitRange(a, b, x, -1.0, 1.0);
- return sCurve(x, n);
- }
- // compoundCurve: Wrapper for sCurve, take an input value (x) and a crossover point (c) on the range [a,b], along with a curve depth (n).
- // Check for invalid values, fit x < c to the range (-1, 0] and x > c to the range [0, 1), call sCurve, then scale the result to the appropriate range based on c.
- float compoundCurve (float a, float b, float x, float n, float c) {
- if (x <= a) return 0.0; //return 0.0 if x is below the range.
- if (x >= b) return 1.0; //return 1.0 if x is below the range.
- if (c <= a) return -1.0; //invalid crossover point
- if (c >= b) return -1.0; //invalid crossover point
- float cMult = fitRange(a, b, c, 0.0, 2.0);
- if (x <= c) {
- return cMult * sCurve(fitRange(a, c, x, -1.0, 0.0), n);
- } else {
- return ((2.0 - cMult) * sCurve(fitRange(c, b, x, 0.0, 1.0), n)) + (cMult - 1);
- }
- }
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // EXTERNAL PARAMETERS BEGINS HERE, SHOULD NOT BE MODIFIED UNLESS YOU KNOW WHAT YOU ARE DOING!!!
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // List of floating point values for hues, used in equalizer.
- float fHueRed = 0.0;
- float fHueOrange = 0.08333333;
- float fHueYellow = 0.16666667;
- float fHueGreen = 0.33333333;
- float fHueCyan = 0.5;
- float fHueBlue = 0.66666667;
- float fHueMagenta = 0.83333333;
- float fHueRed2 = 1.0;
- ///////////////
- // FUNCTIONS //
- ///////////////
- float ColorEqualizerMult(in float H)
- {
- float SMult = 1.0;
- SMult += fColorSaturationMultRed * ( 1.0 - min( 1.0, abs( ( fHueRed - H ) / ( fHueRed - fHueOrange ) ) ) );
- SMult += fColorSaturationMultOrange * ( 1.0 - min( 1.0, abs( ( fHueOrange - H ) / ( fHueOrange - fHueYellow ) ) ) );
- SMult += fColorSaturationMultYellow * ( 1.0 - min( 1.0, abs( ( fHueYellow - H ) / ( fHueYellow - fHueGreen ) ) ) );
- SMult += fColorSaturationMultGreen * ( 1.0 - min( 1.0, abs( ( fHueGreen - H ) / ( fHueGreen - fHueYellow ) ) ) );
- SMult += fColorSaturationMultCyan * ( 1.0 - min( 1.0, abs( ( fHueCyan - H ) / ( fHueCyan - fHueGreen ) ) ) );
- SMult += fColorSaturationMultBlue * ( 1.0 - min( 1.0, abs( ( fHueBlue - H ) / ( fHueBlue - fHueCyan ) ) ) );
- SMult += fColorSaturationMultMagenta * ( 1.0 - min( 1.0, abs( ( fHueMagenta - H ) / ( fHueMagenta - fHueBlue ) ) ) );
- SMult += fColorSaturationMultRed * ( 1.0 - min( 1.0, abs( ( fHueRed2 - H ) / ( fHueRed2 - fHueMagenta ) ) ) );
- return SMult;
- }
- float ColorEqualizerMod(in float H)
- {
- float SMod = 0.0;
- SMod += fColorSaturationModRed * ( 1.0 - min( 1.0, abs( ( fHueRed - H ) / ( fHueRed - fHueOrange ) ) ) );
- SMod += fColorSaturationModOrange * ( 1.0 - min( 1.0, abs( ( fHueOrange - H ) / ( fHueOrange - fHueYellow ) ) ) );
- SMod += fColorSaturationModYellow * ( 1.0 - min( 1.0, abs( ( fHueYellow - H ) / ( fHueYellow - fHueGreen ) ) ) );
- SMod += fColorSaturationModGreen * ( 1.0 - min( 1.0, abs( ( fHueGreen - H ) / ( fHueGreen - fHueYellow ) ) ) );
- SMod += fColorSaturationModCyan * ( 1.0 - min( 1.0, abs( ( fHueCyan - H ) / ( fHueCyan - fHueGreen ) ) ) );
- SMod += fColorSaturationModBlue * ( 1.0 - min( 1.0, abs( ( fHueBlue - H ) / ( fHueBlue - fHueCyan ) ) ) );
- SMod += fColorSaturationModMagenta * ( 1.0 - min( 1.0, abs( ( fHueMagenta - H ) / ( fHueMagenta - fHueBlue ) ) ) );
- SMod += fColorSaturationModRed * ( 1.0 - min( 1.0, abs( ( fHueRed2 - H ) / ( fHueRed2 - fHueMagenta ) ) ) );
- return SMod;
- }
- float3 HUEtoRGB(in float H)
- {
- float R = abs(H * 6.0 - 3.0) - 1.0;
- float G = 2.0 - abs(H * 6.0 - 2.0);
- float B = 2.0 - abs(H * 6.0 - 4.0);
- return saturate(float3(R,G,B));
- }
- float RGBCVtoHUE(in float3 RGB, in float C, in float V)
- {
- float3 Delta = (V - RGB) / C;
- Delta.rgb -= Delta.brg;
- Delta.rgb += float3(2.0,4.0,6.0);
- Delta.brg = step(V, RGB) * Delta.brg;
- float H;
- H = max(Delta.r, max(Delta.g, Delta.b));
- return frac(H / 6.0);
- }
- float3 HSVtoRGB(in float3 HSV)
- {
- float3 RGB = HUEtoRGB(HSV.x);
- return ((RGB - 1) * HSV.y + 1) * HSV.z;
- }
- float3 RGBtoHSV(in float3 RGB)
- {
- float3 HSV = 0.0;
- HSV.z = max(RGB.r, max(RGB.g, RGB.b));
- float M = min(RGB.r, min(RGB.g, RGB.b));
- float C = HSV.z - M;
- if (C != 0.0)
- {
- HSV.x = RGBCVtoHUE(RGB, C, HSV.z);
- HSV.y = C / HSV.z;
- }
- return HSV;
- }
- float random(in float2 uv)
- {
- float2 noise = (frac(sin(dot(uv , float2(12.9898,78.233) * 2.0)) * 43758.5453));
- return abs(noise.x + noise.y) * 0.5;
- }
- float smootherstep(float edge0, float edge1, float x)
- {
- x = saturate((x - edge0)/(edge1 - edge0));
- return x*x*(3 - 2*x);
- }
- //keyboard controlled temporary variables (in some versions exists in the config file). Press and hold key 1,2,3...8 together with PageUp or PageDown to modify. By default all set to 1.0
- float4 tempF1; //0,1,2,3
- float4 tempF2; //5,6,7,8
- float4 tempF3; //9,0
- float4 Timer; //x=generic timer in range 0..1, period of 16777216 ms (4.6 hours), w=frame time elapsed (in seconds)
- float4 ScreenSize; //x=Width, y=1/Width, z=ScreenScaleY, w=1/ScreenScaleY
- float ENightDayFactor; //changes in range 0..1, 0 means that night time, 1 - day time
- float EInteriorFactor; //changes 0 or 1. 0 means that exterior, 1 - interior
- float EBloomAmount; //enb version of bloom applied, ignored if original post processing used
- texture2D texs0;//color
- texture2D texs1;//bloom skyrim
- texture2D texs2;//adaptation skyrim
- texture2D texs3;//bloom enb
- texture2D texs4;//adaptation enb
- texture2D texs7;//palette enb
- sampler2D _s0 = sampler_state
- {
- Texture = <texs0>;
- MinFilter = POINT;//
- MagFilter = POINT;//
- MipFilter = NONE;//LINEAR;
- AddressU = Clamp;
- AddressV = Clamp;
- SRGBTexture=FALSE;
- MaxMipLevel=0;
- MipMapLodBias=0;
- };
- sampler2D _s1 = sampler_state
- {
- Texture = <texs1>;
- MinFilter = LINEAR;//
- MagFilter = LINEAR;//
- MipFilter = NONE;//LINEAR;
- AddressU = Clamp;
- AddressV = Clamp;
- SRGBTexture=FALSE;
- MaxMipLevel=0;
- MipMapLodBias=0;
- };
- sampler2D _s2 = sampler_state
- {
- Texture = <texs2>;
- MinFilter = LINEAR;//
- MagFilter = LINEAR;//
- MipFilter = NONE;//LINEAR;
- AddressU = Clamp;
- AddressV = Clamp;
- SRGBTexture=FALSE;
- MaxMipLevel=0;
- MipMapLodBias=0;
- };
- sampler2D _s3 = sampler_state
- {
- Texture = <texs3>;
- MinFilter = LINEAR;//
- MagFilter = LINEAR;//
- MipFilter = NONE;//LINEAR;
- AddressU = Clamp;
- AddressV = Clamp;
- SRGBTexture=FALSE;
- MaxMipLevel=0;
- MipMapLodBias=0;
- };
- sampler2D _s4 = sampler_state
- {
- Texture = <texs4>;
- MinFilter = LINEAR;//
- MagFilter = LINEAR;//
- MipFilter = NONE;//LINEAR;
- AddressU = Clamp;
- AddressV = Clamp;
- SRGBTexture=FALSE;
- MaxMipLevel=0;
- MipMapLodBias=0;
- };
- sampler2D _s7 = sampler_state
- {
- Texture = <texs7>;
- MinFilter = LINEAR;
- MagFilter = LINEAR;
- MipFilter = NONE;
- AddressU = Clamp;
- AddressV = Clamp;
- SRGBTexture=FALSE;
- MaxMipLevel=0;
- MipMapLodBias=0;
- };
- struct VS_OUTPUT_POST
- {
- float4 vpos : POSITION;
- float2 txcoord0 : TEXCOORD0;
- };
- struct VS_INPUT_POST
- {
- float3 pos : POSITION;
- float2 txcoord0 : TEXCOORD0;
- };
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- VS_OUTPUT_POST VS_Quad(VS_INPUT_POST IN)
- {
- VS_OUTPUT_POST OUT;
- OUT.vpos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);
- OUT.txcoord0.xy=IN.txcoord0.xy;
- return OUT;
- }
- //skyrim shader specific externals, do not modify
- float4 _c1 : register(c1);
- float4 _c2 : register(c2);
- float4 _c3 : register(c3);
- float4 _c4 : register(c4);
- float4 _c5 : register(c5);
- float4 PS_D6EC7DD1(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
- {
- float4 _oC0=0.0; //output
- float4 _c6=float4(0, 0, 0, 0);
- float4 _c7=float4(0.212500006, 0.715399981, 0.0720999986, 1.0);
- float4 r0;
- float4 r1;
- float4 r2;
- float4 r3;
- float4 r4;
- float4 r5;
- float4 r6;
- float4 r7;
- float4 r8;
- float4 r9;
- float4 r10;
- float4 r11;
- ////////////////////
- // LETTERBOX CODE //
- ////////////////////
- #ifdef ENABLE_LETTERBOX_BARS
- float LBInteriorFactor = EInteriorFactor;
- float LBNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- LBInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- LBNightDayFactor = 1 - ENightDayFactor;
- #endif
- float fLetterboxBarHeight =lerp( lerp( fLetterboxBarHeightDay, fLetterboxBarHeightNight, LBNightDayFactor ), fLetterboxBarHeightInterior, LBInteriorFactor );
- if( IN.txcoord0.y > 1.0 - fLetterboxBarHeight || IN.txcoord0.y < fLetterboxBarHeight )
- {
- return _c6;
- }
- #endif
- ////////////////////
- // INTERLACE CODE //
- ////////////////////
- #ifdef ENABLE_INTERLACE_VERTICAL
- float InVInteriorFactor = EInteriorFactor;
- float InVNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- InVInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- InVNightDayFactor = 1 - ENightDayFactor;
- #endif
- float fInterlaceVerticalWidth =lerp( lerp( fInterlaceVerticalWidthDay, fInterlaceVerticalWidthNight, InVNightDayFactor ), fInterlaceVerticalWidthInterior, InVInteriorFactor );
- float InterlaceVerticalScalar = 0.5 / max( 1.0, floor( fInterlaceVerticalWidth ) );
- if( frac( IN.txcoord0.x * ScreenSize.x * InterlaceVerticalScalar ) > 0.5 )
- {
- return _c6;
- }
- #endif
- #ifdef ENABLE_INTERLACE_HORIZONTAL
- float InHInteriorFactor = EInteriorFactor;
- float InHNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- InHInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- InHNightDayFactor = 1 - ENightDayFactor;
- #endif
- float fInterlaceHorizontalWidth =lerp( lerp( fInterlaceHorizontalWidthDay, fInterlaceHorizontalWidthNight, InHNightDayFactor ), fInterlaceHorizontalWidthInterior, InHInteriorFactor );
- float InterlaceHorizontalScalar = 0.5 / max( 1.0, floor( fInterlaceHorizontalWidth ) );
- if( frac( IN.txcoord0.y * ScreenSize.x * ScreenSize.w * InterlaceHorizontalScalar ) > 0.5 )
- {
- return _c6;
- }
- #endif
- float4 _v0=0.0;
- _v0.xy=IN.txcoord0.xy;
- r1=tex2D(_s0, _v0.xy); //color
- r11=r1; //my bypass
- _oC0.xyz=r1.xyz; //for future use without game color corrections
- #ifdef APPLYGAMECOLORCORRECTION
- //apply original
- r0.x=1.0/_c2.y;
- r1=tex2D(_s2, _v0);
- r0.yz=r1.xy * _c1.y;
- r0.w=1.0/r0.y;
- r0.z=r0.w * r0.z;
- r1=tex2D(_s0, _v0);
- r1.xyz=r1 * _c1.y;
- r0.w=dot(_c7.xyz, r1.xyz);
- r1.w=r0.w * r0.z;
- r0.z=r0.z * r0.w + _c7.w;
- r0.z=1.0/r0.z;
- r0.x=r1.w * r0.x + _c7.w;
- r0.x=r0.x * r1.w;
- r0.x=r0.z * r0.x;
- if (r0.w<0) r0.x=_c6.x;
- r0.z=1.0/r0.w;
- r0.z=r0.z * r0.x;
- r0.x=saturate(-r0.x + _c2.x);
- //r2=tex2D(_s3, _v0); // enb bloom
- r2=tex2D(_s1, _v0); // vanilla bloom
- r2.xyz=r2 * _c1.y;
- r2.xyz=r0.x * r2;
- r1.xyz=r1 * r0.z + r2;
- r0.x=dot(r1.xyz, _c7.xyz);
- r1.w=_c7.w;
- r2=lerp(r0.x, r1, _c3.x);
- r1=r0.x * _c4 - r2;
- r1=_c4.w * r1 + r2;
- r1=_c3.w * r1 - r0.y; //khajiit night vision _c3.w
- r0=_c3.z * r1 + r0.y;
- r1=-r0 + _c5;
- _oC0=_c5.w * r1 + r0;
- #endif //APPLYGAMECOLORCORRECTION
- float4 color=_oC0;
- #ifndef APPLYGAMECOLORCORRECTION
- color*=1.0;
- color+=0.0; //0.05 //KYO : decrease this value to increase black levels. I'm doing this to affect BLACKS only without touching anything else.
- #endif
- #ifdef ENABLE_ENB_BLOOM
- #ifdef COMBINE_BLOOM
- float4 enbbloomcol = tex2D( _s3, _v0.xy ); + tex2D( _s1, _v0.xy );
- #else
- float4 enbbloomcol = tex2D( _s3, _v0.xy );
- #endif
- // DEBUG OUTPUT
- // return enbbloomcol;
- if( enbbloomcol.r + enbbloomcol.g + enbbloomcol.b > 0.0 )
- {
- #ifdef USE_BLOOM_HSV
- float EBInteriorFactor = EInteriorFactor;
- float EBNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- EBInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- EBNightDayFactor = 1 - ENightDayFactor;
- #endif
- float fBloomSaturationSmooth =lerp( lerp( fBloomSaturationSmoothDay, fBloomSaturationSmoothNight, EBNightDayFactor ), fBloomSaturationSmoothInterior, EBInteriorFactor );
- float fBloomSaturationCurve =lerp( lerp( fBloomSaturationCurveDay, fBloomSaturationCurveNight, EBNightDayFactor ), fBloomSaturationCurveInterior, EBInteriorFactor );
- float fBloomSaturationMult =lerp( lerp( fBloomSaturationMultDay, fBloomSaturationMultNight, EBNightDayFactor ), fBloomSaturationMultInterior, EBInteriorFactor );
- float fBloomIntensitySmooth =lerp( lerp( fBloomIntensitySmoothDay, fBloomIntensitySmoothNight, EBNightDayFactor ), fBloomIntensitySmoothInterior, EBInteriorFactor );
- float fBloomIntensityCurve =lerp( lerp( fBloomIntensityCurveDay, fBloomIntensityCurveNight, EBNightDayFactor ), fBloomIntensityCurveInterior, EBInteriorFactor );
- float fBloomIntensityMult =lerp( lerp( fBloomIntensityMultDay, fBloomIntensityMultNight, EBNightDayFactor ), fBloomIntensityMultInterior, EBInteriorFactor );
- float fBloomIntensityMod =lerp( lerp( fBloomIntensityModDay, fBloomIntensityModNight, EBNightDayFactor ), fBloomIntensityModInterior, EBInteriorFactor );
- float fBloomIntensityMax =lerp( lerp( fBloomIntensityMaxDay, fBloomIntensityMaxNight, EBNightDayFactor ), fBloomIntensityMaxInterior, EBInteriorFactor );
- float3 bloomhsv = RGBtoHSV( enbbloomcol.rgb );
- bloomhsv.y = lerp( bloomhsv.y, smoothstep( 0.0, 1.0, bloomhsv.y ), fBloomSaturationSmooth );
- bloomhsv.y = pow( bloomhsv.y, fBloomSaturationCurve );
- bloomhsv.y *= fBloomSaturationMult;
- bloomhsv.z = lerp( bloomhsv.z, smoothstep( 0.0, 1.0, bloomhsv.z ), fBloomIntensitySmooth );
- bloomhsv.z = pow( bloomhsv.z, fBloomIntensityCurve );
- bloomhsv.z *= fBloomIntensityMult;
- bloomhsv.z += fBloomIntensityMod;
- bloomhsv.z = clamp( bloomhsv.z, 0.0, fBloomIntensityMax );
- enbbloomcol.rgb = HSVtoRGB( bloomhsv );
- #endif
- #ifdef USE_BLOOM_LERP
- color.rgb = lerp( color.rgb, enbbloomcol.rgb, clamp( EBloomAmount, 0.0, 1.0 ) );
- #endif
- #ifdef USE_BLOOM_ADD
- color.rgb += enbbloomcol.rgb * clamp( EBloomAmount, 0.0, 1.0 );
- #endif
- }
- #endif
- //adaptation in time
- float4 Adaptation=tex2D(_s4, 0.5);
- float grayadaptation=max(max(Adaptation.x, Adaptation.y), Adaptation.z);
- // grayadaptation=1.0/grayadaptation;
- float4 xcolorbloom=tex2D(_s3, _v0.xy); //bloom
- // float maxb=max(xcolorbloom.x, max(xcolorbloom.y, xcolorbloom.z));
- // float violetamount=maxb/(maxb+EVioletShiftAmountInv);
- // xcolorbloom.xyz=lerp(xcolorbloom.xyz, xcolorbloom.xyz*EVioletShiftColor, violetamount*violetamount);
- #ifdef HD6_BLOOM_DEBLUEIFY
- float DbInteriorFactor = EInteriorFactor;
- float DbNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- DbInteriorFactor = 1.0 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- DbNightDayFactor = 1.0 - ENightDayFactor;
- #endif
- // Deblueify samples
- //float3 nsat=float3(1,0.74,0.64); // perfect-ish - removes blue and green from fog and outdoors, makes dwarven ruins very white though
- //float3 nsat=float3(1,0.80,0.74); // Touch greener
- //float3 nsat=float3(1,0.70,0.65); // Grey, very grey ice gaves almost white, but... foggy days go pink
- //float3 nsat=float3(0.85,0.75,0.7); // More reasnioable, still pink sky and snow in places
- //float3 nsat=float3(0.80,0.75,0.73);
- //float3 nsat=float3(1,0.64,0.58);
- //float3 nsat=float3(1,0.74,0.90);
- //float3 nsat=float3(0.8,0.56,0.46);
- //float3 nsat=float3(0.7,0.6,0.4); // desatures everything a bit
- //float3 nsat=float3(0,0,0); // no color in bloom, makes everything very desaturated, fire looks white almost
- // --JawZ-- added day, night and interior debluify
- float3 nsat = lerp( lerp( bsatd, bsatn, DbNightDayFactor ), bsati, DbInteriorFactor );
- // store old values
- float3 oldcol=xcolorbloom.xyz;
- // adjust saturation
- xcolorbloom.xyz *= nsat;
- //+++++++Changes appareance of color perception for Bloom only++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- float3 greyc = float3(0.299, 0.587, 0.114); // perception of color luminace
- //float3 greyc = float3(0.811,0.523,0.996); // perception of color luminace
- //float3 greyc = float3(0.333,0.333,0.333); // screw perception
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- xcolorbloom.xyz += (oldcol.x-(oldcol.x*nsat.x)) * greyc.x;
- xcolorbloom.xyz += (oldcol.y-(oldcol.y*nsat.y)) * greyc.y;
- xcolorbloom.xyz += (oldcol.z-(oldcol.z*nsat.z)) * greyc.z;
- #endif
- #ifdef HD6_BLOOM_DEFUZZ
- // Heliosdouble cobbled together bloom defuzzer - increases contrast of bloom / stop it hazing low brightness values
- // modulated by the overall brightness of the screen.
- float mavg=((xcolorbloom.x+xcolorbloom.y+xcolorbloom.z)/3);
- xcolorbloom.xyz-=(mavg/3);
- //xcolorbloom.xyz=min(xcolorbloom.xyz,0.0);
- xcolorbloom.xyz+=(mavg*0.22222222);
- xcolorbloom.xyz*(mavg*1.22222222);
- #endif
- #ifdef DIFFUSE_BLOOM
- float DiffInteriorFactor = EInteriorFactor;
- float DiffNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- DiffInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- DiffNightDayFactor = 1 - ENightDayFactor;
- #endif
- xcolorbloom.r*= lerp( lerp( REDDay, REDNight, DiffNightDayFactor ), REDInterior, DiffInteriorFactor );
- xcolorbloom.g*= lerp( lerp( GREENDay, GREENNight, DiffNightDayFactor ), GREENInterior, DiffInteriorFactor );
- xcolorbloom.b*= lerp( lerp( BLUEDay, BLUENight, DiffNightDayFactor ), BLUEInterior, DiffInteriorFactor );
- float Saturation = lerp( lerp( SatDay, SatNight, DiffNightDayFactor ), SatInterior, DiffInteriorFactor );
- float Luma = lerp( lerp( LumaDay, LumaNight, DiffNightDayFactor ), LumaInterior, DiffInteriorFactor );
- float Pow = lerp( lerp( PowDay, PowNight, DiffNightDayFactor ), PowInterior, DiffInteriorFactor );
- float Pow2 = lerp( lerp( Pow2Day, Pow2Night, DiffNightDayFactor ), Pow2Interior, DiffInteriorFactor );
- float3 cgray2=dot(xcolorbloom.xyz, Luma);
- float3 poweredcolor2=pow(xcolorbloom.xyz, Saturation);
- float newgray2=dot(poweredcolor2.xyz, Pow);
- xcolorbloom.xyz=poweredcolor2.xyz*cgray2/(newgray2+Pow2);
- color.xyz+=xcolorbloom.xyz*EBloomAmount;
- #endif
- float bchnd = ENightDayFactor;
- float ji = EInteriorFactor;
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- bchnd = 1 - ENightDayFactor;
- #endif
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- ji = 1 - EInteriorFactor;
- #endif
- float hnd = bchnd;
- float h1 = lerp(-1,1,tempF1.x); // Increases speed it changes by when pressing key
- h1 = lerp( h1, 1, hnd ); // Removes affect during day
- h1 = h1 - (h1 % 0.1); // Changes it so incriments are in steps, remove this if you want smooth changes when pressing keys
- float hbs = lerp( EBloomAmount/2, EBloomAmount, h1); // Reduce bloom as it gets darker, otherwise it just gets hazier, higher number reduces bloom more as it gets darker
- #ifdef HD6_BLOOM_CRISP
- float3 LumCoeff = lerp( LumCoeffInterior, ( lerp( LumCoeffNight, LumCoeffDay, bchnd ) ), ji);
- float3 AvgLumin = lerp( AvgLuminInterior, ( lerp( AvgLuminNight, AvgLuminDay, bchnd ) ), ji);
- // Limits what triggers a bloom
- float3 brightbloom = xcolorbloom - lerp( TrigInterior, ( lerp( TrigNight, TrigDay, bchnd ) ), ji);
- brightbloom = max( brightbloom , 0);
- // Limits bloom to superbright spots only
- float3 superbright = xcolorbloom - lerp( SBrightInterior, ( lerp( SBrightNight, SBrightDay, bchnd ) ), ji);
- superbright = max( superbright , 0 ) ; // crop so dont go any lower than black
- //superbright = lerp( AvgLumin, superbright, 0.5); // Contrast
- superbright *= 0.6;
- // Bloom - Brightness, Contrast and Saturation
- float3 brt = lerp( CBrightnessInterior, ( lerp( CBrightnessNight, CBrightnessDay, bchnd ) ), ji);
- float3 con = lerp( CContrastInterior, ( lerp( CContrastNight, CContrastDay, bchnd ) ), ji);
- float3 sat = lerp( CSaturationInterior, ( lerp( CSaturationNight, CSaturationDay, bchnd ) ), ji);
- float3 brtColor = brightbloom * brt;
- float3 cintensity = dot( brtColor, LumCoeff );
- float3 satColor = lerp( cintensity, brtColor, sat );
- float3 conColor = lerp( AvgLumin, satColor, con );
- conColor -= 0.3;
- brightbloom = conColor;
- // These values compensates the brightness when no bloom is used
- color.xyz += lerp( BrightnessModInterior, ( lerp( BrightnessModNight, BrightnessModDay, bchnd ) ), ji);
- color.xyz *= lerp( BrightnessMultInterior, ( lerp( BrightnessMultNight, BrightnessMultDay, bchnd ) ), ji);
- // Adds bloom while compensating for any brightness change
- color.xyz += (( superbright * hbs ) * lerp( CompSBInterior, ( lerp( CompSBNight, CompSBDay, bchnd ) ), ji)); // Limits where the bloom will "bloom"
- brightbloom -= ( superbright * 2 ); // removes superbright from brightbloom
- brightbloom = max( brightbloom , 0.0 );
- color.xyz += (( brightbloom * hbs ) * lerp( BloomStrInterior, ( lerp( BloomStrNight, BloomStrDay, bchnd ) ), ji)); // How strong the bloom will be
- // This blends the the ENB and Skyrim bloom together, for a more hazey effect
- color.xyz += (xcolorbloom.xyz * hbs) * lerp( BloomBlendInterior, ( lerp( BloomBlendNight, BloomBlendDay, bchnd ) ), ji); // How much the blend there will be
- color.xyz *= lerp( BlendCompInterior, ( lerp( BlendCompNight, BlendCompDay, bchnd ) ), ji); // compensate for brightening caused by above bloom
- #endif
- #ifdef HD6_BLOOM_SCREEN
- // Helios code to restrict bloom to bright areas only, not smudging dark outs around
- color+=(color*EBloomAmount); // compensate if bloom disabled
- xcolorbloom=max(xcolorbloom,0); // will cause color shift/desaturation also
- float tmult = 10;
- color/=tmult; xcolorbloom/=tmult; // Screen mode wont work with floating point numbers / big numbers, so I reduce it first
- color.x = 1.0 - ((1.0 - color.x) * (1.0 - xcolorbloom.x));
- color.y = 1.0 - ((1.0 - color.y) * (1.0 - xcolorbloom.y));
- color.z = 1.0 - ((1.0 - color.z) * (1.0 - xcolorbloom.z));
- color*=tmult;
- #endif
- #ifdef JZ_BLOOM_COLORIZATION
- float BCInteriorFactor = EInteriorFactor;
- float BCNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- BCInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NIGHT_DAY_FACTOR
- BCNightDayFactor = 1 - ENightDayFactor;
- #endif
- xcolorbloom.rgb*= lerp( lerp( bloommultDay, bloommultNight, BCNightDayFactor ), bloommultInterior, BCInteriorFactor );
- xcolorbloom.rgb-= lerp( lerp( bloomsubDay, bloomsubNight, BCNightDayFactor ), bloomsubInterior, BCInteriorFactor );
- xcolorbloom.rb*= lerp( lerp( MAGENTAbloomDay, MAGENTAbloomNight, BCNightDayFactor ), MAGENTAbloomInterior, BCInteriorFactor );
- xcolorbloom.gb*= lerp( lerp( CYANbloomDay, CYANbloomNight, BCNightDayFactor ), CYANbloomInterior, BCInteriorFactor );
- xcolorbloom.rg*= lerp( lerp( YELLOWbloomDay, YELLOWbloomNight, BCNightDayFactor ), YELLOWbloomInterior, BCInteriorFactor );
- color.xyz+=xcolorbloom.xyz*EBloomAmount;
- #endif
- // color.xyz+=xcolorbloom.xyz*EBloomAmount;
- ///////////////////////////////
- // HSV COLOR CORRECTION CODE //
- ///////////////////////////////
- //IndigoNeko's Color Correction Code
- #ifdef ENABLE_HSV
- float fInteriorFactor = EInteriorFactor;
- float fNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- fInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- fNightDayFactor = 1 - ENightDayFactor;
- #endif
- float fColorHueSmooth =lerp( lerp( fColorHueSmoothDay, fColorHueSmoothNight, fNightDayFactor ), fColorHueSmoothInterior, fInteriorFactor );
- float fColorSaturationSmooth =lerp( lerp( fColorSaturationSmoothDay, fColorSaturationSmoothNight, fNightDayFactor ), fColorSaturationSmoothInterior, fInteriorFactor );
- float fColorIntensitySmooth =lerp( lerp( fColorIntensitySmoothDay, fColorIntensitySmoothNight, fNightDayFactor ), fColorIntensitySmoothInterior, fInteriorFactor );
- float fColorHueCurve =lerp( lerp( fColorHueCurveDay, fColorHueCurveNight, fNightDayFactor ), fColorHueCurveInterior, fInteriorFactor );
- float fColorSaturationCurve =lerp( lerp( fColorSaturationCurveDay, fColorSaturationCurveNight, fNightDayFactor ), fColorSaturationCurveInterior, fInteriorFactor );
- float fColorIntensityCurve =lerp( lerp( fColorIntensityCurveDay, fColorIntensityCurveNight, fNightDayFactor ), fColorIntensityCurveInterior, fInteriorFactor );
- float fColorHueMult =lerp( lerp( fColorHueMultDay, fColorHueMultNight, fNightDayFactor ), fColorHueMultInterior, 1.0 - fInteriorFactor );
- float fColorSaturationMult =lerp( lerp( fColorSaturationMultDay, fColorSaturationMultNight, fNightDayFactor ), fColorSaturationMultInterior, fInteriorFactor );
- float fColorIntensityMult =lerp( lerp( fColorIntensityMultDay, fColorIntensityMultNight, fNightDayFactor ), fColorIntensityMultInterior, fInteriorFactor );
- float fColorHueMod =lerp( lerp( fColorHueModDay, fColorHueModNight, fNightDayFactor ), fColorHueModInterior, fInteriorFactor );
- float fColorSaturationMod =lerp( lerp( fColorSaturationModDay, fColorSaturationModNight, fNightDayFactor ), fColorSaturationModInterior, fInteriorFactor );
- float fColorIntensityMod =lerp( lerp( fColorIntensityModDay, fColorIntensityModNight, fNightDayFactor ), fColorIntensityModInterior, fInteriorFactor );
- float3 hsvcolor = RGBtoHSV( color.xyz );
- hsvcolor.y = max( hsvcolor.y, 0.0 );
- hsvcolor.z = max( hsvcolor.z, 0.0 );
- #ifdef USE_HSV_SMOOTH
- hsvcolor.x = lerp( hsvcolor.x, smoothstep( 0.0, 1.0, hsvcolor.x ), fColorHueSmooth );
- hsvcolor.y = lerp( hsvcolor.y, smoothstep( 0.0, 1.0, hsvcolor.y ), fColorSaturationSmooth );
- hsvcolor.z = lerp( hsvcolor.z, smoothstep( 0.0, 1.0, hsvcolor.z ), fColorIntensitySmooth );
- #endif
- #ifdef USE_HSV_CURVE
- hsvcolor.x = pow( hsvcolor.x, fColorHueCurve );
- hsvcolor.y = pow( hsvcolor.y, fColorSaturationCurve );
- hsvcolor.z = pow( hsvcolor.z, fColorIntensityCurve );
- #endif
- hsvcolor.x = fColorHueMod + ( fColorHueMult * hsvcolor.x );
- hsvcolor.y = fColorSaturationMod + ( fColorSaturationMult * hsvcolor.y );
- hsvcolor.z = fColorIntensityMod + ( fColorIntensityMult * hsvcolor.z );
- #ifdef USE_HSV_EQUALIZER
- hsvcolor.y = ColorEqualizerMod( hsvcolor.x ) + ( ColorEqualizerMult( hsvcolor.x ) * hsvcolor.y );
- #endif
- hsvcolor.y = max( hsvcolor.y, 0.0 );
- hsvcolor.z = max( hsvcolor.z, 0.0 );
- color.xyz = HSVtoRGB( hsvcolor );
- #endif
- #ifdef JZ_COLOR_FILTER
- float CFInteriorFactor = EInteriorFactor;
- float CFNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- CFInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NIGHT_DAY_FACTOR
- CFNightDayFactor = 1 - ENightDayFactor;
- #endif
- float3 EColorFilter =lerp( lerp( EColorFilterDay, EColorFilterNight, CFNightDayFactor ), EColorFilterInterior, CFInteriorFactor );
- EColorFilter.rgb-= lerp( lerp( EColorFilterSubDay, EColorFilterSubNight, CFNightDayFactor ), EColorFilterSubInterior, CFInteriorFactor );
- EColorFilter.rb*= lerp( lerp( MAGENTADay, MAGENTANight, CFNightDayFactor ), MAGENTAInterior, CFInteriorFactor );
- EColorFilter.gb*= lerp( lerp( CYANDay, CYANNight, CFNightDayFactor ), CYANInterior, CFInteriorFactor );
- EColorFilter.rg*= lerp( lerp( YELLOWDay, YELLOWNight, CFNightDayFactor ), YELLOWInterior, CFInteriorFactor );
- EColorFilter.rb-= lerp( lerp( MAGENTAsubDay, MAGENTAsubNight, CFNightDayFactor ), MAGENTAsubInterior, CFInteriorFactor );
- EColorFilter.gb-= lerp( lerp( CYANsubDay, CYANsubNight, CFNightDayFactor ), CYANsubInterior, CFInteriorFactor );
- EColorFilter.rg-= lerp( lerp( YELLOWsubDay, YELLOWsubNight, CFNightDayFactor ), YELLOWsubInterior, CFInteriorFactor );
- color.xyz*=EColorFilter;
- #endif
- //+++++++++++++++++++++++++++++
- float PPInteriorFactor = EInteriorFactor;
- float PPNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- PPInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- PPNightDayFactor = 1 - ENightDayFactor;
- #endif
- hnd = PPNightDayFactor;
- ji = PPInteriorFactor;
- float2 hndtweak = float2( 3.1 , 1.5 );
- float vhnd = hnd; // effects vignette strength;
- bchnd = hnd; // effects hd6 bloom crisp
- float cdhnd = hnd; // effects hd6 colorsat daynight
- // Some caves are seen as daytime, so I set key 3 to force nightime
- // This doesnt work very well >_<
- hnd = tempF1.z < 1 ? 0 : hnd;
- hndtweak.x = tempF1.z < 1 ? hndtweak.y : hndtweak.x; // Don't ask, I have no idea why I need this // KYO : Me neither :P
- //+++++++++++++++++++++++++++++
- #if (POSTPROCESS==1)
- float EAdaptationMinV1 =lerp( lerp( EAdaptationMinV1Day, EAdaptationMinV1Night, PPNightDayFactor ), EAdaptationMinV1Interior, PPInteriorFactor );
- float EAdaptationMaxV1 =lerp( lerp( EAdaptationMaxV1Day, EAdaptationMaxV1Night, PPNightDayFactor ), EAdaptationMaxV1Interior, PPInteriorFactor );
- float EContrastV1 =lerp( lerp( EContrastV1Day, EContrastV1Night, PPNightDayFactor ), EContrastV1Interior, PPInteriorFactor );
- float EColorSaturationV1 =lerp( lerp( EColorSaturationV1Day, EColorSaturationV1Night, PPNightDayFactor ), EColorSaturationV1Interior, PPInteriorFactor );
- float EToneMappingCurveV1 =lerp( lerp( EToneMappingCurveV1Day, EToneMappingCurveV1Night, PPNightDayFactor ), EToneMappingCurveV1Interior, PPInteriorFactor );
- grayadaptation=max(grayadaptation, 0.0);
- grayadaptation=min(grayadaptation, 50.0);
- color.xyz=color.xyz/(grayadaptation*EAdaptationMaxV1+EAdaptationMinV1);//*tempF1.x
- float cgray=dot(color.xyz, float3(0.27, 0.67, 0.06));
- cgray=pow(cgray, EContrastV1);
- float3 poweredcolor=pow(color.xyz, EColorSaturationV1);
- float newgray=dot(poweredcolor.xyz, float3(0.27, 0.67, 0.06));
- color.xyz=poweredcolor.xyz*cgray/(newgray+0.0001);
- float3 luma=color.xyz;
- float lumamax=300.0;
- color.xyz=(color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + EToneMappingCurveV1);
- #endif
- //+++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++
- #if (POSTPROCESS==2)
- float newEAdaptationMax = lerp( EAdaptationMaxV2Interior, ( lerp( EAdaptationMaxV2Night, EAdaptationMaxV2Day, hnd ) ), ji );
- float newEAdaptationMin = lerp( EAdaptationMinV2Interior, ( lerp( EAdaptationMinV2Night, EAdaptationMinV2Day, hnd ) ), ji );
- float newEBrightnessV2 = lerp( EBrightnessV2Interior, ( lerp( EBrightnessV2Night, EBrightnessV2Day, hnd ) ), ji );
- float newEToneMappingCurve = lerp( EToneMappingCurveV2Interior, ( lerp( EToneMappingCurveV2Night, EToneMappingCurveV2Day, hnd ) ), ji );
- float newEIntensityContrastV2 = lerp( EIntensityContrastV2Interior, ( lerp( EIntensityContrastV2Night, EIntensityContrastV2Day, hnd ) ), ji );
- float newEToneMappingOversaturationV2 = lerp( EToneMappingOversaturationV2Interior, ( lerp( EToneMappingOversaturationV2Night, EToneMappingOversaturationV2Day, hnd ) ), ji );
- float newEColorSaturationV2 = lerp( EColorSaturationV2Interior, ( lerp( EColorSaturationV2Night, EColorSaturationV2Day, hnd ) ), ji );
- float HCompensateSatV2 = lerp( HCompensateSatV2Interior, ( lerp( HCompensateSatV2Night, HCompensateSatV2Day, hnd ) ), ji );
- grayadaptation=max(grayadaptation, 0.0);
- grayadaptation=min(grayadaptation, 50.0);
- color.xyz=color.xyz/(grayadaptation*newEAdaptationMax+newEAdaptationMin);//*tempF1.x
- color.xyz*=(newEBrightnessV2);
- color.xyz+=0.000001;
- float3 xncol=normalize(color.xyz);
- float3 scl=color.xyz/xncol.xyz;
- scl=pow(scl, newEIntensityContrastV2);
- xncol.xyz=pow(xncol.xyz, newEColorSaturationV2);
- color.xyz=scl*xncol.xyz;
- color.xyz*=HCompensateSatV2;
- float lumamax=newEToneMappingOversaturationV2;
- color.xyz=(color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + newEToneMappingCurve);
- #endif
- //+++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++
- #if (POSTPROCESS==3)
- float EAdaptationMaxV3 =lerp( lerp( EAdaptationMaxV3Day, EAdaptationMaxV3Night, PPNightDayFactor ), EAdaptationMaxV3Interior, PPInteriorFactor );
- float EAdaptationMinV3 =lerp( lerp( EAdaptationMinV3Day, EAdaptationMinV3Night, PPNightDayFactor ), EAdaptationMinV3Interior, PPInteriorFactor );
- float EToneMappingOversaturationV3 =lerp( lerp( EToneMappingOversaturationV3Day, EToneMappingOversaturationV3Night, PPNightDayFactor ), EToneMappingOversaturationV3Interior, PPInteriorFactor );
- float EToneMappingCurveV3 =lerp( lerp( EToneMappingCurveV3Day, EToneMappingCurveV3Night, PPNightDayFactor ), EToneMappingCurveV3Interior, PPInteriorFactor );
- grayadaptation=max(grayadaptation, 0.0);
- grayadaptation=min(grayadaptation, 50.0);
- color.xyz=color.xyz/(grayadaptation*EAdaptationMaxV3+EAdaptationMinV3);//*tempF1.x
- float lumamax=EToneMappingOversaturationV3;
- color.xyz=(color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + EToneMappingCurveV3);
- #endif
- //+++++++++++++++++++++++++++++
- //color.xyz=tex2D(_s0, _v0.xy) + xcolorbloom.xyz*float3(0.7, 0.6, 1.0)*0.5;
- //color.xyz=tex2D(_s0, _v0.xy) + xcolorbloom.xyz*float3(0.7, 0.6, 1.0)*0.5;
- //color.xyz*=0.7;
- //+++++++++++++++++++++++++++++
- #if (POSTPROCESS==4)
- float EAdaptationMaxV4 =lerp( lerp( EAdaptationMaxV4Day, EAdaptationMaxV4Night, PPNightDayFactor ), EAdaptationMaxV4Interior, PPInteriorFactor );
- float EAdaptationMinV4 =lerp( lerp( EAdaptationMinV4Day, EAdaptationMinV4Night, PPNightDayFactor ), EAdaptationMinV4Interior, PPInteriorFactor );
- float EBrightnessCurveV4 =lerp( lerp( EBrightnessCurveV4Day, EBrightnessCurveV4Night, PPNightDayFactor ), EBrightnessCurveV4Interior, PPInteriorFactor );
- float EBrightnessMultiplierV4 =lerp( lerp( EBrightnessMultiplierV4Day, EBrightnessMultiplierV4Night, PPNightDayFactor ), EBrightnessMultiplierV4Interior, PPInteriorFactor );
- float EBrightnessToneMappingCurveV4 =lerp( lerp( EBrightnessToneMappingCurveV4Day, EBrightnessToneMappingCurveV4Night, PPNightDayFactor ), EBrightnessToneMappingCurveV4Interior, PPInteriorFactor );
- grayadaptation=max(grayadaptation, 0.0);
- grayadaptation=min(grayadaptation, 50.0);
- color.xyz=color.xyz/(grayadaptation*EAdaptationMaxV4+EAdaptationMinV4);
- float Y = dot(color.xyz, float3(0.299, 0.587, 0.114)); //0.299 * R + 0.587 * G + 0.114 * B;
- float U = dot(color.xyz, float3(-0.14713, -0.28886, 0.436)); //-0.14713 * R - 0.28886 * G + 0.436 * B;
- float V = dot(color.xyz, float3(0.615, -0.51499, -0.10001)); //0.615 * R - 0.51499 * G - 0.10001 * B;
- Y=pow(Y, EBrightnessCurveV4);
- Y=Y*EBrightnessMultiplierV4;
- // Y=Y/(Y+EBrightnessToneMappingCurveV4);
- // float desaturatefact=saturate(Y*Y*Y*1.7);
- // U=lerp(U, 0.0, desaturatefact);
- // V=lerp(V, 0.0, desaturatefact);
- color.xyz=V * float3(1.13983, -0.58060, 0.0) + U * float3(0.0, -0.39465, 2.03211) + Y;
- color.xyz=max(color.xyz, 0.0);
- color.xyz=color.xyz/(color.xyz+EBrightnessToneMappingCurveV4);
- #endif
- //+++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++ HD6 version based on postprocess 2
- #if (POSTPROCESS==5)
- float EAdaptationMaxV5 =lerp( lerp( EAdaptationMaxV5Day, EAdaptationMaxV5Night, PPNightDayFactor ), EAdaptationMaxV5Interior, PPInteriorFactor );
- float EAdaptationMinV5 =lerp( lerp( EAdaptationMinV5Day, EAdaptationMinV5Night, PPNightDayFactor ), EAdaptationMinV5Interior, PPInteriorFactor );
- float EIntensityContrastV5 =lerp( lerp( EIntensityContrastV5Day, EIntensityContrastV5Night, PPNightDayFactor ), EIntensityContrastV5Interior, PPInteriorFactor );
- float EColorSaturationV5 =lerp( lerp( EColorSaturationV5Day, EColorSaturationV5Night, PPNightDayFactor ), EColorSaturationV5Interior, PPInteriorFactor );
- float HCompensateSatV5 =lerp( lerp( HCompensateSatV5Day, HCompensateSatV5Night, PPNightDayFactor ), HCompensateSatV5Interior, PPInteriorFactor );
- float EToneMappingCurveV5 =lerp( lerp( EToneMappingCurveV5Day, EToneMappingCurveV5Night, PPNightDayFactor ), EToneMappingCurveV5Interior, PPInteriorFactor );
- grayadaptation=max(grayadaptation, 0.0);
- grayadaptation=min(grayadaptation, 50.0);
- color.xyz=color.xyz/(grayadaptation*EAdaptationMaxV5+EAdaptationMinV5); //*tempF1.x
- //color.xyz*=EBrightnessV5;
- //color.xyz+=0.000001; // HD6 - Why? how curious
- float3 xncol=normalize(color.xyz);
- float3 scl=color.xyz/xncol.xyz;
- scl=pow(scl, EIntensityContrastV5);
- xncol.xyz=pow(xncol.xyz, EColorSaturationV5);
- color.xyz=scl*xncol.xyz;
- color.xyz*=HCompensateSatV5; // compensate for darkening caused my EcolorSat above
- //float lumamax=EToneMappingOversaturationV5;
- //color.xyz=(color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + EToneMappingCurveV5);
- color.xyz=color.xyz/(color.xyz + EToneMappingCurveV5);
- //color.xyz=tex2D(_s0, _v0.xy);
- //color.xyz=color.xyz-0.03;
- //color.xyz/=10;
- #endif
- //+++++++++++++++++++++++++++++
- //+++++++++++++++++++++++++++++ Improved Tonemapping v1.1 by Brodiggan Gale
- #if (POSTPROCESS==6)
- //hd6/ppv2///////////////////////////////////////////
- float EIntensityContrastV6 = lerp( lerp( EIntensityContrastV6Day, EIntensityContrastV6Night, PPNightDayFactor), EIntensityContrastV6Interior, PPInteriorFactor );
- float EColorSaturationV6 = lerp( lerp( EColorSaturationV6Day, EColorSaturationV6Night, PPNightDayFactor), EColorSaturationV6Interior, PPInteriorFactor );
- float HCompensateSatV6 = lerp( lerp( HCompensateSatV6Day, HCompensateSatV6Night, PPNightDayFactor), HCompensateSatV6Interior, PPInteriorFactor );
- float EToneMappingCurveV6 = lerp( lerp( EToneMappingCurveV6Day, EToneMappingCurveV6Night, PPNightDayFactor), EToneMappingCurveV6Interior, PPInteriorFactor );
- float EBrightnessV6 = lerp( lerp( EBrightnessV6Day, EBrightnessV6Night, PPNightDayFactor), EBrightnessV6Interior, PPInteriorFactor );
- float EToneMappingOversaturationV6 = lerp( lerp( EToneMappingOversaturationV6Day, EToneMappingOversaturationV6Night, PPNightDayFactor), EToneMappingOversaturationV6Interior, PPInteriorFactor );
- float EAdaptationMaxV6 =lerp( lerp( EAdaptationMaxV6Day, EAdaptationMaxV6Night, PPNightDayFactor ), EAdaptationMaxV6Interior, PPInteriorFactor );
- float EAdaptationMinV6 =lerp( lerp( EAdaptationMinV6Day, EAdaptationMinV6Night, PPNightDayFactor ), EAdaptationMinV6Interior, PPInteriorFactor );
- float lumamax = EToneMappingOversaturationV6;
- //kermles////////////////////////////////////////////
- float EAdaptationCompensateV6 =lerp( lerp( EAdaptationCompensateV6Day, EAdaptationCompensateV6Night, PPNightDayFactor ), EAdaptationCompensateV6Interior, PPInteriorFactor );
- float EBrightnessMaxV6 = lerp( lerp( EBrightnessMaxV6Day, EBrightnessMaxV6Night, PPNightDayFactor ), EBrightnessMaxV6Interior, PPInteriorFactor );
- float EBrightnessMinV6 = lerp( lerp( EBrightnessMinV6Day, EBrightnessMinV6Night, PPNightDayFactor ), EBrightnessMinV6Interior, PPInteriorFactor );
- float3 moodColor = float3(lerp( lerp( EMoodColorDay.x, EMoodColorNight.x, PPNightDayFactor), EMoodColorInt.x, PPInteriorFactor), lerp( lerp( EMoodColorDay.y, EMoodColorNight.y, PPNightDayFactor), EMoodColorInt.y, PPInteriorFactor),lerp( lerp( EMoodColorDay.z, EMoodColorNight.z, PPNightDayFactor), EMoodColorInt.z, PPInteriorFactor));
- float moodAmount = lerp( lerp( EMoodAmountDay, EMoodAmountNight, PPNightDayFactor), EMoodAmountInt, PPInteriorFactor);
- float moodCurve = lerp( lerp( EMoodCurveDay, EMoodCurveNight, PPNightDayFactor), EMoodCurveInt, PPInteriorFactor);
- float3 shadowColor = float3(lerp( lerp( EShadowColorDay.x, EShadowColorNight.x, PPNightDayFactor), EShadowColorInt.x, PPInteriorFactor), lerp( lerp( EShadowColorDay.y, EShadowColorNight.y, PPNightDayFactor), EShadowColorInt.y, PPInteriorFactor),lerp( lerp( EShadowColorDay.z, EShadowColorNight.z, PPNightDayFactor), EShadowColorInt.z, PPInteriorFactor));
- float shadowThreshold = lerp( lerp( EShadowThresholdDay, EShadowThresholdNight, PPNightDayFactor), EShadowThresholdInt, PPInteriorFactor);
- float shadowCurve = lerp( lerp( EShadowCurveDay, EShadowCurveNight, PPNightDayFactor), EShadowCurveInt, PPInteriorFactor);
- float3 brightSpotColor = float3(lerp( lerp( EBrightSpotColorDay.x, EBrightSpotColorNight.x, PPNightDayFactor), EBrightSpotColorInt.x, PPInteriorFactor), lerp( lerp( EBrightSpotColorDay.y, EBrightSpotColorNight.y, PPNightDayFactor), EBrightSpotColorInt.y, PPInteriorFactor),lerp( lerp( EBrightSpotColorDay.z, EBrightSpotColorNight.z, PPNightDayFactor), EBrightSpotColorInt.z, PPInteriorFactor));
- float brightSpotThreshold = lerp( lerp( EBrightSpotThresholdDay, EBrightSpotThresholdNight, PPNightDayFactor), EBrightSpotThresholdInt, PPInteriorFactor);
- float brightSpotCurve = lerp( lerp( EBrightSpotCurveDay, EBrightSpotCurveNight, PPNightDayFactor), EBrightSpotCurveInt, PPInteriorFactor) / 10;
- float hsvDesatCurve = lerp( lerp( EHSVDesatCurveDay, EHSVDesatCurveNight, PPNightDayFactor), EHSVDesatCurveInt, PPInteriorFactor); //controls desaturation strength
- float PPAmount = 0.8; //controls interpolation between vanilla colors and PP6 colors
- float4 ncolor; //temporary variable for color adjustments
- float avgbr; //temporary variable for color adjustments
- //begin pp code/////////////////////////////////////////////////
- //store vanilla colors//////////////////////////////////////////
- float4 oldcolor = color;
- //convert to hsv////////////////////////////////////////////////
- float3 hsvncolor = RGBtoHSV( color.xyz );
- hsvncolor.y = max( hsvncolor.y, 0.0 );
- hsvncolor.z = max( hsvncolor.z, 0.0 );
- //desaturate based on original saturation then resaturate///////
- hsvncolor.y = pow( hsvncolor.y, hsvDesatCurve );
- hsvncolor.y = saturate(hsvncolor.y * EColorSaturationV6);
- //convert back to rgb///////////////////////////////////////////
- hsvncolor.y = max( hsvncolor.y, 0.0 );
- color.xyz = HSVtoRGB( hsvncolor );
- //brightness clamping///////////////////////////////////////////
- color.xyz=clamp(color.xyz, EBrightnessMinV6, EBrightnessMaxV6);
- //ppv2 modified by kermles//////////////////////////////////////
- grayadaptation = clamp(grayadaptation, 0, 50);
- color.xyz *= EBrightnessV6;
- float3 xncol = normalize(color.xyz);
- float3 scl = color.xyz/xncol.xyz;
- scl = pow(scl, EIntensityContrastV6);
- xncol.xyz = pow(xncol.xyz, EColorSaturationV6);
- color.xyz = scl*xncol.xyz;
- color.xyz *= HCompensateSatV6;
- color.xyz = (color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + EToneMappingCurveV6);
- //mood coloring/////////////////////////////////////////////////
- ncolor = color;
- avgbr = (ncolor.x + ncolor.y + ncolor.z)/3;
- moodColor.xyz = lerp( moodColor/10, moodColor, saturate( avgbr * 2 ) );
- moodColor.xyz = lerp( moodColor, 1, saturate( avgbr - 0.5 ) * 2 );
- moodColor.xyz = lerp( ncolor, moodColor, saturate(avgbr / moodCurve));
- ncolor.xyz = lerp( ncolor, moodColor, saturate( avgbr * moodAmount ) );
- color.xyz = max(0, ncolor);
- //shadows///////////////////////////////////////////////////////
- ncolor = color;
- avgbr = (ncolor.x + ncolor.y + ncolor.z)/3;
- shadowColor = lerp(0.1*(2.55-shadowColor), 2.55-shadowColor, saturate(avgbr*2));
- shadowColor = lerp(shadowColor, 1, saturate(avgbr-0.5)*2);
- ncolor.xyz = max(ncolor, pow(ncolor, ((1.0+ncolor) * (shadowColor))*shadowThreshold)/shadowCurve);
- color.xyz = saturate(ncolor);
- //brightspots///////////////////////////////////////////////////
- brightSpotColor = lerp(brightSpotColor/10, brightSpotColor, saturate(avgbr*2));
- brightSpotColor = lerp(brightSpotColor, 1, saturate(avgbr-0.5)*2);
- ncolor = 1-color;
- ncolor.xyz = max(ncolor, pow(ncolor, ((1.0 + ncolor) * (brightSpotColor))*brightSpotThreshold)/brightSpotCurve);
- color.xyz = saturate(1-ncolor);
- //convert to hsv////////////////////////////////////////////////
- hsvncolor = RGBtoHSV( color.xyz );
- hsvncolor.y = max( hsvncolor.y, 0.0 );
- hsvncolor.z = max( hsvncolor.z, 0.0 );
- //adaptation/contrast///////////////////////////////////////////
- hsvncolor.z = pow(hsvncolor.z, (grayadaptation*EAdaptationMaxV6+EAdaptationMinV6));
- //convert back to rgb///////////////////////////////////////////
- hsvncolor.y = max( hsvncolor.y, 0.0 );
- hsvncolor.z = max( hsvncolor.z, 0.0 );
- color.xyz = HSVtoRGB( hsvncolor );
- color.xyz /= grayadaptation*EAdaptationMaxV6+EAdaptationMinV6;
- color.xyz /= EAdaptationCompensateV6;
- //rerun ppv2////////////////////////////////////////////////////
- color.xyz *= EBrightnessV6;
- xncol = normalize(color.xyz);
- scl = color.xyz/xncol.xyz;
- scl = pow(scl, EIntensityContrastV6);
- xncol.xyz = pow(xncol.xyz, EColorSaturationV6);
- color.xyz = scl*xncol.xyz;
- color.xyz *= HCompensateSatV6;
- color.xyz = (color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + EToneMappingCurveV6);
- //lerp between vanilla and pp6 colors///////////////////////////
- color = lerp(oldcolor, color, PPAmount);
- #endif
- //+++++++++++++++++++++++++++++
- //////////////////////
- // ENB PALETTE CODE //
- //////////////////////
- #ifdef ENABLE_ENB_PALETTE
- float PMInteriorFactor = EInteriorFactor;
- float PMNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- PMInteriorFactor = 1.0 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- PMNightDayFactor = 1.0 - ENightDayFactor;
- #endif
- float palmix =lerp( lerp( palmixDay, palmixNight, PMNightDayFactor ), palmixInterior, PMInteriorFactor );
- float3 enbpalcol = tex2D( _s7, 0.5 ).rgb;
- float enbpallum = ( enbpalcol.r + enbpalcol.g + enbpalcol.b );
- if( enbpallum > 0.0 )
- {
- color.rgb = saturate(color.rgb);
- float3 brightness = Adaptation.xyz;
- brightness=max(brightness.x, max(brightness.y, brightness.z));
- float3 palette=0.0;
- float4 uvsrc=0.0;
- uvsrc.x=color.r;
- uvsrc.y=brightness.r;
- palette.r=tex2D(_s7, uvsrc).r;
- uvsrc.x=color.g;
- uvsrc.y=brightness.g;
- palette.g=tex2D(_s7, uvsrc).g;
- uvsrc.x=color.b;
- uvsrc.y=brightness.b;
- palette.b=tex2D(_s7, uvsrc).b;
- color.rgb=palette.rgb * palmix;
- }
- #endif
- /////////////////////
- // SEPIA TONE CODE //
- /////////////////////
- #ifdef ENABLE_SEPIATONE
- float SPInteriorFactor = EInteriorFactor;
- float SPNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- SPInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- SPNightDayFactor = 1 - ENightDayFactor;
- #endif
- float fSepiaExposure =lerp( lerp( fSepiaExposureDay, fSepiaExposureNight, SPNightDayFactor ), fSepiaExposureInterior, SPInteriorFactor );
- float fSepiaColor =lerp( lerp( fSepiaColorDay, fSepiaColorNight, SPNightDayFactor ), fSepiaColorInterior, SPInteriorFactor );
- float fSepiaDesaturation =lerp( lerp( fSepiaDesaturationDay, fSepiaDesaturationNight, SPNightDayFactor ), fSepiaDesaturationInterior, SPInteriorFactor );
- float SepiaWeight = float3( 0.2125, 0.7154, 0.0721 );
- float SepiaLuminance = min( 1.0, dot( color, SepiaWeight ) * fSepiaExposure ) ;
- float3 SepiaColor = fSepiaColor * SepiaLuminance;
- color.rgb = lerp( color.rgb, SepiaColor, fSepiaDesaturation );
- #endif
- ////////////////
- // GRAIN CODE //
- ////////////////
- #ifdef ENABLE_GRAIN
- float GInteriorFactor = EInteriorFactor;
- float GNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- GInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- GNightDayFactor = 1 - ENightDayFactor;
- #endif
- float fGrainMotion =lerp( lerp( fGrainMotionDay, fGrainMotionNight, GNightDayFactor ), fGrainMotionInterior, GInteriorFactor );
- float fGrainSaturation =lerp( lerp( fGrainSaturationDay, fGrainSaturationNight, GNightDayFactor ), fGrainSaturationInterior, GInteriorFactor );
- float fGrainIntensity =lerp( lerp( fGrainIntensityDay, fGrainIntensityNight, GNightDayFactor ), fGrainIntensityInterior, GInteriorFactor );
- float GrainTimerSeed = Timer.x * fGrainMotion;
- float2 GrainTexCoordSeed = _v0.xy * 1.0;
- float2 GrainSeed1 = GrainTexCoordSeed + float2( 0.0, GrainTimerSeed );
- float2 GrainSeed2 = GrainTexCoordSeed + float2( GrainTimerSeed, 0.0 );
- float2 GrainSeed3 = GrainTexCoordSeed + float2( GrainTimerSeed, GrainTimerSeed );
- float GrainNoise1 = random( GrainSeed1 );
- float GrainNoise2 = random( GrainSeed2 );
- float GrainNoise3 = random( GrainSeed3 );
- float GrainNoise4 = ( GrainNoise1 + GrainNoise2 + GrainNoise3 ) * 0.333333333;
- float3 GrainNoise = float3( GrainNoise4, GrainNoise4, GrainNoise4 );
- float3 GrainColor = float3( GrainNoise1, GrainNoise2, GrainNoise3 );
- color.rgb += ( lerp( GrainNoise, GrainColor, fGrainSaturation ) * fGrainIntensity ) - ( fGrainIntensity * 0.5);
- #endif
- ///////////////////
- // VIGNETTE CODE //
- ///////////////////
- #ifdef ENABLE_VIGNETTE
- float VInteriorFactor = EInteriorFactor;
- float VNightDayFactor = ENightDayFactor;
- #ifdef ENABLE_FLIP_INT_EXT_FACTOR
- VInteriorFactor = 1 - EInteriorFactor;
- #endif
- #ifdef ENABLE_FLIP_NITE_DAY_FACTOR
- VNightDayFactor = 1 - ENightDayFactor;
- #endif
- float fVignetteCenter =lerp( lerp( fVignetteCenterDay, fVignetteCenterNight, VNightDayFactor ), fVignetteCenterInterior, VInteriorFactor );
- float fVignetteScale =lerp( lerp( fVignetteScaleDay, fVignetteScaleNight, VNightDayFactor ), fVignetteScaleInterior, VInteriorFactor );
- float fVignetteRadius =lerp( lerp( fVignetteRadiusDay, fVignetteRadiusNight, VNightDayFactor ), fVignetteRadiusInterior, VInteriorFactor );
- float fVignetteSharpness =lerp( lerp( fVignetteSharpnessDay, fVignetteSharpnessNight, VNightDayFactor ), fVignetteSharpnessInterior, VInteriorFactor );
- float fVignetteCurve =lerp( lerp( fVignetteCurveDay, fVignetteCurveNight, VNightDayFactor ), fVignetteCurveInterior, VInteriorFactor );
- float2 VignettePosition = ( _v0.xy - fVignetteCenter ) * float2( ScreenSize.z, 1.0 );
- VignettePosition /= fVignetteScale;
- float VignetteDistance = distance( VignettePosition, float2(0.0 , 0.0) );
- float VignetteEffect = max( 0.0, ( VignetteDistance - fVignetteRadius ) * fVignetteSharpness * 50.0 );
- color.rgb *= max( 0.0, min( 1.0, 1.0 - pow( VignetteEffect, fVignetteCurve ) ) );
- #endif
- _oC0.w=1.0;
- _oC0.xyz=color.xyz;
- return _oC0;
- }
- //switch between vanilla and mine post processing
- #ifndef ENB_FLIPTECHNIQUE
- technique Shader_D6EC7DD1
- #else
- technique Shader_ORIGINALPOSTPROCESS
- #endif
- {
- pass p0
- {
- VertexShader = compile vs_3_0 VS_Quad();
- PixelShader = compile ps_3_0 PS_D6EC7DD1();
- ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
- ZEnable=FALSE;
- ZWriteEnable=FALSE;
- CullMode=NONE;
- AlphaTestEnable=FALSE;
- AlphaBlendEnable=FALSE;
- SRGBWRITEENABLE=FALSE;
- }
- }
- //original shader of post processing
- #ifndef ENB_FLIPTECHNIQUE
- technique Shader_ORIGINALPOSTPROCESS
- #else
- technique Shader_D6EC7DD1
- #endif
- {
- pass p0
- {
- VertexShader = compile vs_3_0 VS_Quad();
- PixelShader=
- asm
- {
- // Parameters:
- // sampler2D Avg;
- // sampler2D Blend;
- // float4 Cinematic;
- // float4 ColorRange;
- // float4 Fade;
- // sampler2D Image;
- // float4 Param;
- // float4 Tint;
- // Registers:
- // Name Reg Size
- // ------------ ----- ----
- // ColorRange c1 1
- // Param c2 1
- // Cinematic c3 1
- // Tint c4 1
- // Fade c5 1
- // Image s0 1
- // Blend s1 1
- // Avg s2 1
- //s0 bloom result
- //s1 color
- //s2 is average color
- ps_3_0
- def c6, 0, 0, 0, 0
- //was c0 originally
- def c7, 0.212500006, 0.715399981, 0.0720999986, 1
- dcl_texcoord v0.xy
- dcl_2d s0
- dcl_2d s1
- dcl_2d s2
- rcp r0.x, c2.y
- texld r1, v0, s2
- mul r0.yz, r1.xxyw, c1.y
- rcp r0.w, r0.y
- mul r0.z, r0.w, r0.z
- texld r1, v0, s1
- mul r1.xyz, r1, c1.y
- dp3 r0.w, c7, r1
- mul r1.w, r0.w, r0.z
- mad r0.z, r0.z, r0.w, c7.w
- rcp r0.z, r0.z
- mad r0.x, r1.w, r0.x, c7.w
- mul r0.x, r0.x, r1.w
- mul r0.x, r0.z, r0.x
- cmp r0.x, -r0.w, c6.x, r0.x
- rcp r0.z, r0.w
- mul r0.z, r0.z, r0.x
- add_sat r0.x, -r0.x, c2.x
- texld r2, v0, s0
- mul r2.xyz, r2, c1.y
- mul r2.xyz, r0.x, r2
- mad r1.xyz, r1, r0.z, r2
- dp3 r0.x, r1, c7
- mov r1.w, c7.w
- lrp r2, c3.x, r1, r0.x
- mad r1, r0.x, c4, -r2
- mad r1, c4.w, r1, r2
- mad r1, c3.w, r1, -r0.y
- mad r0, c3.z, r1, r0.y
- add r1, -r0, c5
- mad oC0, c5.w, r1, r0
- };
- ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
- ZEnable=FALSE;
- ZWriteEnable=FALSE;
- CullMode=NONE;
- AlphaTestEnable=FALSE;
- AlphaBlendEnable=FALSE;
- SRGBWRITEENABLE=FALSE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement