diff --git a/Logo.png b/Logo.png deleted file mode 100644 index dba3d72..0000000 Binary files a/Logo.png and /dev/null differ diff --git a/README.md b/README.md deleted file mode 100644 index 56118da..0000000 --- a/README.md +++ /dev/null @@ -1,13 +0,0 @@ -![logo](Logo.png) - -This repo contains every single version of MariENB ever made. -For the sake of neater organization, they are divided in specific branches: - -- **historic**: Alpha versions of MariENB. -- **legacy**: 1.x releases. -- **twopoint-modular**: 2.0.x releases that used a modular packaging model. -- **twopoint-dust**: 2.x releases for Fallout: DUST. -- **twopoint-fnv**: 2.x releases for Fallout: New Vegas. -- **twopoint-skyrim**: 2.x releases for Skyrim. -- **threepoint-frost**: 3.x releases for Fallout: FROST. -- **threepoint-fo4**: 3.x releases for Fallout 4. \ No newline at end of file diff --git a/enbseries.ini b/enbseries.ini new file mode 100644 index 0000000..441f7dc --- /dev/null +++ b/enbseries.ini @@ -0,0 +1,555 @@ +[GLOBAL] +UseEffect=true +[EFFECT] +UseOriginalObjectsProcessing=false +UseOriginalPostProcessing=false +UseOriginalColorFilter=true +UseOriginalBloom=false +UseOriginalAdaptation=false +EnablePostPassShader=true +EnableDithering=true +EnableAdaptation=true +EnableBloom=true +EnableLens=true +EnableDepthOfField=true +EnableSSAO=true +EnableSkyAmbientCalculation=true +EnableCloudShadows=true +EnableDetailedShadow=true +EnableSkylighting=true +EnableSubSurfaceScattering=true +EnableWater=true +EnableReflections=false +EnablePuddleReflections=true +EnableProceduralSun=false +[COLORCORRECTION] +UseProceduralCorrection=true +Brightness=1.0 +GammaCurve=1.0 +UsePaletteTexture=true +[TIMEOFDAY] +DawnDuration=2.0 +SunriseTime=7.0 +DayTime=12.0 +SunsetTime=18.0 +DuskDuration=2.0 +NightTime=0.0 +[ADAPTATION] +AdaptationSensitivity=0.2 +AdaptationTime=0.65 +ForceMinMaxValues=false +AdaptationMin=0.0 +AdaptationMax=1.0 +[DEPTHOFFIELD] +FocusingTime=0.4 +ApertureTime=1.0 +[BLOOM] +IgnoreWeatherSystem=true +AmountDawn=1.0 +AmountSunrise=1.0 +AmountDay=1.0 +AmountSunset=1.0 +AmountDusk=1.0 +AmountNight=1.0 +AmountInteriorDay=1.0 +AmountInteriorNight=1.0 +[LENS] +IgnoreWeatherSystem=true +AmountDawn=1.0 +AmountSunrise=1.0 +AmountDay=1.0 +AmountSunset=1.0 +AmountDusk=1.0 +AmountNight=1.0 +AmountInteriorDay=1.0 +AmountInteriorNight=1.0 +[SKY] +IgnoreWeatherSystem=true +Enable=true +GradientIntensityDawn=1.02 +GradientIntensitySunrise=1.15 +GradientIntensityDay=1.29 +GradientIntensitySunset=1.130001 +GradientIntensityDusk=1.080001 +GradientIntensityNight=0.410001 +GradientIntensityInteriorDay=1.18 +GradientIntensityInteriorNight=0.37 +GradientDesaturationDawn=0.0 +GradientDesaturationSunrise=0.0 +GradientDesaturationDay=0.0 +GradientDesaturationSunset=0.0 +GradientDesaturationDusk=0.0 +GradientDesaturationNight=0.0 +GradientDesaturationInteriorDay=0.0 +GradientDesaturationInteriorNight=0.0 +GradientTopIntensityDawn=0.62 +GradientTopIntensitySunrise=0.79 +GradientTopIntensityDay=0.990001 +GradientTopIntensitySunset=0.82 +GradientTopIntensityDusk=0.6 +GradientTopIntensityNight=0.42 +GradientTopIntensityInteriorDay=0.97 +GradientTopIntensityInteriorNight=0.38 +GradientTopCurveDawn=0.87 +GradientTopCurveSunrise=0.82 +GradientTopCurveDay=0.97 +GradientTopCurveSunset=0.88 +GradientTopCurveDusk=0.86 +GradientTopCurveNight=0.89 +GradientTopCurveInteriorDay=0.98 +GradientTopCurveInteriorNight=0.82 +GradientTopColorFilterDawn=0.988, 0.686, 0.675 +GradientTopColorFilterSunrise=0.984, 0.835, 0.639 +GradientTopColorFilterDay=1, 1, 1 +GradientTopColorFilterSunset=0.988, 0.757, 0.58 +GradientTopColorFilterDusk=0.984, 0.624, 0.624 +GradientTopColorFilterNight=0.596, 0.561, 0.867 +GradientTopColorFilterInteriorDay=0.949, 0.996, 0.992 +GradientTopColorFilterInteriorNight=0.667, 0.569, 0.757 +GradientMiddleIntensityDawn=0.84 +GradientMiddleIntensitySunrise=1.02 +GradientMiddleIntensityDay=1.27 +GradientMiddleIntensitySunset=1.03 +GradientMiddleIntensityDusk=0.96 +GradientMiddleIntensityNight=0.66 +GradientMiddleIntensityInteriorDay=1.0 +GradientMiddleIntensityInteriorNight=0.55 +GradientMiddleCurveDawn=0.93 +GradientMiddleCurveSunrise=0.96 +GradientMiddleCurveDay=1.02 +GradientMiddleCurveSunset=0.95 +GradientMiddleCurveDusk=0.92 +GradientMiddleCurveNight=0.88 +GradientMiddleCurveInteriorDay=1.05 +GradientMiddleCurveInteriorNight=0.87 +GradientMiddleColorFilterDawn=0.976, 0.612, 0.529 +GradientMiddleColorFilterSunrise=0.984, 0.82, 0.663 +GradientMiddleColorFilterDay=1, 1, 1 +GradientMiddleColorFilterSunset=0.984, 0.784, 0.584 +GradientMiddleColorFilterDusk=0.984, 0.663, 0.592 +GradientMiddleColorFilterNight=0.518, 0.667, 0.988 +GradientMiddleColorFilterInteriorDay=1, 1, 1 +GradientMiddleColorFilterInteriorNight=0.561, 0.561, 0.976 +GradientHorizonIntensityDawn=1.11 +GradientHorizonIntensitySunrise=1.25 +GradientHorizonIntensityDay=1.310001 +GradientHorizonIntensitySunset=1.24 +GradientHorizonIntensityDusk=1.11 +GradientHorizonIntensityNight=0.930001 +GradientHorizonIntensityInteriorDay=1.32 +GradientHorizonIntensityInteriorNight=0.94 +GradientHorizonCurveDawn=0.82 +GradientHorizonCurveSunrise=0.86 +GradientHorizonCurveDay=0.92 +GradientHorizonCurveSunset=0.87 +GradientHorizonCurveDusk=0.87 +GradientHorizonCurveNight=0.78 +GradientHorizonCurveInteriorDay=0.9 +GradientHorizonCurveInteriorNight=0.98 +GradientHorizonColorFilterDawn=0.984, 0.667, 0.6 +GradientHorizonColorFilterSunrise=0.992, 0.839, 0.773 +GradientHorizonColorFilterDay=1, 1, 1 +GradientHorizonColorFilterSunset=0.992, 0.827, 0.773 +GradientHorizonColorFilterDusk=0.992, 0.753, 0.718 +GradientHorizonColorFilterNight=0.706, 0.843, 0.98 +GradientHorizonColorFilterInteriorDay=1, 1, 1 +GradientHorizonColorFilterInteriorNight=0.851, 0.863, 0.89 +CloudsIntensityDawn=0.64 +CloudsIntensitySunrise=0.920001 +CloudsIntensityDay=1.240001 +CloudsIntensitySunset=0.940001 +CloudsIntensityDusk=0.660001 +CloudsIntensityNight=0.370001 +CloudsIntensityInteriorDay=1.17 +CloudsIntensityInteriorNight=0.49 +CloudsCurveDawn=0.9 +CloudsCurveSunrise=0.95 +CloudsCurveDay=1.0 +CloudsCurveSunset=0.97 +CloudsCurveDusk=0.94 +CloudsCurveNight=0.84 +CloudsCurveInteriorDay=1.02 +CloudsCurveInteriorNight=0.83 +CloudsDesaturationDawn=0.0 +CloudsDesaturationSunrise=0.0 +CloudsDesaturationDay=0.0 +CloudsDesaturationSunset=0.0 +CloudsDesaturationDusk=0.0 +CloudsDesaturationNight=0.0 +CloudsDesaturationInteriorDay=0.0 +CloudsDesaturationInteriorNight=0.0 +CloudsOpacityDawn=1.0 +CloudsOpacitySunrise=1.0 +CloudsOpacityDay=1.0 +CloudsOpacitySunset=1.0 +CloudsOpacityDusk=1.0 +CloudsOpacityNight=1.0 +CloudsOpacityInteriorDay=1.0 +CloudsOpacityInteriorNight=1.0 +CloudsColorFilterDawn=0.953, 0.639, 0.592 +CloudsColorFilterSunrise=0.969, 0.749, 0.702 +CloudsColorFilterDay=1, 1, 1 +CloudsColorFilterSunset=0.98, 0.824, 0.769 +CloudsColorFilterDusk=0.984, 0.667, 0.608 +CloudsColorFilterNight=0.839, 0.886, 0.98 +CloudsColorFilterInteriorDay=1, 1, 1 +CloudsColorFilterInteriorNight=0.792, 0.808, 0.957 +SunIntensityDawn=1.91 +SunIntensitySunrise=2.45 +SunIntensityDay=2.06 +SunIntensitySunset=2.45 +SunIntensityDusk=1.97 +SunIntensityNight=1.15 +SunIntensityInteriorDay=2.02 +SunIntensityInteriorNight=1.19 +SunDesaturationDawn=0.0 +SunDesaturationSunrise=0.0 +SunDesaturationDay=0.0 +SunDesaturationSunset=0.0 +SunDesaturationDusk=0.0 +SunDesaturationNight=0.0 +SunDesaturationInteriorDay=0.0 +SunDesaturationInteriorNight=0.0 +SunColorFilterDawn=0.988, 0.412, 0.267 +SunColorFilterSunrise=0.992, 0.671, 0.482 +SunColorFilterDay=1, 0.898, 0.718 +SunColorFilterSunset=0.984, 0.58, 0.365 +SunColorFilterDusk=0.957, 0.196, 0.141 +SunColorFilterNight=0.914, 0.145, 0.145 +SunColorFilterInteriorDay=0.996, 0.827, 0.706 +SunColorFilterInteriorNight=0.816, 0.114, 0.0784 +MoonIntensityDawn=0.7 +MoonIntensitySunrise=0.57 +MoonIntensityDay=0.49 +MoonIntensitySunset=0.58 +MoonIntensityDusk=0.69 +MoonIntensityNight=0.83 +MoonIntensityInteriorDay=0.57 +MoonIntensityInteriorNight=0.89 +MoonDesaturationDawn=0.47 +MoonDesaturationSunrise=0.41 +MoonDesaturationDay=0.36 +MoonDesaturationSunset=0.42 +MoonDesaturationDusk=0.48 +MoonDesaturationNight=0.61 +MoonDesaturationInteriorDay=0.43 +MoonDesaturationInteriorNight=0.59 +MoonColorFilterDawn=0.761, 0.733, 0.898 +MoonColorFilterSunrise=0.875, 0.894, 0.922 +MoonColorFilterDay=1, 1, 1 +MoonColorFilterSunset=0.847, 0.882, 0.933 +MoonColorFilterDusk=0.78, 0.769, 0.863 +MoonColorFilterNight=0.741, 0.769, 0.82 +MoonColorFilterInteriorDay=1, 1, 1 +MoonColorFilterInteriorNight=0.725, 0.749, 0.843 +[ENVIRONMENT] +IgnoreWeatherSystem=true +DirectLightingIntensityDawn=1.27 +DirectLightingIntensitySunrise=1.47 +DirectLightingIntensityDay=1.73 +DirectLightingIntensitySunset=1.5 +DirectLightingIntensityDusk=1.22 +DirectLightingIntensityNight=1.17 +DirectLightingIntensityInteriorDay=1.64 +DirectLightingIntensityInteriorNight=1.19 +DirectLightingDesaturationDawn=0.0 +DirectLightingDesaturationSunrise=0.0 +DirectLightingDesaturationDay=0.0 +DirectLightingDesaturationSunset=0.0 +DirectLightingDesaturationDusk=0.0 +DirectLightingDesaturationNight=0.0 +DirectLightingDesaturationInteriorDay=0.0 +DirectLightingDesaturationInteriorNight=0.0 +DirectLightingColorFilterDawn=0.984, 0.455, 0.427 +DirectLightingColorFilterSunrise=0.988, 0.765, 0.471 +DirectLightingColorFilterDay=1, 0.922, 0.812 +DirectLightingColorFilterSunset=0.992, 0.729, 0.576 +DirectLightingColorFilterDusk=0.984, 0.451, 0.388 +DirectLightingColorFilterNight=0.663, 0.749, 0.984 +DirectLightingColorFilterInteriorDay=1, 1, 1 +DirectLightingColorFilterInteriorNight=0.655, 0.596, 0.988 +AmbientLightingIntensityDawn=0.32 +AmbientLightingIntensitySunrise=0.48 +AmbientLightingIntensityDay=0.65 +AmbientLightingIntensitySunset=0.53 +AmbientLightingIntensityDusk=0.37 +AmbientLightingIntensityNight=0.2 +AmbientLightingIntensityInteriorDay=0.18 +AmbientLightingIntensityInteriorNight=0.12 +SkyAmbientTopIntensityDawn=0.27 +SkyAmbientTopIntensitySunrise=0.31 +SkyAmbientTopIntensityDay=0.36 +SkyAmbientTopIntensitySunset=0.32 +SkyAmbientTopIntensityDusk=0.24 +SkyAmbientTopIntensityNight=0.23 +SkyAmbientTopIntensityInteriorDay=0.24 +SkyAmbientTopIntensityInteriorNight=0.1 +SkyAmbientBottomIntensityDawn=0.1 +SkyAmbientBottomIntensitySunrise=0.12 +SkyAmbientBottomIntensityDay=0.13 +SkyAmbientBottomIntensitySunset=0.11 +SkyAmbientBottomIntensityDusk=0.1 +SkyAmbientBottomIntensityNight=0.08 +SkyAmbientBottomIntensityInteriorDay=0.08 +SkyAmbientBottomIntensityInteriorNight=0.03 +SpecularAmountMultiplierDawn=1.0 +SpecularAmountMultiplierSunrise=1.0 +SpecularAmountMultiplierDay=1.0 +SpecularAmountMultiplierSunset=1.0 +SpecularAmountMultiplierDusk=1.0 +SpecularAmountMultiplierNight=1.0 +SpecularAmountMultiplierInteriorDay=1.0 +SpecularAmountMultiplierInteriorNight=1.0 +SpecularPowerMultiplierDawn=1.0 +SpecularPowerMultiplierSunrise=1.0 +SpecularPowerMultiplierDay=1.0 +SpecularPowerMultiplierSunset=1.0 +SpecularPowerMultiplierDusk=1.0 +SpecularPowerMultiplierNight=1.0 +SpecularPowerMultiplierInteriorDay=1.0 +SpecularPowerMultiplierInteriorNight=1.0 +[SSAO_SSIL] +UseIndirectLighting=true +SamplingQuality=1 +SamplingRange=0.25 +AOIntensity=1.1 +AOIntensityInterior=0.89 +AOAmount=1.44 +AOAmountInterior=1.2 +ILAmount=1.33 +ILAmountInterior=1.2 +AOMixingType=2 +AOMixingTypeInterior=2 +ResolutionScale=0.5 +SourceTexturesScale=0.5 +UseComplexAmbientOcclusion=true +EnableComplexFilter=true +FilterBluriness=1 +UseSelfIntersecting=true +EnableExterior=true +EnableInterior=true +[FOG] +IgnoreWeatherSystem=true +DistanceFadeDawn=1.0 +DistanceFadeSunrise=1.0 +DistanceFadeDay=1.0 +DistanceFadeSunset=1.0 +DistanceFadeDusk=1.0 +DistanceFadeNight=1.0 +DistanceFadeInteriorDay=1.0 +DistanceFadeInteriorNight=1.0 +VerticalFadeDawn=1.0 +VerticalFadeSunrise=1.0 +VerticalFadeDay=1.0 +VerticalFadeSunset=1.0 +VerticalFadeDusk=1.0 +VerticalFadeNight=1.0 +VerticalFadeInteriorDay=1.0 +VerticalFadeInteriorNight=1.0 +SunIntensityDawn=1.0 +SunIntensitySunrise=1.0 +SunIntensityDay=1.0 +SunIntensitySunset=1.0 +SunIntensityDusk=1.0 +SunIntensityNight=1.0 +SunIntensityInteriorDay=1.0 +SunIntensityInteriorNight=1.0 +SunDesaturationDawn=0.0 +SunDesaturationSunrise=0.0 +SunDesaturationDay=0.0 +SunDesaturationSunset=0.0 +SunDesaturationDusk=0.0 +SunDesaturationNight=0.0 +SunDesaturationInteriorDay=0.0 +SunDesaturationInteriorNight=0.0 +SunColorFilterDawn=1, 1, 1 +SunColorFilterSunrise=1, 1, 1 +SunColorFilterDay=1, 1, 1 +SunColorFilterSunset=1, 1, 1 +SunColorFilterDusk=1, 1, 1 +SunColorFilterNight=1, 1, 1 +SunColorFilterInteriorDay=1, 1, 1 +SunColorFilterInteriorNight=1, 1, 1 +DistanceColorMultiplierDawn=0.43 +DistanceColorMultiplierSunrise=0.51 +DistanceColorMultiplierDay=0.68 +DistanceColorMultiplierSunset=0.47 +DistanceColorMultiplierDusk=0.34 +DistanceColorMultiplierNight=0.2 +DistanceColorMultiplierInteriorDay=0.6 +DistanceColorMultiplierInteriorNight=0.31 +VerticalColorMultiplierDawn=1.0 +VerticalColorMultiplierSunrise=1.0 +VerticalColorMultiplierDay=1.0 +VerticalColorMultiplierSunset=1.0 +VerticalColorMultiplierDusk=1.0 +VerticalColorMultiplierNight=1.0 +VerticalColorMultiplierInteriorDay=1.0 +VerticalColorMultiplierInteriorNight=1.0 +[CLOUDSHADOWS] +IgnoreWeatherSystem=true +EnableAtNight=true +ForceOpacity=false +OpacityDawn=0.5 +OpacitySunrise=0.5 +OpacityDay=0.5 +OpacitySunset=0.5 +OpacityDusk=0.5 +OpacityNight=0.5 +OpacityInteriorDay=0.5 +OpacityInteriorNight=0.5 +[SHADOW] +DetailedShadowQuality=1 +[SUBSURFACESCATTERING] +IgnoreWeatherSystem=true +EnableSeparateInteriorParameters=true +Radius=3.86 +RadiusInterior=4.12 +Amount=0.67 +AmountInterior=0.7 +EpidermalAmount=1.46 +EpidermalAmountInterior=1.43 +SubdermalAmount=1.89 +SubdermalAmountInterior=2.08 +EpidermalDiffuseSaturation=-0.18 +EpidermalDiffuseSaturationInterior=-0.11 +SubdermalDiffuseSaturation=0.24 +SubdermalDiffuseSaturationInterior=0.58 +EpidermalMix=0.69 +EpidermalMixInterior=0.57 +SubdermalMix=0.52 +SubdermalMixInterior=0.59 +SubdermalTranslucency=0.76 +SubdermalTranslucencyInterior=0.64 +SubdermalPhase=0.72 +SubdermalPhaseInterior=0.61 +[WATER] +IgnoreWeatherSystem=true +EnableDispersion=true +EnableCaustics=true +EnableParallax=true +EnableSelfReflection=true +EnableDisplacement=true +DisplacementQuality=1 +ReflectionAmount=0.91 +ReflectionBlurring=0.36 +ReflectionFlatness=0.73 +FresnelMultiplier=1.69 +DispersionAmount=0.95 +CausticsAmount=0.85 +SunSpecularMultiplier=1.67 +SunScatteringMultiplier=1.35 +WavesAmplitudeDawn=0.62 +WavesAmplitudeSunrise=0.72 +WavesAmplitudeDay=0.78 +WavesAmplitudeSunset=0.74 +WavesAmplitudeDusk=0.63 +WavesAmplitudeNight=0.53 +WavesAmplitudeInteriorDay=0.68 +WavesAmplitudeInteriorNight=0.56 +[SKYLIGHTING] +IgnoreWeatherSystem=true +AmbientMinLevelDawn=0.57 +AmbientMinLevelSunrise=0.64 +AmbientMinLevelDay=0.68 +AmbientMinLevelSunset=0.61 +AmbientMinLevelDusk=0.58 +AmbientMinLevelNight=0.54 +AmbientMinLevelInteriorDay=0.66 +AmbientMinLevelInteriorNight=0.51 +[REFLECTIONS] +Quality=1 +[WEATHER] +EnableMultipleWeathers=false +EnableLocationWeather=false +[GAMEVOLUMETRICRAYS] +IgnoreWeatherSystem=true +IntensityDawn=1.0 +IntensitySunrise=1.0 +IntensityDay=1.0 +IntensitySunset=1.0 +IntensityDusk=1.0 +IntensityNight=1.0 +IntensityInteriorDay=1.0 +IntensityInteriorNight=1.0 +[GAMELENSFLARE] +IgnoreWeatherSystem=true +IntensityDawn=1.0 +IntensitySunrise=1.0 +IntensityDay=1.0 +IntensitySunset=1.0 +IntensityDusk=1.0 +IntensityNight=1.0 +IntensityInteriorDay=1.0 +IntensityInteriorNight=1.0 +[VOLUMETRICFOG] +IgnoreWeatherSystem=true +IntensityDawn=1.0 +IntensitySunrise=1.0 +IntensityDay=1.0 +IntensitySunset=1.0 +IntensityDusk=1.0 +IntensityNight=1.0 +IntensityInteriorDay=1.0 +IntensityInteriorNight=1.0 +CurveDawn=1.0 +CurveSunrise=1.0 +CurveDay=1.0 +CurveSunset=1.0 +CurveDusk=1.0 +CurveNight=1.0 +CurveInteriorDay=1.0 +CurveInteriorNight=1.0 +OpacityDawn=1.0 +OpacitySunrise=1.0 +OpacityDay=1.0 +OpacitySunset=1.0 +OpacityDusk=1.0 +OpacityNight=1.0 +OpacityInteriorDay=1.0 +OpacityInteriorNight=1.0 +ColorFilterDawn=1, 1, 1 +ColorFilterSunrise=1, 1, 1 +ColorFilterDay=1, 1, 1 +ColorFilterSunset=1, 1, 1 +ColorFilterDusk=1, 1, 1 +ColorFilterNight=1, 1, 1 +ColorFilterInteriorDay=1, 1, 1 +ColorFilterInteriorNight=1, 1, 1 +[RAIN] +IgnoreWeatherSystem=true +Enable=true +EnableSupersampling=true +UseOriginalTexture=false +MotionStretch=1.0 +MotionTransparency=0.1 +MotionBluriness=0.0 +RefractionFactor=1.0 +BrightnessDawn=1.0 +BrightnessSunrise=1.0 +BrightnessDay=1.0 +BrightnessSunset=1.0 +BrightnessDusk=1.0 +BrightnessNight=1.0 +BrightnessInteriorDay=1.0 +BrightnessInteriorNight=1.0 +[PROCEDURALSUN] +IgnoreWeatherSystem=true +Size=1.0 +EdgeSoftness=0.5 +GlowIntensityDawn=0.1 +GlowIntensitySunrise=0.1 +GlowIntensityDay=0.1 +GlowIntensitySunset=0.1 +GlowIntensityDusk=0.1 +GlowIntensityNight=0.1 +GlowIntensityInteriorDay=0.1 +GlowIntensityInteriorNight=0.1 +GlowCurveDawn=1.0 +GlowCurveSunrise=1.0 +GlowCurveDay=1.0 +GlowCurveSunset=1.0 +GlowCurveDusk=1.0 +GlowCurveNight=1.0 +GlowCurveInteriorDay=1.0 +GlowCurveInteriorNight=1.0 diff --git a/enbseries/COPYING b/enbseries/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/enbseries/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/enbseries/SMAA/AreaTex.dds b/enbseries/SMAA/AreaTex.dds new file mode 100644 index 0000000..7a3b1f8 Binary files /dev/null and b/enbseries/SMAA/AreaTex.dds differ diff --git a/enbseries/SMAA/LICENSE.txt b/enbseries/SMAA/LICENSE.txt new file mode 100644 index 0000000..dbce0e6 --- /dev/null +++ b/enbseries/SMAA/LICENSE.txt @@ -0,0 +1,24 @@ +Copyright (C) 2013 Jorge Jimenez (jorge@iryoku.com) +Copyright (C) 2013 Jose I. Echevarria (joseignacioechevarria@gmail.com) +Copyright (C) 2013 Belen Masia (bmasia@unizar.es) +Copyright (C) 2013 Fernando Navarro (fernandn@microsoft.com) +Copyright (C) 2013 Diego Gutierrez (diegog@unizar.es) + +Permission is hereby granted, free of charge, to any person obtaining a copy +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. As clarification, there is no +requirement that the copyright notice and permission be included in binary +distributions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/enbseries/SMAA/SMAA.fxh b/enbseries/SMAA/SMAA.fxh new file mode 100644 index 0000000..1c09f68 --- /dev/null +++ b/enbseries/SMAA/SMAA.fxh @@ -0,0 +1,1364 @@ +/** + * Copyright (C) 2013 Jorge Jimenez (jorge@iryoku.com) + * Copyright (C) 2013 Jose I. Echevarria (joseignacioechevarria@gmail.com) + * Copyright (C) 2013 Belen Masia (bmasia@unizar.es) + * Copyright (C) 2013 Fernando Navarro (fernandn@microsoft.com) + * Copyright (C) 2013 Diego Gutierrez (diegog@unizar.es) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to + * do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. As clarification, there + * is no requirement that the copyright notice and permission be included in + * binary distributions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +/** + * _______ ___ ___ ___ ___ + * / || \/ | / \ / \ + * | (---- | \ / | / ^ \ / ^ \ + * \ \ | |\/| | / /_\ \ / /_\ \ + * ----) | | | | | / _____ \ / _____ \ + * |_______/ |__| |__| /__/ \__\ /__/ \__\ + * + * E N H A N C E D + * S U B P I X E L M O R P H O L O G I C A L A N T I A L I A S I N G + * + * http://www.iryoku.com/smaa/ + * + * Hi, welcome aboard! + * + * Here you'll find instructions to get the shader up and running as fast as + * possible. + * + * IMPORTANTE NOTICE: when updating, remember to update both this file and the + * precomputed textures! They may change from version to version. + * + * The shader has three passes, chained together as follows: + * + * |input|------------------+ + * v | + * [ SMAA*EdgeDetection ] | + * v | + * |edgesTex| | + * v | + * [ SMAABlendingWeightCalculation ] | + * v | + * |blendTex| | + * v | + * [ SMAANeighborhoodBlending ] <------+ + * v + * |output| + * + * Note that each [pass] has its own vertex and pixel shader. Remember to use + * oversized triangles instead of quads to avoid overshading along the + * diagonal. + * + * You've three edge detection methods to choose from: luma, color or depth. + * They represent different quality/performance and anti-aliasing/sharpness + * tradeoffs, so our recommendation is for you to choose the one that best + * suits your particular scenario: + * + * - Depth edge detection is usually the fastest but it may miss some edges. + * + * - Luma edge detection is usually more expensive than depth edge detection, + * but catches visible edges that depth edge detection can miss. + * + * - Color edge detection is usually the most expensive one but catches + * chroma-only edges. + * + * For quickstarters: just use luma edge detection. + * + * The general advice is to not rush the integration process and ensure each + * step is done correctly (don't try to integrate SMAA T2x with predicated edge + * detection from the start!). Ok then, let's go! + * + * 1. The first step is to create two RGBA temporal render targets for holding + * |edgesTex| and |blendTex|. + * + * In DX10 or DX11, you can use a RG render target for the edges texture. + * In the case of NVIDIA GPUs, using RG render targets seems to actually be + * slower. + * + * On the Xbox 360, you can use the same render target for resolving both + * |edgesTex| and |blendTex|, as they aren't needed simultaneously. + * + * 2. Both temporal render targets |edgesTex| and |blendTex| must be cleared + * each frame. Do not forget to clear the alpha channel! + * + * 3. The next step is loading the two supporting precalculated textures, + * 'areaTex' and 'searchTex'. You'll find them in the 'Textures' folder as + * C++ headers, and also as regular DDS files. They'll be needed for the + * 'SMAABlendingWeightCalculation' pass. + * + * If you use the C++ headers, be sure to load them in the format specified + * inside of them. + * + * You can also compress 'areaTex' and 'searchTex' using BC5 and BC4 + * respectively, if you have that option in your content processor pipeline. + * When compressing then, you get a non-perceptible quality decrease, and a + * marginal performance increase. + * + * 4. All samplers must be set to linear filtering and clamp. + * + * After you get the technique working, remember that 64-bit inputs have + * half-rate linear filtering on GCN. + * + * If SMAA is applied to 64-bit color buffers, switching to point filtering + * when accesing them will increase the performance. Search for + * 'SMAASamplePoint' to see which textures may benefit from point + * filtering, and where (which is basically the color input in the edge + * detection and resolve passes). + * + * 5. All texture reads and buffer writes must be non-sRGB, with the exception + * of the input read and the output write in + * 'SMAANeighborhoodBlending' (and only in this pass!). If sRGB reads in + * this last pass are not possible, the technique will work anyway, but + * will perform antialiasing in gamma space. + * + * IMPORTANT: for best results the input read for the color/luma edge + * detection should *NOT* be sRGB. + * + * 6. Before including SMAA.h you'll have to setup the render target metrics, + * the target and any optional configuration defines. Optionally you can + * use a preset. + * + * You have the following targets available: + * SMAA_HLSL_3 + * SMAA_HLSL_4 + * SMAA_HLSL_4_1 + * SMAA_GLSL_3 * + * SMAA_GLSL_4 * + * + * * (See SMAA_INCLUDE_VS and SMAA_INCLUDE_PS below). + * + * And four presets: + * SMAA_PRESET_LOW (%60 of the quality) + * SMAA_PRESET_MEDIUM (%80 of the quality) + * SMAA_PRESET_HIGH (%95 of the quality) + * SMAA_PRESET_ULTRA (%99 of the quality) + * + * For example: + * #define SMAA_RT_METRICS float4(1.0 / 1280.0, 1.0 / 720.0, 1280.0, 720.0) + * #define SMAA_HLSL_4 + * #define SMAA_PRESET_HIGH + * #include "SMAA.h" + * + * Note that SMAA_RT_METRICS doesn't need to be a macro, it can be a + * uniform variable. The code is designed to minimize the impact of not + * using a constant value, but it is still better to hardcode it. + * + * Depending on how you encoded 'areaTex' and 'searchTex', you may have to + * add (and customize) the following defines before including SMAA.h: + * #define SMAA_AREATEX_SELECT(sample) sample.rg + * #define SMAA_SEARCHTEX_SELECT(sample) sample.r + * + * If your engine is already using porting macros, you can define + * SMAA_CUSTOM_SL, and define the porting functions by yourself. + * + * 7. Then, you'll have to setup the passes as indicated in the scheme above. + * You can take a look into SMAA.fx, to see how we did it for our demo. + * Checkout the function wrappers, you may want to copy-paste them! + * + * 8. It's recommended to validate the produced |edgesTex| and |blendTex|. + * You can use a screenshot from your engine to compare the |edgesTex| + * and |blendTex| produced inside of the engine with the results obtained + * with the reference demo. + * + * 9. After you get the last pass to work, it's time to optimize. You'll have + * to initialize a stencil buffer in the first pass (discard is already in + * the code), then mask execution by using it the second pass. The last + * pass should be executed in all pixels. + * + * + * After this point you can choose to enable predicated thresholding, + * temporal supersampling and motion blur integration: + * + * a) If you want to use predicated thresholding, take a look into + * SMAA_PREDICATION; you'll need to pass an extra texture in the edge + * detection pass. + * + * b) If you want to enable temporal supersampling (SMAA T2x): + * + * 1. The first step is to render using subpixel jitters. I won't go into + * detail, but it's as simple as moving each vertex position in the + * vertex shader, you can check how we do it in our DX10 demo. + * + * 2. Then, you must setup the temporal resolve. You may want to take a look + * into SMAAResolve for resolving 2x modes. After you get it working, you'll + * probably see ghosting everywhere. But fear not, you can enable the + * CryENGINE temporal reprojection by setting the SMAA_REPROJECTION macro. + * Check out SMAA_DECODE_VELOCITY if your velocity buffer is encoded. + * + * 3. The next step is to apply SMAA to each subpixel jittered frame, just as + * done for 1x. + * + * 4. At this point you should already have something usable, but for best + * results the proper area textures must be set depending on current jitter. + * For this, the parameter 'subsampleIndices' of + * 'SMAABlendingWeightCalculationPS' must be set as follows, for our T2x + * mode: + * + * @SUBSAMPLE_INDICES + * + * | S# | Camera Jitter | subsampleIndices | + * +----+------------------+---------------------+ + * | 0 | ( 0.25, -0.25) | float4(1, 1, 1, 0) | + * | 1 | (-0.25, 0.25) | float4(2, 2, 2, 0) | + * + * These jitter positions assume a bottom-to-top y axis. S# stands for the + * sample number. + * + * More information about temporal supersampling here: + * http://iryoku.com/aacourse/downloads/13-Anti-Aliasing-Methods-in-CryENGINE-3.pdf + * + * c) If you want to enable spatial multisampling (SMAA S2x): + * + * 1. The scene must be rendered using MSAA 2x. The MSAA 2x buffer must be + * created with: + * - DX10: see below (*) + * - DX10.1: D3D10_STANDARD_MULTISAMPLE_PATTERN or + * - DX11: D3D11_STANDARD_MULTISAMPLE_PATTERN + * + * This allows to ensure that the subsample order matches the table in + * @SUBSAMPLE_INDICES. + * + * (*) In the case of DX10, we refer the reader to: + * - SMAA::detectMSAAOrder and + * - SMAA::msaaReorder + * + * These functions allow to match the standard multisample patterns by + * detecting the subsample order for a specific GPU, and reordering + * them appropriately. + * + * 2. A shader must be run to output each subsample into a separate buffer + * (DX10 is required). You can use SMAASeparate for this purpose, or just do + * it in an existing pass (for example, in the tone mapping pass, which has + * the advantage of feeding tone mapped subsamples to SMAA, which will yield + * better results). + * + * 3. The full SMAA 1x pipeline must be run for each separated buffer, storing + * the results in the final buffer. The second run should alpha blend with + * the existing final buffer using a blending factor of 0.5. + * 'subsampleIndices' must be adjusted as in the SMAA T2x case (see point + * b). + * + * d) If you want to enable temporal supersampling on top of SMAA S2x + * (which actually is SMAA 4x): + * + * 1. SMAA 4x consists on temporally jittering SMAA S2x, so the first step is + * to calculate SMAA S2x for current frame. In this case, 'subsampleIndices' + * must be set as follows: + * + * | F# | S# | Camera Jitter | Net Jitter | subsampleIndices | + * +----+----+--------------------+-------------------+----------------------+ + * | 0 | 0 | ( 0.125, 0.125) | ( 0.375, -0.125) | float4(5, 3, 1, 3) | + * | 0 | 1 | ( 0.125, 0.125) | (-0.125, 0.375) | float4(4, 6, 2, 3) | + * +----+----+--------------------+-------------------+----------------------+ + * | 1 | 2 | (-0.125, -0.125) | ( 0.125, -0.375) | float4(3, 5, 1, 4) | + * | 1 | 3 | (-0.125, -0.125) | (-0.375, 0.125) | float4(6, 4, 2, 4) | + * + * These jitter positions assume a bottom-to-top y axis. F# stands for the + * frame number. S# stands for the sample number. + * + * 2. After calculating SMAA S2x for current frame (with the new subsample + * indices), previous frame must be reprojected as in SMAA T2x mode (see + * point b). + * + * e) If motion blur is used, you may want to do the edge detection pass + * together with motion blur. This has two advantages: + * + * 1. Pixels under heavy motion can be omitted from the edge detection process. + * For these pixels we can just store "no edge", as motion blur will take + * care of them. + * 2. The center pixel tap is reused. + * + * Note that in this case depth testing should be used instead of stenciling, + * as we have to write all the pixels in the motion blur pass. + * + * That's it! + */ + +//----------------------------------------------------------------------------- +// SMAA Presets + +/** + * Note that if you use one of these presets, the following configuration + * macros will be ignored if set in the "Configurable Defines" section. + */ + +#if defined(SMAA_PRESET_LOW) +#define SMAA_THRESHOLD 0.15 +#define SMAA_MAX_SEARCH_STEPS 4 +#define SMAA_DISABLE_DIAG_DETECTION +#define SMAA_DISABLE_CORNER_DETECTION +#elif defined(SMAA_PRESET_MEDIUM) +#define SMAA_THRESHOLD 0.1 +#define SMAA_MAX_SEARCH_STEPS 8 +#define SMAA_DISABLE_DIAG_DETECTION +#define SMAA_DISABLE_CORNER_DETECTION +#elif defined(SMAA_PRESET_HIGH) +#define SMAA_THRESHOLD 0.1 +#define SMAA_MAX_SEARCH_STEPS 16 +#define SMAA_MAX_SEARCH_STEPS_DIAG 8 +#define SMAA_CORNER_ROUNDING 25 +#elif defined(SMAA_PRESET_ULTRA) +#define SMAA_THRESHOLD 0.05 +#define SMAA_MAX_SEARCH_STEPS 32 +#define SMAA_MAX_SEARCH_STEPS_DIAG 16 +#define SMAA_CORNER_ROUNDING 25 +#endif + +//----------------------------------------------------------------------------- +// Configurable Defines + +/** + * SMAA_THRESHOLD specifies the threshold or sensitivity to edges. + * Lowering this value you will be able to detect more edges at the expense of + * performance. + * + * Range: [0, 0.5] + * 0.1 is a reasonable value, and allows to catch most visible edges. + * 0.05 is a rather overkill value, that allows to catch 'em all. + * + * If temporal supersampling is used, 0.2 could be a reasonable value, as low + * contrast edges are properly filtered by just 2x. + */ +#ifndef SMAA_THRESHOLD +#define SMAA_THRESHOLD 0.1 +#endif + +/** + * SMAA_DEPTH_THRESHOLD specifies the threshold for depth edge detection. + * + * Range: depends on the depth range of the scene. + */ +#ifndef SMAA_DEPTH_THRESHOLD +#define SMAA_DEPTH_THRESHOLD (0.1 * SMAA_THRESHOLD) +#endif + +/** + * SMAA_MAX_SEARCH_STEPS specifies the maximum steps performed in the + * horizontal/vertical pattern searches, at each side of the pixel. + * + * In number of pixels, it's actually the double. So the maximum line length + * perfectly handled by, for example 16, is 64 (by perfectly, we meant that + * longer lines won't look as good, but still antialiased). + * + * Range: [0, 112] + */ +#ifndef SMAA_MAX_SEARCH_STEPS +#define SMAA_MAX_SEARCH_STEPS 16 +#endif + +/** + * SMAA_MAX_SEARCH_STEPS_DIAG specifies the maximum steps performed in the + * diagonal pattern searches, at each side of the pixel. In this case we jump + * one pixel at time, instead of two. + * + * Range: [0, 20] + * + * On high-end machines it is cheap (between a 0.8x and 0.9x slower for 16 + * steps), but it can have a significant impact on older machines. + * + * Define SMAA_DISABLE_DIAG_DETECTION to disable diagonal processing. + */ +#ifndef SMAA_MAX_SEARCH_STEPS_DIAG +#define SMAA_MAX_SEARCH_STEPS_DIAG 8 +#endif + +/** + * SMAA_CORNER_ROUNDING specifies how much sharp corners will be rounded. + * + * Range: [0, 100] + * + * Define SMAA_DISABLE_CORNER_DETECTION to disable corner processing. + */ +#ifndef SMAA_CORNER_ROUNDING +#define SMAA_CORNER_ROUNDING 25 +#endif + +/** + * If there is an neighbor edge that has SMAA_LOCAL_CONTRAST_FACTOR times + * bigger contrast than current edge, current edge will be discarded. + * + * This allows to eliminate spurious crossing edges, and is based on the fact + * that, if there is too much contrast in a direction, that will hide + * perceptually contrast in the other neighbors. + */ +#ifndef SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR +#define SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR 2.0 +#endif + +/** + * Predicated thresholding allows to better preserve texture details and to + * improve performance, by decreasing the number of detected edges using an + * additional buffer like the light accumulation buffer, object ids or even the + * depth buffer (the depth buffer usage may be limited to indoor or short range + * scenes). + * + * It locally decreases the luma or color threshold if an edge is found in an + * additional buffer (so the global threshold can be higher). + * + * This method was developed by Playstation EDGE MLAA team, and used in + * Killzone 3, by using the light accumulation buffer. More information here: + * http://iryoku.com/aacourse/downloads/06-MLAA-on-PS3.pptx + */ +#ifndef SMAA_PREDICATION +#define SMAA_PREDICATION 0 +#endif + +/** + * Threshold to be used in the additional predication buffer. + * + * Range: depends on the input, so you'll have to find the magic number that + * works for you. + */ +#ifndef SMAA_PREDICATION_THRESHOLD +#define SMAA_PREDICATION_THRESHOLD 0.01 +#endif + +/** + * How much to scale the global threshold used for luma or color edge + * detection when using predication. + * + * Range: [1, 5] + */ +#ifndef SMAA_PREDICATION_SCALE +#define SMAA_PREDICATION_SCALE 2.0 +#endif + +/** + * How much to locally decrease the threshold. + * + * Range: [0, 1] + */ +#ifndef SMAA_PREDICATION_STRENGTH +#define SMAA_PREDICATION_STRENGTH 0.4 +#endif + +/** + * Temporal reprojection allows to remove ghosting artifacts when using + * temporal supersampling. We use the CryEngine 3 method which also introduces + * velocity weighting. This feature is of extreme importance for totally + * removing ghosting. More information here: + * http://iryoku.com/aacourse/downloads/13-Anti-Aliasing-Methods-in-CryENGINE-3.pdf + * + * Note that you'll need to setup a velocity buffer for enabling reprojection. + * For static geometry, saving the previous depth buffer is a viable + * alternative. + */ +#ifndef SMAA_REPROJECTION +#define SMAA_REPROJECTION 0 +#endif + +/** + * SMAA_REPROJECTION_WEIGHT_SCALE controls the velocity weighting. It allows to + * remove ghosting trails behind the moving object, which are not removed by + * just using reprojection. Using low values will exhibit ghosting, while using + * high values will disable temporal supersampling under motion. + * + * Behind the scenes, velocity weighting removes temporal supersampling when + * the velocity of the subsamples differs (meaning they are different objects). + * + * Range: [0, 80] + */ +#ifndef SMAA_REPROJECTION_WEIGHT_SCALE +#define SMAA_REPROJECTION_WEIGHT_SCALE 30.0 +#endif + +/** + * On some compilers, discard cannot be used in vertex shaders. Thus, they need + * to be compiled separately. + */ +#ifndef SMAA_INCLUDE_VS +#define SMAA_INCLUDE_VS 1 +#endif +#ifndef SMAA_INCLUDE_PS +#define SMAA_INCLUDE_PS 1 +#endif + +//----------------------------------------------------------------------------- +// Texture Access Defines + +#ifndef SMAA_AREATEX_SELECT +#if defined(SMAA_HLSL_3) +#define SMAA_AREATEX_SELECT(sample) sample.ra +#else +#define SMAA_AREATEX_SELECT(sample) sample.rg +#endif +#endif + +#ifndef SMAA_SEARCHTEX_SELECT +#define SMAA_SEARCHTEX_SELECT(sample) sample.r +#endif + +#ifndef SMAA_DECODE_VELOCITY +#define SMAA_DECODE_VELOCITY(sample) sample.rg +#endif + +//----------------------------------------------------------------------------- +// Non-Configurable Defines + +#define SMAA_AREATEX_MAX_DISTANCE 16 +#define SMAA_AREATEX_MAX_DISTANCE_DIAG 20 +#define SMAA_AREATEX_PIXEL_SIZE (1.0 / float2(160.0, 560.0)) +#define SMAA_AREATEX_SUBTEX_SIZE (1.0 / 7.0) +#define SMAA_SEARCHTEX_SIZE float2(66.0, 33.0) +#define SMAA_SEARCHTEX_PACKED_SIZE float2(64.0, 16.0) +#define SMAA_CORNER_ROUNDING_NORM (float(SMAA_CORNER_ROUNDING) / 100.0) + +//----------------------------------------------------------------------------- +// Porting Functions + +#if defined(SMAA_HLSL_3) +#define SMAATexture2D(tex) sampler2D tex +#define SMAATexturePass2D(tex) tex +#define SMAASampleLevelZero(tex, coord) tex2Dlod(tex, float4(coord, 0.0, 0.0)) +#define SMAASampleLevelZeroPoint(tex, coord) tex2Dlod(tex, float4(coord, 0.0, 0.0)) +#define SMAASampleLevelZeroOffset(tex, coord, offset) tex2Dlod(tex, float4(coord + offset * SMAA_RT_METRICS.xy, 0.0, 0.0)) +#define SMAASample(tex, coord) tex2D(tex, coord) +#define SMAASamplePoint(tex, coord) tex2D(tex, coord) +#define SMAASampleOffset(tex, coord, offset) tex2D(tex, coord + offset * SMAA_RT_METRICS.xy) +#define SMAA_FLATTEN [flatten] +#define SMAA_BRANCH [branch] +#endif +#if defined(SMAA_HLSL_4) || defined(SMAA_HLSL_4_1) +SamplerState LinearSampler { Filter = MIN_MAG_LINEAR_MIP_POINT; AddressU = Clamp; AddressV = Clamp; }; +SamplerState PointSampler { Filter = MIN_MAG_MIP_POINT; AddressU = Clamp; AddressV = Clamp; }; +#define SMAATexture2D(tex) Texture2D tex +#define SMAATexturePass2D(tex) tex +#define SMAASampleLevelZero(tex, coord) tex.SampleLevel(LinearSampler, coord, 0) +#define SMAASampleLevelZeroPoint(tex, coord) tex.SampleLevel(PointSampler, coord, 0) +#define SMAASampleLevelZeroOffset(tex, coord, offset) tex.SampleLevel(LinearSampler, coord, 0, offset) +#define SMAASample(tex, coord) tex.Sample(LinearSampler, coord) +#define SMAASamplePoint(tex, coord) tex.Sample(PointSampler, coord) +#define SMAASampleOffset(tex, coord, offset) tex.Sample(LinearSampler, coord, offset) +#define SMAA_FLATTEN [flatten] +#define SMAA_BRANCH [branch] +#define SMAATexture2DMS2(tex) Texture2DMS tex +#define SMAALoad(tex, pos, sample) tex.Load(pos, sample) +#if defined(SMAA_HLSL_4_1) +#define SMAAGather(tex, coord) tex.Gather(LinearSampler, coord, 0) +#endif +#endif +#if defined(SMAA_GLSL_3) || defined(SMAA_GLSL_4) +#define SMAATexture2D(tex) sampler2D tex +#define SMAATexturePass2D(tex) tex +#define SMAASampleLevelZero(tex, coord) textureLod(tex, coord, 0.0) +#define SMAASampleLevelZeroPoint(tex, coord) textureLod(tex, coord, 0.0) +#define SMAASampleLevelZeroOffset(tex, coord, offset) textureLodOffset(tex, coord, 0.0, offset) +#define SMAASample(tex, coord) texture(tex, coord) +#define SMAASamplePoint(tex, coord) texture(tex, coord) +#define SMAASampleOffset(tex, coord, offset) texture(tex, coord, offset) +#define SMAA_FLATTEN +#define SMAA_BRANCH +#define lerp(a, b, t) mix(a, b, t) +#define saturate(a) clamp(a, 0.0, 1.0) +#if defined(SMAA_GLSL_4) +#define mad(a, b, c) fma(a, b, c) +#define SMAAGather(tex, coord) textureGather(tex, coord) +#else +#define mad(a, b, c) (a * b + c) +#endif +#define float2 vec2 +#define float3 vec3 +#define float4 vec4 +#define int2 ivec2 +#define int3 ivec3 +#define int4 ivec4 +#define bool2 bvec2 +#define bool3 bvec3 +#define bool4 bvec4 +#endif + +#if !defined(SMAA_HLSL_3) && !defined(SMAA_HLSL_4) && !defined(SMAA_HLSL_4_1) && !defined(SMAA_GLSL_3) && !defined(SMAA_GLSL_4) && !defined(SMAA_CUSTOM_SL) +#error you must define the shading language: SMAA_HLSL_*, SMAA_GLSL_* or SMAA_CUSTOM_SL +#endif + +//----------------------------------------------------------------------------- +// Misc functions + +/** + * Gathers current pixel, and the top-left neighbors. + */ +float3 SMAAGatherNeighbours(float2 texcoord, + float4 offset[3], + SMAATexture2D(tex)) { + #ifdef SMAAGather + return SMAAGather(tex, texcoord + SMAA_RT_METRICS.xy * float2(-0.5, -0.5)).grb; + #else + float P = SMAASamplePoint(tex, texcoord).r; + float Pleft = SMAASamplePoint(tex, offset[0].xy).r; + float Ptop = SMAASamplePoint(tex, offset[0].zw).r; + return float3(P, Pleft, Ptop); + #endif +} + +/** + * Adjusts the threshold by means of predication. + */ +float2 SMAACalculatePredicatedThreshold(float2 texcoord, + float4 offset[3], + SMAATexture2D(predicationTex)) { + float3 neighbours = SMAAGatherNeighbours(texcoord, offset, SMAATexturePass2D(predicationTex)); + float2 delta = abs(neighbours.xx - neighbours.yz); + float2 edges = step(SMAA_PREDICATION_THRESHOLD, delta); + return SMAA_PREDICATION_SCALE * SMAA_THRESHOLD * (1.0 - SMAA_PREDICATION_STRENGTH * edges); +} + +/** + * Conditional move: + */ +void SMAAMovc(bool2 cond, inout float2 variable, float2 value) { + SMAA_FLATTEN if (cond.x) variable.x = value.x; + SMAA_FLATTEN if (cond.y) variable.y = value.y; +} + +void SMAAMovc(bool4 cond, inout float4 variable, float4 value) { + SMAAMovc(cond.xy, variable.xy, value.xy); + SMAAMovc(cond.zw, variable.zw, value.zw); +} + + +#if SMAA_INCLUDE_VS +//----------------------------------------------------------------------------- +// Vertex Shaders + +/** + * Edge Detection Vertex Shader + */ +void SMAAEdgeDetectionVS(float2 texcoord, + out float4 offset[3]) { + offset[0] = mad(SMAA_RT_METRICS.xyxy, float4(-1.0, 0.0, 0.0, -1.0), texcoord.xyxy); + offset[1] = mad(SMAA_RT_METRICS.xyxy, float4( 1.0, 0.0, 0.0, 1.0), texcoord.xyxy); + offset[2] = mad(SMAA_RT_METRICS.xyxy, float4(-2.0, 0.0, 0.0, -2.0), texcoord.xyxy); +} + +/** + * Blend Weight Calculation Vertex Shader + */ +void SMAABlendingWeightCalculationVS(float2 texcoord, + out float2 pixcoord, + out float4 offset[3]) { + pixcoord = texcoord * SMAA_RT_METRICS.zw; + + // We will use these offsets for the searches later on (see @PSEUDO_GATHER4): + offset[0] = mad(SMAA_RT_METRICS.xyxy, float4(-0.25, -0.125, 1.25, -0.125), texcoord.xyxy); + offset[1] = mad(SMAA_RT_METRICS.xyxy, float4(-0.125, -0.25, -0.125, 1.25), texcoord.xyxy); + + // And these for the searches, they indicate the ends of the loops: + offset[2] = mad(SMAA_RT_METRICS.xxyy, + float4(-2.0, 2.0, -2.0, 2.0) * float(SMAA_MAX_SEARCH_STEPS), + float4(offset[0].xz, offset[1].yw)); +} + +/** + * Neighborhood Blending Vertex Shader + */ +void SMAANeighborhoodBlendingVS(float2 texcoord, + out float4 offset) { + offset = mad(SMAA_RT_METRICS.xyxy, float4( 1.0, 0.0, 0.0, 1.0), texcoord.xyxy); +} +#endif // SMAA_INCLUDE_VS + +#if SMAA_INCLUDE_PS +//----------------------------------------------------------------------------- +// Edge Detection Pixel Shaders (First Pass) + +/** + * Luma Edge Detection + * + * IMPORTANT NOTICE: luma edge detection requires gamma-corrected colors, and + * thus 'colorTex' should be a non-sRGB texture. + */ +float2 SMAALumaEdgeDetectionPS(float2 texcoord, + float4 offset[3], + SMAATexture2D(colorTex) + #if SMAA_PREDICATION + , SMAATexture2D(predicationTex) + #endif + ) { + // Calculate the threshold: + #if SMAA_PREDICATION + float2 threshold = SMAACalculatePredicatedThreshold(texcoord, offset, SMAATexturePass2D(predicationTex)); + #else + float2 threshold = float2(SMAA_THRESHOLD, SMAA_THRESHOLD); + #endif + + // Calculate lumas: + float3 weights = float3(0.2126, 0.7152, 0.0722); + float L = dot(SMAASamplePoint(colorTex, texcoord).rgb, weights); + + float Lleft = dot(SMAASamplePoint(colorTex, offset[0].xy).rgb, weights); + float Ltop = dot(SMAASamplePoint(colorTex, offset[0].zw).rgb, weights); + + // We do the usual threshold: + float4 delta; + delta.xy = abs(L - float2(Lleft, Ltop)); + float2 edges = step(threshold, delta.xy); + + // Then discard if there is no edge: + if (dot(edges, float2(1.0, 1.0)) == 0.0) + return float2(0.0, 0.0); // use of discard produces garbage data in ENB + // discard; + + // Calculate right and bottom deltas: + float Lright = dot(SMAASamplePoint(colorTex, offset[1].xy).rgb, weights); + float Lbottom = dot(SMAASamplePoint(colorTex, offset[1].zw).rgb, weights); + delta.zw = abs(L - float2(Lright, Lbottom)); + + // Calculate the maximum delta in the direct neighborhood: + float2 maxDelta = max(delta.xy, delta.zw); + + // Calculate left-left and top-top deltas: + float Lleftleft = dot(SMAASamplePoint(colorTex, offset[2].xy).rgb, weights); + float Ltoptop = dot(SMAASamplePoint(colorTex, offset[2].zw).rgb, weights); + delta.zw = abs(float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop)); + + // Calculate the final maximum delta: + maxDelta = max(maxDelta.xy, delta.zw); + float finalDelta = max(maxDelta.x, maxDelta.y); + + // Local contrast adaptation: + edges.xy *= step(finalDelta, SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR * delta.xy); + + return edges; +} + +/** + * Color Edge Detection + * + * IMPORTANT NOTICE: color edge detection requires gamma-corrected colors, and + * thus 'colorTex' should be a non-sRGB texture. + */ +float2 SMAAColorEdgeDetectionPS(float2 texcoord, + float4 offset[3], + SMAATexture2D(colorTex) + #if SMAA_PREDICATION + , SMAATexture2D(predicationTex) + #endif + ) { + // Calculate the threshold: + #if SMAA_PREDICATION + float2 threshold = SMAACalculatePredicatedThreshold(texcoord, offset, predicationTex); + #else + float2 threshold = float2(SMAA_THRESHOLD, SMAA_THRESHOLD); + #endif + + // Calculate color deltas: + float4 delta; + float3 C = SMAASamplePoint(colorTex, texcoord).rgb; + + float3 Cleft = SMAASamplePoint(colorTex, offset[0].xy).rgb; + float3 t = abs(C - Cleft); + delta.x = max(max(t.r, t.g), t.b); + + float3 Ctop = SMAASamplePoint(colorTex, offset[0].zw).rgb; + t = abs(C - Ctop); + delta.y = max(max(t.r, t.g), t.b); + + // We do the usual threshold: + float2 edges = step(threshold, delta.xy); + + // Then discard if there is no edge: + if (dot(edges, float2(1.0, 1.0)) == 0.0) + return float2(0.0, 0.0); // use of discard produces garbage data in ENB + // discard; + + // Calculate right and bottom deltas: + float3 Cright = SMAASamplePoint(colorTex, offset[1].xy).rgb; + t = abs(C - Cright); + delta.z = max(max(t.r, t.g), t.b); + + float3 Cbottom = SMAASamplePoint(colorTex, offset[1].zw).rgb; + t = abs(C - Cbottom); + delta.w = max(max(t.r, t.g), t.b); + + // Calculate the maximum delta in the direct neighborhood: + float2 maxDelta = max(delta.xy, delta.zw); + + // Calculate left-left and top-top deltas: + float3 Cleftleft = SMAASamplePoint(colorTex, offset[2].xy).rgb; + t = abs(C - Cleftleft); + delta.z = max(max(t.r, t.g), t.b); + + float3 Ctoptop = SMAASamplePoint(colorTex, offset[2].zw).rgb; + t = abs(C - Ctoptop); + delta.w = max(max(t.r, t.g), t.b); + + // Calculate the final maximum delta: + maxDelta = max(maxDelta.xy, delta.zw); + float finalDelta = max(maxDelta.x, maxDelta.y); + + // Local contrast adaptation: + edges.xy *= step(finalDelta, SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR * delta.xy); + + return edges; +} + +/** + * Depth Edge Detection + */ +float2 SMAADepthEdgeDetectionPS(float2 texcoord, + float4 offset[3], + SMAATexture2D(depthTex)) { + float3 neighbours = SMAAGatherNeighbours(texcoord, offset, SMAATexturePass2D(depthTex)); + float2 delta = abs(neighbours.xx - float2(neighbours.y, neighbours.z)); + float2 edges = step(SMAA_DEPTH_THRESHOLD, delta); + + if (dot(edges, float2(1.0, 1.0)) == 0.0) + return float2(0.0, 0.0); // use of discard produces garbage data in ENB + // discard; + + return edges; +} + +//----------------------------------------------------------------------------- +// Diagonal Search Functions + +#if !defined(SMAA_DISABLE_DIAG_DETECTION) + +/** + * Allows to decode two binary values from a bilinear-filtered access. + */ +float2 SMAADecodeDiagBilinearAccess(float2 e) { + // Bilinear access for fetching 'e' have a 0.25 offset, and we are + // interested in the R and G edges: + // + // +---G---+-------+ + // | x o R x | + // +-------+-------+ + // + // Then, if one of these edge is enabled: + // Red: (0.75 * X + 0.25 * 1) => 0.25 or 1.0 + // Green: (0.75 * 1 + 0.25 * X) => 0.75 or 1.0 + // + // This function will unpack the values (mad + mul + round): + // wolframalpha.com: round(x * abs(5 * x - 5 * 0.75)) plot 0 to 1 + e.r = e.r * abs(5.0 * e.r - 5.0 * 0.75); + return round(e); +} + +float4 SMAADecodeDiagBilinearAccess(float4 e) { + e.rb = e.rb * abs(5.0 * e.rb - 5.0 * 0.75); + return round(e); +} + +/** + * These functions allows to perform diagonal pattern searches. + */ +float2 SMAASearchDiag1(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out float2 e) { + float4 coord = float4(texcoord, -1.0, 1.0); + float3 t = float3(SMAA_RT_METRICS.xy, 1.0); + while (coord.z < float(SMAA_MAX_SEARCH_STEPS_DIAG - 1) && + coord.w > 0.9) { + coord.xyz = mad(t, float3(dir, 1.0), coord.xyz); + e = SMAASampleLevelZero(edgesTex, coord.xy).rg; + coord.w = dot(e, float2(0.5, 0.5)); + } + return coord.zw; +} + +float2 SMAASearchDiag2(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out float2 e) { + float4 coord = float4(texcoord, -1.0, 1.0); + coord.x += 0.25 * SMAA_RT_METRICS.x; // See @SearchDiag2Optimization + float3 t = float3(SMAA_RT_METRICS.xy, 1.0); + while (coord.z < float(SMAA_MAX_SEARCH_STEPS_DIAG - 1) && + coord.w > 0.9) { + coord.xyz = mad(t, float3(dir, 1.0), coord.xyz); + + // @SearchDiag2Optimization + // Fetch both edges at once using bilinear filtering: + e = SMAASampleLevelZero(edgesTex, coord.xy).rg; + e = SMAADecodeDiagBilinearAccess(e); + + // Non-optimized version: + // e.g = SMAASampleLevelZero(edgesTex, coord.xy).g; + // e.r = SMAASampleLevelZeroOffset(edgesTex, coord.xy, int2(1, 0)).r; + + coord.w = dot(e, float2(0.5, 0.5)); + } + return coord.zw; +} + +/** + * Similar to SMAAArea, this calculates the area corresponding to a certain + * diagonal distance and crossing edges 'e'. + */ +float2 SMAAAreaDiag(SMAATexture2D(areaTex), float2 dist, float2 e, float offset) { + float2 texcoord = mad(float2(SMAA_AREATEX_MAX_DISTANCE_DIAG, SMAA_AREATEX_MAX_DISTANCE_DIAG), e, dist); + + // We do a scale and bias for mapping to texel space: + texcoord = mad(SMAA_AREATEX_PIXEL_SIZE, texcoord, 0.5 * SMAA_AREATEX_PIXEL_SIZE); + + // Diagonal areas are on the second half of the texture: + texcoord.x += 0.5; + + // Move to proper place, according to the subpixel offset: + texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset; + + // Do it! + return SMAA_AREATEX_SELECT(SMAASampleLevelZero(areaTex, texcoord)); +} + +/** + * This searches for diagonal patterns and returns the corresponding weights. + */ +float2 SMAACalculateDiagWeights(SMAATexture2D(edgesTex), SMAATexture2D(areaTex), float2 texcoord, float2 e, float4 subsampleIndices) { + float2 weights = float2(0.0, 0.0); + + // Search for the line ends: + float4 d; + float2 end; + if (e.r > 0.0) { + d.xz = SMAASearchDiag1(SMAATexturePass2D(edgesTex), texcoord, float2(-1.0, 1.0), end); + d.x += float(end.y > 0.9); + } else + d.xz = float2(0.0, 0.0); + d.yw = SMAASearchDiag1(SMAATexturePass2D(edgesTex), texcoord, float2(1.0, -1.0), end); + + SMAA_BRANCH + if (d.x + d.y > 2.0) { // d.x + d.y + 1 > 3 + // Fetch the crossing edges: + float4 coords = mad(float4(-d.x + 0.25, d.x, d.y, -d.y - 0.25), SMAA_RT_METRICS.xyxy, texcoord.xyxy); + float4 c; + c.xy = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-1, 0)).rg; + c.zw = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, 0)).rg; + c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw); + + // Non-optimized version: + // float4 coords = mad(float4(-d.x, d.x, d.y, -d.y), SMAA_RT_METRICS.xyxy, texcoord.xyxy); + // float4 c; + // c.x = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-1, 0)).g; + // c.y = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2( 0, 0)).r; + // c.z = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, 0)).g; + // c.w = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, -1)).r; + + // Merge crossing edges at each side into a single value: + float2 cc = mad(float2(2.0, 2.0), c.xz, c.yw); + + // Remove the crossing edge if we didn't found the end of the line: + SMAAMovc(bool2(step(0.9, d.zw)), cc, float2(0.0, 0.0)); + + // Fetch the areas for this line: + weights += SMAAAreaDiag(SMAATexturePass2D(areaTex), d.xy, cc, subsampleIndices.z); + } + + // Search for the line ends: + d.xz = SMAASearchDiag2(SMAATexturePass2D(edgesTex), texcoord, float2(-1.0, -1.0), end); + if (SMAASampleLevelZeroOffset(edgesTex, texcoord, int2(1, 0)).r > 0.0) { + d.yw = SMAASearchDiag2(SMAATexturePass2D(edgesTex), texcoord, float2(1.0, 1.0), end); + d.y += float(end.y > 0.9); + } else + d.yw = float2(0.0, 0.0); + + SMAA_BRANCH + if (d.x + d.y > 2.0) { // d.x + d.y + 1 > 3 + // Fetch the crossing edges: + float4 coords = mad(float4(-d.x, -d.x, d.y, d.y), SMAA_RT_METRICS.xyxy, texcoord.xyxy); + float4 c; + c.x = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-1, 0)).g; + c.y = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2( 0, -1)).r; + c.zw = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, 0)).gr; + float2 cc = mad(float2(2.0, 2.0), c.xz, c.yw); + + // Remove the crossing edge if we didn't found the end of the line: + SMAAMovc(bool2(step(0.9, d.zw)), cc, float2(0.0, 0.0)); + + // Fetch the areas for this line: + weights += SMAAAreaDiag(SMAATexturePass2D(areaTex), d.xy, cc, subsampleIndices.w).gr; + } + + return weights; +} +#endif + +//----------------------------------------------------------------------------- +// Horizontal/Vertical Search Functions + +/** + * This allows to determine how much length should we add in the last step + * of the searches. It takes the bilinearly interpolated edge (see + * @PSEUDO_GATHER4), and adds 0, 1 or 2, depending on which edges and + * crossing edges are active. + */ +float SMAASearchLength(SMAATexture2D(searchTex), float2 e, float offset) { + // The texture is flipped vertically, with left and right cases taking half + // of the space horizontally: + float2 scale = SMAA_SEARCHTEX_SIZE * float2(0.5, -1.0); + float2 bias = SMAA_SEARCHTEX_SIZE * float2(offset, 1.0); + + // Scale and bias to access texel centers: + scale += float2(-1.0, 1.0); + bias += float2( 0.5, -0.5); + + // Convert from pixel coordinates to texcoords: + // (We use SMAA_SEARCHTEX_PACKED_SIZE because the texture is cropped) + scale *= 1.0 / SMAA_SEARCHTEX_PACKED_SIZE; + bias *= 1.0 / SMAA_SEARCHTEX_PACKED_SIZE; + + // Lookup the search texture: + return SMAA_SEARCHTEX_SELECT(SMAASampleLevelZero(searchTex, mad(scale, e, bias))); +} + +/** + * Horizontal/vertical search functions for the 2nd pass. + */ +float SMAASearchXLeft(SMAATexture2D(edgesTex), SMAATexture2D(searchTex), float2 texcoord, float end) { + /** + * @PSEUDO_GATHER4 + * This texcoord has been offset by (-0.25, -0.125) in the vertex shader to + * sample between edge, thus fetching four edges in a row. + * Sampling with different offsets in each direction allows to disambiguate + * which edges are active from the four fetched ones. + */ + float2 e = float2(0.0, 1.0); + while (texcoord.x > end && + e.g > 0.8281 && // Is there some edge not activated? + e.r == 0.0) { // Or is there a crossing edge that breaks the line? + e = SMAASampleLevelZero(edgesTex, texcoord).rg; + texcoord = mad(-float2(2.0, 0.0), SMAA_RT_METRICS.xy, texcoord); + } + + float offset = mad(-(255.0 / 127.0), SMAASearchLength(SMAATexturePass2D(searchTex), e, 0.0), 3.25); + return mad(SMAA_RT_METRICS.x, offset, texcoord.x); + + // Non-optimized version: + // We correct the previous (-0.25, -0.125) offset we applied: + // texcoord.x += 0.25 * SMAA_RT_METRICS.x; + + // The searches are bias by 1, so adjust the coords accordingly: + // texcoord.x += SMAA_RT_METRICS.x; + + // Disambiguate the length added by the last step: + // texcoord.x += 2.0 * SMAA_RT_METRICS.x; // Undo last step + // texcoord.x -= SMAA_RT_METRICS.x * (255.0 / 127.0) * SMAASearchLength(SMAATexturePass2D(searchTex), e, 0.0); + // return mad(SMAA_RT_METRICS.x, offset, texcoord.x); +} + +float SMAASearchXRight(SMAATexture2D(edgesTex), SMAATexture2D(searchTex), float2 texcoord, float end) { + float2 e = float2(0.0, 1.0); + while (texcoord.x < end && + e.g > 0.8281 && // Is there some edge not activated? + e.r == 0.0) { // Or is there a crossing edge that breaks the line? + e = SMAASampleLevelZero(edgesTex, texcoord).rg; + texcoord = mad(float2(2.0, 0.0), SMAA_RT_METRICS.xy, texcoord); + } + float offset = mad(-(255.0 / 127.0), SMAASearchLength(SMAATexturePass2D(searchTex), e, 0.5), 3.25); + return mad(-SMAA_RT_METRICS.x, offset, texcoord.x); +} + +float SMAASearchYUp(SMAATexture2D(edgesTex), SMAATexture2D(searchTex), float2 texcoord, float end) { + float2 e = float2(1.0, 0.0); + while (texcoord.y > end && + e.r > 0.8281 && // Is there some edge not activated? + e.g == 0.0) { // Or is there a crossing edge that breaks the line? + e = SMAASampleLevelZero(edgesTex, texcoord).rg; + texcoord = mad(-float2(0.0, 2.0), SMAA_RT_METRICS.xy, texcoord); + } + float offset = mad(-(255.0 / 127.0), SMAASearchLength(SMAATexturePass2D(searchTex), e.gr, 0.0), 3.25); + return mad(SMAA_RT_METRICS.y, offset, texcoord.y); +} + +float SMAASearchYDown(SMAATexture2D(edgesTex), SMAATexture2D(searchTex), float2 texcoord, float end) { + float2 e = float2(1.0, 0.0); + while (texcoord.y < end && + e.r > 0.8281 && // Is there some edge not activated? + e.g == 0.0) { // Or is there a crossing edge that breaks the line? + e = SMAASampleLevelZero(edgesTex, texcoord).rg; + texcoord = mad(float2(0.0, 2.0), SMAA_RT_METRICS.xy, texcoord); + } + float offset = mad(-(255.0 / 127.0), SMAASearchLength(SMAATexturePass2D(searchTex), e.gr, 0.5), 3.25); + return mad(-SMAA_RT_METRICS.y, offset, texcoord.y); +} + +/** + * Ok, we have the distance and both crossing edges. So, what are the areas + * at each side of current edge? + */ +float2 SMAAArea(SMAATexture2D(areaTex), float2 dist, float e1, float e2, float offset) { + // Rounding prevents precision errors of bilinear filtering: + float2 texcoord = mad(float2(SMAA_AREATEX_MAX_DISTANCE, SMAA_AREATEX_MAX_DISTANCE), round(4.0 * float2(e1, e2)), dist); + + // We do a scale and bias for mapping to texel space: + texcoord = mad(SMAA_AREATEX_PIXEL_SIZE, texcoord, 0.5 * SMAA_AREATEX_PIXEL_SIZE); + + // Move to proper place, according to the subpixel offset: + texcoord.y = mad(SMAA_AREATEX_SUBTEX_SIZE, offset, texcoord.y); + + // Do it! + return SMAA_AREATEX_SELECT(SMAASampleLevelZero(areaTex, texcoord)); +} + +//----------------------------------------------------------------------------- +// Corner Detection Functions + +void SMAADetectHorizontalCornerPattern(SMAATexture2D(edgesTex), inout float2 weights, float4 texcoord, float2 d) { + #if !defined(SMAA_DISABLE_CORNER_DETECTION) + float2 leftRight = step(d.xy, d.yx); + float2 rounding = (1.0 - SMAA_CORNER_ROUNDING_NORM) * leftRight; + + rounding /= leftRight.x + leftRight.y; // Reduce blending for pixels in the center of a line. + + float2 factor = float2(1.0, 1.0); + factor.x -= rounding.x * SMAASampleLevelZeroOffset(edgesTex, texcoord.xy, int2(0, 1)).r; + factor.x -= rounding.y * SMAASampleLevelZeroOffset(edgesTex, texcoord.zw, int2(1, 1)).r; + factor.y -= rounding.x * SMAASampleLevelZeroOffset(edgesTex, texcoord.xy, int2(0, -2)).r; + factor.y -= rounding.y * SMAASampleLevelZeroOffset(edgesTex, texcoord.zw, int2(1, -2)).r; + + weights *= saturate(factor); + #endif +} + +void SMAADetectVerticalCornerPattern(SMAATexture2D(edgesTex), inout float2 weights, float4 texcoord, float2 d) { + #if !defined(SMAA_DISABLE_CORNER_DETECTION) + float2 leftRight = step(d.xy, d.yx); + float2 rounding = (1.0 - SMAA_CORNER_ROUNDING_NORM) * leftRight; + + rounding /= leftRight.x + leftRight.y; + + float2 factor = float2(1.0, 1.0); + factor.x -= rounding.x * SMAASampleLevelZeroOffset(edgesTex, texcoord.xy, int2( 1, 0)).g; + factor.x -= rounding.y * SMAASampleLevelZeroOffset(edgesTex, texcoord.zw, int2( 1, 1)).g; + factor.y -= rounding.x * SMAASampleLevelZeroOffset(edgesTex, texcoord.xy, int2(-2, 0)).g; + factor.y -= rounding.y * SMAASampleLevelZeroOffset(edgesTex, texcoord.zw, int2(-2, 1)).g; + + weights *= saturate(factor); + #endif +} + +//----------------------------------------------------------------------------- +// Blending Weight Calculation Pixel Shader (Second Pass) + +float4 SMAABlendingWeightCalculationPS(float2 texcoord, + float2 pixcoord, + float4 offset[3], + SMAATexture2D(edgesTex), + SMAATexture2D(areaTex), + SMAATexture2D(searchTex), + float4 subsampleIndices) { // Just pass zero for SMAA 1x, see @SUBSAMPLE_INDICES. + float4 weights = float4(0.0, 0.0, 0.0, 0.0); + + float2 e = SMAASample(edgesTex, texcoord).rg; + + SMAA_BRANCH + if (e.g > 0.0) { // Edge at north + #if !defined(SMAA_DISABLE_DIAG_DETECTION) + // Diagonals have both north and west edges, so searching for them in + // one of the boundaries is enough. + weights.rg = SMAACalculateDiagWeights(SMAATexturePass2D(edgesTex), SMAATexturePass2D(areaTex), texcoord, e, subsampleIndices); + + // We give priority to diagonals, so if we find a diagonal we skip + // horizontal/vertical processing. + SMAA_BRANCH + if (weights.r == -weights.g) { // weights.r + weights.g == 0.0 + #endif + + float2 d; + + // Find the distance to the left: + float3 coords; + coords.x = SMAASearchXLeft(SMAATexturePass2D(edgesTex), SMAATexturePass2D(searchTex), offset[0].xy, offset[2].x); + coords.y = offset[1].y; // offset[1].y = texcoord.y - 0.25 * SMAA_RT_METRICS.y (@CROSSING_OFFSET) + d.x = coords.x; + + // Now fetch the left crossing edges, two at a time using bilinear + // filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to + // discern what value each edge has: + float e1 = SMAASampleLevelZero(edgesTex, coords.xy).r; + + // Find the distance to the right: + coords.z = SMAASearchXRight(SMAATexturePass2D(edgesTex), SMAATexturePass2D(searchTex), offset[0].zw, offset[2].y); + d.y = coords.z; + + // We want the distances to be in pixel units (doing this here allow to + // better interleave arithmetic and memory accesses): + d = abs(round(mad(SMAA_RT_METRICS.zz, d, -pixcoord.xx))); + + // SMAAArea below needs a sqrt, as the areas texture is compressed + // quadratically: + float2 sqrt_d = sqrt(d); + + // Fetch the right crossing edges: + float e2 = SMAASampleLevelZeroOffset(edgesTex, coords.zy, int2(1, 0)).r; + + // Ok, we know how this pattern looks like, now it is time for getting + // the actual area: + weights.rg = SMAAArea(SMAATexturePass2D(areaTex), sqrt_d, e1, e2, subsampleIndices.y); + + // Fix corners: + coords.y = texcoord.y; + SMAADetectHorizontalCornerPattern(SMAATexturePass2D(edgesTex), weights.rg, coords.xyzy, d); + + #if !defined(SMAA_DISABLE_DIAG_DETECTION) + } else + e.r = 0.0; // Skip vertical processing. + #endif + } + + SMAA_BRANCH + if (e.r > 0.0) { // Edge at west + float2 d; + + // Find the distance to the top: + float3 coords; + coords.y = SMAASearchYUp(SMAATexturePass2D(edgesTex), SMAATexturePass2D(searchTex), offset[1].xy, offset[2].z); + coords.x = offset[0].x; // offset[1].x = texcoord.x - 0.25 * SMAA_RT_METRICS.x; + d.x = coords.y; + + // Fetch the top crossing edges: + float e1 = SMAASampleLevelZero(edgesTex, coords.xy).g; + + // Find the distance to the bottom: + coords.z = SMAASearchYDown(SMAATexturePass2D(edgesTex), SMAATexturePass2D(searchTex), offset[1].zw, offset[2].w); + d.y = coords.z; + + // We want the distances to be in pixel units: + d = abs(round(mad(SMAA_RT_METRICS.ww, d, -pixcoord.yy))); + + // SMAAArea below needs a sqrt, as the areas texture is compressed + // quadratically: + float2 sqrt_d = sqrt(d); + + // Fetch the bottom crossing edges: + float e2 = SMAASampleLevelZeroOffset(edgesTex, coords.xz, int2(0, 1)).g; + + // Get the area for this direction: + weights.ba = SMAAArea(SMAATexturePass2D(areaTex), sqrt_d, e1, e2, subsampleIndices.x); + + // Fix corners: + coords.x = texcoord.x; + SMAADetectVerticalCornerPattern(SMAATexturePass2D(edgesTex), weights.ba, coords.xyxz, d); + } + + return weights; +} + +//----------------------------------------------------------------------------- +// Neighborhood Blending Pixel Shader (Third Pass) + +float4 SMAANeighborhoodBlendingPS(float2 texcoord, + float4 offset, + SMAATexture2D(colorTex), + SMAATexture2D(blendTex) + #if SMAA_REPROJECTION + , SMAATexture2D(velocityTex) + #endif + ) { + // Fetch the blending weights for current pixel: + float4 a; + a.x = SMAASample(blendTex, offset.xy).a; // Right + a.y = SMAASample(blendTex, offset.zw).g; // Top + a.wz = SMAASample(blendTex, texcoord).xz; // Bottom / Left + + // Is there any blending weight with a value greater than 0.0? + SMAA_BRANCH + if (dot(a, float4(1.0, 1.0, 1.0, 1.0)) < 1e-5) { + float4 color = SMAASampleLevelZero(colorTex, texcoord); + + #if SMAA_REPROJECTION + float2 velocity = SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, texcoord)); + + // Pack velocity into the alpha channel: + color.a = sqrt(5.0 * length(velocity)); + #endif + + return color; + } else { + bool h = max(a.x, a.z) > max(a.y, a.w); // max(horizontal) > max(vertical) + + // Calculate the blending offsets: + float4 blendingOffset = float4(0.0, a.y, 0.0, a.w); + float2 blendingWeight = a.yw; + SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.0, a.z, 0.0)); + SMAAMovc(bool2(h, h), blendingWeight, a.xz); + blendingWeight /= dot(blendingWeight, float2(1.0, 1.0)); + + // Calculate the texture coordinates: + float4 blendingCoord = mad(blendingOffset, float4(SMAA_RT_METRICS.xy, -SMAA_RT_METRICS.xy), texcoord.xyxy); + + // We exploit bilinear filtering to mix current pixel with the chosen + // neighbor: + float4 color = blendingWeight.x * SMAASampleLevelZero(colorTex, blendingCoord.xy); + color += blendingWeight.y * SMAASampleLevelZero(colorTex, blendingCoord.zw); + + #if SMAA_REPROJECTION + // Antialias velocity for proper reprojection in a later stage: + float2 velocity = blendingWeight.x * SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, blendingCoord.xy)); + velocity += blendingWeight.y * SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, blendingCoord.zw)); + + // Pack velocity into the alpha channel: + color.a = sqrt(5.0 * length(velocity)); + #endif + + return color; + } +} + +//----------------------------------------------------------------------------- +// Temporal Resolve Pixel Shader (Optional Pass) + +float4 SMAAResolvePS(float2 texcoord, + SMAATexture2D(currentColorTex), + SMAATexture2D(previousColorTex) + #if SMAA_REPROJECTION + , SMAATexture2D(velocityTex) + #endif + ) { + #if SMAA_REPROJECTION + // Velocity is assumed to be calculated for motion blur, so we need to + // inverse it for reprojection: + float2 velocity = -SMAA_DECODE_VELOCITY(SMAASamplePoint(velocityTex, texcoord).rg); + + // Fetch current pixel: + float4 current = SMAASamplePoint(currentColorTex, texcoord); + + // Reproject current coordinates and fetch previous pixel: + float4 previous = SMAASamplePoint(previousColorTex, texcoord + velocity); + + // Attenuate the previous pixel if the velocity is different: + float delta = abs(current.a * current.a - previous.a * previous.a) / 5.0; + float weight = 0.5 * saturate(1.0 - sqrt(delta) * SMAA_REPROJECTION_WEIGHT_SCALE); + + // Blend the pixels according to the calculated weight: + return lerp(current, previous, weight); + #else + // Just blend the pixels: + float4 current = SMAASamplePoint(currentColorTex, texcoord); + float4 previous = SMAASamplePoint(previousColorTex, texcoord); + return lerp(current, previous, 0.5); + #endif +} + +//----------------------------------------------------------------------------- +// Separate Multisamples Pixel Shader (Optional Pass) + +#ifdef SMAALoad +void SMAASeparatePS(float4 position, + float2 texcoord, + out float4 target0, + out float4 target1, + SMAATexture2DMS2(colorTexMS)) { + int2 pos = int2(position.xy); + target0 = SMAALoad(colorTexMS, pos, 0); + target1 = SMAALoad(colorTexMS, pos, 1); +} +#endif + +//----------------------------------------------------------------------------- +#endif // SMAA_INCLUDE_PS diff --git a/enbseries/SMAA/SearchTex.dds b/enbseries/SMAA/SearchTex.dds new file mode 100644 index 0000000..f48ec89 Binary files /dev/null and b/enbseries/SMAA/SearchTex.dds differ diff --git a/enbseries/VERSION b/enbseries/VERSION new file mode 100644 index 0000000..3ff3460 --- /dev/null +++ b/enbseries/VERSION @@ -0,0 +1 @@ +3.6.1 "Ibuki's Giant Tiddies" diff --git a/enbseries/_locationweather.ini b/enbseries/_locationweather.ini new file mode 100644 index 0000000..9799319 --- /dev/null +++ b/enbseries/_locationweather.ini @@ -0,0 +1,3 @@ +//example usage +//[0000003C] - WorldSpaceID +//13163=d4886 - first is LocationID, second is WeatherID (Riverwood with rainy weather) \ No newline at end of file diff --git a/enbseries/_weatherlist.ini b/enbseries/_weatherlist.ini new file mode 100644 index 0000000..38f637d --- /dev/null +++ b/enbseries/_weatherlist.ini @@ -0,0 +1,44 @@ +[WEATHER001] +FileName=wt_general.ini + +[WEATHER002] +FileName=wt_dark.ini + +[WEATHER003] +FileName=wt_harbor.ini + +[WEATHER004] +FileName=wt_frosty.ini + +[WEATHER005] +FileName=wt_heat.ini + +[WEATHER006] +FileName=wt_scorched.ini + +[WEATHER007] +FileName=wt_generalfog.ini + +[WEATHER008] +FileName=wt_generalrain.ini + +[WEATHER009] +FileName=wt_darkfog.ini + +[WEATHER010] +FileName=wt_darkrain.ini + +[WEATHER011] +FileName=wt_harborfog.ini + +[WEATHER012] +FileName=wt_frostyfog.ini + +[WEATHER013] +FileName=wt_harborrain.ini + +[WEATHER014] +FileName=wt_heatfog.ini + +[WEATHER015] +FileName=wt_scorchedfog.ini diff --git a/enbseries/enbadaptation.fx b/enbseries/enbadaptation.fx new file mode 100644 index 0000000..e9dbe82 --- /dev/null +++ b/enbseries/enbadaptation.fx @@ -0,0 +1,105 @@ +/* + enbadaptation.fx : MariENB3 eye adaptation shader. + (C)2016-2020 Marisa Kirisame, UnSX Team. + Part of MariENB3, the personal ENB of Marisa for Fallout 4. + Released under the GNU GPLv3 (or later). +*/ +#include "menbglobaldefs.fx" + +float4 AdaptationParameters; + +Texture2D TextureCurrent; +Texture2D TexturePrevious; + +SamplerState Sampler0 +{ + Filter = MIN_MAG_MIP_POINT; + AddressU = Clamp; + AddressV = Clamp; + MaxLOD = 0; +}; + +struct VS_INPUT_POST +{ + float3 pos : POSITION; + float2 txcoord : TEXCOORD0; +}; +struct VS_OUTPUT_POST +{ + float4 pos : SV_POSITION; + float2 txcoord0 : TEXCOORD0; +}; + +VS_OUTPUT_POST VS_Quad( VS_INPUT_POST IN ) +{ + VS_OUTPUT_POST OUT; + OUT.pos = float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0); + OUT.txcoord0.xy = IN.txcoord.xy; + return OUT; +} + +/* helper functions */ +/* photometric */ +#define luminance(x) dot(x,float3(0.2126,0.7152,0.0722)) +/* CCIR601 */ +//#define luminance(x) dot(x,float3(0.299,0.587,0.114)) + +float4 PS_Downsample( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord0.xy; + float ssz = 1.0/16.0; + float4 res = float4(0,0,0,0); + int x, y; + [unroll] for ( y=-8; y<8; y++ ) [unroll] for ( x=-8; x<8; x++ ) + { + res += TextureCurrent.Sample(Sampler0,coord + +float2(x+0.5,y+0.5)*ssz); + } + res /= 256.0; + res = luminance(res.rgb); + res.w = 1.0; + return res; +} + +float4 PS_Adaptation(VS_OUTPUT_POST IN, float4 v0 : SV_Position0) : SV_Target +{ + float2 coord = IN.txcoord0.xy; + float prev = TexturePrevious.Sample(Sampler0,coord).x; + float ssz = 1.0/16.0; + float4 res = float4(0,0,0,0); + float smpmax = 0.0, smp; + int x, y; + [unroll] for ( y=-8; y<8; y++ ) [unroll] for ( x=-8; x<8; x++ ) + { + smp = TextureCurrent.Sample(Sampler0,coord + +float2(x+0.5,y+0.5)*ssz).x; + smpmax = max(smpmax,smp); + res += smp; + } + res /= 256.0; + res = lerp(res,smpmax,AdaptationParameters.z); + res = lerp(prev,res,AdaptationParameters.w); + res = clamp(res,0.0,16384.0); + float vclip = clamp(res.x,AdaptationParameters.x, + AdaptationParameters.y); + res *= vclip/(res+0.000000001); + res.w = 1.0; + return res; +} + +technique11 Downsample +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsample())); + } +} +technique11 Draw +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Adaptation())); + } +} diff --git a/enbseries/enbadaptation.fx.ini b/enbseries/enbadaptation.fx.ini new file mode 100644 index 0000000..5bcee41 --- /dev/null +++ b/enbseries/enbadaptation.fx.ini @@ -0,0 +1,2 @@ +[ENBADAPTATION.FX] +TECHNIQUE=0 diff --git a/enbseries/enbbloom.fx b/enbseries/enbbloom.fx new file mode 100644 index 0000000..8964743 --- /dev/null +++ b/enbseries/enbbloom.fx @@ -0,0 +1,776 @@ +/* + enbbloom.fx : MariENB3 bloom shader. + (C)2016-2020 Marisa Kirisame, UnSX Team. + Part of MariENB3, the personal ENB of Marisa for Fallout 4. + Released under the GNU GPLv3 (or later). +*/ +#include "menbglobaldefs.fx" + +string str_bloompre = "Bloom Prepass"; +/* bloom intensity */ +float bloomintensity_n +< + string UIName = "Bloom Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float bloomintensity_d +< + string UIName = "Bloom Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float bloomintensity_i +< + string UIName = "Bloom Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +/* bloom power (contrast) */ +float bloompower_n +< + string UIName = "Bloom Contrast Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float bloompower_d +< + string UIName = "Bloom Contrast Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float bloompower_i +< + string UIName = "Bloom Contrast Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +/* bloom saturation */ +float bloomsaturation_n +< + string UIName = "Bloom Saturation Night"; + string UIWidget = "Spinner"; +> = {0.75}; +float bloomsaturation_d +< + string UIName = "Bloom Saturation Day"; + string UIWidget = "Spinner"; +> = {0.75}; +float bloomsaturation_i +< + string UIName = "Bloom Saturation Interior"; + string UIWidget = "Spinner"; +> = {0.75}; +/* bloom offset (negative values keep dark areas from muddying up) */ +float bloombump_n +< + string UIName = "Bloom Offset Night"; + string UIWidget = "Spinner"; +> = {-0.5}; +float bloombump_d +< + string UIName = "Bloom Offset Day"; + string UIWidget = "Spinner"; +> = {-0.5}; +float bloombump_i +< + string UIName = "Bloom Offset Interior"; + string UIWidget = "Spinner"; +> = {-0.5}; +/* bloom cap (maximum brightness samples can have) */ +float bloomcap_n +< + string UIName = "Bloom Intensity Cap Night"; + string UIWidget = "Spinner"; +> = {20.0}; +float bloomcap_d +< + string UIName = "Bloom Intensity Cap Day"; + string UIWidget = "Spinner"; +> = {20.0}; +float bloomcap_i +< + string UIName = "Bloom Intensity Cap Interior"; + string UIWidget = "Spinner"; +> = {20.0}; +string str_bloomper = "Bloom Per-pass"; +/* bloom blur radius */ +float bloomradiusx +< + string UIName = "Bloom Blur Radius X"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float bloomradiusy +< + string UIName = "Bloom Blur Radius Y"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +/* bloom tint/blueshift parameters */ +float3 blu_n +< + string UIName = "Blue Shift Night"; + string UIWidget = "Color"; +> = {0.2,0.6,1.0}; +float3 blu_d +< + string UIName = "Blue Shift Day"; + string UIWidget = "Color"; +> = {0.2,0.6,1.0}; +float3 blu_i +< + string UIName = "Blue Shift Interior"; + string UIWidget = "Color"; +> = {0.2,0.6,1.0}; +float bsi_n +< + string UIName = "Blue Shift Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.5}; +float bsi_d +< + string UIName = "Blue Shift Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.5}; +float bsi_i +< + string UIName = "Blue Shift Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.5}; +float bslp +< + string UIName = "Blue Shift Luminance Factor Per-pass"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.22}; +float bsbp +< + string UIName = "Blue Shift Color Factor Per-pass"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.33}; +/* anamorphic bloom (very intensive) */ +string str_bloomalf = "Anamorphic Bloom"; +bool alfenable +< + string UIName = "Enable Anamorphic Bloom"; + string UIWidget = "Checkbox"; +> = {true}; +float fbl_n +< + string UIName = "Anamorphic Bloom Blend Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.75}; +float fbl_d +< + string UIName = "Anamorphic Bloom Blend Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.75}; +float fbl_i +< + string UIName = "Anamorphic Bloom Blend Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.75}; +float3 flu_n +< + string UIName = "Anamorphic Bloom Blue Shift Night"; + string UIWidget = "Color"; +> = {0.4,0.1,1.0}; +float3 flu_d +< + string UIName = "Anamorphic Bloom Blue Shift Day"; + string UIWidget = "Color"; +> = {0.4,0.1,1.0}; +float3 flu_i +< + string UIName = "Anamorphic Bloom Blue Shift Interior"; + string UIWidget = "Color"; +> = {0.4,0.1,1.0}; +float fsi_n +< + string UIName = "Anamorphic Bloom Blue Shift Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float fsi_d +< + string UIName = "Anamorphic Bloom Blue Shift Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float fsi_i +< + string UIName = "Anamorphic Bloom Blue Shift Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float fpw_n +< + string UIName = "Anamorphic Bloom Contrast Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float fpw_d +< + string UIName = "Anamorphic Bloom Contrast Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float fpw_i +< + string UIName = "Anamorphic Bloom Contrast Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float flen +< + string UIName = "Anamorphic Bloom Radius Multiplier"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {4.0}; +string str_bloompost = "Bloom Post-pass"; +/* bloom mix factors */ +float bloommix1 +< + string UIName = "Bloom Pass 1 Blend"; + string UIWidget = "Spinner"; +> = {0.75}; +float bloommix2 +< + string UIName = "Bloom Pass 2 Blend"; + string UIWidget = "Spinner"; +> = {0.8}; +float bloommix3 +< + string UIName = "Bloom Pass 3 Blend"; + string UIWidget = "Spinner"; +> = {0.85}; +float bloommix4 +< + string UIName = "Bloom Pass 4 Blend"; + string UIWidget = "Spinner"; +> = {0.9}; +float bloommix5 +< + string UIName = "Bloom Pass 5 Blend"; + string UIWidget = "Spinner"; +> = {0.95}; +float bloommix6 +< + string UIName = "Bloom Pass 6 Blend"; + string UIWidget = "Spinner"; +> = {1.0}; +float bloommixs +< + string UIName = "Bloom Single Pass Blend"; + string UIWidget = "Spinner"; +> = {1.0}; + +#ifndef HQBLOOM +/* gaussian blur matrices */ +/* radius: 4, std dev: 1.5 */ +static const float gauss4[4] = +{ + 0.270682, 0.216745, 0.111281, 0.036633 +}; +#define hvgauss gauss4 +#define hvgausssz 3 +#else +/* radius: 8, std dev: 3 */ +static const float gauss8[8] = +{ + 0.134598, 0.127325, 0.107778, 0.081638, + 0.055335, 0.033562, 0.018216, 0.008847 +}; +#define hvgauss gauss8 +#define hvgausssz 7 +#endif +#ifndef HQBLOOM +/* radius: 20, std dev: 7.5 */ +static const float gauss20[20] = +{ + 0.053690, 0.053215, 0.051815, 0.049562, + 0.046572, 0.042992, 0.038987, 0.034732, + 0.030397, 0.026134, 0.022073, 0.018314, + 0.014928, 0.011953, 0.009403, 0.007266, + 0.005516, 0.004114, 0.003014, 0.002169 +}; +#define angauss gauss20 +#define angausssz 19 +#else +/* radius: 40, std dev: 15 */ +static const float gauss40[40] = +{ + 0.026823, 0.026763, 0.026585, 0.026291, + 0.025886, 0.025373, 0.024760, 0.024055, + 0.023267, 0.022404, 0.021478, 0.020499, + 0.019477, 0.018425, 0.017352, 0.016269, + 0.015186, 0.014112, 0.013056, 0.012025, + 0.011027, 0.010067, 0.009149, 0.008279, + 0.007458, 0.006688, 0.005972, 0.005308, + 0.004697, 0.004139, 0.003630, 0.003170, + 0.002756, 0.002385, 0.002055, 0.001763, + 0.001506, 0.001280, 0.001084, 0.000913 +}; +#define angauss gauss40 +#define angausssz 39 +#endif +/* mathematical constants */ +static const float pi = 3.1415926535898; + +float4 ScreenSize; +float ENightDayFactor; +float EInteriorFactor; +float4 TimeOfDay1; +float4 TimeOfDay2; + +Texture2D TextureDownsampled; +Texture2D TextureColor; + +Texture2D RenderTarget1024; +Texture2D RenderTarget512; +Texture2D RenderTarget256; +Texture2D RenderTarget128; +Texture2D RenderTarget64; +Texture2D RenderTarget32; +Texture2D RenderTarget16; + +SamplerState Sampler +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Border; + AddressV = Border; + MaxLOD = 0; +}; +SamplerState Sampler2 +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Clamp; + AddressV = Clamp; + MaxLOD = 0; +}; + +struct VS_INPUT_POST +{ + float3 pos : POSITION; + float2 txcoord : TEXCOORD0; +}; +struct VS_OUTPUT_POST +{ + float4 pos : SV_POSITION; + float2 txcoord0 : TEXCOORD0; +}; + +VS_OUTPUT_POST VS_Quad(VS_INPUT_POST IN) +{ + VS_OUTPUT_POST OUT; + OUT.pos = float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0); + OUT.txcoord0.xy = IN.txcoord.xy; + return OUT; +} + +/* helper functions */ +/* photometric */ +#define luminance(x) dot(x,float3(0.2126,0.7152,0.0722)) +/* CCIR601 */ +//#define luminance(x) dot(x,float3(0.299,0.587,0.114)) +float3 rgb2hsv( float3 c ) +{ + float4 K = float4(0.0,-1.0/3.0,2.0/3.0,-1.0); + float4 p = (c.g=0.0)&&(pp.x<1.0))?angauss[abs(i)]:0.0; + } + res *= 1.0/sum; + float3 flu = tod_ind(flu); + float fsi = tod_ind(fsi); + float lm = max(0,luminance(res.rgb)-luminance(base.rgb))*fsi; + lm = lm/(1.0+lm); + res.rgb *= lerp(1.0,flu,lm); + float fbl = tod_ind(fbl); + float fpw = tod_ind(fpw); + res.rgb = pow(max(0,res.rgb),fpw)*fbl; + return res; +} + +/* blur step goes here */ +float4 PS_HorizontalBlur( VS_OUTPUT_POST IN, float4 v0 : SV_Position0, + uniform Texture2D intex, uniform float insz ) : SV_Target +{ + float2 coord = IN.txcoord0.xy; + float4 res = float4(0.0,0.0,0.0,0.0); + int i; + float sum = 0.0; + float inc = bloomradiusx/insz; + float2 pp; + [unroll] for ( i=-hvgausssz; i<=hvgausssz; i++ ) + { + pp = coord+float2(i,0)*inc; + res += hvgauss[abs(i)]*intex.Sample(Sampler,pp); + sum += ((pp.x>=0.0)&&(pp.x<1.0))?hvgauss[abs(i)]:0.0; + } + res *= 1.0/sum; + if ( alfenable ) res += Anamorphic(coord,intex,insz); + res.a = 1.0; + return res; +} + +/* This is the vertical step */ +float4 PS_VerticalBlur( VS_OUTPUT_POST IN, float4 v0 : SV_Position0, + uniform Texture2D intex, uniform float insz, + uniform float bpass ) : SV_Target +{ + + float2 coord = IN.txcoord0.xy; + float4 res = float4(0.0,0.0,0.0,0.0), + base = RenderTarget1024.Sample(Sampler,coord); + int i; + float sum = 0.0; + float inc = bloomradiusy/insz; + float2 pp; + [unroll] for ( i=-hvgausssz; i<=hvgausssz; i++ ) + { + pp = coord+float2(0,i)*inc; + res += hvgauss[abs(i)]*intex.Sample(Sampler,pp); + sum += ((pp.y>=0.0)&&(pp.y<1.0))?hvgauss[abs(i)]:0.0; + } + res *= 1.0/sum; + float3 blu = tod_ind(blu); + float bsi = tod_ind(bsi); + float lm = max(0,luminance(res.rgb)-luminance(base.rgb))*bsi; + lm = lm/(1.0+lm); + lm *= 1.0-saturate(bpass*bslp); + blu = saturate(blu+bpass*bsbp); + res.rgb *= lerp(1.0,blu,lm); + res.a = 1.0; + return res; +} + +/* end pass, mix it all up */ +float4 PS_PostPass( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord0.xy; + float4 res = bloommix1*RenderTarget512.Sample(Sampler2,coord); + res += bloommix2*RenderTarget256.Sample(Sampler2,coord); + res += bloommix3*RenderTarget128.Sample(Sampler2,coord); + res += bloommix4*RenderTarget64.Sample(Sampler2,coord); + res += bloommix5*RenderTarget32.Sample(Sampler2,coord); + res += bloommix6*RenderTarget16.Sample(Sampler2,coord); + res.rgb /= 6.0; + res.rgb = clamp(res.rgb,0.0,32768.0); + res.a = 1.0; + return res; +} + +float4 PS_SPostPass( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord0.xy; + float4 res = bloommixs*RenderTarget64.Sample(Sampler2,coord); + res.rgb = clamp(res.rgb,0.0,32768.0); + res.a = 1.0; + return res; +} + +technique11 BloomSimplePass +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_PrePass())); + } +} +technique11 BloomSimplePass1 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget1024,1024.0))); + } +} +technique11 BloomSimplePass2 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget512,512.0))); + } +} +technique11 BloomSimplePass3 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget256,256.0))); + } +} +technique11 BloomSimplePass4 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget128,128.0))); + } +} +technique11 BloomSimplePass5 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget64,64.0))); + } +} +technique11 BloomSimplePass6 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,64.0,3.0))); + } +} +technique11 BloomSimplePass7 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_SPostPass())); + } +} + +technique11 BloomPass +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_PrePass())); + } +} +technique11 BloomPass1 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget1024,1024.0))); + } +} +technique11 BloomPass2 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget512,512.0))); + } +} +technique11 BloomPass3 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget256,256.0))); + } +} +technique11 BloomPass4 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget128,128.0))); + } +} +technique11 BloomPass5 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget64,64.0))); + } +} +technique11 BloomPass6 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget32,32.0))); + } +} +technique11 BloomPass7 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget512,512.0))); + } +} +technique11 BloomPass8 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,512.0,0.0))); + } +} +technique11 BloomPass9 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget256,256.0))); + } +} +technique11 BloomPass10 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,256.0,1.0))); + } +} +technique11 BloomPass11 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget128,128.0))); + } +} +technique11 BloomPass12 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,128.0,2.0))); + } +} +technique11 BloomPass13 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget64,64.0))); + } +} +technique11 BloomPass14 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,64.0,3.0))); + } +} +technique11 BloomPass15 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget32,32.0))); + } +} +technique11 BloomPass16 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,32.0,4.0))); + } +} +technique11 BloomPass17 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget16,16.0))); + } +} +technique11 BloomPass18 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,16.0,5.0))); + } +} +technique11 BloomPass19 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_PostPass())); + } +} diff --git a/enbseries/enbbloom.fx.ini b/enbseries/enbbloom.fx.ini new file mode 100644 index 0000000..3c99423 --- /dev/null +++ b/enbseries/enbbloom.fx.ini @@ -0,0 +1,48 @@ +[ENBBLOOM.FX] +TECHNIQUE=2 +Bloom Intensity Night=0.72 +Bloom Intensity Day=0.48 +Bloom Intensity Interior=0.65 +Bloom Contrast Night=0.89 +Bloom Contrast Day=0.98 +Bloom Contrast Interior=0.93 +Bloom Saturation Night=1.11 +Bloom Saturation Day=1.06 +Bloom Saturation Interior=1.18 +Bloom Offset Night=-0.41 +Bloom Offset Day=-0.83 +Bloom Offset Interior=-0.56 +Bloom Intensity Cap Night=25.0 +Bloom Intensity Cap Day=25.0 +Bloom Intensity Cap Interior=25.0 +Bloom Blur Radius X=1.0 +Bloom Blur Radius Y=1.0 +Blue Shift Night=0.294, 0.424, 0.859 +Blue Shift Day=0.22, 0.537, 0.855 +Blue Shift Interior=0.337, 0.525, 0.878 +Blue Shift Intensity Night=0.32 +Blue Shift Intensity Day=0.22 +Blue Shift Intensity Interior=0.31 +Blue Shift Luminance Factor Per-pass=0.48 +Blue Shift Color Factor Per-pass=0.84 +Enable Anamorphic Bloom=true +Anamorphic Bloom Blend Night=0.92 +Anamorphic Bloom Blend Day=0.86 +Anamorphic Bloom Blend Interior=0.83 +Anamorphic Bloom Blue Shift Night=0.553, 0.404, 0.851 +Anamorphic Bloom Blue Shift Day=0.424, 0.384, 0.831 +Anamorphic Bloom Blue Shift Interior=0.537, 0.475, 0.89 +Anamorphic Bloom Blue Shift Intensity Night=1.24 +Anamorphic Bloom Blue Shift Intensity Day=1.33 +Anamorphic Bloom Blue Shift Intensity Interior=1.38 +Anamorphic Bloom Contrast Night=1.25 +Anamorphic Bloom Contrast Day=1.33 +Anamorphic Bloom Contrast Interior=1.28 +Anamorphic Bloom Radius Multiplier=1.0 +Bloom Pass 1 Blend=0.16 +Bloom Pass 2 Blend=0.2 +Bloom Pass 3 Blend=0.39 +Bloom Pass 4 Blend=0.58 +Bloom Pass 5 Blend=0.72 +Bloom Pass 6 Blend=0.86 +Bloom Single Pass Blend=0.35 diff --git a/enbseries/enbdepthoffield.fx b/enbseries/enbdepthoffield.fx new file mode 100644 index 0000000..0441c53 --- /dev/null +++ b/enbseries/enbdepthoffield.fx @@ -0,0 +1,1878 @@ +/* + enbdepthoffield.fx : MariENB3 prepass shaders. + (C)2016-2020 Marisa Kirisame, UnSX Team. + Part of MariENB3, the personal ENB of Marisa for Fallout 4. + Released under the GNU GPLv3 (or later). +*/ +#include "menbglobaldefs.fx" + +string str_misc = "Miscellaneous"; +/* fixed resolution, keeps blur filters at a consistent internal resolution */ +int2 fixed +< + string UIName = "Fixed Resolution"; + string UIWidget = "Vector"; + int2 UIMin = {0,0}; +> = {1920,1080}; +float cutoff +< + string UIName = "Depth Cutoff"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1000000.0; +> = {999949.0}; +float zNear +< + string UIName = "Near Z"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.05}; +float zFar +< + string UIName = "Far Z"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {3098.0}; +string str_dist = "Distortion Filters"; +float distcha +< + string UIName = "Distortion Chromatic Aberration"; + string UIWidget = "Spinner"; +> = {10.0}; +bool heatenable +< + string UIName = "Enable Hot Air Refraction"; + string UIWidget = "Checkbox"; +> = {false}; +float heatsize +< + string UIName = "Heat Texture Size"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {3.5}; +float heatspeed +< + string UIName = "Heat Speed"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.5}; +float heatfadepow +< + string UIName = "Heat Fade Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {200.0}; +float heatfademul +< + string UIName = "Heat Fade Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.5}; +float heatfadebump +< + string UIName = "Heat Fade Offset"; + string UIWidget = "Spinner"; +> = {0.0}; +float heatstrength +< + string UIName = "Heat Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.25}; +float heatpow +< + string UIName = "Heat Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.2}; +float heatfactor_dw +< + string UIName = "Heat Factor Dawn"; + string UIWidget = "Spinner"; +> = {0.2}; +float heatfactor_sr +< + string UIName = "Heat Factor Sunrise"; + string UIWidget = "Spinner"; +> = {0.5}; +float heatfactor_dy +< + string UIName = "Heat Factor Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float heatfactor_ss +< + string UIName = "Heat Factor Sunset"; + string UIWidget = "Spinner"; +> = {0.7}; +float heatfactor_ds +< + string UIName = "Heat Factor Dusk"; + string UIWidget = "Spinner"; +> = {0.1}; +float heatfactor_nt +< + string UIName = "Heat Factor Night"; + string UIWidget = "Spinner"; +> = {0.0}; +float heatfactor_i +< + string UIName = "Heat Factor Interior"; + string UIWidget = "Spinner"; +> = {0.0}; +string str_focus = "Focusing Parameters"; +/* + focus modes: + -2 : mouse + -1 : manual + 0 : center spot + 1 : center + triangle + 2 : 8x8 grid average + TODO + 3 : 8x8 grid average of 8 closest points + 4 : 8x8 grid average of 8 farthest points +*/ +int focuscircle +< + string UIName = "Focus Mode"; + string UIWidget = "Checkbox"; + int UIMin = -2; + int UIMax = 2; +> = {1}; +bool focusdisplay +< + string UIName = "Display Focus Points"; + string UIWidget = "Checkbox"; +> = {false}; +bool focusmanual +< + string UIName = "Enable Manual Focus"; + string UIWidget = "Checkbox"; +> = {false}; +float focusmanualvalue +< + string UIName = "Manual Focus Depth"; + string UIWidget = "Checkbox"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.5}; +/* center point of focus */ +float2 focuscenter +< + string UIName = "Focus Point Center"; + string UIWidget = "Vector"; + float2 UIMin = {0.0,0.0}; + float2 UIMax = {1.0,1.0}; +> = {0.5,0.5}; +float focuscircleangle +< + string UIName = "Focus Triangle Angle"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +/* radius of the focus point triangle */ +float focusradius_n +< + string UIName = "Focus Triangle Radius Night"; + string UIWidget = "Spinner"; +> = {20.0}; +float focusradius_d +< + string UIName = "Focus Triangle Radius Day"; + string UIWidget = "Spinner"; +> = {20.0}; +float focusradius_i +< + string UIName = "Focus Triangle Radius Interior"; + string UIWidget = "Spinner"; +> = {20.0}; +/* mix factor with sample at screen center */ +float focusmix_n +< + string UIName = "Focus Triangle Blending Night"; + string UIWidget = "Spinner"; +> = {0.5}; +float focusmix_d +< + string UIName = "Focus Triangle Blending Day"; + string UIWidget = "Spinner"; +> = {0.5}; +float focusmix_i +< + string UIName = "Focus Triangle Blending Interior"; + string UIWidget = "Spinner"; +> = {0.5}; +/* maximum focus depth */ +float focusmax_n +< + string UIName = "Focus Maximum Depth Night"; + string UIWidget = "Spinner"; +> = {1000.0}; +float focusmax_d +< + string UIName = "Focus Maximum Depth Day"; + string UIWidget = "Spinner"; +> = {1000.0}; +float focusmax_i +< + string UIName = "Focus Maximum Depth Interior"; + string UIWidget = "Spinner"; +> = {1000.0}; +float focuscenterdiscard +< + string UIName = "Focus Circle Discard Center Depth"; + string UIWidget = "Spinner"; +> = {0.0}; +/* dof filter */ +string str_dof = "Depth Of Field"; +/* dof multiplier (makes unfocused depths more blurry) */ +float dofmult_n +< + string UIName = "DOF Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +float dofmult_d +< + string UIName = "DOF Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +float dofmult_i +< + string UIName = "DOF Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +/* dof power (falloff, kinda) */ +float dofpow_n +< + string UIName = "DOF Contrast Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {4.0}; +float dofpow_d +< + string UIName = "DOF Contrast Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {4.0}; +float dofpow_i +< + string UIName = "DOF Contrast Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {4.0}; +/* dof bump (negative values are useful for "widening" the focused area) */ +float dofbump_n +< + string UIName = "DOF Shift Night"; + string UIWidget = "Spinner"; +> = {0.0}; +float dofbump_d +< + string UIName = "DOF Shift Day"; + string UIWidget = "Spinner"; +> = {0.0}; +float dofbump_i +< + string UIName = "DOF Shift Interior"; + string UIWidget = "Spinner"; +> = {0.0}; +/* fixed focused depth factors */ +float doffixedfocusmult_n +< + string UIName = "DOF Fixed Focus Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float doffixedfocusmult_d +< + string UIName = "DOF Fixed Focus Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float doffixedfocusmult_i +< + string UIName = "DOF Fixed Focus Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float doffixedfocuspow_n +< + string UIName = "DOF Fixed Focus Contrast Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float doffixedfocuspow_d +< + string UIName = "DOF Fixed Focus Contrast Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float doffixedfocuspow_i +< + string UIName = "DOF Fixed Focus Contrast Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float doffixedfocusbump_n +< + string UIName = "DOF Fixed Focus Shift Night"; + string UIWidget = "Spinner"; +> = {0.0}; +float doffixedfocusbump_d +< + string UIName = "DOF Fixed Focus Shift Day"; + string UIWidget = "Spinner"; +> = {0.0}; +float doffixedfocusbump_i +< + string UIName = "DOF Fixed Focus Shift Interior"; + string UIWidget = "Spinner"; +> = {0.0}; +float doffixedfocusblend_n +< + string UIName = "DOF Fixed Focus Blend Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +float doffixedfocusblend_d +< + string UIName = "DOF Fixed Focus Blend Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +float doffixedfocusblend_i +< + string UIName = "DOF Fixed Focus Blend Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +float doffixedfocusdepth +< + string UIName = "DOF Fixed Focus Depth"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +float doffixedfocuscap +< + string UIName = "DOF Fixed Focus Cap"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +/* fixed unfocused depth factors */ +float doffixedunfocusmult_n +< + string UIName = "DOF Fixed Unfocus Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float doffixedunfocusmult_d +< + string UIName = "DOF Fixed Unfocus Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float doffixedunfocusmult_i +< + string UIName = "DOF Fixed Unfocus Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float doffixedunfocuspow_n +< + string UIName = "DOF Fixed Unfocus Contrast Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1000.0}; +float doffixedunfocuspow_d +< + string UIName = "DOF Fixed Unfocus Contrast Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1000.0}; +float doffixedunfocuspow_i +< + string UIName = "DOF Fixed Unfocus Contrast Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1000.0}; +float doffixedunfocusbump_n +< + string UIName = "DOF Fixed Unfocus Shift Night"; + string UIWidget = "Spinner"; +> = {0.0}; +float doffixedunfocusbump_d +< + string UIName = "DOF Fixed Unfocus Shift Day"; + string UIWidget = "Spinner"; +> = {0.0}; +float doffixedunfocusbump_i +< + string UIName = "DOF Fixed Unfocus Shift Interior"; + string UIWidget = "Spinner"; +> = {0.0}; +float doffixedunfocusblend_n +< + string UIName = "DOF Fixed Unfocus Blend Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +float doffixedunfocusblend_d +< + string UIName = "DOF Fixed Unfocus Blend Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +float doffixedunfocusblend_i +< + string UIName = "DOF Fixed Unfocus Blend Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +float doffixedunfocusdepth +< + string UIName = "DOF Fixed Unfocus Depth"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +/* prevents fixed dof from blurring the skybox */ +bool doffixedcut +< + string UIName = "DOF Fixed Use Cutoff"; + string UIWidget = "Checkbox"; +> = {true}; +/* disable depth of field */ +bool dofdisable +< + string UIName = "Disable DOF"; + string UIWidget = "Checkbox"; +> = {false}; +bool doffixedonly +< + string UIName = "Use Only Fixed DOF"; + string UIWidget = "Checkbox"; +> = {false}; +float dofpradius +< + string UIName = "DOF Gather Blur Radius"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {6.0}; +bool dofpostblur +< + string UIName = "Enable DOF Post-Blur"; + string UIWidget = "Checkbox"; +> = {true}; +float dofpbradius +< + string UIName = "DOF Post-Blur Radius"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float dofpcha +< + string UIName = "DOF Blur Chromatic Aberration"; + string UIWidget = "Spinner"; +> = {0.0}; +bool dofhilite +< + string UIName = "Enable DOF Highlights"; + string UIWidget = "Checkbox"; +> = {false}; +float dofbthreshold +< + string UIName = "DOF Highlight Threshold"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.5}; +float dofbgain +< + string UIName = "DOF Highlight Gain"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float dofbradius +< + string UIName = "DOF Bokeh Blur Radius"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float dofbbias +< + string UIName = "DOF Bokeh Edge Bias"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.5}; +float dofbnoise +< + string UIName = "DOF Bokeh Fuzz"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.01}; +/* tilting */ +float doftiltxcenter +< + string UIName = "Focus Plane Horizontal Tilt Center"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.5}; +float doftiltycenter +< + string UIName = "Focus Plane Vertical Tilt Center"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.5}; +float doftiltx +< + string UIName = "Focus Plane Horizontal Tilt"; + string UIWidget = "Spinner"; +> = {0.0}; +float doftilty +< + string UIName = "Focus Plane Vertical Tilt"; + string UIWidget = "Spinner"; +> = {0.0}; +/* cheap performance option */ +float dofminblur +< + string UIName = "DOF Minimum Blur"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +bool dofdebug +< + string UIName = "Debug Depth"; + string UIWidget = "Checkbox"; +> = {false}; +bool dfcdebug +< + string UIName = "Debug Focus"; + string UIWidget = "Checkbox"; +> = {false}; +/* use "edge vision" filter */ +string str_view = "Edgevision"; +bool edgevenable +< + string UIName = "Enable Edgevision"; + string UIWidget = "Checkbox"; +> = {false}; +/* factors */ +float edgevfadepow_n +< + string UIName = "Edgevision Fade Contrast Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float edgevfadepow_d +< + string UIName = "Edgevision Fade Contrast Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float edgevfadepow_i +< + string UIName = "Edgevision Fade Contrast Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float edgevfademult_n +< + string UIName = "Edgevision Fade Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +float edgevfademult_d +< + string UIName = "Edgevision Fade Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +float edgevfademult_i +< + string UIName = "Edgevision Fade Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +float edgevpow +< + string UIName = "Edgevision Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.25}; +float edgevmult +< + string UIName = "Edgevision Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {4.0}; +float edgevradius +< + string UIName = "Edgevision Radius"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +bool edgevinv +< + string UIName = "Invert Edgevision"; + string UIWidget = "Checkbox"; +> = {false}; +bool edgevblend +< + string UIName = "Blend Edgevision"; + string UIWidget = "Checkbox"; +> = {false}; +/* use luma edge detection filter */ +string str_com = "Edge Detect"; +bool comenable +< + string UIName = "Enable Edge Detect"; + string UIWidget = "Checkbox"; +> = {false}; +float compow +< + string UIName = "Edge Detect Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float commult +< + string UIName = "Edge Detect Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float comradius +< + string UIName = "Edge Detect Radius"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +bool cominv +< + string UIName = "Invert Edge Detect"; + string UIWidget = "Checkbox"; +> = {false}; +bool comblend +< + string UIName = "Blend Edge Detect"; + string UIWidget = "Checkbox"; +> = {false}; +/* use edge threshold filter aka "linevision" */ +string str_cont = "Linevision"; +bool contenable +< + string UIName = "Enable Linevision"; + string UIWidget = "Checkbox"; +> = {false}; +/* factors */ +float contfadepow_n +< + string UIName = "Linevision Fade Contrast Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float contfadepow_d +< + string UIName = "Linevision Fade Contrast Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float contfadepow_i +< + string UIName = "Linevision Fade Contrast Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float contfademult_n +< + string UIName = "Linevision Fade Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +float contfademult_d +< + string UIName = "Linevision Fade Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +float contfademult_i +< + string UIName = "Linevision Fade Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {500.0}; +float contpow +< + string UIName = "Linevision Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float contmult +< + string UIName = "Linevision Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +float contradius +< + string UIName = "Linevision Radius"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float contthreshold +< + string UIName = "Linevision Threshold"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.05}; +bool continv +< + string UIName = "Invert Linevision"; + string UIWidget = "Checkbox"; +> = {false}; +bool contblend +< + string UIName = "Blend Linevision"; + string UIWidget = "Checkbox"; +> = {false}; +/* fog filter */ +string str_fog = "Custom Fog Filter"; +bool fogenable +< + string UIName = "Enable Custom Fog"; + string UIWidget = "Checkbox"; +> = {false}; +float fogpow +< + string UIName = "Fog Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float fogmult +< + string UIName = "Fog Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float fogbump +< + string UIName = "Fog Shift"; + string UIWidget = "Spinner"; +> = {0.0}; +float3 fogcolor +< + string UIName = "Fog Color"; + string UIWidget = "Spinner"; +> = {1.0,1.0,1.0}; +bool foglimbo +< + string UIName = "Limbo Mode"; + string UIWidget = "Checkbox"; +> = {false}; +/* depth-based colour grading suite */ +string str_grade = "Depth Color Grading Suite"; +float dgradedfoc +< + string UIName = "Depth Grading Center Depth"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.0}; +float dgradedpow_n +< + string UIName = "Depth Grading Contrast Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float dgradedpow_d +< + string UIName = "Depth Grading Contrast Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float dgradedpow_i +< + string UIName = "Depth Grading Contrast Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float dgradedmul_n +< + string UIName = "Depth Grading Intensity Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float dgradedmul_d +< + string UIName = "Depth Grading Intensity Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float dgradedmul_i +< + string UIName = "Depth Grading Intensity Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float dgradedbump_n +< + string UIName = "Depth Grading Shift Night"; + string UIWidget = "Spinner"; +> = {0.0}; +float dgradedbump_d +< + string UIName = "Depth Grading Shift Day"; + string UIWidget = "Spinner"; +> = {0.0}; +float dgradedbump_i +< + string UIName = "Depth Grading Shift Interior"; + string UIWidget = "Spinner"; +> = {0.0}; +float dgradedblend_n +< + string UIName = "Depth Grading Blend Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +float dgradedblend_d +< + string UIName = "Depth Grading Blend Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +float dgradedblend_i +< + string UIName = "Depth Grading Blend Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +bool dgradeenable1 +< + string UIName = "Enable RGB Grading"; + string UIWidget = "Checkbox"; +> = {false}; +/* color component multipliers */ +float3 dgrademul_n +< + string UIName = "Grading Intensity Night"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 dgrademul_d +< + string UIName = "Grading Intensity Day"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 dgrademul_i +< + string UIName = "Grading Intensity Interior"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +/* color component contrasts */ +float3 dgradepow_n +< + string UIName = "Grading Contrast Night"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 dgradepow_d +< + string UIName = "Grading Contrast Day"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 dgradepow_i +< + string UIName = "Grading Contrast Interior"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +/* colorization factors */ +bool dgradeenable2 +< + string UIName = "Enable Vibrance Grading"; + string UIWidget = "Checkbox"; +> = {false}; +float3 dgradecol_n +< + string UIName = "Grading Color Night"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 dgradecol_d +< + string UIName = "Grading Color Day"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 dgradecol_i +< + string UIName = "Grading Color Interior"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +/* blend factor for colorization (negative values are quite fancy) */ +float dgradecolfact_n +< + string UIName = "Grading Color Factor Night"; + string UIWidget = "Spinner"; +> = {0.0}; +float dgradecolfact_d +< + string UIName = "Grading Color Factor Day"; + string UIWidget = "Spinner"; +> = {0.0}; +float dgradecolfact_i +< + string UIName = "Grading Color Factor Interior"; + string UIWidget = "Spinner"; +> = {0.0}; +/* HSV grading */ +bool dgradeenable3 +< + string UIName = "Enable HSV Grading"; + string UIWidget = "Checkbox"; +> = {false}; +/* saturation multiplier */ +float dgradesatmul_n +< + string UIName = "Grading Saturation Intensity Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float dgradesatmul_d +< + string UIName = "Grading Saturation Intensity Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float dgradesatmul_i +< + string UIName = "Grading Saturation Intensity Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +/* saturation power */ +float dgradesatpow_n +< + string UIName = "Grading Saturation Contrast Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float dgradesatpow_d +< + string UIName = "Grading Saturation Contrast Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float dgradesatpow_i +< + string UIName = "Grading Saturation Contrast Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +/* value multiplier */ +float dgradevalmul_n +< + string UIName = "Grading Value Intensity Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float dgradevalmul_d +< + string UIName = "Grading Value Intensity Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float dgradevalmul_i +< + string UIName = "Grading Value Intensity Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +/* value power */ +float dgradevalpow_n +< + string UIName = "Grading Value Contrast Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float dgradevalpow_d +< + string UIName = "Grading Value Contrast Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float dgradevalpow_i +< + string UIName = "Grading Value Contrast Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +bool dcolorizeafterhsv +< + string UIName = "Colorize After HSV"; + string UIWidget = "Checkbox"; +> = {true}; + +/* mathematical constants */ +static const float pi = 3.1415926535898; + +/* edge detect factors */ +static const float3x3 GX = +{ + -1, 0, 1, + -2, 0, 2, + -1, 0, 1 +}; +static const float3x3 GY = +{ + 1, 2, 1, + 0, 0, 0, + -1,-2,-1 +}; +/* radius: 8, std dev: 3 */ +static const float gauss8[8] = +{ + 0.134598, 0.127325, 0.107778, 0.081638, + 0.055335, 0.033562, 0.018216, 0.008847 +}; +/* radius: 16, std dev: 13 */ +static const float gauss16[16] = +{ + 0.040012, 0.039893, 0.039541, 0.038960, + 0.038162, 0.037159, 0.035969, 0.034612, + 0.033109, 0.031485, 0.029764, 0.027971, + 0.026131, 0.024268, 0.022405, 0.020563 +}; +/* For low quality DOF */ +static const float2 poisson32[32] = +{ + float2( 0.7284430,-0.1927130),float2( 0.4051600,-0.2312710), + float2( 0.9535280, 0.0669683),float2( 0.6544140,-0.4439470), + float2( 0.6029910, 0.1058970),float2( 0.2637500,-0.7163810), + float2( 0.9105380,-0.3889810),float2( 0.5942730,-0.7400740), + float2( 0.8215680, 0.3162520),float2( 0.3577550, 0.4884250), + float2( 0.6935990, 0.7070140),float2( 0.0470570, 0.1961800), + float2(-0.0977021, 0.6241300),float2( 0.2110300, 0.8778350), + float2(-0.3743440, 0.2494580),float2( 0.0144776,-0.0766484), + float2(-0.3377660,-0.1255100),float2( 0.3136420, 0.1077710), + float2(-0.5204340, 0.8369860),float2(-0.1182680, 0.9801750), + float2(-0.6969480,-0.3869330),float2(-0.6156080, 0.0307209), + float2(-0.3806790,-0.6055360),float2(-0.1909570,-0.3861330), + float2(-0.2449080,-0.8655030),float2( 0.0822108,-0.4975580), + float2(-0.5649250, 0.5756740),float2(-0.8741830,-0.1685750), + float2( 0.0761715,-0.9631760),float2(-0.9218270, 0.2121210), + float2(-0.6378530, 0.3053550),float2(-0.8425180, 0.4753000) +}; + +float4 Timer; +float4 ScreenSize; +float4 Weather; +float ENightDayFactor; +float EInteriorFactor; +float4 TimeOfDay1; +float4 TimeOfDay2; +float4 DofParameters; +float4 tempInfo2; + +Texture2D TextureCurrent; +Texture2D TexturePrevious; +Texture2D TextureOriginal; +Texture2D TextureColor; +Texture2D TextureDepth; +Texture2D TextureFocus; + +Texture2D RenderTargetR16F; /* for SSAO */ +Texture2D RenderTargetR32F; /* for DOF */ + +Texture2D TextureNoise3 +< + string ResourceName = "menbnoise3.png"; +>; +Texture2D TextureHeat +< +#ifdef HEAT_DDS + string ResourceName = "menbheat.dds"; +#else + string ResourceName = "menbheat.png"; +#endif +>; + +SamplerState Sampler0 +{ + Filter = MIN_MAG_MIP_POINT; + AddressU = Clamp; + AddressV = Clamp; + MaxLOD = 0; +}; +SamplerState Sampler1 +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Clamp; + AddressV = Clamp; + MaxLOD = 0; +}; +SamplerState Sampler2 +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Wrap; + AddressV = Wrap; + MaxLOD = 0; +}; + +struct VS_INPUT_POST +{ + float3 pos : POSITION; + float2 txcoord : TEXCOORD0; +}; +struct VS_OUTPUT_POST +{ + float4 pos : SV_POSITION; + float2 txcoord : TEXCOORD0; +}; + +VS_OUTPUT_POST VS_Quad( VS_INPUT_POST IN ) +{ + VS_OUTPUT_POST OUT; + OUT.pos = float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0); + OUT.txcoord.xy = IN.txcoord.xy; + return OUT; +} + +/* helper functions */ +/* photometric */ +#define luminance(x) dot(x,float3(0.2126,0.7152,0.0722)) +/* CCIR601 */ +//#define luminance(x) dot(x,float3(0.299,0.587,0.114)) +float3 rgb2hsv( float3 c ) +{ + float4 K = float4(0.0,-1.0/3.0,2.0/3.0,-1.0); + float4 p = (c.g doffixedfocuscap ) dff = 1.0; + float dfu = abs(dep-doffixedunfocusdepth); + dfu = clamp(pow(dfu,doffixedunfocuspow)*doffixedunfocusmult + +doffixedunfocusbump,0.0,1.0); + if ( doffixedcut && (dep >= cutoff*0.000001) ) dfu *= 0; + float dfc = abs(dep-foc); + dfc = clamp(pow(dfc,dofpow)*dofmult+dofbump,0.0,1.0); + if ( doffixedonly ) dfc *= 0; + dfc += lerp(0.0,dfu,doffixedunfocusblend); + dfc *= lerp(1.0,dff,doffixedfocusblend); + return clamp(dfc,0.0,1.0); +} + +/* old Edgevision mode */ +float3 EdgeView( float3 res, float2 coord ) +{ + float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + if ( fixed.x>0 && fixed.y>0 ) bresl = fixed; + float edgevfadepow = tod_ind(edgevfadepow); + float edgevfademult = tod_ind(edgevfademult); + float2 bof = float2(1.0/bresl.x,1.0/bresl.y)*edgevradius; + float mdx = 0, mdy = 0, mud = 0; + /* this reduces texture fetches by half, big difference */ + float3x3 depths; + depths[0][0] = depthlinear(coord+float2(-1,-1)*bof); + depths[0][1] = depthlinear(coord+float2( 0,-1)*bof); + depths[0][2] = depthlinear(coord+float2( 1,-1)*bof); + depths[1][0] = depthlinear(coord+float2(-1, 0)*bof); + depths[1][1] = depthlinear(coord+float2( 0, 0)*bof); + depths[1][2] = depthlinear(coord+float2( 1, 0)*bof); + depths[2][0] = depthlinear(coord+float2(-1, 1)*bof); + depths[2][1] = depthlinear(coord+float2( 0, 1)*bof); + depths[2][2] = depthlinear(coord+float2( 1, 1)*bof); + mdx += GX[0][0]*depths[0][0]; + mdx += GX[0][1]*depths[0][1]; + mdx += GX[0][2]*depths[0][2]; + mdx += GX[1][0]*depths[1][0]; + mdx += GX[1][1]*depths[1][1]; + mdx += GX[1][2]*depths[1][2]; + mdx += GX[2][0]*depths[2][0]; + mdx += GX[2][1]*depths[2][1]; + mdx += GX[2][2]*depths[2][2]; + mdy += GY[0][0]*depths[0][0]; + mdy += GY[0][1]*depths[0][1]; + mdy += GY[0][2]*depths[0][2]; + mdy += GY[1][0]*depths[1][0]; + mdy += GY[1][1]*depths[1][1]; + mdy += GY[1][2]*depths[1][2]; + mdy += GY[2][0]*depths[2][0]; + mdy += GY[2][1]*depths[2][1]; + mdy += GY[2][2]*depths[2][2]; + mud = pow(mdx*mdx+mdy*mdy,0.5); + float fade = 1.0-TextureDepth.Sample(Sampler1,coord).x; + mud *= clamp(pow(max(0,fade),edgevfadepow)*edgevfademult,0.0,1.0); + mud = clamp(pow(max(0,mud),edgevpow)*edgevmult,0.0,1.0); + if ( edgevblend ) return res-(edgevinv?1.0-mud:mud); + return edgevinv?1.0-mud:mud; +} + +/* luminance edge detection */ +float3 EdgeDetect( float3 res, float2 coord ) +{ + float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + if ( fixed.x>0 && fixed.y>0 ) bresl = fixed; + float2 bof = float2(1.0/bresl.x,1.0/bresl.y)*comradius; + float mdx = 0, mdy = 0, mud = 0; + float3x3 lums; + float3 col; + col = TextureOriginal.Sample(Sampler1,coord+float2(-1,-1)*bof).rgb; + lums[0][0] = luminance(col); + col = TextureOriginal.Sample(Sampler1,coord+float2(0,-1)*bof).rgb; + lums[0][1] = luminance(col); + col = TextureOriginal.Sample(Sampler1,coord+float2(1,-1)*bof).rgb; + lums[0][2] = luminance(col); + col = TextureOriginal.Sample(Sampler1,coord+float2(-1,0)*bof).rgb; + lums[1][0] = luminance(col); + col = TextureOriginal.Sample(Sampler1,coord+float2(0,0)*bof).rgb; + lums[1][1] = luminance(col); + col = TextureOriginal.Sample(Sampler1,coord+float2(1,0)*bof).rgb; + lums[1][2] = luminance(col); + col = TextureOriginal.Sample(Sampler1,coord+float2(-1,1)*bof).rgb; + lums[2][0] = luminance(col); + col = TextureOriginal.Sample(Sampler1,coord+float2(0,1)*bof).rgb; + lums[2][1] = luminance(col); + col = TextureOriginal.Sample(Sampler1,coord+float2(1,1)*bof).rgb; + lums[2][2] = luminance(col); + mdx += GX[0][0]*lums[0][0]; + mdx += GX[0][1]*lums[0][1]; + mdx += GX[0][2]*lums[0][2]; + mdx += GX[1][0]*lums[1][0]; + mdx += GX[1][1]*lums[1][1]; + mdx += GX[1][2]*lums[1][2]; + mdx += GX[2][0]*lums[2][0]; + mdx += GX[2][1]*lums[2][1]; + mdx += GX[2][2]*lums[2][2]; + mdy += GY[0][0]*lums[0][0]; + mdy += GY[0][1]*lums[0][1]; + mdy += GY[0][2]*lums[0][2]; + mdy += GY[1][0]*lums[1][0]; + mdy += GY[1][1]*lums[1][1]; + mdy += GY[1][2]*lums[1][2]; + mdy += GY[2][0]*lums[2][0]; + mdy += GY[2][1]*lums[2][1]; + mdy += GY[2][2]*lums[2][2]; + mud = pow(max(mdx*mdx+mdy*mdy,0.0),0.5); + mud = clamp(pow(max(mud,0.0),compow)*commult,0.0,1.0); + if ( comblend ) return res-(cominv?1.0-mud:mud); + return cominv?1.0-mud:mud; +} + +/* linevision filter */ +float3 LineView( float3 res, float2 coord ) +{ + float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + if ( fixed.x>0 && fixed.y>0 ) bresl = fixed; + float contfadepow = tod_ind(contfadepow); + float contfademult = tod_ind(contfademult); + float2 bof = float2(1.0/bresl.x,1.0/bresl.y)*contradius; + float dep = depthlinear(coord); + float cont = depthlinear(coord+float2(-1,-1)*bof); + cont += depthlinear(coord+float2(0,-1)*bof); + cont += depthlinear(coord+float2(1,-1)*bof); + cont += depthlinear(coord+float2(-1,0)*bof); + cont += depthlinear(coord+float2(1,0)*bof); + cont += depthlinear(coord+float2(-1,1)*bof); + cont += depthlinear(coord+float2(0,1)*bof); + cont += depthlinear(coord+float2(1,1)*bof); + cont /= 8.0; + float mud = 0.0; + if ( abs(cont-dep) > (contthreshold*0.00001) ) mud = 1.0; + float fade = 1.0-TextureDepth.Sample(Sampler1,coord).x; + mud *= clamp(pow(max(0.0,fade),contfadepow)*contfademult,0.0,1.0); + mud = clamp(pow(max(0.0,mud),contpow)*contmult,0.0,1.0); + if ( contblend ) return res-(continv?1.0-mud:mud); + return continv?1.0-mud:mud; +} + +/* fog filter */ +float3 Limbo( float3 res, float2 coord ) +{ + float mud = clamp(pow(max(0.0,depthlinear(coord)),fogpow)*fogmult + +fogbump,0.0,1.0); + if ( foglimbo ) return fogcolor*mud; + return lerp(res,fogcolor,mud); +} + +/* Colour grading based on depth */ +float3 DepthGradeRGB( float3 res, float dfc ) +{ + float3 dgrademul = tod_ind(dgrademul); + float3 dgradepow = tod_ind(dgradepow); + return lerp(res,pow(max(0,res),dgradepow)*dgrademul,dfc); +} +float3 DepthGradeColor( float3 res, float dfc ) +{ + float dgradecolfact = tod_ind(dgradecolfact); + float3 dgradecol = tod_ind(dgradecol); + float tonev = luminance(res); + float3 tonecolor = dgradecol*tonev; + return lerp(res,res*(1.0-dgradecolfact)+tonecolor*dgradecolfact,dfc); +} +float3 DepthGradeHSV( float3 res, float dfc ) +{ + float dgradesatmul = tod_ind(dgradesatmul); + float dgradesatpow = tod_ind(dgradesatpow); + float dgradevalmul = tod_ind(dgradevalmul); + float dgradevalpow = tod_ind(dgradevalpow); + float3 hsv = rgb2hsv(res); + hsv.y = clamp(pow(max(0,hsv.y),dgradesatpow)*dgradesatmul,0.0,1.0); + hsv.z = pow(max(0,hsv.z),dgradevalpow)*dgradevalmul; + return lerp(res,hsv2rgb(hsv),dfc); +} +float3 DepthGrade( float3 res, float2 coord ) +{ + float dep = TextureDepth.Sample(Sampler1,coord).x; + float dfc = abs(dep-dgradedfoc); + float dgradedpow = tod_ind(dgradedpow); + float dgradedmul = tod_ind(dgradedmul); + float dgradedbump = tod_ind(dgradedbump); + float dgradedblend = tod_ind(dgradedblend); + dfc = clamp(pow(dfc,dgradedpow)*dgradedmul+dgradedbump,0.0,1.0) + *dgradedblend; + if ( dgradeenable1 ) res = DepthGradeRGB(res,dfc); + if ( dcolorizeafterhsv ) + { + if ( dgradeenable3 ) res = DepthGradeHSV(res,dfc); + if ( dgradeenable2 ) res = DepthGradeColor(res,dfc); + } + else + { + if ( dgradeenable2 ) res = DepthGradeColor(res,dfc); + if ( dgradeenable3 ) res = DepthGradeHSV(res,dfc); + } + return res; +} + +float4 PS_DepthGrade( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float4 res = TextureColor.Sample(Sampler1,coord); + res.rgb = DepthGrade(res.rgb,coord); + res.rgb = max(res.rgb,0.0); + return res; +} + +float4 PS_PreFilters( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float4 res = TextureColor.Sample(Sampler1,coord); + if ( edgevenable ) res.rgb = EdgeView(res.rgb,coord); + if ( comenable ) res.rgb = EdgeDetect(res.rgb,coord); + if ( contenable ) res.rgb = LineView(res.rgb,coord); + if ( fogenable ) res.rgb = Limbo(res.rgb,coord); + res.rgb = max(res.rgb,0.0); + return res; +} + +/* Distant hot air refraction. Not very realistic, but does the job. */ +float2 DistantHeat( float2 coord ) +{ + float2 bresl; + float dep, odep; + dep = TextureDepth.Sample(Sampler1,coord).x; + float distfade = clamp(pow(max(0,dep),heatfadepow)*heatfademul + +heatfadebump,0.0,1.0); + if ( distfade <= 0.0 ) return coord; + float todpow = max(0.0,todx_ind(heatfactor)); + if ( todpow <= 0.0 ) return coord; + if ( (fixed.x > 0) && (fixed.y > 0) ) bresl = fixed; + else bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float2 nc = coord*(bresl/HEATSIZE)*heatsize; + float2 ts = float2(0.01,1.0)*Timer.x*10000.0*heatspeed; + float2 ofs = TextureHeat.SampleLevel(Sampler2,nc+ts,0).xy; + ofs = (ofs-0.5)*2.0; + ofs *= pow(length(ofs),heatpow); + ofs *= todpow; + /*ofs *= max(0.0,warmfactor-coldfactor);*/ + odep = TextureDepth.SampleLevel(Sampler1,coord+ofs*heatstrength + *distfade*0.01,0).x; + float odistfade = clamp(pow(max(0,odep),heatfadepow)*heatfademul + +heatfadebump,0.0,1.0); + if ( odistfade <= 0.0 ) return coord; + return coord+ofs*heatstrength*distfade*0.01; +} + +/* Screen distortion filters */ +float4 PS_Distortion( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float2 bresl; + if ( (fixed.x > 0) && (fixed.y > 0) ) bresl = fixed; + else bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float2 ofs = coord; + if ( heatenable ) ofs = DistantHeat(ofs); + ofs -= coord; + float4 res; + if ( (distcha == 0.0) || (length(ofs) == 0.0) ) + return TextureColor.Sample(Sampler1,coord+ofs); + float2 ofr, ofg, ofb; + ofr = ofs*(1.0-distcha*0.01); + ofg = ofs; + ofb = ofs*(1.0+distcha*0.01); + res = float4(TextureColor.Sample(Sampler1,coord+ofr).r, + TextureColor.Sample(Sampler1,coord+ofg).g, + TextureColor.Sample(Sampler1,coord+ofb).b, + TextureColor.Sample(Sampler1,coord+ofs).a); + return res; +} + +/* This will do absolutely nothing */ +float4 PS_Aperture( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + return float4(0,0,0,1); +} + +/* Focus */ +float4 PS_ReadFocus( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + if ( dofdisable ) return 0.0; + if ( focuscircle == -2 ) + return TextureDepth.Sample(Sampler1,tempInfo2.zw).x; + if ( focuscircle < 0 ) return focusmanualvalue; + float focusmax = tod_ind(focusmax); + float cfocus = min(TextureDepth.Sample(Sampler1,focuscenter).x, + focusmax*0.001); + if ( focuscircle == 0 ) return cfocus; + if ( focuscircle == 2 ) + { + int i, j; + float mfocus = 0.0; + float2 px; + [unroll] for( j=0; j<8; j++ ) [unroll] for( i=0; i<8; i++ ) + { + px = float2((i+0.5)/8.0,(j+0.5)/8.0); + mfocus += min(TextureDepth.Sample(Sampler1,px).x, + focusmax*0.001); + } + return mfocus/64.0; + } + /* using polygons inscribed into a circle, in this case a triangle */ + float focusradius = tod_ind(focusradius); + float focusmix = tod_ind(focusmix); + float cstep = (1.0/3.0); + float sfocus, mfocus[4]; + float2 coord; + float2 bof = float2(1.0,1.0/ScreenSize.w)*focusradius*0.01; + float fan = focuscircleangle*2.0*pi; + coord.x = focuscenter.x+sin(fan)*bof.x; + coord.y = focuscenter.y+cos(fan)*bof.y; + mfocus[0] = min(TextureDepth.Sample(Sampler1,coord).x, + focusmax*0.001); + coord.x = focuscenter.x+sin(fan+2.0*pi*cstep)*bof.x; + coord.y = focuscenter.y+cos(fan+2.0*pi*cstep)*bof.y; + mfocus[1] = min(TextureDepth.Sample(Sampler1,coord).x, + focusmax*0.001); + coord.x = focuscenter.x+sin(fan+4.0*pi*cstep)*bof.x; + coord.y = focuscenter.y+cos(fan+4.0*pi*cstep)*bof.y; + mfocus[2] = min(TextureDepth.Sample(Sampler1,coord).x, + focusmax*0.001); + if ( (mfocus[0] <= focuscenterdiscard) + && (mfocus[1] <= focuscenterdiscard) + && (mfocus[2] <= focuscenterdiscard) ) + mfocus[3] = focuscenterdiscard; + else if ( mfocus[0] <= focuscenterdiscard ) + { + if ( mfocus[1] <= focuscenterdiscard ) mfocus[3] = mfocus[2]; + else mfocus[3] = 0.5*(mfocus[1]+mfocus[2]); + } + else if ( mfocus[1] <= focuscenterdiscard ) + { + if ( mfocus[2] <= focuscenterdiscard ) mfocus[3] = mfocus[0]; + else mfocus[3] = 0.5*(mfocus[0]+mfocus[2]); + } + else if ( mfocus[2] <= focuscenterdiscard ) + mfocus[3] = 0.5*(mfocus[0]+mfocus[1]); + else mfocus[3] = cstep*(mfocus[0]+mfocus[1]+mfocus[2]); + if ( cfocus <= focuscenterdiscard ) cfocus = mfocus[3]; + else if ( (mfocus[3] > focuscenterdiscard) ) + cfocus = (1.0-focusmix)*cfocus+focusmix*mfocus[3]; + return cfocus; +} + +float4 PS_Focus( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + if ( dofdisable ) return 0.0; + return max(lerp(TexturePrevious.Sample(Sampler0,0.5).x, + TextureCurrent.Sample(Sampler0,0.5).x, + saturate(DofParameters.w)),0.0); +} +/* helper code for simplifying these */ +#define gcircle(x) float2(cos(x),sin(x)) +float4 dofsample( float2 coord, float2 bsz, float blur, bool bDoHighlight, + out float4 deps, out float4 dfcs ) +{ + float4 res; + float cstep = 2.0*pi*(1.0/3.0); + float ang = 0.5*pi; + res.r = TextureColor.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).r; + deps.r = TextureDepth.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).x; + dfcs.r = RenderTargetR32F.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).x; + ang += cstep; + res.g = TextureColor.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).g; + deps.g = TextureDepth.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).x; + dfcs.g = RenderTargetR32F.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).x; + ang += cstep; + res.b = TextureColor.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).b; + deps.b = TextureDepth.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).x; + dfcs.b = RenderTargetR32F.SampleLevel(Sampler1,coord + +gcircle(ang)*bsz*dofpcha*0.1,0).x; + if ( bDoHighlight ) + { + float l = luminance(res.rgb); + float threshold = max((l-dofbthreshold)*dofbgain,0.0); + res += lerp(0,res,threshold*blur); + } + res.a = TextureColor.SampleLevel(Sampler1,coord,0).a; + deps.a = TextureDepth.SampleLevel(Sampler1,coord,0).x; + dfcs.a = RenderTargetR32F.SampleLevel(Sampler1,coord,0).x; + return res; +} +/* gather blur pass */ +float4 PS_DoFBlur( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + if ( dofdisable ) return TextureColor.Sample(Sampler1,coord); + float dfc = RenderTargetR32F.Sample(Sampler1,coord).x; + if ( dofdebug ) return TextureDepth.Sample(Sampler1,coord).x; + if ( dfcdebug ) return dfc; + float2 bresl; + if ( (fixed.x > 0) && (fixed.y > 0) ) bresl = fixed; + else bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float2 bof = 1.0/bresl; + if ( dfc <= dofminblur ) return TextureColor.Sample(Sampler1,coord); + float4 res = float4(0,0,0,0); + float dep = TextureDepth.Sample(Sampler1,coord).x; + float2 bsz = bof*dofpradius*dfc; + float4 sc, ds, sd, sw, tw = float4(0,0,0,0); + float cstep = 2.0*pi*(1.0/3.0); + float ang = 0.5*pi; + [unroll] for ( int i=0; i<32; i++ ) + { + sc = dofsample(coord+poisson32[i]*bsz,bsz,dfc,dofhilite,ds,sd); + sw.r = (ds.r>dep)?1.0:sd.r; + sw.g = (ds.g>dep)?1.0:sd.g; + sw.b = (ds.b>dep)?1.0:sd.b; + sw.a = (ds.a>dep)?1.0:sd.a; + tw += sw; + res += sc*sw; + } + res /= tw; + return res; +} + +/* "bokeh" blur pass */ +float4 PS_DoFBorkeh( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + if ( dofdisable ) return TextureColor.Sample(Sampler1,coord); + float dfc = RenderTargetR32F.Sample(Sampler1,coord).x; + if ( dofdebug ) return TextureDepth.Sample(Sampler1,coord).x; + if ( dfcdebug ) return dfc; + float2 bresl; + if ( (fixed.x > 0) && (fixed.y > 0) ) bresl = fixed; + else bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float2 bof = 1.0/bresl; + float4 res = TextureColor.Sample(Sampler1,coord); + /* + Skip blurring areas that are perfectly in focus. The performance + gain is negligible in most cases, though. + */ + if ( dfc <= dofminblur ) return res; + float dep = TextureDepth.Sample(Sampler1,coord).x; + float2 sf = bof+(TextureNoise3.SampleLevel(Sampler2,coord + *(bresl/256.0),0).xy*2.0-1.0)*dofbnoise*0.001; + float2 sr = sf*dofbradius*dfc; + int rsamples; + float bstep, bw; + float4 sc, ds, sd, sw, tw = float4(1,1,1,1); + float2 rcoord; + #define dofbrings 7 + #define dofbsamples 3 + [unroll] for ( int i=1; i<=dofbrings; i++ ) + { + rsamples = i*dofbsamples; + [unroll] for ( int j=0; jdep)?1.0:sd.r; + sw.g = (ds.g>dep)?1.0:sd.g; + sw.b = (ds.b>dep)?1.0:sd.b; + sw.a = (ds.a>dep)?1.0:sd.a; + res += sc*sw*bw; + tw += sw*bw; + } + } + res /= tw; + return res; +} +float4 PS_DoFPostBlur( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + if ( dofdisable ) return TextureColor.Sample(Sampler1,coord); + float dfc = RenderTargetR32F.Sample(Sampler1,coord).x; + if ( dofdebug ) return TextureDepth.Sample(Sampler1,coord).x; + if ( dfcdebug ) return dfc; + float2 bresl; + if ( (fixed.x > 0) && (fixed.y > 0) ) bresl = fixed; + else bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float2 bof = (1.0/bresl)*dofpbradius; + float2 ofs[16] = + { + float2(1.0,1.0), float2(-1.0,-1.0), + float2(-1.0,1.0), float2(1.0,-1.0), + + float2(1.0,0.0), float2(-1.0,0.0), + float2(0.0,1.0), float2(0.0,-1.0), + + float2(1.41,0.0), float2(-1.41,0.0), + float2(0.0,1.41), float2(0.0,-1.41), + + float2(1.41,1.41), float2(-1.41,-1.41), + float2(-1.41,1.41), float2(1.41,-1.41) + }; + float4 res = TextureColor.Sample(Sampler1,coord); + if ( !dofpostblur ) return res; + int i; + [unroll] for ( i=0; i<16; i++ ) + res += TextureColor.Sample(Sampler1,coord+ofs[i]*bof*dfc); + res /= 17.0; + return res; +} + +/* screen frost overlay */ +float4 PS_DebugFocus( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float4 res = TextureColor.Sample(Sampler1,coord); + if ( !focusdisplay || (focuscircle == -1) ) return res; + if ( focuscircle == -2 ) + { + if ( distance(coord,tempInfo2.zw) < 0.01 ) + res.rgb = float3(1,0,0); + return res; + } + if ( focuscircle == 2 ) + { + int i, j; + float2 px; + [unroll] for( j=0; j<8; j++ ) [unroll] for( i=0; i<8; i++ ) + { + px = float2((i+0.5)/8.0,(j+0.5)/8.0); + if ( distance(coord,px) < 0.005 ) + res.rgb = float3(1,0,0); + } + return res; + } + if ( distance(coord,focuscenter) < 0.01 ) res.rgb = float3(1,0,0); + if ( focuscircle == 0 ) return res; + float cstep = (1.0/3.0); + float2 tcoord; + float focusradius = tod_ind(focusradius); + float2 bof = float2(1.0,1.0/ScreenSize.w)*focusradius*0.01; + float fan = focuscircleangle*2.0*pi; + tcoord.x = focuscenter.x+sin(fan)*bof.x; + tcoord.y = focuscenter.y+cos(fan)*bof.y; + if ( distance(coord,tcoord) < 0.01 ) res.rgb = float3(1,0,0); + tcoord.x = focuscenter.x+sin(fan+2.0*pi*cstep)*bof.x; + tcoord.y = focuscenter.y+cos(fan+2.0*pi*cstep)*bof.y; + if ( distance(coord,tcoord) < 0.01 ) res.rgb = float3(1,0,0); + tcoord.x = focuscenter.x+sin(fan+4.0*pi*cstep)*bof.x; + tcoord.y = focuscenter.y+cos(fan+4.0*pi*cstep)*bof.y; + if ( distance(coord,tcoord) < 0.01 ) res.rgb = float3(1,0,0); + return res; +} + +technique11 Aperture +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Aperture())); + } +} + +technique11 ReadFocus +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_ReadFocus())); + } +} + +technique11 Focus +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Focus())); + } +} + +technique11 Prepass +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_PreFilters())); + } +} +technique11 Prepass1 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DepthGrade())); + } +} +technique11 Prepass2 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Distortion())); + } +} +technique11 Prepass3 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DoFPrepass())); + } +} +technique11 Prepass4 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DoFBlur())); + } +} +technique11 Prepass5 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DoFPostBlur())); + } +} +technique11 Prepass6 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DebugFocus())); + } +} + +technique11 PrepassB +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_PreFilters())); + } +} +technique11 PrepassB1 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DepthGrade())); + } +} +technique11 PrepassB2 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Distortion())); + } +} +technique11 PrepassB3 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DoFPrepass())); + } +} +technique11 PrepassB4 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DoFBorkeh())); + } +} +technique11 PrepassB5 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DoFPostBlur())); + } +} +technique11 PrepassB6 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_DebugFocus())); + } +} + diff --git a/enbseries/enbdepthoffield.fx.ini b/enbseries/enbdepthoffield.fx.ini new file mode 100644 index 0000000..3d99f22 --- /dev/null +++ b/enbseries/enbdepthoffield.fx.ini @@ -0,0 +1,175 @@ +[ENBDEPTHOFFIELD.FX] +TECHNIQUE=1 +Fixed ResolutionX=1920 +Fixed ResolutionY=1080 +Depth Cutoff=999998.0 +Near Z=0.05 +Far Z=3098.0 +Distortion Chromatic Aberration=9.5 +Enable Hot Air Refraction=true +Heat Texture Size=16.48 +Heat Speed=0.69 +Heat Fade Contrast=47.670006 +Heat Fade Intensity=1.08 +Heat Fade Offset=-0.97 +Heat Intensity=0.82 +Heat Contrast=0.55 +Heat Factor Dawn=-0.17 +Heat Factor Sunrise=0.62 +Heat Factor Day=1.06 +Heat Factor Sunset=0.54 +Heat Factor Dusk=-0.14 +Heat Factor Night=-0.51 +Heat Factor Interior=0.0 +Focus Mode=1 +Display Focus Points=false +Enable Manual Focus=false +Manual Focus Depth=1.0 +Focus Point Center=0.5, 0.48, 0 +Focus Triangle Angle=0.5 +Focus Triangle Radius Night=10.0 +Focus Triangle Radius Day=12.0 +Focus Triangle Radius Interior=11.0 +Focus Triangle Blending Night=0.75 +Focus Triangle Blending Day=0.9 +Focus Triangle Blending Interior=0.8 +Focus Maximum Depth Night=990.0 +Focus Maximum Depth Day=994.0 +Focus Maximum Depth Interior=988.0 +Focus Circle Discard Center Depth=0.01 +DOF Intensity Night=471.689972 +DOF Intensity Day=421.940002 +DOF Intensity Interior=438.609985 +DOF Contrast Night=4.110001 +DOF Contrast Day=4.340001 +DOF Contrast Interior=4.220002 +DOF Shift Night=0.0 +DOF Shift Day=0.0 +DOF Shift Interior=0.0 +DOF Fixed Focus Intensity Night=182.839996 +DOF Fixed Focus Intensity Day=196.440002 +DOF Fixed Focus Intensity Interior=172.610001 +DOF Fixed Focus Contrast Night=2.44 +DOF Fixed Focus Contrast Day=2.77 +DOF Fixed Focus Contrast Interior=2.59 +DOF Fixed Focus Shift Night=0.0 +DOF Fixed Focus Shift Day=0.0 +DOF Fixed Focus Shift Interior=0.0 +DOF Fixed Focus Blend Night=1.0 +DOF Fixed Focus Blend Day=1.0 +DOF Fixed Focus Blend Interior=1.0 +DOF Fixed Focus Depth=0.01 +DOF Fixed Focus Cap=0.01 +DOF Fixed Unfocus Intensity Night=1.11 +DOF Fixed Unfocus Intensity Day=1.07 +DOF Fixed Unfocus Intensity Interior=1.15 +DOF Fixed Unfocus Contrast Night=96.980003 +DOF Fixed Unfocus Contrast Day=134.399994 +DOF Fixed Unfocus Contrast Interior=65.19001 +DOF Fixed Unfocus Shift Night=-0.96 +DOF Fixed Unfocus Shift Day=-1.06 +DOF Fixed Unfocus Shift Interior=-0.78 +DOF Fixed Unfocus Blend Night=1.0 +DOF Fixed Unfocus Blend Day=1.0 +DOF Fixed Unfocus Blend Interior=1.0 +DOF Fixed Unfocus Depth=0.0 +DOF Fixed Use Cutoff=true +Disable DOF=false +Use Only Fixed DOF=false +DOF Gather Blur Radius=8.0 +Enable DOF Post-Blur=true +DOF Post-Blur Radius=1.0 +DOF Blur Chromatic Aberration=1.33 +Enable DOF Highlights=true +DOF Highlight Threshold=0.66 +DOF Highlight Gain=2.2 +DOF Bokeh Blur Radius=1.78 +DOF Bokeh Edge Bias=0.78 +DOF Bokeh Fuzz=0.1 +Focus Plane Horizontal Tilt Center=0.5 +Focus Plane Vertical Tilt Center=0.5 +Focus Plane Horizontal Tilt=0.0 +Focus Plane Vertical Tilt=0.0 +DOF Minimum Blur=0.01 +Debug Depth=false +Debug Focus=false +Enable Edgevision=false +Edgevision Fade Contrast Night=2.0 +Edgevision Fade Contrast Day=2.0 +Edgevision Fade Contrast Interior=2.0 +Edgevision Fade Intensity Night=700.0 +Edgevision Fade Intensity Day=800.0 +Edgevision Fade Intensity Interior=600.0 +Edgevision Contrast=0.25 +Edgevision Intensity=1.0 +Edgevision Radius=1.0 +Invert Edgevision=false +Blend Edgevision=false +Enable Edge Detect=false +Edge Detect Contrast=1.0 +Edge Detect Intensity=1.0 +Edge Detect Radius=1.0 +Invert Edge Detect=false +Blend Edge Detect=false +Enable Linevision=false +Linevision Fade Contrast Night=2.0 +Linevision Fade Contrast Day=2.0 +Linevision Fade Contrast Interior=2.0 +Linevision Fade Intensity Night=700.0 +Linevision Fade Intensity Day=800.0 +Linevision Fade Intensity Interior=600.0 +Linevision Contrast=1.0 +Linevision Intensity=1.0 +Linevision Radius=1.0 +Linevision Threshold=0.1 +Invert Linevision=false +Blend Linevision=false +Enable Custom Fog=false +Fog Contrast=1.0 +Fog Intensity=1.0 +Fog Shift=0.0 +Fog ColorX=1.0 +Fog ColorY=1.0 +Fog ColorZ=1.0 +Limbo Mode=false +Depth Grading Center Depth=0.0 +Depth Grading Contrast Night=218.809998 +Depth Grading Contrast Day=255.580002 +Depth Grading Contrast Interior=230.0 +Depth Grading Intensity Night=1.86 +Depth Grading Intensity Day=1.67 +Depth Grading Intensity Interior=1.73 +Depth Grading Shift Night=-1.41 +Depth Grading Shift Day=-1.27 +Depth Grading Shift Interior=-1.37 +Depth Grading Blend Night=0.3 +Depth Grading Blend Day=0.4 +Depth Grading Blend Interior=0.5 +Enable RGB Grading=true +Grading Intensity Night=1.04, 1, 0.94 +Grading Intensity Day=1.08, 1.03, 0.95 +Grading Intensity Interior=1.03, 0.98, 0.94 +Grading Contrast Night=1.04, 1, 0.96 +Grading Contrast Day=1.02, 0.96, 0.94 +Grading Contrast Interior=1.02, 0.98, 0.92 +Enable Vibrance Grading=true +Grading Color Night=-0.32, -0.54, -1.19 +Grading Color Day=-0.91, -0.4, -0.67 +Grading Color Interior=-0.66, -0.33, -0.93 +Grading Color Factor Night=-0.51 +Grading Color Factor Day=-0.65 +Grading Color Factor Interior=-0.64 +Enable HSV Grading=true +Grading Saturation Intensity Night=1.17 +Grading Saturation Intensity Day=1.22 +Grading Saturation Intensity Interior=1.14 +Grading Saturation Contrast Night=1.11 +Grading Saturation Contrast Day=1.05 +Grading Saturation Contrast Interior=1.07 +Grading Value Intensity Night=0.88 +Grading Value Intensity Day=0.88 +Grading Value Intensity Interior=0.84 +Grading Value Contrast Night=0.72 +Grading Value Contrast Day=0.68 +Grading Value Contrast Interior=0.62 +Colorize After HSV=true diff --git a/enbseries/enbeffect.fx b/enbseries/enbeffect.fx new file mode 100644 index 0000000..c1733e6 --- /dev/null +++ b/enbseries/enbeffect.fx @@ -0,0 +1,1233 @@ +/* + enbeffect.fx : MariENB3 base shader. + (C)2016-2020 Marisa Kirisame, UnSX Team. + Part of MariENB3, the personal ENB of Marisa for Fallout 4. + Released under the GNU GPLv3 (or later). +*/ +#include "menbglobaldefs.fx" + +string str_misc = "Miscellaneous"; +/* fixed resolution, keeps blur filters at a consistent internal resolution */ +int2 fixed +< + string UIName = "Fixed Resolution"; + string UIWidget = "Vector"; + int2 UIMin = {0,0}; +> = {1920,1080}; +string str_dist = "Distortion Filters"; +float distcha +< + string UIName = "Distortion Chromatic Aberration"; + string UIWidget = "Spinner"; +> = {10.0}; +bool frostenable +< + string UIName = "Enable Screen Frost"; + string UIWidget = "Checkbox"; +> = {false}; +float frostpow +< + string UIName = "Frost Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float froststrength +< + string UIName = "Frost Strength"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float frostrpow +< + string UIName = "Frost Radial Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float frostrmult +< + string UIName = "Frost Radial Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float frostrbump +< + string UIName = "Frost Radial Offset"; + string UIWidget = "Spinner"; +> = {0.0}; +float frostblend +< + string UIName = "Frost Texture Blend"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float frostbpow +< + string UIName = "Frost Texture Blend Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float frostsize +< + string UIName = "Frost Texture Size"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float frostfactor_dw +< + string UIName = "Frost Factor Dawn"; + string UIWidget = "Spinner"; +> = {0.1}; +float frostfactor_sr +< + string UIName = "Frost Factor Sunrise"; + string UIWidget = "Spinner"; +> = {0.0}; +float frostfactor_dy +< + string UIName = "Frost Factor Day"; + string UIWidget = "Spinner"; +> = {0.0}; +float frostfactor_ss +< + string UIName = "Frost Factor Sunset"; + string UIWidget = "Spinner"; +> = {0.0}; +float frostfactor_ds +< + string UIName = "Frost Factor Dusk"; + string UIWidget = "Spinner"; +> = {0.1}; +float frostfactor_nt +< + string UIName = "Frost Factor Night"; + string UIWidget = "Spinner"; +> = {0.25}; +float frostfactor_i +< + string UIName = "Frost Factor Interior"; + string UIWidget = "Spinner"; +> = {0.0}; +string str_noise = "Film Grain"; +bool ne +< + string UIName = "Enable Grain"; + string UIWidget = "Checkbox"; +> = {false}; +/* speed of grain */ +float nf +< + string UIName = "Grain Speed"; + string UIWidget = "Spinner"; +> = {2500.0}; +/* intensity of grain */ +float ni +< + string UIName = "Grain Intensity"; + string UIWidget = "Spinner"; +> = {0.05}; +/* saturation of grain */ +float ns +< + string UIName = "Grain Saturation"; + string UIWidget = "Spinner"; +> = {0.0}; +/* use two-pass grain (double the texture fetches, but looks less uniform) */ +bool np +< + string UIName = "Grain Two-Pass"; + string UIWidget = "Checkbox"; +> = {true}; +/* + blending mode for grain: + 0 -> normal + 1 -> add + 2 -> overlay + 3 -> "dark mask", a personal invention +*/ +int nb +< + string UIName = "Grain Blending Mode"; + string UIWidget = "Spinner"; + int UIMin = 0; + int UIMax = 3; +> = {1}; +/* dark mask blend mode contrast for mask image */ +float bnp +< + string UIName = "Grain Dark Mask Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.5}; +/* two-pass distortion factor (0 = look just like one-pass grain) */ +float nk +< + string UIName = "Grain Two-Pass Factor"; + string UIWidget = "Spinner"; +> = {0.04}; +/* zoom factors for each component of each noise texture */ +float3 nm +< + string UIName = "Grain Magnification"; + string UIWidget = "Vector"; +> = {13.25,19.64,17.35}; +float3 nm1 +< + string UIName = "Grain Pass 1 Magnification"; + string UIWidget = "Vector"; +> = {2.05,3.11,2.22}; +float3 nm2 +< + string UIName = "Grain Pass 2 Magnification"; + string UIWidget = "Vector"; +> = {4.25,0.42,6.29}; +/* contrast of grain */ +float nj +< + string UIName = "Grain Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {2.0}; +bool nbt +< + string UIName = "Apply Grain Before Tone Mapping"; + string UIWidget = "Checkbox"; +> = {true}; +/* old dirt filter */ +string str_dirt = "Screen Dirt"; +bool dirtenable +< + string UIName = "Enable Dirt"; + string UIWidget = "Checkbox"; +> = {false}; +float dirtcfactor +< + string UIName = "Dirt Coord Factor"; + string UIWidget = "Spinner"; +> = {0.1}; +float dirtlfactor +< + string UIName = "Dirt Luminance Factor"; + string UIWidget = "Spinner"; +> = {0.0}; +float dirtmc +< + string UIName = "Dirt Coord Zoom"; + string UIWidget = "Spinner"; +> = {3.0}; +float dirtml +< + string UIName = "Dirt Luminance Zoom"; + string UIWidget = "Spinner"; +> = {1.0}; +/* eye adaptation */ +string str_adaptation = "Eye Adaptation"; +bool aenable +< + string UIName = "Enable Adaptation"; + string UIWidget = "Checkbox"; +> = {false}; +/* tone mapping */ +string str_tonemap = "Tone Mapping"; +/* + algorithms: + -1 : Disabled + 0 : Vanilla + 1 : Linear + 2 : Reinhard + 3 : Uncharted 2 + 4 : Hejl Dawson + 5 : Haarm-Peter Duiker +*/ +int tmapenable +< + string UIName = "Tonemapping Method"; + string UIWidget = "Spinner"; + int UIMin = -1; + int UIMax = 5; +> = {3}; +float tmapexposure_n +< + string UIName = "Tonemap Exposure Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float tmapexposure_d +< + string UIName = "Tonemap Exposure Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float tmapexposure_i +< + string UIName = "Tonemap Exposure Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float tmapblend_n +< + string UIName = "Tonemap Blend Night"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +float tmapblend_d +< + string UIName = "Tonemap Blend Day"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +float tmapblend_i +< + string UIName = "Tonemap Blend Interior"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +float unA_n +< + string UIName = "Uncharted2 Shoulder Strength Night"; + string UIWidget = "Spinner"; +> = {0.5}; +float unA_d +< + string UIName = "Uncharted2 Shoulder Strength Day"; + string UIWidget = "Spinner"; +> = {0.5}; +float unA_i +< + string UIName = "Uncharted2 Shoulder Strength Interior"; + string UIWidget = "Spinner"; +> = {0.5}; +float unB_n +< + string UIName = "Uncharted2 Linear Strength Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float unB_d +< + string UIName = "Uncharted2 Linear Strength Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float unB_i +< + string UIName = "Uncharted2 Linear Strength Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +float unC_n +< + string UIName = "Uncharted2 Linear Angle Night"; + string UIWidget = "Spinner"; +> = {0.2}; +float unC_d +< + string UIName = "Uncharted2 Linear Angle Day"; + string UIWidget = "Spinner"; +> = {0.2}; +float unC_i +< + string UIName = "Uncharted2 Linear Angle Interior"; + string UIWidget = "Spinner"; +> = {0.2}; +float unD_n +< + string UIName = "Uncharted2 Toe Strength Night"; + string UIWidget = "Spinner"; +> = {0.75}; +float unD_d +< + string UIName = "Uncharted2 Toe Strength Day"; + string UIWidget = "Spinner"; +> = {0.75}; +float unD_i +< + string UIName = "Uncharted2 Toe Strength Interior"; + string UIWidget = "Spinner"; +> = {0.75}; +float unE_n +< + string UIName = "Uncharted2 Toe Numerator Night"; + string UIWidget = "Spinner"; +> = {0.02}; +float unE_d +< + string UIName = "Uncharted2 Toe Numerator Day"; + string UIWidget = "Spinner"; +> = {0.02}; +float unE_i +< + string UIName = "Uncharted2 Toe Numerator Interior"; + string UIWidget = "Spinner"; +> = {0.02}; +float unF_n +< + string UIName = "Uncharted2 Toe Denominator Night"; + string UIWidget = "Spinner"; +> = {0.30}; +float unF_d +< + string UIName = "Uncharted2 Toe Denominator Day"; + string UIWidget = "Spinner"; +> = {0.30}; +float unF_i +< + string UIName = "Uncharted2 Toe Denominator Interior"; + string UIWidget = "Spinner"; +> = {0.30}; +float unW_n +< + string UIName = "Uncharted2 Linear White Night"; + string UIWidget = "Spinner"; +> = {10.0}; +float unW_d +< + string UIName = "Uncharted2 Linear White Day"; + string UIWidget = "Spinner"; +> = {10.0}; +float unW_i +< + string UIName = "Uncharted2 Linear White Interior"; + string UIWidget = "Spinner"; +> = {10.0}; + +/* Color grading */ +string str_grade = "Color Grading Suite"; +bool gradeenable1 +< + string UIName = "Enable RGB Grading"; + string UIWidget = "Checkbox"; +> = {false}; +/* color component multipliers */ +float3 grademul_n +< + string UIName = "Grading Intensity Night"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 grademul_d +< + string UIName = "Grading Intensity Day"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 grademul_i +< + string UIName = "Grading Intensity Interior"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +/* color component contrasts */ +float3 gradepow_n +< + string UIName = "Grading Contrast Night"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 gradepow_d +< + string UIName = "Grading Contrast Day"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 gradepow_i +< + string UIName = "Grading Contrast Interior"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +/* colorization factors */ +bool gradeenable2 +< + string UIName = "Enable Vibrance Grading"; + string UIWidget = "Checkbox"; +> = {false}; +float3 gradecol_n +< + string UIName = "Grading Color Night"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 gradecol_d +< + string UIName = "Grading Color Day"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +float3 gradecol_i +< + string UIName = "Grading Color Interior"; + string UIWidget = "Vector"; +> = {1.0,1.0,1.0}; +/* blend factor for colorization (negative values are quite fancy) */ +float gradecolfact_n +< + string UIName = "Grading Color Factor Night"; + string UIWidget = "Spinner"; +> = {0.0}; +float gradecolfact_d +< + string UIName = "Grading Color Factor Day"; + string UIWidget = "Spinner"; +> = {0.0}; +float gradecolfact_i +< + string UIName = "Grading Color Factor Interior"; + string UIWidget = "Spinner"; +> = {0.0}; +/* HSV grading */ +bool gradeenable3 +< + string UIName = "Enable HSV Grading"; + string UIWidget = "Checkbox"; +> = {false}; +/* saturation multiplier */ +float gradesatmul_n +< + string UIName = "Grading Saturation Intensity Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float gradesatmul_d +< + string UIName = "Grading Saturation Intensity Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float gradesatmul_i +< + string UIName = "Grading Saturation Intensity Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +/* saturation power */ +float gradesatpow_n +< + string UIName = "Grading Saturation Contrast Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float gradesatpow_d +< + string UIName = "Grading Saturation Contrast Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float gradesatpow_i +< + string UIName = "Grading Saturation Contrast Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +/* value multiplier */ +float gradevalmul_n +< + string UIName = "Grading Value Intensity Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float gradevalmul_d +< + string UIName = "Grading Value Intensity Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float gradevalmul_i +< + string UIName = "Grading Value Intensity Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +/* value power */ +float gradevalpow_n +< + string UIName = "Grading Value Contrast Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float gradevalpow_d +< + string UIName = "Grading Value Contrast Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float gradevalpow_i +< + string UIName = "Grading Value Contrast Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +bool colorizeafterhsv +< + string UIName = "Colorize After HSV"; + string UIWidget = "Checkbox"; +> = {true}; +/* LUT grading */ +string str_lut = "RGB Lookup Table Grading"; +bool lutenable +< + string UIName = "Enable LUT Grading"; + string UIWidget = "Checkbox"; +> = {false}; +float lutblend_n +< + string UIName = "LUT Blend Night"; + string UIWidget = "Spinner"; +> = {1.0}; +float lutblend_d +< + string UIName = "LUT Blend Day"; + string UIWidget = "Spinner"; +> = {1.0}; +float lutblend_i +< + string UIName = "LUT Blend Interior"; + string UIWidget = "Spinner"; +> = {1.0}; +/* technicolor shader */ +string str_tech = "Technicolor"; +bool techenable +< + string UIName = "Enable Technicolor"; + string UIWidget = "Checkbox"; +> = {false}; +float techblend +< + string UIName = "Technicolor Blend"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +/* vanilla */ +string str_vanilla = "Vanilla Processing"; +bool vgradeenable +< + string UIName = "Enable Vanilla Imagespace"; + string UIWidget = "Checkbox"; +> = {true}; +float vtintpow +< + string UIName = "Vanilla Tint Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float vtintmul +< + string UIName = "Vanilla Tint Strength"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float vtintblend +< + string UIName = "Vanilla Tint Blend"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +float vsatpow +< + string UIName = "Vanilla Vibrance Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float vsatmul +< + string UIName = "Vanilla Vibrance Strength"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float vsatblend +< + string UIName = "Vanilla Vibrance Blend"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +float vconblend +< + string UIName = "Vanilla Contrast Blend"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {1.0}; +string str_debug = "Debugging"; +bool bloomdebug +< + string UIName = "Display Bloom"; + string UIWidget = "Checkbox"; +> = {false}; +bool adaptdebug +< + string UIName = "Display Adaptation"; + string UIWidget = "Checkbox"; +> = {false}; + +float4 Timer; +float4 ScreenSize; +float ENightDayFactor; +float EInteriorFactor; +float4 TimeOfDay1; +float4 TimeOfDay2; + +#ifdef SKYRIMSE +float4 Params01[7]; +#else +float4 Params01[6]; +#endif +float4 ENBParams01; +Texture2D TextureColor; +Texture2D TextureBloom; +Texture2D TextureAdaptation; + +Texture2D TextureNoise1 +< + string ResourceName = "menbnoise1.png"; +>; +Texture2D TextureNoise2 +< + string ResourceName = "menbnoise2.png"; +>; +Texture2D TextureNoise3 +< + string ResourceName = "menbnoise3.png"; +>; +Texture3D TextureLUTN +< + string ResourceName = "menblut_night.dds"; +>; +Texture3D TextureLUTD +< + string ResourceName = "menblut_day.dds"; +>; +Texture3D TextureLUTI +< + string ResourceName = "menblut_interior.dds"; +>; +Texture2D TextureTonemap +< + string ResourceName = "menbfilmlut.png"; +>; +Texture2D TextureFrost +< +#ifdef FROST_DDS + string ResourceName = "menbfrost.dds"; +#else + string ResourceName = "menbfrost.png"; +#endif +>; + +SamplerState Sampler0 +{ + Filter = MIN_MAG_MIP_POINT; + AddressU = Clamp; + AddressV = Clamp; + MaxLOD = 0; +}; +SamplerState Sampler1 +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Clamp; + AddressV = Clamp; + MaxLOD = 0; +}; +SamplerState Sampler2 +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Wrap; + AddressV = Wrap; + MaxLOD = 0; +}; +SamplerState SamplerLUT +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Clamp; + AddressV = Clamp; + AddressW = Clamp; + MaxLOD = 0; +}; + +struct VS_INPUT_POST +{ + float3 pos : POSITION; + float2 txcoord : TEXCOORD0; +}; +struct VS_OUTPUT_POST +{ + float4 pos : SV_POSITION; + float2 txcoord0 : TEXCOORD0; +}; + +VS_OUTPUT_POST VS_Draw( VS_INPUT_POST IN ) +{ + VS_OUTPUT_POST OUT; + OUT.pos = float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0); + OUT.txcoord0.xy = IN.txcoord.xy; + return OUT; +} + +/* helper functions */ +/* photometric */ +#define luminance(x) dot(x,float3(0.2126,0.7152,0.0722)) +/* CCIR601 */ +//#define luminance(x) dot(x,float3(0.299,0.587,0.114)) +/* overlay blend */ +#define overlay(a,b) (a<0.5)?(2.0*a*b):(1.0-(2.0*(1.0-a)*(1.0-b))) +/* "dark mask" blending is something I came up with and can't really explain */ +#define darkmask(a,b) (a>0.5)?(2.0*a*(0.5+b)):(1.0-2.0*(1.0-a)*(1.0-((0.5+b)))) +float3 rgb2hsv( float3 c ) +{ + float4 K = float4(0.0,-1.0/3.0,2.0/3.0,-1.0); + float4 p = (c.g 0) && (fixed.y > 0) ) bresl = fixed; + else bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float2 nc = coord*(bresl/FROSTSIZE)*frostsize; + float2 ofs = TextureFrost.Sample(Sampler2,nc).xy; + ofs = (ofs-0.5)*2.0; + ofs *= pow(length(ofs),frostpow)*froststrength; + float todpow = max(0.0,todx_ind(frostfactor)); + ofs *= todpow; + /*ofs *= max(0.0,coldfactor-warmfactor);*/ + float dist = distance(coord,float2(0.5,0.5))*2.0; + ofs *= clamp(pow(dist,frostrpow)*frostrmult+frostrbump,0.0,1.0); + return coord+ofs; +} + +/* Old MariENB 0.x screen dirt filter, updated */ +float3 ScreenDirt( float3 res, float2 coord ) +{ + float2 nr = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w)/256.0; + float3 ncolc = TextureNoise1.Sample(Sampler2,coord*dirtmc*nr).rgb; + float2 ds = float2(res.r+res.g,res.g+res.b)/2.0; + float3 ncoll = TextureNoise1.Sample(Sampler2,ds*dirtml).rgb; + res = lerp(res,(ncolc.r+1.0)*res,dirtcfactor + *saturate(1.0-(ds.x+ds.y)*0.25)); + res = lerp(res,(ncoll.r+1.0)*res,dirtlfactor + *saturate(1.0-(ds.x+ds.y)*0.25)); + return res; +} + +float4 PS_Draw( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord0.xy; + float2 bresl; + if ( (fixed.x > 0) && (fixed.y > 0) ) bresl = fixed; + else bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float4 res, mud; + if ( frostenable ) + { + float2 ofs = ScreenFrost(coord); + ofs -= coord; + float2 ofr, ofg, ofb; + ofr = ofs*(1.0-distcha*0.01); + ofg = ofs; + ofb = ofs*(1.0+distcha*0.01); + res = float4(TextureColor.Sample(Sampler0,coord+ofr).r, + TextureColor.Sample(Sampler0,coord+ofg).g, + TextureColor.Sample(Sampler0,coord+ofb).b,1.0); +#ifdef SKYRIMSE + mud = float4(TextureBloom.Sample(Sampler1,coord+ofr).r, + TextureBloom.Sample(Sampler1,coord+ofg).g, + TextureBloom.Sample(Sampler1,coord+ofb).b,1.0); +#else + mud = float4(TextureBloom.Sample(Sampler1, + Params01[4].zw*(coord+ofr)).r, + TextureBloom.Sample(Sampler1,Params01[4].zw + *(coord+ofg)).g,TextureBloom.Sample(Sampler1, + Params01[4].zw*(coord+ofb)).b,1.0); +#endif + float2 nc = coord*(bresl/FROSTSIZE)*frostsize; + float bmp = pow(max(0,TextureFrost.SampleLevel(Sampler2,nc, + 0).z),frostbpow); + float dist = distance(coord,float2(0.5,0.5))*2.0; + dist = clamp(pow(dist,frostrpow)*frostrmult+frostrbump,0.0, + 1.0)*frostblend; + float todpow = max(0.0,todx_ind(frostfactor)); + dist *= todpow; + /* Weathers not implemented in FO4 ENB as of 0.291 */ + /*dist *= max(0.0,coldfactor-warmfactor);*/ + res.rgb *= 1.0+bmp*dist; + } + else + { + res = TextureColor.Sample(Sampler0,coord); +#ifdef SKYRIMSE + mud = TextureBloom.Sample(Sampler1,coord); +#else + mud = TextureBloom.Sample(Sampler1,Params01[4].zw*coord); +#endif + } + /* Insert MariENB filters here */ + float2 adapt = Adaptation(coord); + if ( bloomdebug ) res.rgb *= 0; + float3 bcol = mud.rgb*ENBParams01.x; + res.rgb += bcol; + if ( aenable ) res.rgb *= adapt.x; + if ( nbt && ne ) res.rgb = FilmGrain(res.rgb,coord); + if ( dirtenable ) res.rgb = ScreenDirt(res.rgb,coord); + res.rgb = Tonemap(res.rgb); + if ( vgradeenable ) res.rgb = GradingGame(res.rgb,adapt.y); + if ( gradeenable1 ) res.rgb = GradingRGB(res.rgb); + if ( colorizeafterhsv ) + { + if ( gradeenable3 ) res.rgb = GradingHSV(res.rgb); + if ( gradeenable2 ) res.rgb = GradingColorize(res.rgb); + } + else + { + if ( gradeenable2 ) res.rgb = GradingColorize(res.rgb); + if ( gradeenable3 ) res.rgb = GradingHSV(res.rgb); + } + if ( techenable ) res.rgb = Technicolor(res.rgb); + if ( lutenable ) res.rgb = GradingLUT(res.rgb); + if ( !nbt && ne ) res.rgb = FilmGrain(res.rgb,coord); + /* fade has same index on both games */ + res.rgb = Params01[5].rgb*Params01[5].a+res.rgb*(1.0-Params01[5].a); + if ( adaptdebug ) res.rgb = TextureAdaptation.Sample(Sampler1,coord).x; + res.rgb = max(0,res.rgb); + res.a = 1.0; + return res; +} + +float4 PS_DrawOriginal( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float4 res; + float4 color; + color = TextureColor.Sample(Sampler0,IN.txcoord0.xy); + float4 r0, r1, r2, r3; +#ifdef SKYRIMSE + /* + You won't believe how HARD Boris has mangled this code. + After fixing the horrid code style and the unnecessary scientific + notation on floats, it's still unreadable. + It's also completely broken and results in a black screen. + */ + float2 scaleduv=Params01[6].xy*IN.txcoord0.xy; + scaleduv = max(scaleduv, 0.0); + scaleduv = min(scaleduv, Params01[6].zy); + r1.xy = scaleduv; + r0.xyz = color.xyz; + if ( Params01[0].x > 0.5 ) r1.xy = IN.txcoord0.xy; + r1.xyz = TextureBloom.Sample(Sampler1,r1.xy).xyz; + r2.xy = TextureAdaptation.Sample(Sampler1,IN.txcoord0.xy).xy; + r0.w = dot(float3(0.2125,0.7154,0.0721),r0.xyz); + r0.w = max(r0.w,0.00001); + r1.w = r2.y/r2.x; + r2.y = r0.w*r1.w; + if ( Params01[2].z >= 0.5 ) r2.z = 0xffffffff; + else r2.z = 0; + r3.xy = r1.w*r0.w+float2(-0.004,1.0); + r1.w = max(r3.x, 0.0); + r3.xz = r1.w*6.2+float2(0.5,1.7); + r2.w = r1.w*r3.x; + r1.w = r1.w*r3.z+0.06; + r1.w = r2.w/r1.w; + r1.w = pow(r1.w,2.2); + r1.w = r1.w*Params01[2].y; + r2.w = r2.y*Params01[2].y+1.0; + r2.y = r2.w*r2.y; + r2.y = r2.y/r3.y; + if (r2.z == 0) r1.w = r2.y; + else r1.w = r1.w; + r0.w = r1.w/r0.w; + r1.w = saturate(Params01[2].x-r1.w); + r1.xyz = r1*r1.w; + r0.xyz = r0*r0.w+r1; + r1.x = dot(r0.xyz,float3(0.2125,0.7154,0.0721)); + r0.w = 1.0; + r0 = r0-r1.x; + r0 = Params01[3].x*r0+r1.x; + r1 = Params01[4]*r1.x-r0; + r0 = Params01[4].w*r1+r0; + r0 = Params01[3].w*r0-r2.x; + r0 = Params01[3].z*r0+r2.x; + r0.xyz = saturate(r0); + r1.xyz = pow(r1.xyz,Params01[6].w); + r1 = Params01[5]-r0; + res = Params01[5].w*r1+r0; +#else + r0.xyz = color.xyz; + r1.xy = Params01[4].zw*IN.txcoord0.xy; + r1.xyz = TextureBloom.Sample(Sampler1,r1.xy).xyz; + r0.w = TextureAdaptation.Sample(Sampler0,IN.txcoord0.xy).x; + r1.w = Params01[1].z/(0.001+r0.w); + r2.x = r1.w +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0, VS_Draw())); + SetPixelShader(CompileShader(ps_5_0, PS_Draw())); + } +} + +technique11 ORIGINALPOSTPROCESS +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0, VS_Draw())); + SetPixelShader(CompileShader(ps_5_0, PS_DrawOriginal())); + } +} diff --git a/enbseries/enbeffect.fx.ini b/enbseries/enbeffect.fx.ini new file mode 100644 index 0000000..49f1d25 --- /dev/null +++ b/enbseries/enbeffect.fx.ini @@ -0,0 +1,112 @@ +[ENBEFFECT.FX] +TECHNIQUE=1 +Fixed ResolutionX=1920 +Fixed ResolutionY=1080 +Distortion Chromatic Aberration=0.0 +Enable Screen Frost=false +Frost Contrast=1.0 +Frost Strength=0.0 +Frost Radial Contrast=1.0 +Frost Radial Intensity=0.0 +Frost Radial Offset=0.0 +Frost Texture Blend=0.0 +Frost Texture Blend Contrast=1.0 +Frost Texture Size=1.0 +Frost Factor Dawn=0.0 +Frost Factor Sunrise=0.0 +Frost Factor Day=0.0 +Frost Factor Sunset=0.0 +Frost Factor Dusk=0.0 +Frost Factor Night=0.0 +Frost Factor Interior=0.0 +Enable Grain=true +Grain Speed=25.0 +Grain Intensity=0.250001 +Grain Saturation=-0.35 +Grain Two-Pass=true +Grain Blending Mode=3 +Grain Dark Mask Contrast=22.140013 +Grain Two-Pass Factor=0.04 +Grain Magnification=13.3, 19.6, 17.4 +Grain Pass 1 Magnification=2.05, 3.11, 2.22 +Grain Pass 2 Magnification=4.25, 9.42, 6.29 +Grain Contrast=8.450001 +Apply Grain Before Tone Mapping=true +Enable Dirt=false +Dirt Coord Factor=0.08 +Dirt Luminance Factor=0.0 +Dirt Coord Zoom=2.49 +Dirt Luminance Zoom=1.0 +Enable Adaptation=true +Tonemapping Method=3 +Tonemap Exposure Night=1.08 +Tonemap Exposure Day=1.12 +Tonemap Exposure Interior=1.26 +Tonemap Blend Night=1.0 +Tonemap Blend Day=1.0 +Tonemap Blend Interior=1.0 +Uncharted2 Shoulder Strength Night=0.17 +Uncharted2 Shoulder Strength Day=0.14 +Uncharted2 Shoulder Strength Interior=0.2 +Uncharted2 Linear Strength Night=1.3 +Uncharted2 Linear Strength Day=1.46 +Uncharted2 Linear Strength Interior=1.34 +Uncharted2 Linear Angle Night=0.71 +Uncharted2 Linear Angle Day=0.74 +Uncharted2 Linear Angle Interior=0.77 +Uncharted2 Toe Strength Night=1.58 +Uncharted2 Toe Strength Day=1.7 +Uncharted2 Toe Strength Interior=1.67 +Uncharted2 Toe Numerator Night=4.57 +Uncharted2 Toe Numerator Day=4.75 +Uncharted2 Toe Numerator Interior=4.3 +Uncharted2 Toe Denominator Night=1.16 +Uncharted2 Toe Denominator Day=1.15 +Uncharted2 Toe Denominator Interior=1.14 +Uncharted2 Linear White Night=14.51 +Uncharted2 Linear White Day=13.680001 +Uncharted2 Linear White Interior=15.57 +Enable RGB Grading=true +Grading Intensity Night=1.02, 1.03, 0.94 +Grading Intensity Day=1.04, 1, 0.93 +Grading Intensity Interior=1.03, 0.98, 0.96 +Grading Contrast Night=1.04, 0.99, 0.95 +Grading Contrast Day=0.981, 1.02, 0.954 +Grading Contrast Interior=1.01, 0.99, 0.94 +Enable Vibrance Grading=true +Grading Color Night=-0.2, -0.16, -0.64 +Grading Color Day=-0.66, -0.27, -0.15 +Grading Color Interior=-0.19, -0.04, -0.7 +Grading Color Factor Night=-0.06 +Grading Color Factor Day=-0.1 +Grading Color Factor Interior=-0.11 +Enable HSV Grading=true +Grading Saturation Intensity Night=0.98 +Grading Saturation Intensity Day=1.14 +Grading Saturation Intensity Interior=1.05 +Grading Saturation Contrast Night=1.1 +Grading Saturation Contrast Day=0.93 +Grading Saturation Contrast Interior=1.01 +Grading Value Intensity Night=0.98 +Grading Value Intensity Day=0.91 +Grading Value Intensity Interior=0.95 +Grading Value Contrast Night=1.13 +Grading Value Contrast Day=1.28 +Grading Value Contrast Interior=1.17 +Colorize After HSV=true +Enable LUT Grading=true +LUT Blend Night=0.62 +LUT Blend Day=0.74 +LUT Blend Interior=0.73 +Enable Technicolor=true +Technicolor Blend=0.5 +Enable Vanilla Imagespace=true +Vanilla Tint Contrast=1.14 +Vanilla Tint Strength=1.0 +Vanilla Tint Blend=0.94 +Vanilla Vibrance Contrast=1.11 +Vanilla Vibrance Strength=1.0 +Vanilla Vibrance Blend=0.91 +Vanilla Contrast Blend=0.96 +Display Bloom=false +Display Adaptation=false diff --git a/enbseries/enbeffectpostpass.fx b/enbseries/enbeffectpostpass.fx new file mode 100644 index 0000000..c9f4992 --- /dev/null +++ b/enbseries/enbeffectpostpass.fx @@ -0,0 +1,1121 @@ +/* + enbeffectpostpass.fx : MariENB3 extra shader. + (C)2016-2020 Marisa Kirisame, UnSX Team. + Part of MariENB3, the personal ENB of Marisa for Fallout 4. + Released under the GNU GPLv3 (or later). +*/ +#include "menbglobaldefs.fx" + +#ifdef WITH_SMAA +/* new SMAA filter */ +string str_smaa = "SMAA"; +bool smaaenable +< + string UIName = "Enable SMAA"; + string UIWidget = "Checkbox"; +> = {false}; +int smaadebug +< + string UIName = "SMAA Debugging"; + string UIWidget = "Spinner"; + int UIMin = 0; + int UIMax = 2; +> = {0}; +#endif +/* Depth-cutting chroma key */ +string str_mask = "Depth Chroma Key"; +bool maskenable +< + string UIName = "Enable Chroma Key"; + string UIWidget = "Checkbox"; +> = {false}; +float3 mask +< + string UIName = "Chroma Key Red"; + string UIWidget = "Color"; +> = {0.0,1.0,0.0}; +float maskd +< + string UIName = "Chroma Key Depth"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.5}; +/* tilting */ +float masktiltxcenter +< + string UIName = "Chroma Key Depth Horizontal Tilt Center"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.5}; +float masktiltycenter +< + string UIName = "Chroma Key Depth Vertical Tilt Center"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 1.0; +> = {0.5}; +float masktiltx +< + string UIName = "Chroma Key Depth Horizontal Tilt"; + string UIWidget = "Spinner"; +> = {0.0}; +float masktilty +< + string UIName = "Chroma Key Depth Vertical Tilt"; + string UIWidget = "Spinner"; +> = {0.0}; +/* luma sharpen because of reasons */ +string str_lsharp = "Luma Sharpen"; +bool lsharpenable +< + string UIName = "Luma Sharpen Enable"; + string UIWidget = "Checkbox"; +> = {false}; +float lsharpradius +< + string UIName = "Luma Sharpen Radius"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.8}; +float lsharpclamp +< + string UIName = "Luma Sharpen Clamp"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.02}; +float lsharpblend +< + string UIName = "Luma Sharpen Blending"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.2}; +/* very cinematic black bars */ +string str_box = "Black Bars"; +bool boxenable +< + string UIName = "Enable Black Bars"; + string UIWidget = "Checkbox"; +> = {false}; +float boxh +< + string UIName = "Box Horizontal Ratio"; + string UIWidget = "Spinner"; + float UIMin = 1.0; +> = {2.39}; +float boxv +< + string UIName = "Box Vertical Ratio"; + string UIWidget = "Spinner"; + float UIMin = 1.0; +> = {1.0}; +/* vignette */ +string str_vignette = "Vignette with border blur"; +bool vigenable +< + string UIName = "Enable Vignette"; + string UIWidget = "Checkbox"; +> = {false}; +bool bblurenable +< + string UIName = "Enable Border Blur"; + string UIWidget = "Checkbox"; +> = {false}; +/* 0 = circle, 1 = box, 2 = texture */ +int vigshape +< + string UIName = "Vignette Shape"; + string UIWidget = "Spinner"; + int UIMin = 0; + int UIMax = 2; +> = {0}; +/* 0 = overwrite, 1 = add, 2 = multiply */ +int vigmode +< + string UIName = "Vignette Blending Mode"; + string UIWidget = "Spinner"; + int UIMin = 0; + int UIMax = 2; +> = {0}; +float vigpow +< + string UIName = "Vignette Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float vigmul +< + string UIName = "Vignette Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float vigbump +< + string UIName = "Vignette Shift"; + string UIWidget = "Spinner"; +> = {0.0}; +float3 vigcolor +< + string UIName = "Vignette Color"; + string UIWidget = "Vector"; +> = {0.0,0.0,0.0}; +float bblurpow +< + string UIName = "Border Blur Contrast"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float bblurmul +< + string UIName = "Border Blur Intensity"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float bblurbump +< + string UIName = "Border Blur Shift"; + string UIWidget = "Spinner"; +> = {0.0}; +float bblurradius +< + string UIName = "Border Blur Radius"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +/* colour matrix */ +string str_cmat = "Color Matrix"; +bool cmatenable +< + string UIName = "Enable Color Matrix"; + string UIWidget = "Checkbox"; +> = {false}; +float cmat_rr +< + string UIName = "Color Matrix Red Red"; + string UIWidget = "Spinner"; +> = {1.0}; +float cmat_rg +< + string UIName = "Color Matrix Red Green"; + string UIWidget = "Spinner"; +> = {0.0}; +float cmat_rb +< + string UIName = "Color Matrix Red Blue"; + string UIWidget = "Spinner"; +> = {0.0}; +float cmat_gr +< + string UIName = "Color Matrix Green Red"; + string UIWidget = "Spinner"; +> = {0.0}; +float cmat_gg +< + string UIName = "Color Matrix Green Green"; + string UIWidget = "Spinner"; +> = {1.0}; +float cmat_gb +< + string UIName = "Color Matrix Green Blue"; + string UIWidget = "Spinner"; +> = {0.0}; +float cmat_br +< + string UIName = "Color Matrix Blue Red"; + string UIWidget = "Spinner"; +> = {0.0}; +float cmat_bg +< + string UIName = "Color Matrix Blue Green"; + string UIWidget = "Spinner"; +> = {0.0}; +float cmat_bb +< + string UIName = "Color Matrix Blue Blue"; + string UIWidget = "Spinner"; +> = {1.0}; +bool cmatnormalize +< + string UIName = "Normalize Matrix"; + string UIWidget = "Checkbox"; +> = {false}; +/* hue-saturation */ +string str_hs = "Hue-Saturation"; +bool hsenable +< + string UIName = "Enable Hue-Saturation"; + string UIWidget = "Checkbox"; +> = {false}; +float hsover +< + string UIName = "Overlap"; + string UIWidget = "Spinner"; + float UIMin = 0.0; + float UIMax = 0.5; +> = {0.0}; +float hshue_a +< + string UIName = "Global Hue"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hssat_a +< + string UIName = "Global Saturation"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hsval_a +< + string UIName = "Global Value"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hshue_r +< + string UIName = "Red Hue"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hssat_r +< + string UIName = "Red Saturation"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hsval_r +< + string UIName = "Red Value"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hshue_y +< + string UIName = "Yellow Hue"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hssat_y +< + string UIName = "Yellow Saturation"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hsval_y +< + string UIName = "Yellow Value"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hshue_g +< + string UIName = "Green Hue"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hssat_g +< + string UIName = "Green Saturation"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hsval_g +< + string UIName = "Green Value"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hshue_c +< + string UIName = "Cyan Hue"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hssat_c +< + string UIName = "Cyan Saturation"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hsval_c +< + string UIName = "Cyan Value"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hshue_b +< + string UIName = "Blue Hue"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hssat_b +< + string UIName = "Blue Saturation"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hsval_b +< + string UIName = "Blue Value"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hshue_m +< + string UIName = "Magenta Hue"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hssat_m +< + string UIName = "Magenta Saturation"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +float hsval_m +< + string UIName = "Magenta Value"; + string UIWidget = "Spinner"; + float UIMin = -1.0; + float UIMax = 1.0; +> = {0.0}; +/* retrofx */ +string str_b = "RetroFX"; +bool benable +< + string UIName = "Enable RetroFX"; + string UIWidget = "Checkbox"; +> = {false}; +float bresx +< + string UIName = "RetroFX Emulted Width"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.0}; +float bresy +< + string UIName = "RetroFX Emulted Height"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.0}; +float bsaturation +< + string UIName = "RetroFX Saturation Modifier"; + string UIWidget = "Spinner"; +> = {1.0}; +float bgamma +< + string UIName = "RetroFX Contrast Modifier"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {1.0}; +float bdbump_r +< + string UIName = "RetroFX Dither Offset Red"; + string UIWidget = "Spinner"; +> = {0.0}; +float bdbump_g +< + string UIName = "RetroFX Dither Offset Green"; + string UIWidget = "Spinner"; +> = {0.0}; +float bdbump_b +< + string UIName = "RetroFX Dither Offset Blue"; + string UIWidget = "Spinner"; +> = {0.0}; +float bdmult_r +< + string UIName = "RetroFX Dither Range Red"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.0}; +float bdmult_g +< + string UIName = "RetroFX Dither Range Green"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.0}; +float bdmult_b +< + string UIName = "RetroFX Dither Range Blue"; + string UIWidget = "Spinner"; + float UIMin = 0.0; +> = {0.0}; +int bpal +< + string UIName = "RetroFX Palette"; + string UIWidget = "Spinner"; + int UIMin = 0; + int UIMax = 63; +> = {0}; +/* needed so people know which palette is which because this stupid thing has no combo widget like Reshade */ +bool bpaldebug +< + string UIName = "RetroFX Display Palette Label"; + string UIWidget = "Checkbox"; +> = {false}; +bool mwatermark +< + string UIName = "Show MariENB Watermark"; + string UIWidget = "Checkbox"; +> = {false}; + +/* gaussian blur matrices */ +/* radius: 4, std dev: 1.5 */ +static const float gauss4[4] = +{ + 0.270682, 0.216745, 0.111281, 0.036633 +}; + +float4 ScreenSize; +Texture2D TextureOriginal; +Texture2D TextureColor; +Texture2D TextureDepth; +Texture2D TextureVignette +< +#ifdef VIGNETTE_DDS + string ResourceName = "menbvignette.dds"; +#else + string ResourceName = "menbvignette.png"; +#endif +>; +Texture2D TextureLogo +< + string ResourceName = "menblogo.png"; +>; +Texture2D TexturePAL +< + string ResourceName = "menbpal.png"; +>; +Texture2D TexturePALNames +< + string ResourceName = "menbpaltext.png"; +>; +Texture2D TextureDither +< + string ResourceName = "menbdither.png"; +>; +SamplerState Sampler +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Clamp; + AddressV = Clamp; + MaxLOD = 0; +}; +SamplerState SamplerB +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Border; + AddressV = Border; + MaxLOD = 0; +}; +SamplerState SamplerN +{ + Filter = MIN_MAG_MIP_POINT; + AddressU = Wrap; + AddressV = Wrap; + MaxLOD = 0; +}; + +struct VS_INPUT_POST +{ + float3 pos : POSITION; + float2 txcoord : TEXCOORD0; +}; +struct VS_OUTPUT_POST +{ + float4 pos : SV_POSITION; + float2 txcoord : TEXCOORD0; +}; + +VS_OUTPUT_POST VS_PostProcess(VS_INPUT_POST IN) +{ + VS_OUTPUT_POST OUT; + OUT.pos = float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0); + OUT.txcoord.xy = IN.txcoord.xy; + return OUT; +} + +/* helpers */ +/* photometric */ +#define luminance(x) dot(x,float3(0.2126,0.7152,0.0722)) +/* CCIR601 */ +//#define luminance(x) dot(x,float3(0.299,0.587,0.114)) +float3 rgb2hsv( float3 c ) +{ + float4 K = float4(0.0,-1.0/3.0,2.0/3.0,-1.0); + float4 p = (c.g msd ) + return float4(mask.r,mask.g,mask.b,1.0); + return res; +} + +/* That "luma sharpen" thingy, added just because someone might want it */ +float4 PS_LumaSharp( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float4 res = TextureColor.Sample(Sampler,coord); + if ( !lsharpenable ) return res; + float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float2 bof = float2(1.0/bresl.x,1.0/bresl.y)*lsharpradius; + float4 crawling = TextureColor.Sample(Sampler,coord+float2(0,-1)*bof); + crawling += TextureColor.Sample(Sampler,coord+float2(-1,0)*bof); + crawling += TextureColor.Sample(Sampler,coord+float2(1,0)*bof); + crawling += TextureColor.Sample(Sampler,coord+float2(0,1)*bof); + crawling *= 0.25; + float4 inmyskin = res-crawling; + float thesewounds = luminance(inmyskin.rgb); + thesewounds = clamp(thesewounds,-lsharpclamp*0.01,lsharpclamp*0.01); + float4 theywillnotheal = res+thesewounds*lsharpblend; + return theywillnotheal; +} + +/* vignette filtering */ +float4 PS_Vignette( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float4 res = TextureColor.Sample(Sampler,coord); + float4 vigdata = float4(0,0,0,0); + if ( vigshape == 0 ) + { + /* circular vignette */ + float2 uv = ((coord-0.5)*float2(1.0,ScreenSize.w))*2.0; + vigdata.a = dot(uv,uv); + vigdata.a = clamp(pow(vigdata.a,vigpow)*vigmul+vigbump, + 0.0,1.0); + vigdata.rgb = vigcolor; + } + else if ( vigshape == 1 ) + { + /* box vignette */ + float2 uv = coord.xy*(1.0-coord.yx)*4.0; + vigdata.a = 1.0-(uv.x*uv.y); + vigdata.a = clamp(pow(max(vigdata.a,0.0),vigpow)*vigmul+vigbump, + 0.0,1.0); + vigdata.rgb = vigcolor; + } + else + { + /* textured vignette (rgb = color, alpha = blend) */ + vigdata = TextureVignette.Sample(Sampler,coord); + } + /* apply blur */ + if ( bblurenable ) + { + float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float bfact = clamp(pow(max(vigdata.a,0.0),bblurpow)*bblurmul + +bblurbump,0.0,1.0); + float2 bof = (1.0/bresl)*bblurradius*bfact; + res.rgb *= 0; + int i,j; + [unroll] for ( i=-3; i<4; i++ ) [unroll] for ( j=-3; j<4; j++ ) + res.rgb += gauss4[abs(i)]*gauss4[abs(j)] + *TextureColor.Sample(Sampler,coord + +float2(i,j)*bof).rgb; + } + /* apply color */ + if ( vigenable ) + { + float3 outcol; + if ( vigmode == 0 ) + outcol = vigdata.rgb; + else if ( vigmode == 1 ) + outcol = res.rgb+vigdata.rgb; + else if ( vigmode == 2 ) + outcol = res.rgb*vigdata.rgb; + res.rgb = lerp(res.rgb,outcol,vigdata.a); + } + return clamp(res,0.0,1.0); +} + +/* Colour matrix */ +float3 ColorMatrix( float3 res ) +{ + float3x3 cmat = float3x3(cmat_rr,cmat_rg,cmat_rb, + cmat_gr,cmat_gg,cmat_gb, + cmat_br,cmat_bg,cmat_bb); + res = mul(res,cmat); + if ( cmatnormalize ) + { + float cmscale = (cmat._11+cmat._12+cmat._13+cmat._21 + +cmat._22+cmat._23+cmat._31+cmat._32+cmat._33)/3.0; + res /= cmscale; + } + return res; +} + +/* Hue-Saturation filter from GIMP */ +float hs_hue_overlap( float hue_p, float hue_s, float res ) +{ + float v = hue_p+hue_s; + res += (hshue_a+v)/2.0; + return res%1.0; +} +float hs_hue( float hue, float res ) +{ + res += (hshue_a+hue)/2.0; + return res%1.0; +} +float hs_sat( float sat, float res ) +{ + float v = hssat_a+sat; + res *= v+1.0; + return clamp(res,0.0,1.0); +} +float hs_val( float val, float res ) +{ + float v = (hsval_a+val)/2.0; + if ( v < 0.0 ) return res*(v+1.0); + return res+(v*(1.0-res)); +} +float3 HueSaturation( float3 res ) +{ + float3 hsv = rgb2hsv(res); + float ch = hsv.x*6.0; + int ph = 0, sh = 0; + float pv = 0.0, sv = 0.0; + bool usesh = false; + float hues[6] = {hshue_r,hshue_y,hshue_g,hshue_c,hshue_b,hshue_m}; + float sats[6] = {hssat_r,hssat_y,hssat_g,hssat_c,hssat_b,hssat_m}; + float vals[6] = {hsval_r,hsval_y,hsval_g,hsval_c,hsval_b,hsval_m}; + float v; + [loop] for ( float h=0.0; h<7.0; h+=1.0 ) + { + float ht = h+0.5; + if ( ch < ht+hsover ) + { + ph = floor(h); + if ( (hsover > 0.0) && (ch > ht-hsover) ) + { + usesh = true; + sh = ph+1; + sv = (ch-ht+hsover)/(2.0*hsover); + pv = 1.0-sv; + } + else usesh = false; + break; + } + } + if ( ph >= 6 ) + { + ph = 0; + usesh = false; + } + if ( sh >= 6 ) sh = 0; + if ( usesh ) + { + hsv.x = hs_hue_overlap(hues[ph]*pv,hues[sh]*sv,hsv.x); + hsv.y = hs_sat(sats[ph],hsv.y)*pv+hs_sat(sats[sh],hsv.y)*sv; + hsv.z = hs_val(vals[ph],hsv.z)*pv+hs_val(vals[sh],hsv.z)*sv; + } + else + { + hsv.x = hs_hue(hues[ph],hsv.x); + hsv.y = hs_sat(sats[ph],hsv.y); + hsv.z = hs_val(vals[ph],hsv.z); + } + return hsv2rgb(hsv); +} + +/* Colour Balance filter from GIMP */ + +/* Additional filters that don't fit in enbeffect */ +float4 PS_Append( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float4 res = TextureColor.Sample(Sampler,coord); + if ( cmatenable ) res.rgb = ColorMatrix(res.rgb); + if ( hsenable ) res.rgb = HueSaturation(res.rgb); + res.rgb = max(res.rgb,0.0); + res.a = 1.0; + return res; +} + +/* ultimate super-cinematic immersive black bars */ +float4 PS_Cinematic( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float4 res = TextureColor.Sample(Sampler,coord); + if ( !boxenable ) return res; + float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w); + float sar = bresl.x/bresl.y; + float tar = boxh/boxv; + float2 box = (sar; +Texture2D TextureSearch +< + string ResourceName = "SMAA/SearchTex.dds"; +>; + +#define SMAA_RT_METRICS float4(1.0/ScreenSize.x,1.0/(ScreenSize.x*ScreenSize.w),ScreenSize.x,ScreenSize.x*ScreenSize.w) +#define SMAA_HLSL_4_1 + +#include "SMAA/SMAA.fxh" + +DepthStencilState DisableDepthReplaceStencil +{ + DepthEnable = FALSE; + StencilEnable = TRUE; + FrontFaceStencilPass = REPLACE; +}; +DepthStencilState DisableDepthUseStencil +{ + DepthEnable = FALSE; + StencilEnable = TRUE; + FrontFaceStencilFunc = EQUAL; +}; +BlendState NoBlending +{ + AlphaToCoverageEnable = FALSE; + BlendEnable[0] = FALSE; +}; + +VS_OUTPUT_POST SMAAEdgeDetectionWrapVS( VS_INPUT_POST IN, + out float4 offset[3] : TEXCOORD1 ) +{ + VS_OUTPUT_POST OUT = VS_PostProcess(IN); + if ( smaaenable ) SMAAEdgeDetectionVS(IN.txcoord.xy,offset); + return OUT; +} +VS_OUTPUT_POST SMAABlendingWeightCalculationWrapVS( VS_INPUT_POST IN, + out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2 ) +{ + VS_OUTPUT_POST OUT = VS_PostProcess(IN); + if ( smaaenable ) + SMAABlendingWeightCalculationVS(IN.txcoord.xy,pixcoord,offset); + return OUT; +} +VS_OUTPUT_POST SMAANeighborhoodBlendingWrapVS( VS_INPUT_POST IN, + out float4 offset : TEXCOORD1 ) +{ + VS_OUTPUT_POST OUT = VS_PostProcess(IN); + if ( smaaenable ) SMAANeighborhoodBlendingVS(IN.txcoord.xy,offset); + return OUT; +} + +float4 SMAAEdgeDetectionWrapPS( VS_OUTPUT_POST IN, + float4 offset[3] : TEXCOORD1 ) : SV_Target +{ + if ( !smaaenable ) return float4(0.0,0.0,0.0,1.0); + float2 coord = IN.txcoord.xy; + float2 edges; + //edges = SMAADepthEdgeDetectionPS(coord,offset,TextureDepth); + //edges = SMAALumaEdgeDetectionPS(coord,offset,TextureColor); + edges = SMAAColorEdgeDetectionPS(coord,offset,TextureColor); + return float4(edges,0.0,1.0); +} +float4 SMAABlendingWeightCalculationWrapPS( VS_OUTPUT_POST IN, + float2 pixcoord : TEXCOORD1, float4 offset[3] : TEXCOORD2 ) : SV_Target +{ + if ( !smaaenable ) return float4(0.0,0.0,0.0,1.0); + return SMAABlendingWeightCalculationPS(IN.txcoord.xy,pixcoord,offset, + RenderTargetRGBA32,TextureArea,TextureSearch,0.0); +} +float4 SMAANeighborhoodBlendingWrapPS( VS_OUTPUT_POST IN, + float4 offset : TEXCOORD1 ) : SV_Target +{ + float2 coord = IN.txcoord.xy; + float4 res; + if ( !smaaenable ) res = TextureColor.Sample(Sampler,coord); + else res = SMAANeighborhoodBlendingPS(coord,offset,TextureColor, + RenderTargetRGBA64); + float3 RGB = res.rgb*(res.rgb*(res.rgb*0.305306011+0.682171111) + +0.012522878); + res.rgb = RGB; + res.a = 1.0; + if ( smaadebug == 1 ) return RenderTargetRGBA32.Sample(Sampler,coord); + if ( smaadebug == 2 ) return RenderTargetRGBA64.Sample(Sampler,coord); + return res; +} +float4 PS_ToSRGB( VS_OUTPUT_POST IN ) : SV_Target +{ + float4 res = TextureColor.Sample(Sampler,IN.txcoord.xy); + float3 S1 = sqrt(res.rgb); + float3 S2 = sqrt(S1); + float3 S3 = sqrt(S2); + float3 sRGB = 0.662002687*S1+0.684122060*S2-0.323583601*S3 + -0.0225411470*res.rgb; + res.rgb = sRGB; + return res; +} + +/* end SMAA integration code */ + +technique11 ExtraFilters +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_Append())); + } +} +technique11 ExtraFilters1 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,SMAAEdgeDetectionWrapVS())); + SetPixelShader(CompileShader(ps_5_0,SMAAEdgeDetectionWrapPS())); + SetDepthStencilState(DisableDepthReplaceStencil,1); + SetBlendState(NoBlending,float4(0.0,0.0,0.0,0.0),0xFFFFFFFF); + } +} +technique11 ExtraFilters2 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,SMAABlendingWeightCalculationWrapVS())); + SetPixelShader(CompileShader(ps_5_0,SMAABlendingWeightCalculationWrapPS())); + SetDepthStencilState(DisableDepthUseStencil,1); + SetBlendState(NoBlending, float4(0.0,0.0,0.0,0.0),0xFFFFFFFF); + } +} +technique11 ExtraFilters3 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_ToSRGB())); + } +} +technique11 ExtraFilters4 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,SMAANeighborhoodBlendingWrapVS())); + SetPixelShader(CompileShader(ps_5_0,SMAANeighborhoodBlendingWrapPS())); + } +} +technique11 ExtraFilters5 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_LumaSharp())); + } +} +technique11 ExtraFilters6 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_ChromaKey())); + } +} +technique11 ExtraFilters7 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_Vignette())); + } +} +technique11 ExtraFilters8 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_Cinematic())); + } +} +technique11 ExtraFilters9 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_RetroRockets())); + } +} +technique11 ExtraFilters10 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_Watermark())); + } +} +#else +technique11 ExtraFilters +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_Append())); + } +} +technique11 ExtraFilters1 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_LumaSharp())); + } +} +technique11 ExtraFilters2 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_ChromaKey())); + } +} +technique11 ExtraFilters3 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_Vignette())); + } +} +technique11 ExtraFilters4 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_Cinematic())); + } +} +technique11 ExtraFilters5 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_RetroRockets())); + } +} +technique11 ExtraFilters6 +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_PostProcess())); + SetPixelShader(CompileShader(ps_5_0,PS_Watermark())); + } +} +#endif diff --git a/enbseries/enbeffectpostpass.fx.ini b/enbseries/enbeffectpostpass.fx.ini new file mode 100644 index 0000000..182c1cb --- /dev/null +++ b/enbseries/enbeffectpostpass.fx.ini @@ -0,0 +1,78 @@ +[ENBEFFECTPOSTPASS.FX] +TECHNIQUE=1 +Enable SMAA=true +SMAA Debugging=0 +Enable Chroma Key=false +Chroma Key Red=0, 1, 0 +Chroma Key Depth=0.99 +Chroma Key Depth Horizontal Tilt Center=0.5 +Chroma Key Depth Vertical Tilt Center=0.5 +Chroma Key Depth Horizontal Tilt=0.0 +Chroma Key Depth Vertical Tilt=0.0 +Luma Sharpen Enable=true +Luma Sharpen Radius=0.8 +Luma Sharpen Clamp=0.1 +Luma Sharpen Blending=8.0 +Enable Black Bars=false +Box Horizontal Ratio=2.39 +Box Vertical Ratio=1.0 +Enable Vignette=false +Enable Border Blur=false +Vignette Shape=1 +Vignette Blending Mode=0 +Vignette Contrast=9.83 +Vignette Intensity=0.47 +Vignette Shift=0.0 +Vignette Color=-0.03, -0.05, -0.07 +Border Blur Contrast=1.6 +Border Blur Intensity=3.74 +Border Blur Shift=0.0 +Border Blur Radius=1.0 +Enable Color Matrix=false +Color Matrix Red Red=1.0 +Color Matrix Red Green=0.0 +Color Matrix Red Blue=0.0 +Color Matrix Green Red=0.0 +Color Matrix Green Green=1.0 +Color Matrix Green Blue=0.0 +Color Matrix Blue Red=0.0 +Color Matrix Blue Green=0.0 +Color Matrix Blue Blue=1.0 +Normalize Matrix=true +Enable Hue-Saturation=false +Overlap=0.5 +Global Hue=0.0 +Global Saturation=0.0 +Global Value=0.0 +Red Hue=0.0 +Red Saturation=0.0 +Red Value=0.0 +Yellow Hue=0.0 +Yellow Saturation=0.0 +Yellow Value=0.0 +Green Hue=0.0 +Green Saturation=0.0 +Green Value=0.0 +Cyan Hue=0.0 +Cyan Saturation=0.0 +Cyan Value=0.0 +Blue Hue=0.0 +Blue Saturation=0.0 +Blue Value=0.0 +Magenta Hue=0.0 +Magenta Saturation=0.0 +Magenta Value=0.0 +Enable RetroFX=false +RetroFX Emulted Width=0.5 +RetroFX Emulted Height=0.5 +RetroFX Saturation Modifier=1.0 +RetroFX Contrast Modifier=1.0 +RetroFX Dither Offset Red=0.0 +RetroFX Dither Offset Green=0.0 +RetroFX Dither Offset Blue=0.0 +RetroFX Dither Range Red=0.05 +RetroFX Dither Range Green=0.05 +RetroFX Dither Range Blue=0.05 +RetroFX Palette=25 +RetroFX Display Palette Label=true +Show MariENB Watermark=false diff --git a/enbseries/enblens.fx b/enbseries/enblens.fx new file mode 100644 index 0000000..df6a8e9 --- /dev/null +++ b/enbseries/enblens.fx @@ -0,0 +1,33 @@ +/* This shader intentionally left blank */ +struct VS_INPUT_POST +{ + float3 pos : POSITION; + float2 txcoord : TEXCOORD0; +}; +struct VS_OUTPUT_POST +{ + float4 pos : SV_POSITION; + float2 txcoord0 : TEXCOORD0; +}; +VS_OUTPUT_POST VS_Quad(VS_INPUT_POST IN) +{ + VS_OUTPUT_POST OUT; + float4 pos; + pos.xyz = IN.pos.xyz; + pos.w = 1.0; + OUT.pos = pos; + OUT.txcoord0.xy = IN.txcoord.xy; + return OUT; +} +float4 PS_Nothing(VS_OUTPUT_POST IN, float4 v0 : SV_Position0) : SV_Target +{ + return float4(0.0,0.0,0.0,1.0); +} +technique11 Nothing +{ + pass p0 + { + SetVertexShader(CompileShader(vs_5_0,VS_Quad())); + SetPixelShader(CompileShader(ps_5_0,PS_Nothing())); + } +} diff --git a/enbseries/enblens.fx.ini b/enbseries/enblens.fx.ini new file mode 100644 index 0000000..d1938c1 --- /dev/null +++ b/enbseries/enblens.fx.ini @@ -0,0 +1,2 @@ +[ENBLENS.FX] +TECHNIQUE=0 diff --git a/enbseries/menbdither.png b/enbseries/menbdither.png new file mode 100644 index 0000000..98f2f4e Binary files /dev/null and b/enbseries/menbdither.png differ diff --git a/enbseries/menbfilmlut.png b/enbseries/menbfilmlut.png new file mode 100644 index 0000000..fec04d6 Binary files /dev/null and b/enbseries/menbfilmlut.png differ diff --git a/enbseries/menbfrost.png b/enbseries/menbfrost.png new file mode 100644 index 0000000..ecba9f7 Binary files /dev/null and b/enbseries/menbfrost.png differ diff --git a/enbseries/menbglobaldefs.fx b/enbseries/menbglobaldefs.fx new file mode 100644 index 0000000..075ab12 --- /dev/null +++ b/enbseries/menbglobaldefs.fx @@ -0,0 +1,83 @@ +/* + menbglobaldefs.fx : MariENB3 global shared code. + (C)2016-2020 Marisa Kirisame, UnSX Team. + Part of MariENB3, the personal ENB of Marisa for Fallout 4. + Released under the GNU GPLv3 (or later). +*/ +/* are we running on skyrim special edition or on fallout 4? */ +//#define SKYRIMSE +/* [New in 3.5.1] increase the quality of bloom by using larger matrices */ +//#define HQBLOOM +/* [New in 3.5.1] compiles in SMAA support */ +#define WITH_SMAA +/* time of day and interior interpolation */ +#define ndfact clamp(0.5+(TimeOfDay1.z+(TimeOfDay1.y+TimeOfDay1.w)*0.5)*0.5\ + -(TimeOfDay2.y+(TimeOfDay1.x+TimeOfDay2.x)*0.5)*0.5,0.0,1.0) +#define tod_ind(a) lerp(lerp(a##_n,a##_d,ndfact),a##_i,EInteriorFactor) +#define todx_ind(a) lerp(a##_dw*TimeOfDay1.x+a##_sr*TimeOfDay1.y+a##_dy\ + *TimeOfDay1.z+a##_ss*TimeOfDay1.w+a##_ds*TimeOfDay2.x+a##_nt\ + *TimeOfDay2.y,a##_i,EInteriorFactor) +/* weather macros (not very useful yet) */ +#define weatherfactor(id) ((Weather.x==id)?(Weather.y==id)?(1.0):(Weather.z)\ + :(Weather.y==id)?(1.0-Weather.z):(0.0)) +/* + Explanation of macro, because some of the people reading this likely don't + know what a ternary conditional is: + + (Weather.x==id) -> transitioning to wanted weather? + ?(Weather.y==id) -> coming from wanted weather? + ?(1.0) -> if so, always 1 + :(Weather.z) -> if not, return transition + :(Weather.y==id) -> not transitioning but coming from wanted weather? + ?(1.0-Weather.z) -> return inverse transition + :(0.0) -> otherwise return 0 +*/ +/* temperate no fog */ +#define WT_NEUTRAL 0.0 +#define WT_GENERAL 1.0 +#define WT_DARK 2.0 +/* cold no fog */ +#define WT_HARBOR 3.0 +#define WT_FROSTY 4.0 +/* warm no fog */ +#define WT_HEAT 5.0 +#define WT_SCORCHED 6.0 +/* temperate fog */ +#define WT_GENERALFOG 7.0 +#define WT_GENERALRAIN 8.0 +#define WT_DARKFOG 9.0 +#define WT_DARKRAIN 10.0 +/* cold fog */ +#define WT_HARBORFOG 11.0 +#define WT_FROSTYFOG 12.0 +#define WT_HARBORRAIN 13.0 +/* warm fog */ +#define WT_HEATFOG 14.0 +#define WT_SCORCHEDFOG 15.0 +/* temperature and fog interpolation macros */ +#define istemperate(x) (((x>=0.0)&&(x<=2.0))||((x>=7.0)&&(x<=10.0))) +#define iscold(x) (((x>=3.0)&&(x<=4.0))||((x>=11.0)&&(x<=13.0))) +#define iswarm(x) (((x>=5.0)&&(x<=6.0))||((x>=14.0)&&(x<=15.0))) +#define isfog(x) ((x>=7.0)&&(x<=15.0)) +#define temperatefactor (istemperate(Weather.x)?istemperate(Weather.y)?(1.0)\ + :(Weather.z):istemperate(Weather.y)?(1.0-Weather.z):(0.0)) +#define coldfactor (iscold(Weather.x)?iscold(Weather.y)?(1.0):(Weather.z)\ + :iscold(Weather.y)?(1.0-Weather.z):(0.0)) +#define warmfactor (iswarm(Weather.x)?iswarm(Weather.y)?(1.0):(Weather.z)\ + :iswarm(Weather.y)?(1.0-Weather.z):(0.0)) +#define fogfactor (isfog(Weather.x)?isfog(Weather.y)?(1.0):(Weather.z)\ + :isfog(Weather.y)?(1.0-Weather.z):(0.0)) +/* asset definitions */ +/* texture sizes */ +#define NOISESIZE 256.0 +#define HEATSIZE 512.0 +#define FROSTSIZE 1024.0 +/* some textures can be provided as DDS rather than PNG to save space */ +//#define HEAT_DDS +//#define FROST_DDS +//#define VIGNETTE_DDS +/* SMAA quality */ +//#define SMAA_PRESET_LOW +//#define SMAA_PRESET_MEDIUM +//#define SMAA_PRESET_HIGH +#define SMAA_PRESET_ULTRA diff --git a/enbseries/menbheat.png b/enbseries/menbheat.png new file mode 100644 index 0000000..343f24c Binary files /dev/null and b/enbseries/menbheat.png differ diff --git a/enbseries/menblogo.png b/enbseries/menblogo.png new file mode 100644 index 0000000..9a7edc4 Binary files /dev/null and b/enbseries/menblogo.png differ diff --git a/enbseries/menblut_day.dds b/enbseries/menblut_day.dds new file mode 100644 index 0000000..309591e Binary files /dev/null and b/enbseries/menblut_day.dds differ diff --git a/enbseries/menblut_interior.dds b/enbseries/menblut_interior.dds new file mode 100644 index 0000000..989ebe6 Binary files /dev/null and b/enbseries/menblut_interior.dds differ diff --git a/enbseries/menblut_night.dds b/enbseries/menblut_night.dds new file mode 100644 index 0000000..4628241 Binary files /dev/null and b/enbseries/menblut_night.dds differ diff --git a/enbseries/menbnoise1.png b/enbseries/menbnoise1.png new file mode 100644 index 0000000..743cb39 Binary files /dev/null and b/enbseries/menbnoise1.png differ diff --git a/enbseries/menbnoise2.png b/enbseries/menbnoise2.png new file mode 100644 index 0000000..e26fcf9 Binary files /dev/null and b/enbseries/menbnoise2.png differ diff --git a/enbseries/menbnoise3.png b/enbseries/menbnoise3.png new file mode 100644 index 0000000..eb7125a Binary files /dev/null and b/enbseries/menbnoise3.png differ diff --git a/enbseries/menbpal.png b/enbseries/menbpal.png new file mode 100644 index 0000000..7612023 Binary files /dev/null and b/enbseries/menbpal.png differ diff --git a/enbseries/menbpaltext.png b/enbseries/menbpaltext.png new file mode 100644 index 0000000..6428c5b Binary files /dev/null and b/enbseries/menbpaltext.png differ diff --git a/enbseries/menbvignette.png b/enbseries/menbvignette.png new file mode 100644 index 0000000..be7d604 Binary files /dev/null and b/enbseries/menbvignette.png differ diff --git a/enbseries/menbweatherinfo.txt b/enbseries/menbweatherinfo.txt new file mode 100644 index 0000000..12a0262 --- /dev/null +++ b/enbseries/menbweatherinfo.txt @@ -0,0 +1,119 @@ +Weather reference + +0 Neutral Generic or unsupported weathers +1 General Most of the temperate areas of the Commonwealth +2 Dark Shady areas +3 Harbor Fog-less Far Harbor sections +4 Frosty FROST weather +5 Heat Warmer parts of the Commonwealth +6 Scorched Mostly used for the bombs dropping in the intro +7 General Fog Temperate fogs +8 General Rain Temperate rains +9 Dark Fog Shady areas with fog +A Dark Rain Shady areas with rain +B Harbor Fog The fog, duh +C Frosty Fog When you can't see in FROST +D Harbor Rain Rainy Far Harbor +E Heat Fog Warmth with fog +F Scorched Fog Glowing sea, mostly + +This is still a work in progress. +Hopefully the classification will be ready by the time +Fallout 4 ENB supports weathers. + +Fallout4 + +15E DefaultWeather . +116B FXDiamondSunlightBounce . +116D DiamondWeather . +116E DiamondWeatherPastel . +16EC IstWeather . +29BB8 FXWthrSunlightOffAtNight . +2B52A CommonwealthClear . +6ED5A FXWthrInvertDayNight . +747C8 FXConcord01 . +7548F FXWthrSunlight . +75491 FXWthrSunlightWhite . +76A58 FXConcord01OffatNight . +777CF FXWthrInvertDayNightWarm . +88C57 FXWthrMoonlightOnly . +96C61 FXWthrMorningOnly . +A1588 NeutralWeather . +A6858 WorldMapWeather . +DB2A1 MQ203Weather . +F1033 CommonwealthGSOvercast . +FF98F PrewarPlayerHouseInteriorWeather . +108640 FXInstituteDayNightCycle . +10D573 FXInstituteDayNightCycleKey . +10E3D4 EditorCloudPreview . +10F781 TCommonwealthMarshOvercast . +115C64 GoodneighborWeatherBase . +1209AF NeutralOvercast . +1256FB FXNukeWeather . +12A18E CommonwealthSanctuaryClear . +141AB4 FXWthrSunlightWhiteBounce . +171621 DefaultInteriorWeatherNoLUT . +171636 FXWthrSunlightOffAtNightGlass . +191647 FXWthrInvertDayNightGS . +1A65E5 ConcMuseumWeather . +1A65F0 DefaultInteriorWeather . +1A6994 CommonwealthSanctuaryClearNukeFog . +1BD481 CommonwealthGSFoggy . +1C3473 CommonwealthFoggy . +1C3D5E CommonwealthGSRadstorm . +1C8556 CommonwealthOvercast . +1CA7E4 CommonwealthRain . +1CC186 CommonwealthMisty . +1CD096 CommonwealthMistyRainy . +1D1CEC FXWthrSunlightOffAtNightBlack . +1D670E CommonwealthClearestSkies . +1E5E60 CommonwealthDarkSkies . +1EB2FF CommonwealthPolluted . +1F2529 CommOvercastTest2 . +1F61A1 CommonwealthDusty . +1F61FD CGPrewarNukeFXWeather . +20F46C CommonwealthOvercastBackup . +211221 VideoVaultExit . +2115D7 CommonwealthMistyRainyBackup . +216A98 CommonwealthClearBackup . +21A563 CommonwealthClearTrailer1 . +21A564 CommonwealthClearTrailer2 . +222394 CommonwealthGSRadstormOld . +22239A CommonwealthRainBackup . +225922 CommonwealthSanctuaryClearNoAttach . +226448 CommonwealthDarkSkies3 . +2385FB CommonwealthDarkSkies2 . +2385FD CommonwealthClear2 . +2392A2 CommonwealthFoggyBackup . +2392A3 CommonwealthGSRadstormBackup . +2392A4 CommonwealthGSFoggyBackup . +2392A5 CommonwealthMistyBackup . +2392A6 CommonwealthSanctuaryClearBackup . +23AB9C CommonwealthClearBackup2 . +2486A4 CommonwealthClear_VBFog . +2486A5 CommonwealthOvercast_VBFog . + +DLCCoast + +74C6 DLC03_RadStorm . +74F2 DLC03_UNUSEDMistyFogWeather . +74F3 DLC03_TestMistyWeather . +74F5 DLC03_RadMistWeather . +74FA DLC03_RainWeather . +7FBA DLC03_RadFogWeather . +9962 DLC03_ClearWeather . +23A97 DLC03VirtualWeather01 . +247B6 DLC03AtomM01_RadStorm . +31416 DLC03VirtualWeather01Original . +427EB DLC03_RadMistWeatherBeforeGrantMessedItUp . +45F6F DLC03_ClearWeatherFast . +54132 DLC03VirtualWeather01OriginalFog . +56378 FXWthrWindowNoGlow01 . +56638 DLC03_ClearWeatherFastBackup . +5D0C4 dlc03_radmistweatherFast . + +DLCNukaWorld + +7E3B DLC04NukaWorldClear . +30ACD DLC04NukaWorldRain . +367CA DLC04NukaWorldClearDusty . \ No newline at end of file