Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
//CHOOSE EFFECTS
#define USE_SPLITSCREEN 0 //[0 or 1] Splitscreen: Disables all effects on
the right half of the screen to show changes.
#define USE_RAYMARCH_AO 0 //[0 or 1] Raymarched AO: Another AO approach,
non-physically correct but realistic shading algorithm. Noisy.
#define USE_CHAPMAN_LENS 0 //[0 or 1] Chapman's lensflare: Simple
lensflare shader with one big halo.
#define USE_FXAA 0 //[0 or 1] FXAA: Detects aliased/jagged edges and
slightly blurs them, using the FXAA technique.
#define USE_DEPTHBUFFER_OUTPUT 0 //[0 or 1] Depth Buffer Output: Shows you
the pixel depth, this is for debugging or depth map creation only.
#define USE_TILTSHIFT 0 //[0 or 1] Tilt Shift: Photographic effect
which blurs the screen to simulate focus. Results in game world looking tiny when
viewed from above.
#define USE_LUT 0 //[0 or 1] Color Lookup Table: Uses a gradient
texture to adjust the colors of the image.
#define USE_LENSDIRT 0 //[0 or 1] Lensdirt: Simulates a dirty camera
lens. IMPORTANT: bloom threshold and amount have influence on the intensity of the
dirt!
#define USE_GAUSSIAN_ANAMFLARE 0 //[0 or 1] Gaussian Anamflare: Applies a
horizontal light beam to bright pixels.
#define USE_BLOOM 1 //[0 or 1] Bloom: Makes bright lights bleed
their light into their surroundings. NOT the SweetFX way to do bloom but a more
proper way.
#define USE_SSAO 0 //[0 or 1] SSAO: Enables Screen-Space Ambient
Occlusion, a non-physically correct but realistic shading algorithm
#define USE_MAGIC_DOF 0 //[0 or 1] Magic DOF: Enables intelligent
hexagonal DOF shader which can create insane blur radii with almost no fps cost.
Expect artifacts.
#define USE_PETKAGTADOF 0 //[0 or 1] PetkaGtA DOF: Enables PetkaGtA's
Depth of Field, originally of Blender.
#define USE_MATSODOF 0 //[0 or 1] Matso DOF: Enables Matso's Depth of
Field.
#define USE_GP65CJ042DOF 0 //[0 or 1] gp65cj042 DOF: Enables Depth of
Field shader, this version is originally by user gp65cj042, ME uses an optimized
version by me (Marty McFly).
#define USE_EXPLOSION 0 //[0 or 1] Explosion : Scatters the pixels,
making the image look fuzzy.
#define USE_CARTOON 0 //[0 or 1] Cartoon : "Toon"s the image.
#define USE_SHARPENING 1 //[0 or 1] Sharpen: Sharps the image but may
increase aliasing
#define USE_LEVELS 0 //[0 or 1] Levels : Sets a new black and white
point. This increases contrast but causes clipping. Use Curves instead if you want
to avoid that.
#define USE_TECHNICOLOR 1 //[0 or 1] Technicolor : Attempts to mimic the
look of an old movie using the Technicolor three-strip color process. Algorithm
from prod80
#define USE_SWFX_TECHNICOLOR 0 //[0 or 1] Technicolor : Attempts to
mimic the look of an old movie using the Technicolor three-strip color process.
Algorithm from SweetFX
#define USE_DPX 1 //[0 or 1] Cineon DPX : Should make the image
look like it's been converted to DXP Cineon - basically it's another movie-like
look similar to technicolor.
#define USE_MONOCHROME 0 //[0 or 1] Monochrome : Monochrome makes the
colors disappear. No control values.
#define USE_LIFTGAMMAGAIN 0 //[0 or 1] Lift Gamma Gain : Adjust brightness
and color of shadows, midtones and highlights.
#define USE_TONEMAP 1 //[0 or 1] Tonemap : Adjust gamma, exposure,
saturation, bleach and defog. (may cause clipping).
#define USE_VIBRANCE 1 //[0 or 1] Vibrance : Intelligently saturates
(or desaturates if you use negative values) the pixels depending on their original
saturation.
#define USE_CURVES 1 //[0 or 1] Curves : Contrast adjustments using
S-curves.
#define USE_SEPIA 1 //[0 or 1] Sepia : Sepia tones the image.
#define USE_SKYRIMTONEMAP 0 //[0 or 1] Skyrim Tonemap: Applies color
correction/tonemapping based on tonemappers of popular Skyrim ENB's.
#define USE_COLORMOOD 0 //[0 or 1] Color Mood: Applies a "mood" to
the color, tinting mainly the dark colors.
#define USE_CROSSPROCESS 0 //[0 or 1] Cross Processing: Simulates wrong
chemistry in color processing.
#define USE_FILMICPASS 0 //[0 or 1] Filmic Pass: Applies some common
color adjustments to mimic a more cinema-like look.
#define USE_REINHARD 0 //[0 or 1] Reinhard: This is the Reinhard
tonemapping shader, if you are interested, google how it works.
#define USE_REINHARDLINEAR 0 //[0 or 1] Reinhard: Reinhard mixed with some
linear tonemapping.
#define USE_COLORMOD 0 //[0 or 1] Colormod: Contrast, Saturation and
Brightness ported from colormod.asi.
#define USE_SPHERICALTONEMAP 0 //[0 or 1] Spherical Tonemap: Another approach
on tonemapping, uses some sphere algorithms.
#define USE_HPD 0 //[0 or 1] Haarm Peter Duiker Filmic Tonemapping:
Tonemapping used in Watch Dogs, ripped from the Watch Dogs shaders themselves.
#define USE_FILMICCURVE 0 //[0 or 1] Filmic Curve: Improved version of
the well-known Uncharted 2 filmic curve, first seen in iCEnhancer 0.3.
#define USE_SINCITY 0 //[0 or 1] Sin City: Effect from the movie "Sin
City" - everything else than red is grey.
#define USE_GODRAYS 0 //[0 or 1] Godrays: Adds some light rays
rotating around screen center.
#define USE_ANAMFLARE 0 //[0 or 1] Anamorphic Lensflare: adds some
horizontal light flare, simulating the use of an anamorphic lens while recording.
#define USE_CHROMATICABBERATION 1 //[0 or 1] Chromatic Abberation & Lens
Distord: Adds some RGB shift in colors and distorts image to look like the
"fisheye" effect.
#define USE_LENZFLARE 0 //[0 or 1] Lenz Flare: Boris Vorontsov's Skyrim
Lensflare with custom offsets, ported to MasterEffect.
#define USE_GRAIN 0 //[0 or 1] Grain: Adds some image grain, looks like
when a TV has no signal.
#define USE_HD6_VIGNETTE 0 //[0 or 1] HeliosDoubleSix Vignette: Adds some
advanced vignette (darkening shader) to lead focus to screen center
#define USE_BORISVIGNETTE 0 //[0 or 1] Boris Vorontsov Vignette: Simple
colorable version of vignette, darkens/tints the image at the corners
#define USE_BORDER 0 //[0 or 1] Adds a 1 pixel black border around
the screen to compensate white outlining caused by excessive sharpening
#define USE_MOVIEBARS 0 //[0 or 1] Movie Bars: blackens the image on
the top and bottom, simulating a higher aspect ratio. Default set to 21:9 aspect
ratio.
#define USE_LEIFX 0 //[0 or 1] LeifFX: Simulates use of old 3dfx
render engines, read here for more info: http://leileilol.mancubus.net/shaders/
#define USE_COLORHUEFX 0 //[0 or 1] Color Hue FX: Desaturates everything
but colors from a fixed hue mid and the range around it. Similiar to Sin City but
much better. Thanks, prod80!
#define VK_INSERT 0x2D
#define ReShade_ToggleKey VK_INSERT
//CHAPMAN LENS
#define CHAPMANDEPTHCHECK 1 //[0 or 1] if 1, only pixels with depth =
1 get lensflares, this prevents white objects from getting lensflare source which
would normally happen in LDR
#define ChapFlareTreshold 0.9 //[0.7 to 0.99] Brightness threshold for
lensflare generation. Everything brighter than this value gets a flare.
#define ChapFlareCount 15 //[1 to 20] Number of single halos to be
generated. If set to 0, only the curved halo around is visible.
#define ChapFlareDispersal 0.5 //[0.25 to 1.0] Distance from screen
center (and from themselves) the flares are generated.
#define ChapFlareSize 0.45 //[0.2 to 0.8] Distance (from screen
center) the halo and flares are generated.
#define ChapFlareCA float3(0.1,0.12,0.14) //[-0.5 to 0.5] Offset of RGB
components of flares as modifier for Chromatic abberation. Same 3 values means no
CA.
#define ChapFlareIntensity 15.0 //[5.0 to 20.0] Intensity of flares and
halo, remember that higher threshold lowers intensity, you might play with both
values to get desired result.
//FXAA
#define FXAANum 2 //[2,4,6,8] Number of FXAA passes. 8 ist
highest but costs a tremendous amount of performance.
#define FXAASearchSteps 16 //[2 to 64] Number of algorithm samples.
Performance affecting texture fetches are FXAANum * FXAASearchSteps so be careful
with changing both values.
#define FXAAEdgeThreshold 0.03 //[0.010 to 0.100] Minimum amount of
local contrast to determine pixel as "aliased"
#define FXAAEdgeThresholdMin 0.06 //[0.010 to 0.100] Darkness threshold.
Trims the algorithm from processing darks.
#define FXAASubpixCap 0.875 //[0.5 to 1.0] Choose the amount of sub-
pixel aliasing removal.
#define FXAASubpixTrim 0.09 //[0.5 to 1.0] Choose the amount of sub-
pixel aliasing removal.
#define FXAASearchThreshold 0.25 //[0.1 to 0.4] If local contrast is lower
than that, pixel is determined as "done".
//TILT SHIFT
#define TiltShiftAxis 0.0 //[0.0 to 90.0] Rotation of Tilt shift
axis. 0.0 means horizontal focus line, 90.0 means vertical.
#define TiltShiftOffset 0.5 //[0.0 to 1.0] Position of Tilt Shift
axis. 0.5 is screen center. You may adjust this value when changing the axis value.
#define TiltShiftCurve 1.0 //[0.0 to 2.0] Power of Tilt Shift
blurring.
#define TiltShiftMult 5.0 //[1.0 to 7.0] Multiplicator if Tilt
Shift blurring. Do not set too high, otherwise the single blur taps are visible.
//LENSDIRT
#define fLensdirtIntensity 2.0 //[0.0 to 2.0] Intensity of lensdirt.
//BLOOM
#define BLOOM_MIXMODE 2 //[1 to 2] 1: Linear add | 2: Screen add
| 3: Screen/Lighten/Opacity | 4: Lighten
#define fBloomThreshold 0.15 //[0.1 to 1.0] Every pixel brighter than
this value triggers bloom.
#define fBloomAmount 0.08 //[1.0 to 20.0] Intensity of bloom.
#define fBloomSaturation 1.5 //[0.0 to 2.0] Bloom saturation. 0.0
means white bloom, 2.0 means very very colorful bloom.
#define fBloomTint float3(0.8,0.7,0.5) //[0.0 to 1.0] R, G and B
components of bloom tintcolor the bloom color gets shifted to.
//"MAGIC" DOF
#define fMagicFocusPoint float2(0.5,0.5) //[0.0 to 1.0] Screen coordinates
of focus point. First value is horizontal, second value is vertical position. 0 is
left/upper, 1 is right/lower.
#define fMagicNearBlurCurve 1.0 //[0.4 to X] Power of blur of closer-
than-focus areas.
#define fMagicFarBlurCurve 1.0 //[0.4 to X] Elementary, my dear Watson:
Blur power of areas behind focus plane.
#define fMagicBlurRadius 10.0 //[5.0 to 50.0] Blur radius approximately
in pixels. Radius, not diameter.
#define fMagicBlurQuality 5 //[1 to 20] Blur quality as control value
over tap count. Quality 15 produces 721 taps, impossible with other DOF shaders by
far, most they can do is about 150.
#define fMagicColorCurve 8.0 //[1.0 to 10.0] DOF weighting curve.
#define fMagicManualFocusEnable 1 //[1.0 to 10.0] Enables manual focus.
#define fMagicManualFocusPlane 0.9 //[0.0 to 1.0] Manual focus depth.
0.0 means camera is focus plane, 1.0 means sky is focus plane.
//EXPLOSION
#define Explosion_Radius 10.5 //[0.2 to 100.0] Amount of effect you
want.
//CARTOON
#define CartoonPower 1.5 //[0.1 to 10.0] Amount of effect you
want.
#define CartoonEdgeSlope 1.5 //[0.1 to 8.0] Raise this to filter out
fainter edges. You might need to increase the power to compensate. Whole numbers
are faster.
//SHARPEN
#define SharpBias 0.20 //[0.05 to 1.0] How big the sharpen
offset is (used to compare neighbor pixels to get sharpen amount
#define SharpStrength 1.0 //[0.05 to 1.0] Amount of sharpening you
want.
#define SharpClamp 0.3 //[0.2 to 2.0] Clamps the sharpening to a
maximum amount to prevent aliasing
//LEVELS
#define Levels_black_point 36 //[0 to 255] The black point is the
new black - literally. Everything darker than this will become completely black.
Default is 16.0
#define Levels_white_point 235 //[0 to 255] The new white point.
Everything brighter than this becomes completely white. Default is 235.0
//TECHNICOLOR
#define ColStrengthR 0.25 //[0.05 to 1.0] Color Strength of Red
channel. Higher means darker and more intense colors.
#define ColStrengthG 0.35 //[0.05 to 1.0] Color Strength of Green
channel. Higher means darker and more intense colors.
#define ColStrengthB 0.50 //[0.05 to 1.0] Color Strength of Blue
channel. Higher means darker and more intense colors.
#define TechniBrightness 0.9 //[0.5 to 1.5] Brightness Adjustment,
higher means brighter image.
#define TechniStrength 1.0 //[0.0 to 1.0] Strength of Technicolor
effect. 0.0 means original image.
#define TechniSat 0.45 //[0.0 to 1.5] Additional saturation
control since technicolor tends to oversaturate the image.
//SWEETFX TECHNICOLOR
#define TechniAmount 0.4 //[0.00 to 1.00] Amount of color change
you want
#define TechniPower 4.0 //[0.00 to 8.00] Power of color change
#define redNegativeAmount 0.88 //[0.00 to 1.00] controls for different
technicolor power on the respective color channels
#define greenNegativeAmount 0.88 //[0.00 to 1.00]
#define blueNegativeAmount 0.88 //[0.00 to 1.00]
//DPX
#define DPXRed 8.0 //[1.0 to 15.0] Amount of DPX applies on Red
color channel
#define DPXGreen 8.0 //[1.0 to 15.0] ""
#define DPXBlue 8.0 //[1.0 to 15.0] ""
#define DPXColorGamma 1.0 //[0.1 to 2.5] Adjusts the colorfulness
of the effect in a manner similar to Vibrance. 1.0 is neutral.
#define DPXSaturation 2.0 //[0.0 to 8.0] Adjust saturation of the
effect. 1.0 is neutral.
#define DPXRedC 0.35 //[0.60 to 0.20]
#define DPXGreenC 0.29 //[0.60 to 0.20]
#define DPXBlueC 0.28 //[0.60 to 0.20]
#define DPXBlend 0.10 //[0.00 to 1.00] How strong the effect
should be.
//LIFTGAMMAGAIN
#define RGB_Lift float3(1.000, 1.000, 1.000) //[0.000 to 2.000]
Adjust shadows for Red, Green and Blue.
#define RGB_Gamma float3(1.000, 2.000, 1.000) //[0.000 to 2.000]
Adjust midtones for Red, Green and Blue
#define RGB_Gain float3(1.000, 1.000, 1.000) //[0.000 to 2.000]
Adjust highlights for Red, Green and Blue
//TONEMAP
#define Gamma 1.05 //[0.000 to 2.000] Adjust midtones. 1.000
is neutral. This setting does exactly the same as the one in Lift Gamma Gain, only
with less control.
#define Exposure -0.05 //[-1.000 to 1.000] Adjust exposure
#define Saturation 0.10 //[-1.000 to 1.000] Adjust
saturation
#define Bleach 0.000 //[0.000 to 1.000] Brightens the
shadows and fades the colors
#define Defog 0.00 //[0.000 to 1.000] How much of the
color tint to remove
#define FogColor float3(0.80, 0.00, 2.00) //[0.00 to 2.55, 0.00 to 2.55,
0.00 to 2.55] What color to remove - default is blue
//VIBRANCE
#define Vibrance 0.5 //[-1.00 to 1.00] Intelligently saturates
(or desaturates if you use negative values) the pixels depending on their original
saturation.
#define Vibrance_RGB_balance float3(1.10, -1.00, 0.05) //[-10.00 to 10.00,-10.00
to 10.00,-10.00 to 10.00] A per channel multiplier to the Vibrance strength so you
can give more boost to certain colors over others
//CURVES
#define Curves_mode 2 //[0|1|2] Choose what to apply contrast
to. 0 = Luma, 1 = Chroma, 2 = both Luma and Chroma. Default is 0 (Luma)
#define Curves_contrast -0.25 //[-1.00 to 1.00] The amount of
contrast you want
//SEPIA
#define ColorTone float3(0.95, 0.93, 1.05) //[0.00 to 2.55, 0.00 to
2.55, 0.00 to 2.55] What color to tint the image
#define GreyPower 0.00 //[0.00 to 1.00] How much
desaturate the image before tinting it
#define SepiaPower 0.50 //[0.00 to 1.00] How much to
tint the image
//SKYRIM TONEMAPPING
#define POSTPROCESS 6 //[1 to 6] Mode of postprocessing you
want. Mode 1 uses V1 values, Mode 2 uses V2 values etc
//
#define EAdaptationMinV1 0.05
#define EAdaptationMaxV1 0.125
#define EContrastV1 1.0
#define EColorSaturationV1 1.0
#define EToneMappingCurveV1 6.0
//
#define EAdaptationMinV2 0.36
#define EAdaptationMaxV2 0.29
#define EToneMappingCurveV2 8.0
#define EIntensityContrastV2 2.5
#define EColorSaturationV2 3.2
#define EToneMappingOversaturationV2 180.0
//
#define EAdaptationMinV3 0.001
#define EAdaptationMaxV3 0.025
#define EToneMappingCurveV3 30.0
#define EToneMappingOversaturationV3 111160.0
//
#define EAdaptationMinV4 0.2
#define EAdaptationMaxV4 0.125
#define EBrightnessCurveV4 0.7
#define EBrightnessMultiplierV4 0.45
#define EBrightnessToneMappingCurveV4 0.3
//
#define EAdaptationMinV5 0.08
#define EAdaptationMaxV5 0.20
#define EToneMappingCurveV5 8
#define EIntensityContrastV5 3.475
#define EColorSaturationV5 4
#define HCompensateSatV5 2
#define EToneMappingOversaturationV5 180.0
//
#define EBrightnessV6Day 2.5
#define EIntensityContrastV6Day 1.5
#define EColorSaturationV6Day 2.0
#define HCompensateSatV6Day 3.0
#define EAdaptationMinV6Day 0.64
#define EAdaptationMaxV6Day 0.24
#define EToneMappingCurveV6Day 8
#define EToneMappingOversaturationV6Day 2500.0
//COLORMOOD
#define fRatio 2.0 //[0.00 to 3.00] Amount of moody coloring
you want
#define moodR 1.0 //[0.0 to 2.0] How strong dark red colors
shall be boosted
#define moodG 1.1 //[0.0 to 2.0] How strong dark green
colors shall be boosted
#define moodB 0.5 //[0.0 to 2.0] How strong dark blue
colors shall be boosted
//CROSSPROCESS
#define CrossContrast 0.95 //[0.5 to 2.00] The names of these
values should explain their functions
#define CrossSaturation 1.12 //[0.5 to 2.00]
#define CrossBrightness -0.052 //[-0.3 to 0.30]
#define CrossAmount 1.0 //[0.05 to 1.5]
//FILMICPASS
#define Strenght 0.725 //[0.05 to 1.5] Strength of the color
curve altering
#define BaseGamma 1.6 //[0.7 to 2.0] Gamma Curve
#define Fade 0.2 //[0.0 to 0.6] Decreases contrast to
imitate faded image
#define Contrast 1.0 //[0.5 to 2.0] Contrast.
#define FSaturation -0.15
#define FBleach 0.005 //[-0.5 to 1.0] More bleach means
more contrasted and less colorful image
#define FRedCurve 6.0
#define FGreenCurve 6.0
#define FBlueCurve 6.0
#define BaseCurve 1.5
#define EffectGammaR 1.0
#define EffectGammaG 1.0
#define EffectGammaB 1.0
#define EffectGamma 0.75
#define Linearization 1.3 //[0.5 to 2.0] Linearizes the color curve
//REINHARD TONEMAP
#define ReinhardWhitepoint 4.0 //[1.0 to 10.0] Point above which
everything is pure white
#define ReinhardScale 0.5 //[0.0 to 2.0] Amount of applied
tonemapping
//COLORMOD
#define ColormodChroma 0.78 // Saturation
#define ColormodGammaR 1.05 // Gamma for Red color
channel
#define ColormodGammaG 1.05 // Gamma for Green color
channel
#define ColormodGammaB 1.05 // Gamma for Blue color
channel
#define ColormodContrastR 0.50 // Contrast for Red color
channel
#define ColormodContrastG 0.50 // ...
#define ColormodContrastB 0.50 // ...
#define ColormodBrightnessR -0.08 // Brightness for Red color channel
#define ColormodBrightnessG -0.08 // ...
#define ColormodBrightnessB -0.08 // ...
//SPHERICAL TONEMAP
#define sphericalAmount 1.0 //[0.0 to 2.0] Amount of spherical
tonemapping applied...sort of
//GODRAYS
#define GODRAYDEPTHCHECK 1 //[0 or 1] if 1, only pixels with depth =
1 get godrays, this prevents white objects from getting godray source which would
normally happen in LDR
#define GodraySamples 128 //[2^x format] How many samples the
godrays get
#define GodrayDecay 0.96 //[0.5 to 0.9999] How fast they
decay. It's logarithmic, 1.0 means infinite long rays which will cover whole screen
#define GodrayExposure 1.0 //[0.7 to 1.5] Upscales the godray's
brightness
#define GodrayWeight 1.25 //[0.8 to 1.7] weighting
#define GodrayDensity 1.0 //[0.2 to 2.0] Density of rays, higher
means more and brighter rays
#define GodrayThreshold 0.9 //[0.6 to 1.0] Minimum brightness
an object must have to cast godrays
//ANAMORPHIC LENSFLARE
#define ANAMFLAREDEPTHCHECK 1 //[0 or 1] if 1, only pixels with depth =
1 get an anamflare, this prevents white objects from getting flare source which
would normally happen in LDR
#define fFlareLuminance 0.95 //[0.6 to 1.0] bright pass luminance
value
#define fFlareBlur 200.0 // [1.0 to 9999999] manages the size of
the flare
#define fFlareIntensity 2.07 // [0.2 to 5.0] effect intensity
#define fFlareTint float3(0.137, 0.216, 1.0) // [0.0 to 2.0]
effect tint RGB
//CHROMATICABBERATION
#define ChromaticAmount 0.002 //[0.005 to 0.03] Amount of color
shifting
#define LensSize 0.500 //[0.5 to 1.0] some lens zoom to hide
bugged edges due to texcoord modification
#define LensDistortion 0.00 //[-0.3 to 0.3] distortion of
image, fish eye effect
#define LensDistortionCubic 0.00 //[-0.3 to 0.3] distortion of image, fish
eye effect, cube based
//LENZ FLARE
#define LENZDEPTHCHECK 1 //[0 or 1] if 1, only pixels with depth =
1 get lens flare, this prevents white objects from getting flare source which would
normally happen in LDR
#define LenzIntensity 1.5 //[0.2 to 3.0] power of lens flare effect
#define LenzThreshold 0.8 //[0.6 to 1.0] Minimum brightness an
object must have to cast lensflare
#define LenzDownsampling 5 //[0 to 7] Mipmap level of lensflare
texture. Too low value means too sharp lensflare, too high value means filtering
artifacts. Sweetspot is 4-6.
//NOISE GRAIN
#define fGrainMotion 0.001 //[0.0 to 0.1] speed of noise
change rate, 0.0 means static noise
#define fGrainSaturation 0.05 //[0.05 to 1.0] brightness and chroma
difference between the single noise pixels, 0 would mean plain black image added to
original image resulting in no noise at all.
#define fGrainIntensity 0.05 //[0.05 to 1.0] Power of noise
#define GrainIntensityBright 0.0 //[0.0 to 2.0] Intensity of Grain in
bright areas.
#define GrainIntensityMid 0.0 //[0.0 to 2.0] Intensity of Grain in
midtone areas.
#define GrainIntensityDark 10.0 //[0.0 to 2.0] Intensity of Grain in dark
areas.
//HD6VIGNETTE
#define LEFTANDRIGHT 0 //[0 or 1] self-explaining, I think. Keep
only one of these 3 booleans enabled!!
#define TOPANDBOTTOM 1 //[0 or 1] self-explaining, I think. Keep
only one of these 3 booleans enabled!!
#define CORNERDARKEN 0 //[0 or 1] self-explaining, I think. Keep
only one of these 3 booleans enabled!!
#define SquareTop 0.58
#define SquareBottom 0.58
#define CircularPower 0.0 //[0.0 to 100000.0] amount of circularism
(new word invented hoho), 0 means linear vignette, 100000.0 means rougly total
circle
#define ColorDistortion 0.0 //[0.0 to 5.0] distorts the colors a
bit
#define ContrastSharpen 11.6
#define VignetteBorder 6.5
//STANDARDVIGNETTE
#define EVignetteAmount 2.9 //[0.0 to 5.0] self-explaining variable
name
#define EVignetteCurve 1.5 //[0.0 to 5.0] self-explaining variable
name
#define EVignetteRadius 0.8 //[0.0 to 5.0] self-explaining variable
name
#define VIGNCOLORING 0 //[0 or 1] enables color override, RGB
controls below.
#define VIGNREDAMOUNT 0.0
#define VIGNGREENAMOUNT 5.0
#define VIGNBLUEAMOUNT 0.0
//COLOR HUE FX
#define USE_COLORSAT 0 //[0 or 1] This will use original color
saturation as an added limiter to the strength of the effect
#define hueMid 0.6 //[0.0 to 1.0] Hue (rotation around the color
wheel) of the color which you want to keep
#define hueRange 0.1 //[0.0 to 1.0] Range of different hue's
around the hueMid that will also kept. Using a max range of 1.0 will allow the
reverse of the effect where it will only filter a specific hue to B&W
#define satLimit 2.9 //[0.0 to 4.0] Saturation control, better keep
it higher than 0 for strong colors in contrast to the gray stuff around
#define fxcolorMix 0.8 //[0.0 to 1.0] Interpolation between the
original and the effect, 0 means full original image, 1 means full grey-color
image.
//+++++++++++++++++++++++++++++
//textures
texture2D texColor : COLOR;
#if (USE_RAYMARCH_AO == 1)
texture texAO { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; MipLevels = 1; Format
= RGBA32F;};
texture texAO2 { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; MipLevels = 1;
Format = RGBA32F;};
#endif
sampler2D SamplerColorLDR
{
Texture = texColor;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=1;
MipMapLodBias=0;
};
sampler2D SamplerColorHDR1
{
Texture = texColorHDR1;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=1;
MipMapLodBias=0;
};
sampler2D SamplerColorHDR2
{
Texture = texColorHDR2;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=1;
MipMapLodBias=0;
};
sampler2D SamplerMagicDOF
{
Texture = texMagicDOF;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=8;
MipMapLodBias=0;
};
#if (USE_RAYMARCH_AO == 1)
sampler2D SamplerAO
{
Texture = texAO;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=8;
MipMapLodBias=0;
};
sampler2D SamplerAO2
{
Texture = texAO2;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=8;
MipMapLodBias=0;
};
#endif
sampler2D SamplerDepth
{
Texture = texDepth;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};
sampler2D SamplerNoise
{
Texture = texNoise;
MinFilter = POINT;
MagFilter = POINT;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};
sampler2D SamplerDirt
{
Texture = texDirt;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};
sampler2D SamplerLut
{
Texture = texLut;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};
struct VS_OUTPUT_POST
{
float4 vpos : SV_Position;
float2 txcoord : TEXCOORD0;
};
struct VS_INPUT_POST
{
uint id : SV_VertexID;
};
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Vertex shader
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Functions
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
return float2(noiseX,noiseY);
}
#define fFlareAxis 0 // blur axis
//people should not change that due to changes I made to the shader (blur in y
direction so vertical flares would get no blur
//too lazy to adapt that so I'll keep it here
#if (ANAMFLAREDEPTHCHECK == 1)
float checkdepth = tex2D(SamplerDepth, tex).x;
if(checkdepth < 0.9999) result = 0;
#endif
return result;
float4 GaussBlur22(float2 coord, sampler tex, float mult, float lodlevel, int axis)
//texcoord, texture, blurmult in pixels, tex2dlod level, axis (0=horiz, 1=vert)
{
float4 sum = 0;
float weight[11] = {0.082607, 0.080977, 0.076276, 0.069041, 0.060049,
0.050187, 0.040306, 0.031105, 0.023066, 0.016436, 0.011254};
return sum;
float3 textureDistorted(
sampler2D tex,
float2 sample_center, // where we'd normally sample
float2 sample_vector,
float3 distortion // per-channel distortion coeffs
) {
return normalize(normal);
}
float3 ConvertToViewSpace(float2 pos)
{
float3 result;
result.xy = pos;
result.z = GetPowDepth(SamplerDepth, pos.xy).x;
return result;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Passes
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
colDF.x = tex2Dlod(SamplerColorHDR1,float4(coords +
float2(0.0,1.0)*pixelsize*fringe*blur,0,0)).x;
colDF.y = tex2Dlod(SamplerColorHDR1,float4(coords + float2(-0.866,-
0.5)*pixelsize*fringe*blur,0,0)).y;
colDF.z = tex2Dlod(SamplerColorHDR1,float4(coords + float2(0.866,-
0.5)*pixelsize*fringe*blur,0,0)).z;
return colorInput;
}
return saturate(colorInput);
}
colorInput = done;
return colorInput;
}
ttarget.rgb = ttemp.grg;
ttarget2.rgb = ttemp.bbr;
return colorInput.rgb;
float3x3 RGB =
float3x3(
2.67147117265996,-1.26723605786241,-0.410995602172227,
-1.02510702934664,1.98409116241089,0.0439502493584124,
0.0610009456429445,-0.223670750812863,1.15902104167061
);
float3x3 XYZ =
float3x3(
0.500303383543316,0.338097573222739,0.164589779545857,
0.257968894274758,0.676195259144706,0.0658358459823868,
0.0234517888692628,0.1126992737203,0.866839673124201
);
float3 B = InputColor.rgb;
B = pow(B, 1.0/DPXGamma);
B = B * (1.0 - DPXContrast) + (0.5 * DPXContrast);
float3 Btemp = (1.0 / (1.0 + exp(RGB_Curve / 2.0)));
B = ((1.0 / (1.0 + exp(-RGB_Curve * (B - RGB_C)))) / (-2.0 * Btemp + 1.0)) +
(-Btemp / (-2.0 * Btemp + 1.0));
return InputColor;
}
// -- Lift --
color = color * (1.5-0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5;
color = saturate(color); //isn't strictly necessary, but doesn't cost
performance.
// -- Gain --
color *= RGB_Gain;
// -- Gamma --
colorInput.rgb = pow(color, 1.0 / RGB_Gamma); //Gamma
// -- Return output --
//return (colorInput);
return saturate(colorInput);
}
return colorInput;
}
/*-----------------------------------------------------------.
/ Separation of Luma and Chroma /
'-----------------------------------------------------------*/
//calculate chroma
float3 chroma = colorInput.rgb - luma;
#endif
/*-----------------------------------------------------------.
/ Contrast formulas /
'-----------------------------------------------------------*/
// -- Curve 1 --
#if Curves_formula == 1
x = sin(PI * 0.5 * x); // Sin - 721 amd fps, +vign 536 nv
x *= x;
// -- Curve 2 --
#if Curves_formula == 2
x = x - 0.5;
x = ( x / (0.5 + abs(x)) ) + 0.5;
// -- Curve 3 --
#if Curves_formula == 3
//x = smoothstep(0.0,1.0,x); //smoothstep
x = x*x*(3.0-2.0*x); //faster smoothstep alternative - 776 amd fps, +vign 536
nv
//x = x - 2.0 * (x - 1.0) * x* (x- 0.5); //2.0 is contrast. Range is 0.0 to
2.0
#endif
// -- Curve 4 --
#if Curves_formula == 4
x = (1.0524 * exp(6.0 * x) - 1.05248) / (20.0855 + exp(6.0 * x)); //exp
formula
#endif
// -- Curve 5 --
#if Curves_formula == 5
//x = 0.5 * (x + 3.0 * x * x - 2.0 * x * x * x); //a simplified catmull-rom
(0,0,1,1) - btw smoothstep can also be expressed as a simplified catmull-rom using
(1,0,1,0)
//x = (0.5 * x) + (1.5 -x) * x*x; //estrin form - faster version
x = x * (x * (1.5-x) + 0.5); //horner form - fastest version
// -- Curve 6 --
#if Curves_formula == 6
x = x*x*x*(x*(x*6.0 - 15.0) + 10.0); //Perlins smootherstep
#endif
// -- Curve 7 --
#if Curves_formula == 7
//x = ((x-0.5) / ((0.5/(4.0/3.0)) + abs((x-0.5)*1.25))) + 0.5;
x = x - 0.5;
x = x / ((abs(x)*1.25) + 0.375 ) + 0.5;
//x = ( (x-0.5) / ((abs(x-0.5)*1.25) + (0.5/(4.0/3.0))) ) + 0.5;
#endif
// -- Curve 8 --
#if Curves_formula == 8
x = (x * (x * (x * (x * (x * (x * (1.6 * x - 7.2) + 10.8) - 4.2) - 3.6) +
2.7) - 1.8) + 2.7) * x * x; //Techicolor Cinestyle - almost identical to curve 1
#endif
// -- Curve 9 --
#if Curves_formula == 9
x = -0.5 * (x*2.0-1.0) * (abs(x*2.0-1.0)-2.0) + 0.5; //parabola
#endif
// -- Curve 10 --
#if Curves_formula == 10 //Half-circles
#if Curves_mode == 0
float xstep = step(x,0.5);
float xstep_shift = (xstep - 0.5);
float shifted_x = x + xstep_shift;
#else
float3 xstep = step(x,0.5);
float3 xstep_shift = (xstep - 0.5);
float3 shifted_x = x + xstep_shift;
#endif
//x = abs(step(x,0.5)-sqrt(-(x+step(x,0.5)-0.5)*(x+step(x,0.5)-0.5)+
(x+step(x,0.5)-0.5)))-(step(x,0.5)-0.5); //single line version of the above
//TODO: Check if I could use an abs split instead of step. It might be more
efficient
// -- Curve 11 --
#if Curves_formula == 11 //Cubic catmull
float a = 1.00; //control point 1
float b = 0.00; //start point
float c = 1.00; //endpoint
float d = 0.20; //control point 2
x = 0.5 * ((-a + 3*b -3*c + d)*x*x*x + (2*a -5*b + 4*c - d)*x*x + (-a+c)*x +
2*b); //A customizable cubic catmull-rom spline
#endif
// -- Curve 12 --
#if Curves_formula == 12 //Cubic Bezier spline
float a = 0.00; //start point
float b = 0.00; //control point 1
float c = 1.00; //control point 2
float d = 1.00; //endpoint
float r = (1-x);
float r2 = r*r;
float r3 = r2 * r;
float x2 = x*x;
float x3 = x2*x;
//x = dot(float4(a,b,c,d),float4(r3,3*r2*x,3*r*x2,x3));
// -- Curve 13 --
#if Curves_formula == 13 //Cubic Bezier spline - alternative implementation.
float3 a = float3(0.00,0.00,0.00); //start point
float3 b = float3(0.25,0.15,0.85); //control point 1
float3 c = float3(0.75,0.85,0.15); //control point 2
float3 d = float3(1.00,1.00,1.00); //endpoint
// -- Curve 14 --
#if Curves_formula == 14
x = 1.0 / (1.0 + exp(-(x * 10.0 - 5.0))); //alternative exp formula
#endif
/*-----------------------------------------------------------.
/ Joining of Luma and Chroma /
'-----------------------------------------------------------*/
#endif
// calculating amounts of input, grey and sepia colors to blend and combine
float grey = dot(sepia, LumCoeff);
sepia *= ColorTone;
#if (POSTPROCESS==1)
color.xyz = color.xyz / (grayadaptation * EAdaptationMaxV1 +
EAdaptationMinV1);
float cgray = dot( color.xyz, LumCoeff);
cgray = pow(cgray, EContrastV1);
float3 poweredcolor = pow( abs(color.xyz), EColorSaturationV1);
float newgray = dot(poweredcolor.xyz, LumCoeff);
color.xyz = poweredcolor.xyz * cgray / (newgray + 0.0001);
float3 luma = color.xyz;
float lumamax = 300.0;
color.xyz = ( color.xyz * (1.0 + color.xyz / lumamax)) / ( color.xyz +
EToneMappingCurveV1);
#endif
#if (POSTPROCESS==2)
color.xyz = color.xyz / (grayadaptation * EAdaptationMaxV2 +
EAdaptationMinV2);
float3 xncol = normalize( color.xyz);
float3 scl = color.xyz / xncol.xyz;
scl = pow(scl, EIntensityContrastV2);
xncol.xyz = pow(xncol.xyz, EColorSaturationV2);
color.xyz = scl*xncol.xyz;
float lumamax = EToneMappingOversaturationV2;
color.xyz = ( color.xyz * (1.0 + color.xyz / lumamax)) / ( color.xyz +
EToneMappingCurveV2);
color.xyz*=4;
#endif
#if (POSTPROCESS==3)
color.xyz *= 35;
float lumamax = EToneMappingOversaturationV3;
color.xyz = ( color.xyz * (1.0 + color.xyz / lumamax)) / ( color.xyz +
EToneMappingCurveV3);
#endif
#if (POSTPROCESS == 4)
color.xyz = color.xyz / (grayadaptation * EAdaptationMaxV4 +
EAdaptationMinV4);
float Y = dot( color.xyz, float3(0.299, 0.587, 0.114)); //0.299 * R + 0.587 *
G + 0.114 * B;
float U = dot( color.xyz, float3(-0.14713, -0.28886, 0.436)); //-0.14713 * R
- 0.28886 * G + 0.436 * B;
float V = dot( color.xyz, float3(0.615, -0.51499, -0.10001)); //0.615 * R -
0.51499 * G - 0.10001 * B;
Y = pow(Y, EBrightnessCurveV4);
Y = Y * EBrightnessMultiplierV4;
color.xyz = V * float3(1.13983, -0.58060, 0.0) + U * float3(0.0, -0.39465,
2.03211) + Y;
color.xyz = max( color.xyz, 0.0);
color.xyz = color.xyz / ( color.xyz + EBrightnessToneMappingCurveV4);
#endif
#if (POSTPROCESS == 5)
float hnd = 1;
float2 hndtweak = float2( 3.1 , 1.5 );
color.xyz *= lerp( hndtweak.x, hndtweak.y, hnd );
float3 xncol = normalize( color.xyz);
float3 scl = color.xyz/xncol.xyz;
scl = pow(scl, EIntensityContrastV5);
xncol.xyz = pow(xncol.xyz, EColorSaturationV5);
color.xyz = scl*xncol.xyz;
color.xyz *= HCompensateSatV5; // compensate for darkening caused my
EcolorSat above
color.xyz = color.xyz / ( color.xyz + EToneMappingCurveV5);
color.xyz *= 4;
#endif
#if (POSTPROCESS==6)
//Postprocessing V6 by Kermles
//tuned by the master himself for ME 1.4, thanks man!!!
//hd6/ppv2///////////////////////////////////////////
float EIntensityContrastV6 = EIntensityContrastV6Day;
float EColorSaturationV6 = EColorSaturationV6Day;
float HCompensateSatV6 = HCompensateSatV6Day;
float EToneMappingCurveV6 = EToneMappingCurveV6Day;
float EBrightnessV6 = EBrightnessV6Day;
float EToneMappingOversaturationV6 = EToneMappingOversaturationV6Day;
float EAdaptationMaxV6 = EAdaptationMaxV6Day;
float EAdaptationMinV6 = EAdaptationMinV6Day;
float lumamax = EToneMappingOversaturationV6;
//kermles////////////////////////////////////////////
float4 ncolor; //temporary variable for
color adjustments
//begin pp code/////////////////////////////////////////////////
//ppv2 modified by kermles//////////////////////////////////////
return color;
float3 FilmPass(float3 B)
{
float3 G = B;
float3 H = 0.01;
B = saturate(B);
B = pow(B, Linearization);
B = lerp(H, B, Contrast);
float a = FRedCurve;
float b = FGreenCurve;
float c = FBlueCurve;
float d = BaseCurve;
float3 C = B;
float3 Di = 1.0 - D;
float3 iF = F;
if (N < 0.5)
Cn = (2.0 * N - 1.0) * (F - F * F) + F;
else
Cn = (2.0 * N - 1.0) * (sqrt(F) - F) + F;
float2 res;
res.x = ScreenSize.x;
res.y = ScreenSize.x*ScreenSize.z;
float2 what;
what.x = 1 / ScreenSize.x;
what.y = 1 / (ScreenSize.x*ScreenSize.z);
// 2x2 matrix?
dithsix *= dithtwo;
dithsixy *= dithtwo;
dithfive *= dithtwo;
// . X . o . X . o . X . o . X
// v g x . v g x . v g x . v g
// . o . o . o . o . o . o . o
// x . v g x . v g x . v g x .
// . X . o . X . o . X . o . X
// v g v . v g v . v g v . v g
float3 dithapick;
float3 XX, oo, vv, xx, gg;
XX = 0.018f;
vv = 0.02f;
xx = 0.015f;
oo = -0.003f;
gg = -60.93f;
ditherX = dithone;
if (ditherX.b < 1.0f) ditherX.rgb = 0;
else ditherX.rgb = XX.rgb;
ditherx = diththree;
if (ditherx.r > 1.3f) ditherx.rgb = 0;
else ditherx.rgb = xx.rgb;
ditherv = dithone;
if (ditherv.b < 0.7f) ditherv.rgb = vv.rgb;
else ditherv.rgb = 0;
dithero = dithsix;
if (dithero.r > 2.2f) dithero.rgb = 0;
else dithero.rgb = -0.018f;
ditherg = dithsixy;
if (ditherg.r > 2.2f) ditherg.rgb = 0;
else ditherg.rgb = -0.006f;
dithapick = ditherv;
dithapick = ditherx + ditherX + ditherv + ditherg + dithero;
// This is the stupidest set of hacks ever to get just this stupid dither
// pattern. It obviously could be done better, but eh.......
// i'm bad at math :(
// Matrix numbers....
float3 dithonme;
float3 dithonyou;
dithonyou.rgb = colorInput.rgb;
//
// Reduce to 16-bit color
//
float why = 1;
float3 reduceme = 1;
float radooct = 32; // 32 is usually the proper value
colorInput.rgb = reduceme.rgb;
// END REDUCTION
// colorInput.r *= 1.1;
return colorInput;
}
#define COP
#define YRI
#define GHT
#define BY
#define MAR
#define TY
#define MC
#define FLY
return colorInput;
}
else
{
if ( colorHue >= hueMin_1 && colorHue <= hueMid )
fxcolor.xyz = lerp( greyVal.xxx, fxcolor.xyz,
smootherstep( hueMin_1, hueMid, colorHue ) * ( colorSat * satLimit ));
else if ( colorHue > hueMid && colorHue <= hueMax_1 )
fxcolor.xyz = lerp( greyVal.xxx, fxcolor.xyz, ( 1.0f -
smootherstep( hueMid, hueMax_1, colorHue )) * ( colorSat * satLimit ));
else
fxcolor.xyz = greyVal.xxx;
}
return color.xyz;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Pixel shaders
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
float2 pixelSize=ScreenSize.y;
pixelSize.y*=ScreenSize.z;
pixelSize.xy *= 2;
float4 bloom=0.0;
float2 bloomuv;
float2 offset[4]=
{
float2(1.0, 1.0),
float2(1.0, 1.0),
float2(-1.0, 1.0),
float2(-1.0, -1.0)
};
bloom *= 0.25;
return bloom;
}
float2 pixelSize=ScreenSize.y;
pixelSize.y*=ScreenSize.z;
pixelSize.xy *= 4;
float4 bloom=0.0;
float2 bloomuv;
float2 offset[8]=
{
float2(1.0, 1.0),
float2(0.0, -1.0),
float2(-1.0, 1.0),
float2(-1.0, -1.0),
float2(0.0, 1.0),
float2(0.0, -1.0),
float2(1.0, 0.0),
float2(-1.0, 0.0)
};
float2 pixelSize=ScreenSize.y;
pixelSize.y*=ScreenSize.z;
float4 bloom=0.0;
float2 bloomuv;
pixelSize.xy *= 8;
float2 offset[8]=
{
float2(0.707, 0.707),
float2(0.707, -0.707),
float2(-0.707, 0.707),
float2(-0.707, -0.707),
float2(0.0, 1.0),
float2(0.0, -1.0),
float2(1.0, 0.0),
float2(-1.0, 0.0)
};
bloom *= 0.5; //to brighten up the sample, it will lose brightness in H/V
gaussian blur
return bloom;
}
#if (DOF_AUTO == 1)
fDepth = linearize(tex2D(SamplerDepth,focus).x);
#endif
float a = (o*f)/(o-f);
float b = (d*f)/(d-f);
float c = (d-f)/(d*fstop*CoC);
blur = abs(a-b)*c;
#endif
blur = saturate(blur);
float2 noise = rand(IN.txcoord.xy)*namount*blur;
float w = (1.0/ScreenSize.x)*blur*maxblur+noise.x;
float h = (1.0/ScreenSize.x*ScreenSize.z)*blur*maxblur+noise.y;
[loop]
for (int g = 1; g <= rings; g += 1)
{
ringsamples = g * samples;
[loop]
for (int j = 0 ; j < ringsamples ; j += 1)
{
float step = PI*2.0 / ringsamples;
float pw = cos(j*step)*g;
float ph = sin(j*step)*g;
float p = 1.0;
float2 samplecoord = IN.txcoord.xy +float2(pw*w,ph*h);
#if (DOF_PENTAGONSHAPE == 1)
p = penta(float2(pw,ph));
#endif
#if( DOF_VIGNETTING == 1)
col *= vignette(IN.txcoord.xy,vignint);
#endif
return col;
}
#endif
#if (USE_MATSODOF==1)
float4 res;
float2 coord = IN.txcoord.xy;
float4 tcol = tex2D(SamplerColorHDR1, coord.xy);
float sd = tex2D(SamplerDepth, coord).x;
int axis = FIRST_PASS;
float sf = 0;
#if (USE_AUTOFOCUS == 1)
sf = tex2D(SamplerDepth, 0.5).x;
#endif
#if ( USE_SMOOTH_DOF == 1)
sf -= fFocusBias * 2.0;
#else
sf -= fFocusBias;
#endif
tdirs[axis].x *= fvTexelSize.x;
tdirs[axis].y *= fvTexelSize.y;
#if( USE_BOKEH_DOF == 1)
blur *= 0.25;
#endif
#if (USE_BOKEH_DOF == 0)
float w = 1.0 + abs(offset[i]); // weight blur for better effect
#else
float ds = tex2D(SamplerDepth, coord.xy).x;
float offs = DOF(ds, sf);
tcol /= wValue;
#if (USE_SPLITSCREEN==1)
return (IN.txcoord.x > 0.5) ? tex2D(SamplerColorHDR1, IN.txcoord) : tcol;
#endif
res.xyz = tcol.xyz;
res.w = 1.0;
return res;
}
float4 res;
float2 coord = IN.txcoord.xy;
float4 tcol = tex2D(SamplerColorHDR2, coord.xy);
float sd = tex2D(SamplerDepth, coord).x;
int axis = SECOND_PASS;
float sf = 0;
#if (USE_AUTOFOCUS == 1)
sf = tex2D(SamplerDepth, 0.5).x;
#endif
#if ( USE_SMOOTH_DOF == 1)
sf -= fFocusBias * 2.0;
#else
sf -= fFocusBias;
#endif
tdirs[axis].x *= fvTexelSize.x;
tdirs[axis].y *= fvTexelSize.y;
#if( USE_BOKEH_DOF == 1)
blur *= 0.25;
#endif
#if (USE_BOKEH_DOF == 0)
float w = 1.0 + abs(offset[i]); // weight blur for better effect
#else
float ds = tex2D(SamplerDepth, coord.xy).x;
float offs = DOF(ds, sf);
tcol /= wValue;
#if (USE_SPLITSCREEN==1)
return (IN.txcoord.x > 0.5) ? tex2D(SamplerColorHDR2, IN.txcoord) : tcol;
#endif
res.xyz = tcol.xyz;
res.w = 1.0;
return res;
}
float4 res;
float2 coord = IN.txcoord.xy;
float4 tcol = tex2D(SamplerColorHDR1, coord.xy);
float sd = tex2D(SamplerDepth, coord).x;
int axis = THIRD_PASS;
float sf = 0;
#if (USE_AUTOFOCUS == 1)
sf = tex2D(SamplerDepth, 0.5).x;
#endif
#if ( USE_SMOOTH_DOF == 1)
sf -= fFocusBias * 2.0;
#else
sf -= fFocusBias;
#endif
tdirs[axis].x *= fvTexelSize.x;
tdirs[axis].y *= fvTexelSize.y;
#if( USE_BOKEH_DOF == 1)
blur *= 0.25;
#endif
#if (USE_BOKEH_DOF == 0)
float w = 1.0 + abs(offset[i]); // weight blur for better effect
#else
float ds = tex2D(SamplerDepth, coord.xy).x;
float offs = DOF(ds, sf);
tcol /= wValue;
#if (USE_SPLITSCREEN==1)
return (IN.txcoord.x > 0.5) ? tex2D(SamplerColorHDR1, IN.txcoord) : tcol;
#endif
res.xyz = tcol.xyz;
res.w = 1.0;
return res;
}
float4 res;
float2 coord = IN.txcoord.xy;
float4 tcol = tex2D(SamplerColorHDR2, coord.xy);
float sd = tex2D(SamplerDepth, coord).x;
int axis = FOURTH_PASS;
float sf = 0;
#if (USE_AUTOFOCUS == 1)
sf = tex2D(SamplerDepth, 0.5).x;
#endif
#if ( USE_SMOOTH_DOF == 1)
sf -= fFocusBias * 2.0;
#else
sf -= fFocusBias;
#endif
tdirs[axis].x *= fvTexelSize.x;
tdirs[axis].y *= fvTexelSize.y;
#if( USE_BOKEH_DOF == 1)
blur *= 0.25;
#endif
#if (USE_BOKEH_DOF == 0)
float w = 1.0 + abs(offset[i]); // weight blur for better effect
#else
float ds = tex2D(SamplerDepth, coord.xy).x;
float offs = DOF(ds, sf);
#if (USE_SPLITSCREEN==1)
return (IN.txcoord.x > 0.5) ? tex2D(SamplerColorHDR2, IN.txcoord) : tcol;
#endif
res.xyz = tcol.xyz;
res.w = 1.0;
return res;
}
#endif
#if( USE_GP65CJ042DOF == 1)
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return tex2D(SamplerColorHDR1, coord.xy);
#endif
float2 uvsrc=FocusPoint;
float2 pixelSize=ScreenSize.y;
pixelSize.y*=ScreenSize.z;
float scenefocus=resdepth;
#if (AUTO_FOCUS == 0)
scenefocus = ManualFocusDepth; //+1 damit es bei 0 nicht 0 ist denn 1 ist das
Niedrigste was sein kann ohne bugs
#endif
res.xyz=origcolor.xyz;
float depth=linearlizeDepth(scenedepth);
float focalPlaneDepth=scenefocus;
float farBlurDepth=scenefocus*pow(4.0, FarBlurCurve);
#if( TILT_SHIFT == 1)
float shiftAngle=(frac(TiltShiftAngle / 90.0) == 0) ? 0.0 :
TiltShiftAngle;
float depthShift=1.0 + (0.5 - coord.x)*tan(-shiftAngle * 0.017453292);
focalPlaneDepth*=depthShift;
farBlurDepth*=depthShift;
#endif
#if ( NOT_BLURRING_SKY_MODE == 1)
#define DEPTH_OF_FIELD_QULITY 0
res.w=(depth > 1000.0) ? 0.5 : res.w;
#endif
return res;
}
float4 PS_GPDOFBokehblur(VS_OUTPUT_POST IN) : COLOR
{
float4 res;
float2 coord=IN.txcoord.xy;
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return origcolor;
#endif
float centerDepth=origcolor.w;
float2 pixelSize=ScreenSize.y;
pixelSize.y*=ScreenSize.z;
res.xyz=origcolor.xyz;
res.w=dot(res.xyz, 0.3333);
res.w=max((res.w - BokehBrightnessThreshold) * BokehBrightnessMultipiler,
0.0);
res.xyz*=1.0 + res.w*blurAmount;
res.w=1.0;
int sampleCycle=0;
int sampleCycleCounter=0;
int sampleCounterInCycle=0;
#if ( POLYGONAL_BOKEH == 1)
float basedAngle=360.0 / POLYGON_NUM;
float2 currentVertex;
float2 nextVertex;
#if ( POLYGONAL_BOKEH == 1)
sampleCycle+=POLYGON_NUM;
currentVertex.xy=float2(1.0 , 0.0);
sincos(basedAngle* 0.017453292, nextVertex.y,
nextVertex.x);
#else
sampleCycle+=8;
#endif
}
sampleCounterInCycle++;
#if (POLYGONAL_BOKEH==1)
float sampleAngle=basedAngle / float(sampleCycleCounter) *
sampleCounterInCycle;
float remainAngle=frac(sampleAngle / basedAngle) * basedAngle;
if(remainAngle == 0)
{
currentVertex=nextVertex;
sincos((sampleAngle + basedAngle) * 0.017453292,
nextVertex.y, nextVertex.x);
}
sampleOffset*=sampleCycleCounter / float(DEPTH_OF_FIELD_QULITY);
float2 coordLow=coord.xy + (pixelSize.xy * sampleOffset.xy *
discRadius);
float4 tap=tex2D(SamplerColorHDR2, coordLow.xy);
weight*=1.0 + BokehBias *
pow(float(sampleCycleCounter)/float(DEPTH_OF_FIELD_QULITY), BokehBiasCurve);
res.xyz+=tap.xyz * weight;
res.w+=weight;
}
res.xyz /= res.w;
res.w=centerDepth;
return res;
}
float2 pixelSize=ScreenSize.y;
pixelSize.y*=ScreenSize.z;
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return origcolor;
#endif
float depth=origcolor.w;
float blurAmount=abs(depth*2.0 - 1.0);
blurAmount *= BokehPostBlur;
res.w=depth;
return res;
}
float2 pixelSize=ScreenSize.y;
pixelSize.y*=ScreenSize.z;
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return origcolor;
#endif
float depth=origcolor.w;
float blurAmount=abs(depth*2.0 - 1.0);
blurAmount *= BokehPostBlur;
res.w=depth;
return res;
}
#endif
//global variables
float2 pixelsize = float2(ScreenSize.y,ScreenSize.y*ScreenSize.z);
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
#if (USE_CARTOON == 1)
color.xyz = CartoonPass(color.xyz, IN.txcoord.xy, pixelsize.xy);
#endif
//colors
#if (USE_LUT == 1)
color.x = tex2D(SamplerLut, float2(color.x, 1.0)).x;
color.y = tex2D(SamplerLut, float2(color.y, 1.0)).y;
color.z = tex2D(SamplerLut, float2(color.z, 1.0)).z;
#endif
#if (USE_LEVELS== 1)
color.xyz = LevelsPass(color.xyz);
#endif
#if (USE_TECHNICOLOR == 1)
color.xyz = TechniPass_prod80(color.xyz);
#endif
#if (USE_SWFX_TECHNICOLOR == 1)
color.xyz = TechnicolorPass(color.xyz);
#endif
#if (USE_DPX == 1)
color.xyz = DPXPass(color.xyz);
#endif
#if (USE_MONOCHROME == 1)
color.xyz = dot(color.xyz, 0.333);
#endif
#if (USE_LIFTGAMMAGAIN == 1)
color.xyz = LiftGammaGainPass(color.xyz);
#endif
#if (USE_TONEMAP == 1)
color.xyz = TonemapPass(color.xyz);
#endif
#if (USE_VIBRANCE == 1)
color.xyz = VibrancePass(color.xyz);
#endif
#if (USE_CURVES == 1)
color.xyz = CurvesPass(color.xyz);
#endif
#if (USE_SEPIA == 1)
color.xyz = SepiaPass(color.xyz);
#endif
#if (USE_SKYRIMTONEMAP == 1)
color.xyz = SkyrimTonemapPass(color.xyz);
#endif
#if (USE_COLORMOOD == 1)
color.xyz = MoodPass(color.xyz);
#endif
#if (USE_CROSSPROCESS == 1)
color.xyz = CrossPass(color.xyz);
#endif
#if (USE_FILMICPASS == 1)
color.xyz = FilmPass(color.xyz);
#endif
#if (USE_REINHARDLINEAR == 1)
color.xyz = ReinhardLinearToneMapping(color.xyz);
#endif
#if (USE_REINHARD == 1)
color.xyz = ReinhardToneMapping(color.xyz);
#endif
#if (USE_HPD == 1)
color.xyz = HaarmPeterDuikerFilmicToneMapping(color.xyz);
#endif
#if (USE_FILMICCURVE == 1)
color.xyz = CustomToneMapping(color.xyz);
#endif
#if (USE_COLORMOD == 1)
color.xyz = ColormodPass(color.xyz);
#endif
#if (USE_SPHERICALTONEMAP == 1)
color.xyz = SphericalPass(color.xyz);
#endif
#if (USE_LEIFX == 1)
color = LeiFX_Reduct(color, IN.txcoord.xy);
#endif
return color;
//global variables
float2 pixelsize = float2(ScreenSize.y,ScreenSize.y*ScreenSize.z);
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
float4 coord=0.0;
coord.xy=IN.txcoord.xy;
coord.w=0.0;
float3 eta =
float3(1.0+ChromaticAmount*0.9,1.0+ChromaticAmount*0.6,1.0+ChromaticAmount*0.3);
float2 center;
center.x = coord.x-0.5;
center.y = coord.y-0.5;
float LensZoom = 1.0/LensSize;
float x = f*LensZoom*(coord.x-0.5)+0.5;
float y = f*LensZoom*(coord.y-0.5)+0.5;
float2 rCoords = (f*eta.r)*LensZoom*(center.xy*0.5)+0.5;
float2 gCoords = (f*eta.g)*LensZoom*(center.xy*0.5)+0.5;
float2 bCoords = (f*eta.b)*LensZoom*(center.xy*0.5)+0.5;
color.xyz = schmotzcolor.xyz;
return color;
//global variables
float2 pixelsize = float2(ScreenSize.y,ScreenSize.y*ScreenSize.z);
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
#if( USE_GODRAYS == 1)
float2 ScreenLightPos = float2(0.5, 0.5);
float2 texCoord = IN.txcoord.xy;
float2 deltaTexCoord = (texCoord.xy - ScreenLightPos.xy);
deltaTexCoord *= 1.0 / (float)GodraySamples * GodrayDensity;
texCoord -= deltaTexCoord;;
float4 sample2 = tex2D(SamplerColorHDR2, texCoord.xy);
float sampledepth = tex2D(SamplerDepth, texCoord.xy).x;
sample2.w = saturate(dot(sample2.xyz, 0.3333) - GodrayThreshold);
sample2.r *= 1.0;
sample2.g *= 0.95;
sample2.b *= 0.85;
sample2 *= illuminationDecay * GodrayWeight;
#if (GODRAYDEPTHCHECK == 1)
if(sampledepth>0.9999) color.xyz += sample2.xyz*sample2.w;
#else
color += sample2;
#endif
illuminationDecay *= GodrayDecay;
}
#endif
#if (USE_LENZFLARE == 1)
float3 lfoffset[19]={
float3(0.9, 0.01, 4),
float3(0.7, 0.25, 25),
float3(0.3, 0.25, 15),
float3(1, 1.0, 5),
float3(-0.15, 20, 1),
float3(-0.3, 20, 1),
float3(6, 6, 6),
float3(7, 7, 7),
float3(8, 8, 8),
float3(9, 9, 9),
float3(0.24, 1, 10),
float3(0.32, 1, 10),
float3(0.4, 1, 10),
float3(0.5, -0.5, 2),
float3(2, 2, -5),
float3(-5, 0.2, 0.2),
float3(20, 0.5, 0),
float3(0.4, 1, 10),
float3(0.00001, 10, 20)
};
float3 lffactors[19]={
float3(1.5, 1.5, 0),
float3(0, 1.5, 0),
float3(0, 0, 1.5),
float3(0.2, 0.25, 0),
float3(0.15, 0, 0),
float3(0, 0, 0.15),
float3(1.4, 0, 0),
float3(1, 1, 0),
float3(0, 1, 0),
float3(0, 0, 1.4),
float3(1, 0.3, 0),
float3(1, 1, 0),
float3(0, 2, 4),
float3(0.2, 0.1, 0),
float3(0, 0, 1),
float3(1, 1, 0),
float3(1, 1, 0),
float3(0, 0, 0.2),
float3(0.012,0.313,0.588)
};
float3 lenstemp = 0;
#if (LENZDEPTHCHECK == 1)
float templensdepth = tex2D(SamplerDepth, lfcoord.xy).x;
if(templensdepth < 0.9999) lenstemp1 = 0;
#endif
lenstemp += lenstemp1;
}
color.xyz += lenstemp.xyz*LenzIntensity;
#endif
#if(USE_ANAMFLARE == 1)
#endif
#if (USE_BLOOM == 1)
float3 colorbloom=0;
colorbloom.xyz = saturate(colorbloom.xyz);
float colorbloomgray = dot(colorbloom.xyz, 0.333);
colorbloom.xyz = lerp(colorbloomgray, colorbloom.xyz, fBloomSaturation);
colorbloom.xyz *= fBloomTint;
float colorgray = dot(color.xyz, 0.333);
#if(USE_GAUSSIAN_ANAMFLARE == 1)
float3 anamflare = tex2D(SamplerBloom5, IN.txcoord.xy).w*2*fAnamFlareColor;
anamflare.xyz = max(anamflare.xyz,0);
color.xyz += pow(anamflare.xyz,1/fAnamFlareCurve);
#endif
#if(USE_LENSDIRT == 1)
float lensdirtmult = dot(tex2D(SamplerBloom5, IN.txcoord.xy).xyz,0.333);
float3 dirttex = tex2D(SamplerDirt, IN.txcoord.xy).xyz;
float3 lensdirt = dirttex.xyz*lensdirtmult*fLensdirtIntensity;
color.xyz += lensdirt.xyz;
#endif
#if(USE_CHAPMAN_LENS == 1)
float2 sample_vector = (float2(0.5,0.5) - IN.txcoord.xy) *
ChapFlareDispersal;
float2 halo_vector = normalize(sample_vector) * ChapFlareSize;
}
chaplens *= 1/float(ChapFlareCount);
color.xyz += chaplens;
#endif
return color;
//global variables
float2 pixelsize = float2(ScreenSize.y,ScreenSize.y*ScreenSize.z);
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
#if (USE_SHARPENING == 1)
color.xyz = SharpPass(color.xyz, IN.txcoord.xy, pixelsize.xy);
#endif
//color.xyz = abs(frac(Timer.x*0.9999)-0.5);
#if(USE_GRAIN == 1)
#endif
return color;
//global variables
float2 pixelsize = float2(ScreenSize.y,ScreenSize.y*ScreenSize.z);
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
#if (USE_LEIFX == 1)
color = LeiFX_Gamma(color,IN.txcoord.xy);
#endif
#if (USE_EXPLOSION == 1)
color.xyz = ExplosionPass(color.xyz, IN.txcoord.xy, pixelsize.xy);
#endif
#if (USE_SINCITY == 1)
float sinlumi = dot(color.rgb, float3(0.30f,0.59f,0.11f));
if(color.r > (color.g + 0.2f) && color.r > (color.b + 0.025f))
{
color.rgb = float3(sinlumi, 0, 0)*1.5;
}
else
{
color.rgb = sinlumi;
}
#endif
#if (USE_COLORHUEFX == 1)
color.xyz = colorhuefx_prod80(color.xyz);
#endif
#if (USE_BORISVIGNETTE==1)
float2 uv=(IN.txcoord-0.5)*EVignetteRadius;
float vignetteold=saturate(dot(uv.xy, uv.xy));
vignetteold=pow(vignetteold, EVignetteCurve);
#if (VIGNCOLORING==1)
float3 EVignetteColor=float3(VIGNREDAMOUNT, VIGNGREENAMOUNT,
VIGNBLUEAMOUNT);
#else
float3 EVignetteColor=float3(0.0, 0.0, 0.0);
#endif
color.xyz=lerp(color.xyz, EVignetteColor, vignetteold*EVignetteAmount);
#endif
#if (USE_HD6_VIGNETTE==1)
float rovigpwr = CircularPower; //for a circular vignette
float2 sqvigpwr = float2( SquareTop, SquareBottom ); // for the top and
bottom of the screen
float vsatstrength = ColorDistortion; // color distortion
float vignettepow = ContrastSharpen; // increases the contrast and sharpness
float vstrengthatnight = VignetteBorder;
#if (LEFTANDRIGHT==1)
float3 topv = min((inTex.x+0.5)*2,1.5) * 2; // top
float3 botv = min(((0-inTex.x)+0.5)*2,1.5) * 2; // botton
topv= lerp(float3(1,1,1), topv, sqvigpwr.x);
botv= lerp(float3(1,1,1), botv, sqvigpwr.y);
vigtex.xyz = (topv)*(botv);
#endif
#if (TOPANDBOTTOM==1)
float3 topv = min((inTex.y+0.5)*2,1.5) * 2; // top
float3 botv = min(((0-inTex.y)+0.5)*2,1.5) * 2; // botton
topv= lerp(float3(1,1,1), topv, sqvigpwr.x);
botv= lerp(float3(1,1,1), botv, sqvigpwr.y);
vigtex.xyz = (topv)*(botv);
#endif
#if (CORNERDARKEN==1)
float3 rightv = min((inTex.x+0.5)*2,1.5) * 2;
float3 leftv = min(((0-inTex.x)+0.5)*2,1.5) * 2;
float3 topv = min((inTex.y+0.5)*2,1.5) * 2;
float3 botv = min(((0-inTex.y)+0.5)*2,1.5) * 2;
rightv= lerp(float3(1,1,1), rightv, sqvigpwr.y);
leftv= lerp(float3(1,1,1), leftv, sqvigpwr.x);
topv= lerp(float3(1,1,1), topv, sqvigpwr.x);
botv= lerp(float3(1,1,1), botv, sqvigpwr.y);
vigtex.xyz = (topv)*(botv)*(rightv)*(leftv);
#endif
#if (USE_BORDER==1)
float2 distancefromcenter = abs(IN.txcoord.xy - 0.5);
bool2 screen_border = step(0.5 - pixelsize,distancefromcenter);
color.xyz = (!dot(screen_border, 1.0)) ? color.xyz : 0.0;
#endif
#if (USE_MOVIEBARS == 1)
color.xyz = IN.txcoord.y > 0.12 && IN.txcoord.y < 0.88 ? color.xyz : 0.0;
#endif
#if(USE_DEPTHBUFFER_OUTPUT == 1)
color.xyz = pow(saturate(tex2D(SamplerDepth, IN.txcoord.xy).x),50);
#endif
return color;
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
float3x3 matRotate;
#if(SSAO_SmartSampling==1)
if(SceneDepthScaled > 0.33) Sample_Scaled=max(8,round(Sample_Scaled*0.5));
if(SceneDepthScaled > 0.66) Sample_Scaled=max(8,round(Sample_Scaled*0.5));
#endif
if(SceneDepthScaled > 0.99) Sample_Scaled=0;
[loop]
for (int i = 0 ; i < (Sample_Scaled / 8) ; i++)
for (int x = -1 ; x <= 1 ; x += 2)
for (int y = -1 ; y <= 1 ; y += 2)
for (int z = -1 ; z <= 1 ; z += 2) {
//Create offset vector
float3 vOffset = normalize(float3(x, y, z)) * (offsetScale *=
fOffsetScaleStep);
//Rotate the offset vector
float3 vRotatedOffset = mul(vOffset, matRotate);
#if(SSAO_DepthFade==1)
fAccessibility = lerp(fAccessibility,0.5,SceneDepthScaled);
#endif
color.w = fAccessibility;
return color;
//global variables
float2 pixelsize = float2(ScreenSize.y,ScreenSize.y*ScreenSize.z);
float4 color = tex2D(SamplerColorHDR2, IN.txcoord.xy);
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
color.a *= weight[0];
return color;
//global variables
float2 pixelsize = float2(ScreenSize.y,ScreenSize.y*ScreenSize.z);
float4 color = tex2D(SamplerColorHDR1, IN.txcoord.xy);
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
color.a *= weight[0];
AOresult -= 0.5;
if(AOresult < 0) AOresult *= SSAO_DarkeningAmount;
if(AOresult > 0) AOresult *= SSAO_BrighteningAmount;
AOresult = 2.0*saturate(AOresult+0.5);
#if(SSAO_Debug == 0)
color.xyz *= AOresult;
#else
color.xyz = AOresult*0.5;
#endif
color.a = 1.0;
return color;
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return color;
#endif
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return res;
#endif
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return res;
#endif
#define FXAA_Linear 0
//moved outside user reach, he/she will not tinker with sRGB anyways
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return tex2D(SamplerColorHDR1, IN.txcoord.xy);
#endif
float4 rgbyM;
rgbyM.xyz = FxaaTexTop(SamplerColorHDR1, pos.xy).xyz;
rgbyM.w = dot(rgbyM.xyz, float3(0.299, 0.587, 0.114));
float lumaE = dot(FxaaTexOff(SamplerColorHDR1, pos.xy, float2( 1, 0),
rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaS = dot(FxaaTexOff(SamplerColorHDR1, pos.xy, float2( 0, 1),
rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaM = rgbyM.w;
gradientN *= FXAASearchThreshold;
#if (FXAA_Linear == 1)
lumaL *= lumaL;
#endif
float lumaF = dot(rgbF, float3(0.299, 0.587, 0.114)) + (1.0/(65536.0*256.0));
float lumaB = lerp(lumaF, lumaL, blendL);
float scale = min(4.0, lumaB/lumaF);
rgbF *= scale;
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return tex2D(SamplerColorHDR2, IN.txcoord.xy);
#endif
float4 rgbyM;
rgbyM.xyz = FxaaTexTop(SamplerColorHDR2, pos.xy).xyz;
rgbyM.w = dot(rgbyM.xyz, float3(0.299, 0.587, 0.114));
float lumaE = dot(FxaaTexOff(SamplerColorHDR2, pos.xy, float2( 1, 0),
rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaS = dot(FxaaTexOff(SamplerColorHDR2, pos.xy, float2( 0, 1),
rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaM = rgbyM.w;
gradientN *= FXAASearchThreshold;
#if (FXAA_Linear == 1)
lumaL *= lumaL;
#endif
float lumaF = dot(rgbF, float3(0.299, 0.587, 0.114)) + (1.0/(65536.0*256.0));
float lumaB = lerp(lumaF, lumaL, blendL);
float scale = min(4.0, lumaB/lumaF);
rgbF *= scale;
float GetMagicDepth(float f)
{
return pow(abs(f),50);
}
for(int r=0;r<6;r++)
{
float t = (float)r;
t *= 3.1415*2/6;
float2 coord = float2(cos(t),sin(t));
coord.y *= ScreenSize.z;
coord *= fcRadius;
float depth =
GetMagicDepth(tex2Dlod(SamplerDepth,float4(coord+foccenter,0,0)).x);
depthsum+=depth;
}
#if(fMagicManualFocusEnable == 1)
return fMagicManualFocusPlane;
#endif
return depthsum/6;
}
//if(IN.txcoord.x > 0.498 && IN.txcoord.y > 0.298 && IN.txcoord.x < 0.502 &&
IN.txcoord.y < 0.302) scenecolor.xyz *= 1000; // test
return float4(scenecolor.xyz, scenedepth);
}
float4 res,tapres;
float mask=1;
float totalweight=0;
res = tex2D(SamplerColorHDR2, IN.txcoord.xy);
float scenedepth = res.a;
float focusdepth = GetMagicFocDepth(fMagicFocusPoint);
float2 pixelSize=float2(ScreenSize.y, ScreenSize.y*ScreenSize.z);
[loop]
for (int i = -fMagicBlurQuality; i <= fMagicBlurQuality; ++i)
{
float2 tapoffset = float2((float)i*pixelSize.x*discRadius,0);
tapres = tex2Dlod(SamplerColorHDR2,
float4(IN.txcoord.xy+tapoffset,0,0));
mask = 1;
if(tapres.a < scenedepth && abs(tapres.a-focusdepth)*scenedepth < 0.4 )
mask = 0;
res.xyz += tapres.xyz*mask;
totalweight+=mask;
}
res.xyz /= totalweight;
return float4(res.xyz,scenedepth);
}
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return tex2D(SamplerColorHDR2, IN.txcoord.xy);
#endif
float4 res,tapres1,tapres2;
float mask=1;
float totalweight=0;
res = tex2D(SamplerColorHDR2, IN.txcoord.xy);
float3 origcolor = res.xyz;
float scenedepth = res.a;
float focusdepth = GetMagicFocDepth(fMagicFocusPoint);
float2 pixelSize=float2(ScreenSize.y, ScreenSize.y*ScreenSize.z);
res.xyz = 0;
[loop]
for (int i = -fMagicBlurQuality; i <= fMagicBlurQuality; ++i)
{
float2 tapoffset = float2((float)i*pixelSize.x*discRadius*0.5,
(float)i*pixelSize.y*discRadius*0.5*tan(60*PIOVER180));
tapres1 = tex2Dlod(SamplerMagicDOF,
float4(IN.txcoord.xy+tapoffset,0,lodlevel));
tapres2 = tex2Dlod(SamplerMagicDOF, float4(IN.txcoord.xy+float2(-
tapoffset.x,tapoffset.y),0,lodlevel));
mask = 1;
if( abs(tapres1.a - focusdepth) < 0.08 && scenedepth > focusdepth+0.08)
mask = 0;
tapres1.xyz *= mask;
totalweight += mask;
res.xyz += pow(min(tapres1.xyz, tapres2.xyz),fMagicColorCurve);
}
res.xyz /= totalweight;
res.xyz = saturate(pow(saturate(res.xyz), 1/fMagicColorCurve));
return res;
}
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return 0;
#endif
float4 vOutColor;
float3 vRandom, vReflRay, vViewNormal;
float fCurrDepth, fSampleDepth, fDepthDelta, fAO;
fCurrDepth = GetPowDepth(SamplerDepth, IN.txcoord.xy).x;
fDepthDelta *= 1-smoothstep(0,RayAO_MaxDepth,fDepthDelta);
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return 0;
#endif
float4 res;
if(IN.txcoord.x > 1/(float)RayAO_Scale || IN.txcoord.y > 1/
(float)RayAO_Scale) discard;
res.xyz = GaussBlur22(IN.txcoord.xy, SamplerAO, 1/(float)RayAO_Scale, 0,
0).x;
return float4(res.xyz,1);
}
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return 0;
#endif
float4 res;
if(IN.txcoord.x > 1/(float)RayAO_Scale || IN.txcoord.y > 1/
(float)RayAO_Scale) discard;
res.xyz = GaussBlur22(IN.txcoord.xy, SamplerAO2, 1/(float)RayAO_Scale, 0,
1).x;
return float4(res.xyz,1);
}
#if (USE_SPLITSCREEN == 1)
if(IN.txcoord.x > 0.5) return tex2D(SamplerColorLDR, IN.txcoord.xy);
#endif
#if(RayAO_Debug == 1)
res.xyz = aores;
#else
res.xyz *= aores;
#endif
return float4(res.xyz,1);
}
#endif
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Techniques
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
technique MasterEffect < bool enabled = true; int toggle = ReShade_ToggleKey; >
{
#if (USE_BLOOM == 1 || USE_GAUSSIAN_ANAMFLARE == 1 || USE_LENSDIRT == 1)
pass BloomPrePass
{
VertexShader = VS_PostProcess;
PixelShader = PS_BloomPrePass;
RenderTarget = texBloom1;
}
pass BloomPass1
{
VertexShader = VS_PostProcess;
PixelShader = PS_BloomPass1;
RenderTarget = texBloom2;
}
pass BloomPass2
{
VertexShader = VS_PostProcess;
PixelShader = PS_BloomPass2;
RenderTarget = texBloom3;
}
pass BloomPass3
{
VertexShader = VS_PostProcess;
PixelShader = PS_BloomPass3;
RenderTarget = texBloom4;
}
pass BloomPass4
{
VertexShader = VS_PostProcess;
PixelShader = PS_BloomPass4;
RenderTarget = texBloom5;
}
#endif
pass MasterEffectInitHDR
{
VertexShader = VS_PostProcess;
PixelShader = PS_EmptyPassInit;
RenderTarget = texColorHDR1;
}
#if(USE_RAYMARCH_AO ==1)
pass RayAOGen
{
VertexShader = VS_PostProcess;
PixelShader = PS_RayAOGen;
RenderTarget = texAO;
}
pass RayAOBlurH
{
VertexShader = VS_PostProcess;
PixelShader = PS_RayAOBlurH;
RenderTarget = texAO2;
}
pass RayAOBlurV
{
VertexShader = VS_PostProcess;
PixelShader = PS_RayAOBlurV;
RenderTarget = texAO;
}
pass RayAOCombine
{
VertexShader = VS_PostProcess;
PixelShader = PS_RayAOCombine;
RenderTarget = texColorHDR1;
}
#endif
#if (USE_SSAO == 1)
pass SSAOGen
{
VertexShader = VS_PostProcess;
PixelShader = PS_SSAOGen; //tex2
RenderTarget = texColorHDR2;
}
pass SSAOBlurH
{
VertexShader = VS_PostProcess;
PixelShader = PS_SSAOBlurH; //tex1
RenderTarget = texColorHDR1;
}
pass SSAOBlurV
{
VertexShader = VS_PostProcess;
PixelShader = PS_SSAOBlurV; //tex2
RenderTarget = texColorHDR2;
}
pass EmptyHDR1
{
VertexShader = VS_PostProcess;
PixelShader = PS_EmptyPassHDR1;
RenderTarget = texColorHDR1;
}
#endif
#if(USE_MAGIC_DOF==1)
pass MagicDOFCoC
{
VertexShader = VS_PostProcess;
PixelShader = PS_MagicDOFCoC;
RenderTarget = texColorHDR2;
}
pass MagicDOF1
{
VertexShader = VS_PostProcess;
PixelShader = PS_MagicDOF1;
RenderTarget = texMagicDOF;
}
pass MagicDOF2
{
VertexShader = VS_PostProcess;
PixelShader = PS_MagicDOF2;
RenderTarget = texColorHDR1;
}
#endif
pass EmptyHDR2
{
VertexShader = VS_PostProcess;
PixelShader = PS_EmptyPassHDR1;
RenderTarget = texColorHDR1;
}
#endif
#if(USE_TILTSHIFT == 1)
pass TiltShiftCoC
{
VertexShader = VS_PostProcess;
PixelShader = PS_TiltShiftCoC; //tex2
RenderTarget = texColorHDR2;
}
pass TiltShiftH
{
VertexShader = VS_PostProcess;
PixelShader = PS_TiltShiftH; //tex1
RenderTarget = texColorHDR1;
}
pass TiltShiftV
{
VertexShader = VS_PostProcess;
PixelShader = PS_TiltShiftV; //tex2
RenderTarget = texColorHDR2;
}
pass EmptyHDR3
{
VertexShader = VS_PostProcess;
PixelShader = PS_EmptyPassHDR1;
RenderTarget = texColorHDR1;
}
#endif
pass Image
{
VertexShader = VS_PostProcess;
PixelShader = PS_Image; //tex2
RenderTarget = texColorHDR2;
}
#if (USE_CHROMATICABBERATION == 1)
pass Distort
{
VertexShader = VS_PostProcess;
PixelShader = PS_Distort; //tex1
RenderTarget = texColorHDR1;
}
pass EmptyHDR4
{
VertexShader = VS_PostProcess;
PixelShader = PS_EmptyPassHDR2;
RenderTarget = texColorHDR2;
}
#endif
pass Lighting
{
VertexShader = VS_PostProcess;
PixelShader = PS_Lighting;
RenderTarget = texColorHDR1;
} //tex1
pass Colors
{
VertexShader = VS_PostProcess;
PixelShader = PS_Colors;
RenderTarget = texColorHDR2;
}//tex2
#if(USE_FXAA == 1)
#if(FXAANum == 2 || FXAANum == 4 || FXAANum == 6 || FXAANum == 8)
pass FXAA1
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA2;
RenderTarget = texColorHDR1;
}
pass FXAA2
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA1;
RenderTarget = texColorHDR2;
}
#endif
#if(FXAANum == 4 || FXAANum == 6 || FXAANum == 8)
pass FXAA3
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA2;
RenderTarget = texColorHDR1;
}
pass FXAA4
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA1;
RenderTarget = texColorHDR2;
}
#endif
#if(FXAANum == 6 || FXAANum == 8)
pass FXAA5
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA2;
RenderTarget = texColorHDR1;
}
pass FXAA6
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA1;
RenderTarget = texColorHDR2;
}
#endif
#if(FXAANum == 8)
pass FXAA7
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA2;
RenderTarget = texColorHDR1;
}
pass FXAA8
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA1;
RenderTarget = texColorHDR2;
}
#endif
#endif
pass Overlay
{
VertexShader = VS_PostProcess;
PixelShader = PS_Overlay;
}//nix