├── .gitattributes ├── README.md ├── v3.X ├── ReShade.ini ├── dxgi.dll └── reshade-shaders │ ├── Shader Library │ ├── Alternate │ │ ├── Bloom.fx │ │ ├── CinematicDOF.fx │ │ ├── Colourfulness.fx │ │ ├── DOF.fx │ │ ├── FakeHDR.fx │ │ ├── Glitch.fx │ │ ├── HSLShift.fx │ │ ├── LUT.fx │ │ ├── Levels.fx │ │ ├── LightDoF.fx │ │ ├── MXAO.fx │ │ ├── MagicBloom.fx │ │ ├── UIMask.fx │ │ ├── Vibrance.fx │ │ └── Vignette.fx │ └── Recommended │ │ ├── 3DFX.fx │ │ ├── ASCII.fx │ │ ├── AdaptiveFog.fx │ │ ├── AdaptiveSharpen.fx │ │ ├── AmbientLight.fx │ │ ├── Border.fx │ │ ├── CRT.fx │ │ ├── Cartoon.fx │ │ ├── Chromakey.fx │ │ ├── ChromaticAberration.fx │ │ ├── Clarity.fx │ │ ├── ColorMatrix.fx │ │ ├── Curves.fx │ │ ├── DPX.fx │ │ ├── Daltonize.fx │ │ ├── Deband.fx │ │ ├── Denoise.fx │ │ ├── Depth3D.fx │ │ ├── DepthHaze.fx │ │ ├── DisplayDepth.fx │ │ ├── Emphasize.fx │ │ ├── EyeAdaption.fx │ │ ├── FXAA.fx │ │ ├── FakeMotionBlur.fx │ │ ├── FilmGrain.fx │ │ ├── FilmGrain2.fx │ │ ├── FilmicAnamorphSharpen.fx │ │ ├── FilmicPass.fx │ │ ├── FineSharp.fx │ │ ├── GaussianBlur.fx │ │ ├── HQ4X.fx │ │ ├── HighPassSharpen.fx │ │ ├── Layer.fx │ │ ├── LiftGammaGain.fx │ │ ├── LumaSharpen.fx │ │ ├── Monochrome.fx │ │ ├── MultiLUT.fx │ │ ├── NightVision.fx │ │ ├── Nostalgia.fx │ │ ├── PerfectPerspective.fx │ │ ├── Prism.fx │ │ ├── ReflectiveBumpMapping.fx │ │ ├── SMAA.fx │ │ ├── Sepia.fx │ │ ├── Splitscreen.fx │ │ ├── SurfaceBlur.fx │ │ ├── Technicolor.fx │ │ ├── Technicolor2.fx │ │ ├── TiltShift.fx │ │ ├── Tonemap.fx │ │ ├── UIDetect.fx │ │ ├── qUINT_bloom.fx │ │ ├── qUINT_common.fxh │ │ ├── qUINT_dof.fx │ │ ├── qUINT_lightroom.fx │ │ ├── qUINT_mxao.fx │ │ └── qUINT_ssr.fx │ ├── Shaders │ ├── DrawText.fxh │ ├── FXAA.fxh │ ├── README.txt │ ├── ReShade.fxh │ ├── SMAA.fxh │ ├── UIDetect.fxh │ └── qUINT_common.fxh │ └── Textures │ ├── AreaTex.dds │ ├── Dirt.png │ ├── DirtOVB.png │ ├── DirtOVR.png │ ├── FontAtlas.png │ ├── Layer.png │ ├── LensDB.png │ ├── LensDB2.png │ ├── LensDOV.png │ ├── LensDUV.png │ ├── LensSprite.png │ ├── MagicBloom_Dirt.png │ ├── MultiLut_atlas1.png │ ├── SearchTex.dds │ ├── UIMask.png │ ├── bayer16x16.png │ └── lut.png └── v4.X ├── ReShade.ini ├── dxgi.dll └── reshade-shaders ├── Shader Library ├── Alternate │ ├── Bloom.fx │ ├── CinematicDOF.fx │ ├── Colourfulness.fx │ ├── DOF.fx │ ├── LUT.fx │ ├── Levels.fx │ ├── LightDoF.fx │ ├── MXAO.fx │ ├── UIMask.fx │ ├── Vibrance.fx │ └── Vignette.fx └── Recommended │ ├── 3DFX.fx │ ├── ASCII.fx │ ├── AdaptiveFog.fx │ ├── AdaptiveSharpen.fx │ ├── AmbientLight.fx │ ├── Border.fx │ ├── CRT.fx │ ├── Cartoon.fx │ ├── Chromakey.fx │ ├── ChromaticAberration.fx │ ├── Clarity.fx │ ├── ColorMatrix.fx │ ├── Curves.fx │ ├── DPX.fx │ ├── Daltonize.fx │ ├── Deband.fx │ ├── Denoise.fx │ ├── Depth3D.fx │ ├── DepthHaze.fx │ ├── DisplayDepth.fx │ ├── Emphasize.fx │ ├── EyeAdaption.fx │ ├── FXAA.fx │ ├── FakeHDR.fx │ ├── FakeMotionBlur.fx │ ├── FilmGrain.fx │ ├── FilmGrain2.fx │ ├── FilmicAnamorphSharpen.fx │ ├── FilmicPass.fx │ ├── FineSharp.fx │ ├── GaussianBlur.fx │ ├── Glitch.fx │ ├── HQ4X.fx │ ├── HSLShift.fx │ ├── HighPassSharpen.fx │ ├── Layer.fx │ ├── LevelsPlus.fx │ ├── LiftGammaGain.fx │ ├── LumaSharpen.fx │ ├── MagicBloom.fx │ ├── Monochrome.fx │ ├── MultiLUT.fx │ ├── NightVision.fx │ ├── Nostalgia.fx │ ├── PerfectPerspective.fx │ ├── Prism.fx │ ├── ReflectiveBumpMapping.fx │ ├── SMAA.fx │ ├── Sepia.fx │ ├── Splitscreen.fx │ ├── StageDepth.fx │ ├── SurfaceBlur.fx │ ├── Technicolor.fx │ ├── Technicolor2.fx │ ├── TiltShift.fx │ ├── Tonemap.fx │ ├── TriDither.fx │ ├── UIDetect.fx │ ├── qUINT_bloom.fx │ ├── qUINT_dof.fx │ ├── qUINT_lightroom.fx │ ├── qUINT_mxao.fx │ └── qUINT_ssr.fx ├── Shaders ├── DrawText.fxh ├── FXAA.fxh ├── Macros.fxh ├── ReShade.fxh ├── ReShadeUI.fxh ├── SMAA.fxh ├── UIDetect.fxh └── qUINT_common.fxh └── Textures ├── AreaTex.dds ├── Dirt.png ├── DirtOVB.png ├── DirtOVR.png ├── FontAtlas.png ├── Layer.png ├── LensDB.png ├── LensDB2.png ├── LensDOV.png ├── LensDUV.png ├── LensSprite.png ├── MagicBloom_Dirt.png ├── MultiLut_atlas1.png ├── SearchTex.dds ├── Stage.png ├── UIMask.png ├── bayer16x16.png └── lut.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Installation Guide: 2 | http://stormshade.otakumouse.com/installation-guide/ 3 | -------------------------------------------------------------------------------- /v3.X/ReShade.ini: -------------------------------------------------------------------------------- 1 | [DX11_BUFFER_DETECTION] 2 | DepthBufferRetrievalMode=0 3 | DepthBufferTextureFormat=0 4 | ExtendedDepthBufferDetection=0 5 | DepthBufferClearingNumber=0 6 | 7 | [GENERAL] 8 | ScreenshotPath 9 | PerformanceMode=0 10 | TextureSearchPaths= 11 | EffectSearchPaths= 12 | TutorialProgress=5 13 | PreprocessorDefinitions=RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=1000.0,RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0,RESHADE_DEPTH_INPUT_IS_REVERSED=0,RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0 14 | CurrentPreset=0 15 | PresetFiles= 16 | ScreenshotFormat=0 17 | ShowClock=0 18 | ShowFPS=0 19 | FontGlobalScale=1.000000 20 | NoReloadOnInit=0 21 | SaveWindowState=0 22 | 23 | [INPUT] 24 | KeyMenu=113,0,1,0 25 | InputProcessing=1 26 | KeyScreenshot=44,0,0,0 27 | KeyReload=0,0,0,0 28 | KeyEffects=114,0,1,0 29 | 30 | [STYLE] 31 | ColFPSText=1.000000,1.000000,0.784314 32 | ColActive=0.392157,0.588235,0.941176 33 | Alpha=1.000000 34 | ColBackground=0.117647,0.117647,0.117647 35 | ColText=0.862745,0.862745,0.862745 36 | ColItemBackground=0.156863,0.156863,0.156863 37 | 38 | -------------------------------------------------------------------------------- /v3.X/dxgi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/dxgi.dll -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Alternate/Colourfulness.fx: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2017, bacondither 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions 6 | // are met: 7 | // 1. Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer 9 | // in this position and unchanged. 10 | // 2. Redistributions in binary form must reproduce the above copyright 11 | // notice, this list of conditions and the following disclaimer in the 12 | // documentation and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 15 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | // Colourfulness - version 2017-05-01 26 | // EXPECTS FULL RANGE GAMMA LIGHT 27 | 28 | uniform float colourfulness < 29 | ui_type = "drag"; 30 | ui_min = -1.0; ui_max = 2.0; 31 | ui_tooltip = "Degree of colourfulness, 0 = neutral"; 32 | ui_step = 0.01; 33 | > = 0.4; 34 | 35 | uniform float lim_luma < 36 | ui_type = "drag"; 37 | ui_min = 0.1; ui_max = 1.0; 38 | ui_tooltip = "Lower vals allow more change near clipping"; 39 | ui_step = 0.01; 40 | > = 0.7; 41 | 42 | //------------------------------------------------------------------------------------------------- 43 | #ifndef fast_luma 44 | #define fast_luma 1 // Rapid approx of sRGB gamma, small difference in quality 45 | #endif 46 | //------------------------------------------------------------------------------------------------- 47 | 48 | #include "Reshade.fxh" 49 | 50 | // Sigmoid function, sign(v)*pow(pow(abs(v), -2) + pow(s, -2), 1.0/-2) 51 | #define soft_lim(v,s) ( (v*s)*rcp(sqrt(s*s + v*v)) ) 52 | 53 | // Weighted power mean, p = 0.5 54 | #define wpmean(a,b,w) ( pow(abs(w)*sqrt(abs(a)) + abs(1-w)*sqrt(abs(b)), 2) ) 55 | 56 | // Max/Min RGB components 57 | #define maxRGB(c) ( max((c).r, max((c).g, (c).b)) ) 58 | #define minRGB(c) ( min((c).r, min((c).g, (c).b)) ) 59 | 60 | // Mean of Rec. 709 & 601 luma coefficients 61 | #define lumacoeff float3(0.2558, 0.6511, 0.0931) 62 | 63 | float3 Colourfulness(float4 vpos : SV_Position, float2 tex : TEXCOORD) : SV_Target 64 | { 65 | #if (fast_luma == 1) 66 | float3 c0 = tex2D(ReShade::BackBuffer, tex).rgb; 67 | float luma = sqrt(dot(saturate(c0*abs(c0)), lumacoeff)); 68 | c0 = saturate(c0); 69 | #else // Better approx of sRGB gamma 70 | float3 c0 = saturate(tex2D(ReShade::BackBuffer, tex).rgb); 71 | float luma = pow(dot(pow(c0 + 0.06, 2.4), lumacoeff), 1.0/2.4) - 0.06; 72 | #endif 73 | 74 | // Calc colour saturation change 75 | float3 diff_luma = c0 - luma; 76 | float3 c_diff = diff_luma*(colourfulness + 1) - diff_luma; 77 | 78 | if (colourfulness > 0.0) 79 | { 80 | // 120% of c_diff clamped to max visible range + overshoot 81 | float3 rlc_diff = clamp((c_diff*1.2) + c0, -0.0001, 1.0001) - c0; 82 | 83 | // Calc max saturation-increase without altering RGB ratios 84 | float poslim = (1.0002 - luma)/(abs(maxRGB(diff_luma)) + 0.0001); 85 | float neglim = (luma + 0.0002)/(abs(minRGB(diff_luma)) + 0.0001); 86 | 87 | float3 diffmax = diff_luma*min(min(poslim, neglim), 32) - diff_luma; 88 | 89 | // Soft limit diff 90 | c_diff = soft_lim( c_diff, max(wpmean(diffmax, rlc_diff, lim_luma), 1e-6) ); 91 | } 92 | 93 | return saturate(c0 + c_diff); 94 | } 95 | 96 | technique Colourfulness 97 | { 98 | pass 99 | { 100 | VertexShader = PostProcessVS; 101 | PixelShader = Colourfulness; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Alternate/FakeHDR.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * HDR 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Not actual HDR - It just tries to mimic an HDR look (relatively high performance cost) 6 | */ 7 | 8 | uniform float HDRPower < 9 | ui_type = "drag"; 10 | ui_min = 0.0; ui_max = 8.0; 11 | ui_label = "Power"; 12 | > = 1.30; 13 | uniform float radius1 < 14 | ui_type = "drag"; 15 | ui_min = 0.0; ui_max = 8.0; 16 | ui_label = "Radius 1"; 17 | > = 0.793; 18 | uniform float radius2 < 19 | ui_type = "drag"; 20 | ui_min = 0.0; ui_max = 8.0; 21 | ui_label = "Radius 2"; 22 | ui_tooltip = "Raising this seems to make the effect stronger and also brighter."; 23 | > = 0.87; 24 | 25 | #include "ReShade.fxh" 26 | 27 | float3 HDRPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 28 | { 29 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 30 | 31 | float3 bloom_sum1 = tex2D(ReShade::BackBuffer, texcoord + float2(1.5, -1.5) * radius1 * ReShade::PixelSize).rgb; 32 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2(-1.5, -1.5) * radius1 * ReShade::PixelSize).rgb; 33 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2( 1.5, 1.5) * radius1 * ReShade::PixelSize).rgb; 34 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2(-1.5, 1.5) * radius1 * ReShade::PixelSize).rgb; 35 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2( 0.0, -2.5) * radius1 * ReShade::PixelSize).rgb; 36 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2( 0.0, 2.5) * radius1 * ReShade::PixelSize).rgb; 37 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2(-2.5, 0.0) * radius1 * ReShade::PixelSize).rgb; 38 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2( 2.5, 0.0) * radius1 * ReShade::PixelSize).rgb; 39 | 40 | bloom_sum1 *= 0.005; 41 | 42 | float3 bloom_sum2 = tex2D(ReShade::BackBuffer, texcoord + float2(1.5, -1.5) * radius2 * ReShade::PixelSize).rgb; 43 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2(-1.5, -1.5) * radius2 * ReShade::PixelSize).rgb; 44 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2( 1.5, 1.5) * radius2 * ReShade::PixelSize).rgb; 45 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2(-1.5, 1.5) * radius2 * ReShade::PixelSize).rgb; 46 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2( 0.0, -2.5) * radius2 * ReShade::PixelSize).rgb; 47 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2( 0.0, 2.5) * radius2 * ReShade::PixelSize).rgb; 48 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2(-2.5, 0.0) * radius2 * ReShade::PixelSize).rgb; 49 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2( 2.5, 0.0) * radius2 * ReShade::PixelSize).rgb; 50 | 51 | bloom_sum2 *= 0.010; 52 | 53 | float dist = radius2 - radius1; 54 | float3 HDR = (color + (bloom_sum2 - bloom_sum1)) * dist; 55 | float3 blend = HDR + color; 56 | color = pow(abs(blend), abs(HDRPower)) + HDR; // pow - don't use fractions for HDRpower 57 | 58 | return saturate(color); 59 | } 60 | 61 | technique HDR 62 | { 63 | pass 64 | { 65 | VertexShader = PostProcessVS; 66 | PixelShader = HDRPass; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Alternate/Glitch.fx: -------------------------------------------------------------------------------- 1 | #include "ReShade.fxh" 2 | 3 | #define PI 3.14159265 4 | #define TILE_SIZE 16.0 5 | 6 | uniform float Timer < source = "timer"; >; 7 | 8 | uniform float Amount < 9 | ui_type = "drag"; 10 | ui_min = 0.0; 11 | ui_max = 10.0; 12 | ui_tooltip = "Glitch Amount [Glitch B]"; 13 | > = 1.0; 14 | 15 | uniform bool bUseUV < 16 | ui_type = "combo"; 17 | ui_tooltip = "Use UV for Glitch [Glitch B]"; 18 | > = false; 19 | 20 | float fmod(float a, float b) { 21 | float c = frac(abs(a / b)) * abs(b); 22 | return a < 0 ? -c : c; 23 | } 24 | 25 | float3 rgb2hsv(float3 c) 26 | { 27 | float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 28 | float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g)); 29 | float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r)); 30 | 31 | float d = q.x - min(q.w, q.y); 32 | float e = 1.0e-10; 33 | return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 34 | } 35 | 36 | float3 hsv2rgb(float3 c) 37 | { 38 | float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); 39 | float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www); 40 | return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); 41 | } 42 | 43 | float3 posterize(float3 color, float steps) 44 | { 45 | return floor(color * steps) / steps; 46 | } 47 | 48 | float quantize(float n, float steps) 49 | { 50 | return floor(n * steps) / steps; 51 | } 52 | 53 | float4 downsample(sampler2D samp, float2 uv, float pixelSize) 54 | { 55 | return tex2D(samp, uv - fmod(uv, float2(pixelSize,pixelSize) / ReShade::ScreenSize.xy)); 56 | } 57 | 58 | float rand(float n) 59 | { 60 | return frac(sin(n) * 43758.5453123); 61 | } 62 | 63 | float noise(float p) 64 | { 65 | float fl = floor(p); 66 | float fc = frac(p); 67 | return lerp(rand(fl), rand(fl + 1.0), fc); 68 | } 69 | 70 | float rand(float2 n) 71 | { 72 | return frac(sin(dot(n, float2(12.9898, 4.1414))) * 43758.5453); 73 | } 74 | 75 | float noise(float2 p) 76 | { 77 | float2 ip = floor(p); 78 | float2 u = frac(p); 79 | u = u * u * (3.0 - 2.0 * u); 80 | 81 | float res = lerp( 82 | lerp(rand(ip), rand(ip + float2(1.0, 0.0)), u.x), 83 | lerp(rand(ip + float2(0.0,1.0)), rand(ip + float2(1.0,1.0)), u.x), u.y); 84 | return res * res; 85 | } 86 | 87 | float3 edge(sampler2D samp, float2 uv, float sampleSize) 88 | { 89 | float dx = sampleSize / ReShade::ScreenSize.x; 90 | float dy = sampleSize / ReShade::ScreenSize.y; 91 | return ( 92 | lerp(downsample(samp, uv - float2(dx, 0.0), sampleSize), downsample(samp, uv + float2(dx, 0.0), sampleSize), fmod(uv.x, dx) / dx) + 93 | lerp(downsample(samp, uv - float2(0.0, dy), sampleSize), downsample(samp, uv + float2(0.0, dy), sampleSize), fmod(uv.y, dy) / dy) 94 | ).rgb / 2.0 - tex2D(samp, uv).rgb; 95 | } 96 | 97 | float3 distort(sampler2D samp, float2 uv, float edgeSize) 98 | { 99 | float2 pixel = float2(1.0,1.0) / ReShade::ScreenSize.xy; 100 | float3 field = rgb2hsv(edge(samp, uv, edgeSize)); 101 | float2 distort = pixel * sin((field.rb) * PI * 2.0); 102 | float shiftx = noise(float2(quantize(uv.y + 31.5, ReShade::ScreenSize.y / TILE_SIZE) * Timer*0.001, frac(Timer*0.001) * 300.0)); 103 | float shifty = noise(float2(quantize(uv.x + 11.5, ReShade::ScreenSize.x / TILE_SIZE) * Timer*0.001, frac(Timer*0.001) * 100.0)); 104 | float3 rgb = tex2D(samp, uv + (distort + (pixel - pixel / 2.0) * float2(shiftx, shifty) * (50.0 + 100.0 * Amount)) * Amount).rgb; 105 | float3 hsv = rgb2hsv(rgb); 106 | hsv.y = fmod(hsv.y + shifty * pow(Amount, 5.0) * 0.25, 1.0); 107 | return posterize(hsv2rgb(hsv), floor(lerp(256.0, pow(1.0 - hsv.z - 0.5, 2.0) * 64.0 * shiftx + 4.0, 1.0 - pow(1.0 - Amount, 5.0)))); 108 | } 109 | 110 | float4 PS_Glitch ( float4 pos : SV_Position, float2 fragCoord : TEXCOORD0) : SV_Target 111 | { 112 | float4 fragColor; 113 | float wow; 114 | float Amount; 115 | 116 | float2 texcoord = fragCoord * ReShade::ScreenSize; //this is because the original shader uses OpenGL's fragCoord, which is in texels rather than pixels 117 | float2 uv = texcoord.xy / ReShade::ScreenSize.xy; 118 | if (bUseUV) { 119 | Amount = uv.x; // Just erase this line if you want to use the control at the top 120 | } 121 | wow = clamp(fmod(noise(Timer*0.001 + uv.y), 1.0), 0.0, 1.0) * 2.0 - 1.0; 122 | float3 finalColor; 123 | finalColor += distort(ReShade::BackBuffer, uv, 8.0); 124 | return float4(finalColor, 1.0); 125 | } 126 | 127 | technique GlitchB { 128 | pass GlitchB { 129 | VertexShader=PostProcessVS; 130 | PixelShader=PS_Glitch; 131 | } 132 | } -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Alternate/LUT.fx: -------------------------------------------------------------------------------- 1 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | // ReShade effect file 3 | // visit facebook.com/MartyMcModding for news/updates 4 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 | // Marty's LUT shader 1.0 for ReShade 3.0 6 | // Copyright © 2008-2016 Marty McFly 7 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 | 9 | #ifndef fLUT_TextureName 10 | #define fLUT_TextureName "lut.png" 11 | #endif 12 | #ifndef fLUT_TileSizeXY 13 | #define fLUT_TileSizeXY 32 14 | #endif 15 | #ifndef fLUT_TileAmount 16 | #define fLUT_TileAmount 32 17 | #endif 18 | 19 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 20 | // 21 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 22 | 23 | uniform float fLUT_AmountChroma < 24 | ui_type = "drag"; 25 | ui_min = 0.00; ui_max = 1.00; 26 | ui_label = "LUT chroma amount"; 27 | ui_tooltip = "Intensity of color/chroma change of the LUT."; 28 | > = 1.00; 29 | 30 | uniform float fLUT_AmountLuma < 31 | ui_type = "drag"; 32 | ui_min = 0.00; ui_max = 1.00; 33 | ui_label = "LUT luma amount"; 34 | ui_tooltip = "Intensity of luma change of the LUT."; 35 | > = 1.00; 36 | 37 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 38 | // 39 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 40 | 41 | #include "ReShade.fxh" 42 | texture texLUT < source = fLUT_TextureName; > { Width = fLUT_TileSizeXY*fLUT_TileAmount; Height = fLUT_TileSizeXY; Format = RGBA8; }; 43 | sampler SamplerLUT { Texture = texLUT; }; 44 | 45 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 46 | // 47 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 48 | 49 | void PS_LUT_Apply(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 res : SV_Target0) 50 | { 51 | float4 color = tex2D(ReShade::BackBuffer, texcoord.xy); 52 | float2 texelsize = 1.0 / fLUT_TileSizeXY; 53 | texelsize.x /= fLUT_TileAmount; 54 | 55 | float3 lutcoord = float3((color.xy*fLUT_TileSizeXY-color.xy+0.5)*texelsize.xy,color.z*fLUT_TileSizeXY-color.z); 56 | float lerpfact = frac(lutcoord.z); 57 | lutcoord.x += (lutcoord.z-lerpfact)*texelsize.y; 58 | 59 | float3 lutcolor = lerp(tex2D(SamplerLUT, lutcoord.xy).xyz, tex2D(SamplerLUT, float2(lutcoord.x+texelsize.y,lutcoord.y)).xyz,lerpfact); 60 | 61 | color.xyz = lerp(normalize(color.xyz), normalize(lutcolor.xyz), fLUT_AmountChroma) * 62 | lerp(length(color.xyz), length(lutcolor.xyz), fLUT_AmountLuma); 63 | 64 | res.xyz = color.xyz; 65 | res.w = 1.0; 66 | } 67 | 68 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 69 | // 70 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 71 | 72 | 73 | technique LUT 74 | { 75 | pass LUT_Apply 76 | { 77 | VertexShader = PostProcessVS; 78 | PixelShader = PS_LUT_Apply; 79 | } 80 | } -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Alternate/Levels.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Levels version 1.2 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Allows you to set a new black and a white level. 6 | * This increases contrast, but clips any colors outside the new range to either black or white 7 | * and so some details in the shadows or highlights can be lost. 8 | * 9 | * The shader is very useful for expanding the 16-235 TV range to 0-255 PC range. 10 | * You might need it if you're playing a game meant to display on a TV with an emulator that does not do this. 11 | * But it's also a quick and easy way to uniformly increase the contrast of an image. 12 | * 13 | * -- Version 1.0 -- 14 | * First release 15 | * -- Version 1.1 -- 16 | * Optimized to only use 1 instruction (down from 2 - a 100% performance increase :) ) 17 | * -- Version 1.2 -- 18 | * Added the ability to highlight clipping regions of the image with #define HighlightClipping 1 19 | */ 20 | 21 | uniform int BlackPoint < 22 | ui_type = "drag"; 23 | ui_min = 0; ui_max = 255; 24 | ui_tooltip = "The black point is the new black - literally. Everything darker than this will become completely black."; 25 | > = 16; 26 | 27 | uniform int WhitePoint < 28 | ui_type = "drag"; 29 | ui_min = 0; ui_max = 255; 30 | ui_tooltip = "The new white point. Everything brighter than this becomes completely white"; 31 | > = 235; 32 | 33 | uniform bool HighlightClipping < 34 | ui_tooltip = "Colors between the two points will stretched, which increases contrast, but details above and below the points are lost (this is called clipping).\n" 35 | "This setting marks the pixels that clip.\n" 36 | "Red: Some detail is lost in the highlights\n" 37 | "Yellow: All detail is lost in the highlights\n" 38 | "Blue: Some detail is lost in the shadows\n" 39 | "Cyan: All detail is lost in the shadows."; 40 | > = false; 41 | 42 | #include "ReShade.fxh" 43 | 44 | float3 LevelsPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 45 | { 46 | float black_point_float = BlackPoint / 255.0; 47 | float white_point_float = WhitePoint == BlackPoint ? (255.0 / 0.00025) : (255.0 / (WhitePoint - BlackPoint)); // Avoid division by zero if the white and black point are the same 48 | 49 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 50 | color = color * white_point_float - (black_point_float * white_point_float); 51 | 52 | if (HighlightClipping) 53 | { 54 | float3 clipped_colors; 55 | 56 | clipped_colors = any(color > saturate(color)) // any colors whiter than white? 57 | ? float3(1.0, 0.0, 0.0) 58 | : color; 59 | clipped_colors = all(color > saturate(color)) // all colors whiter than white? 60 | ? float3(1.0, 1.0, 0.0) 61 | : clipped_colors; 62 | clipped_colors = any(color < saturate(color)) // any colors blacker than black? 63 | ? float3(0.0, 0.0, 1.0) 64 | : clipped_colors; 65 | clipped_colors = all(color < saturate(color)) // all colors blacker than black? 66 | ? float3(0.0, 1.0, 1.0) 67 | : clipped_colors; 68 | 69 | color = clipped_colors; 70 | } 71 | 72 | return color; 73 | } 74 | 75 | technique Levels 76 | { 77 | pass 78 | { 79 | VertexShader = PostProcessVS; 80 | PixelShader = LevelsPass; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Alternate/Vibrance.fx: -------------------------------------------------------------------------------- 1 | /** 2 | Vibrance 3 | by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | 5 | Vibrance intelligently boosts the saturation of pixels so pixels that had little color get a larger boost than pixels that had a lot. 6 | This avoids oversaturation of pixels that were already very saturated. 7 | 8 | History: 9 | 10 | Version 1.0 by Ceejay.dk 11 | - Original 12 | Version 1.1 by CeeJay.dk 13 | - Introduced RBG balance to help colorblind users 14 | Version 1.1.1 15 | - Minor UI improvements for Reshade 3.x 16 | */ 17 | 18 | uniform float Vibrance < 19 | ui_type = "drag"; 20 | ui_min = -1.0; ui_max = 1.0; 21 | ui_tooltip = "Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation."; 22 | > = 0.15; 23 | 24 | uniform float3 VibranceRGBBalance < 25 | ui_type = "drag"; 26 | ui_min = 0.0; ui_max = 10.0; 27 | ui_label = "RGB Balance"; 28 | ui_tooltip = "A per channel multiplier to the Vibrance strength so you can give more boost to certain colors over others.\nThis is handy if you are colorblind and less sensitive to a specific color.\nYou can then boost that color more than the others."; 29 | > = float3(1.0, 1.0, 1.0); 30 | 31 | /* 32 | uniform int Vibrance_Luma < 33 | ui_type = "combo"; 34 | ui_label = "Luma type"; 35 | ui_items = "Perceptual\0Even\0"; 36 | > = 0; 37 | */ 38 | 39 | #include "ReShade.fxh" 40 | 41 | float3 VibrancePass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target 42 | { 43 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 44 | 45 | float3 coefLuma = float3(0.212656, 0.715158, 0.072186); 46 | 47 | /* 48 | if (Vibrance_Luma) 49 | coefLuma = float3(0.333333, 0.333334, 0.333333); 50 | */ 51 | 52 | float luma = dot(coefLuma, color); 53 | 54 | 55 | float max_color = max(color.r, max(color.g, color.b)); // Find the strongest color 56 | float min_color = min(color.r, min(color.g, color.b)); // Find the weakest color 57 | 58 | float color_saturation = max_color - min_color; // The difference between the two is the saturation 59 | 60 | // Extrapolate between luma and original by 1 + (1-saturation) - current 61 | float3 coeffVibrance = float3(VibranceRGBBalance * Vibrance); 62 | color = lerp(luma, color, 1.0 + (coeffVibrance * (1.0 - (sign(coeffVibrance) * color_saturation)))); 63 | 64 | return color; 65 | } 66 | 67 | technique Vibrance 68 | { 69 | pass 70 | { 71 | VertexShader = PostProcessVS; 72 | PixelShader = VibrancePass; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Alternate/Vignette.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Vignette version 1.3 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Darkens the edges of the image to make it look more like it was shot with a camera lens. 6 | * May cause banding artifacts. 7 | */ 8 | 9 | uniform int Type < 10 | ui_type = "combo"; 11 | ui_items = "Original\0New\0TV style\0Untitled 1\0Untitled 2\0Untitled 3\0Untitled 4\0"; 12 | > = 0; 13 | uniform float Ratio < 14 | ui_type = "drag"; 15 | ui_min = 0.15; ui_max = 6.0; 16 | ui_tooltip = "Sets a width to height ratio. 1.00 (1/1) is perfectly round, while 1.60 (16/10) is 60 % wider than it's high."; 17 | > = 1.0; 18 | uniform float Radius < 19 | ui_type = "drag"; 20 | ui_min = -1.0; ui_max = 3.0; 21 | ui_tooltip = "lower values = stronger radial effect from center"; 22 | > = 2.0; 23 | uniform float Amount < 24 | ui_type = "drag"; 25 | ui_min = -2.0; ui_max = 1.0; 26 | ui_tooltip = "Strength of black. -2.00 = Max Black, 1.00 = Max White."; 27 | > = -1.0; 28 | uniform int Slope < 29 | ui_type = "drag"; 30 | ui_min = 2; ui_max = 16; 31 | ui_tooltip = "How far away from the center the change should start to really grow strong (odd numbers cause a larger fps drop than even numbers)."; 32 | > = 2; 33 | uniform float2 Center < 34 | ui_type = "drag"; 35 | ui_min = 0.0; ui_max = 1.0; 36 | ui_tooltip = "Center of effect for 'Original' vignette type. 'New' and 'TV style' do not obey this setting."; 37 | > = float2(0.5, 0.5); 38 | 39 | #include "ReShade.fxh" 40 | 41 | float4 VignettePass(float4 vpos : SV_Position, float2 tex : TexCoord) : SV_Target 42 | { 43 | float4 color = tex2D(ReShade::BackBuffer, tex); 44 | 45 | if (Type == 0) 46 | { 47 | // Set the center 48 | float2 distance_xy = tex - Center; 49 | 50 | // Adjust the ratio 51 | distance_xy *= float2((ReShade::PixelSize.y / ReShade::PixelSize.x), Ratio); 52 | 53 | // Calculate the distance 54 | distance_xy /= Radius; 55 | float distance = dot(distance_xy, distance_xy); 56 | 57 | // Apply the vignette 58 | color.rgb *= (1.0 + pow(distance, Slope * 0.5) * Amount); //pow - multiply 59 | } 60 | 61 | if (Type == 1) // New round (-x*x+x) + (-y*y+y) method. 62 | { 63 | tex = -tex * tex + tex; 64 | color.rgb = saturate(((ReShade::PixelSize.y / ReShade::PixelSize.x)*(ReShade::PixelSize.y / ReShade::PixelSize.x) * Ratio * tex.x + tex.y) * 4.0) * color.rgb; 65 | } 66 | 67 | if (Type == 2) // New (-x*x+x) * (-y*y+y) TV style method. 68 | { 69 | tex = -tex * tex + tex; 70 | color.rgb = saturate(tex.x * tex.y * 100.0) * color.rgb; 71 | } 72 | 73 | if (Type == 3) 74 | { 75 | tex = abs(tex - 0.5); 76 | float tc = dot(float4(-tex.x, -tex.x, tex.x, tex.y), float4(tex.y, tex.y, 1.0, 1.0)); //XOR 77 | 78 | tc = saturate(tc - 0.495); 79 | color.rgb *= (pow((1.0 - tc * 200), 4) + 0.25); //or maybe abs(tc*100-1) (-(tc*100)-1) 80 | } 81 | 82 | if (Type == 4) 83 | { 84 | tex = abs(tex - 0.5); 85 | float tc = dot(float4(-tex.x, -tex.x, tex.x, tex.y), float4(tex.y, tex.y, 1.0, 1.0)); //XOR 86 | 87 | tc = saturate(tc - 0.495) - 0.0002; 88 | color.rgb *= (pow((1.0 - tc * 200), 4) + 0.0); //or maybe abs(tc*100-1) (-(tc*100)-1) 89 | } 90 | 91 | if (Type == 5) // MAD version of 2 92 | { 93 | tex = abs(tex - 0.5); 94 | float tc = tex.x * (-2.0 * tex.y + 1.0) + tex.y; //XOR 95 | 96 | tc = saturate(tc - 0.495); 97 | color.rgb *= (pow((-tc * 200 + 1.0), 4) + 0.25); //or maybe abs(tc*100-1) (-(tc*100)-1) 98 | //color.rgb *= (pow(((tc*200.0)-1.0),4)); //or maybe abs(tc*100-1) (-(tc*100)-1) 99 | } 100 | 101 | if (Type == 6) // New round (-x*x+x) * (-y*y+y) method. 102 | { 103 | //tex.y /= float2((ReShade::PixelSize.y / ReShade::PixelSize.x), Ratio); 104 | float tex_xy = dot(float4(tex, tex), float4(-tex, 1.0, 1.0)); //dot is actually slower 105 | color.rgb = saturate(tex_xy * 4.0) * color.rgb; 106 | } 107 | 108 | return color; 109 | } 110 | 111 | technique Vignette 112 | { 113 | pass 114 | { 115 | VertexShader = PostProcessVS; 116 | PixelShader = VignettePass; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Border.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Border version 1.4.1 3 | * 4 | * -- Version 1.0 by Oomek -- 5 | * Fixes light, one pixel thick border in some games when forcing MSAA like i.e. Dishonored 6 | * -- Version 1.1 by CeeJay.dk -- 7 | * Optimized the shader. It still does the same but now it runs faster. 8 | * -- Version 1.2 by CeeJay.dk -- 9 | * Added border_width and border_color features 10 | * -- Version 1.3 by CeeJay.dk -- 11 | * Optimized the performance further 12 | * -- Version 1.4 by CeeJay.dk -- 13 | * Added the border_ratio feature 14 | * -- Version 1.4.1 by CeeJay.dk -- 15 | * Cleaned up setting for Reshade 3.x 16 | */ 17 | 18 | #include "ReShade.fxh" 19 | 20 | /* 21 | uniform float2 border_width < 22 | ui_type = "input"; 23 | ui_label = "Size"; 24 | ui_tooltip = "Measured in pixels. If this is set to zero then the ratio will be used instead."; 25 | > = float2(0.0, 0.0); 26 | */ 27 | 28 | uniform float2 border_width < 29 | ui_type = "drag"; 30 | ui_label = "Size"; 31 | ui_tooltip = "Measured in pixels. If this is set to zero then the ratio will be used instead."; 32 | ui_min = 0.0; ui_max = (BUFFER_WIDTH * 0.5); 33 | ui_step = 1.0; 34 | > = float2(0.0, 0.0); 35 | 36 | uniform float border_ratio < 37 | ui_type = "input"; 38 | ui_label = "Size Ratio"; 39 | ui_tooltip = "Set the desired ratio for the visible area."; 40 | > = 2.35; 41 | 42 | uniform float3 border_color < 43 | ui_type = "color"; 44 | ui_label = "Border Color"; 45 | > = float3(0.0, 0.0, 0.0); 46 | 47 | float3 BorderPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 48 | { 49 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 50 | 51 | // -- calculate the right border_width for a given border_ratio -- 52 | float2 border_width_variable = border_width; 53 | if (border_width.x == -border_width.y) // If width is not used 54 | if (ReShade::AspectRatio < border_ratio) 55 | border_width_variable = float2(0.0, (ReShade::ScreenSize.y - (ReShade::ScreenSize.x / border_ratio)) * 0.5); 56 | else 57 | border_width_variable = float2((ReShade::ScreenSize.x - (ReShade::ScreenSize.y * border_ratio)) * 0.5, 0.0); 58 | 59 | float2 border = (ReShade::PixelSize * border_width_variable); // Translate integer pixel width to floating point 60 | float2 within_border = saturate((-texcoord * texcoord + texcoord) - (-border * border + border)); // Becomes positive when inside the border and zero when outside 61 | 62 | return all(within_border) ? color : border_color; 63 | } 64 | 65 | technique Border 66 | { 67 | pass 68 | { 69 | VertexShader = PostProcessVS; 70 | PixelShader = BorderPass; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Cartoon.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Cartoon 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | */ 5 | 6 | uniform float Power < 7 | ui_type = "drag"; 8 | ui_min = 0.1; ui_max = 10.0; 9 | ui_tooltip = "Amount of effect you want."; 10 | > = 1.5; 11 | uniform float EdgeSlope < 12 | ui_type = "drag"; 13 | ui_min = 0.1; ui_max = 6.0; 14 | ui_label = "Edge Slope"; 15 | ui_tooltip = "Raise this to filter out fainter edges. You might need to increase the power to compensate. Whole numbers are faster."; 16 | > = 1.5; 17 | 18 | #include "ReShade.fxh" 19 | 20 | float3 CartoonPass(float4 position : SV_Position, float2 texcoord : TEXCOORD0) : SV_Target 21 | { 22 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 23 | const float3 coefLuma = float3(0.2126, 0.7152, 0.0722); 24 | 25 | float diff1 = dot(coefLuma, tex2D(ReShade::BackBuffer, texcoord + ReShade::PixelSize).rgb); 26 | diff1 = dot(float4(coefLuma, -1.0), float4(tex2D(ReShade::BackBuffer, texcoord - ReShade::PixelSize).rgb , diff1)); 27 | float diff2 = dot(coefLuma, tex2D(ReShade::BackBuffer, texcoord + ReShade::PixelSize * float2(1, -1)).rgb); 28 | diff2 = dot(float4(coefLuma, -1.0), float4(tex2D(ReShade::BackBuffer, texcoord + ReShade::PixelSize * float2(-1, 1)).rgb , diff2)); 29 | 30 | float edge = dot(float2(diff1, diff2), float2(diff1, diff2)); 31 | 32 | return saturate(pow(edge, EdgeSlope) * -Power + color); 33 | } 34 | 35 | technique Cartoon 36 | { 37 | pass 38 | { 39 | VertexShader = PostProcessVS; 40 | PixelShader = CartoonPass; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Chromakey.fx: -------------------------------------------------------------------------------- 1 | /* 2 | Chromakey PS v1.1.0 (c) 2018 Jacob Maximilian Fober 3 | 4 | This work is licensed under the Creative Commons 5 | Attribution-ShareAlike 4.0 International License. 6 | To view a copy of this license, visit 7 | http://creativecommons.org/licenses/by-sa/4.0/. 8 | */ 9 | 10 | //////////////////// 11 | /////// MENU /////// 12 | //////////////////// 13 | 14 | uniform float Threshold < 15 | ui_label = "Threshold"; 16 | ui_type = "drag"; 17 | ui_min = 0.0; ui_max = 0.999; ui_step = 0.001; 18 | > = 0.1; 19 | 20 | uniform int Pass < 21 | ui_label = "Keying type"; 22 | ui_type = "combo"; 23 | ui_items = "Background key\0Foreground key\0"; 24 | > = 0; 25 | 26 | uniform int Color < 27 | ui_label = "Keying color"; 28 | ui_tooltip = "Ultimatte(tm) Super Blue and Green are industry standard colors for chromakey"; 29 | ui_type = "combo"; 30 | ui_items = "Super Blue Ultimatte(tm)\0Green Ultimatte(tm)\0Custom\0"; 31 | > = 0; 32 | 33 | uniform float3 CustomColor < 34 | ui_type = "color"; 35 | ui_label = "Custom color"; 36 | > = float3(1.0, 0.0, 0.0); 37 | 38 | ////////////////////// 39 | /////// SHADER /////// 40 | ////////////////////// 41 | 42 | #include "ReShade.fxh" 43 | 44 | float3 ChromakeyPS(float4 vois : SV_Position, float2 texcoord : TexCoord) : SV_Target 45 | { 46 | // Sample depth image 47 | float Depth = ReShade::GetLinearizedDepth(texcoord); 48 | 49 | // Define chromakey color, Ultimatte(tm) Super Blue, Ultimatte(tm) Green, or user color 50 | float3 Screen = (Color == 0) ? float3(0.07, 0.18, 0.72) : Color == 1 ? float3(0.29, 0.84, 0.36) : CustomColor; 51 | 52 | // Paint the picture 53 | bool IsItFront = (Pass == 0); 54 | return (Threshold < Depth ? IsItFront : !IsItFront 55 | ) ? Screen : tex2D(ReShade::BackBuffer, texcoord).rgb; 56 | } 57 | 58 | technique Chromakey 59 | { 60 | pass 61 | { 62 | VertexShader = PostProcessVS; 63 | PixelShader = ChromakeyPS; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/ChromaticAberration.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Chromatic Aberration 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Distorts the image by shifting each color component, which creates color artifacts similar to those in a very cheap lens or a cheap sensor. 6 | */ 7 | 8 | uniform float2 Shift < 9 | ui_type = "drag"; 10 | ui_min = -10; ui_max = 10; 11 | ui_tooltip = "Distance (X,Y) in pixels to shift the color components. For a slightly blurred look try fractional values (.5) between two pixels."; 12 | > = float2(2.5, -0.5); 13 | uniform float Strength < 14 | ui_type = "drag"; 15 | ui_min = 0.0; ui_max = 1.0; 16 | > = 0.5; 17 | 18 | #include "ReShade.fxh" 19 | 20 | float3 ChromaticAberrationPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 21 | { 22 | float3 color, colorInput = tex2D(ReShade::BackBuffer, texcoord).rgb; 23 | // Sample the color components 24 | color.r = tex2D(ReShade::BackBuffer, texcoord + (ReShade::PixelSize * Shift)).r; 25 | color.g = colorInput.g; 26 | color.b = tex2D(ReShade::BackBuffer, texcoord - (ReShade::PixelSize * Shift)).b; 27 | 28 | // Adjust the strength of the effect 29 | return lerp(colorInput, color, Strength); 30 | } 31 | 32 | technique CA 33 | { 34 | pass 35 | { 36 | VertexShader = PostProcessVS; 37 | PixelShader = ChromaticAberrationPass; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/ColorMatrix.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Color Matrix version 1.0 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * ColorMatrix allow the user to transform the colors using a color matrix 6 | */ 7 | 8 | uniform float3 ColorMatrix_Red < 9 | ui_type = "drag"; 10 | ui_min = 0.0; ui_max = 1.0; 11 | ui_label = "Matrix Red"; 12 | ui_tooltip = "How much of Red, Green and Blue the new red value should contain. Should sum to 1.0 if you don't wish to change the brightness."; 13 | > = float3(0.817, 0.183, 0.000); 14 | uniform float3 ColorMatrix_Green < 15 | ui_type = "drag"; 16 | ui_min = 0.0; ui_max = 1.0; 17 | ui_label = "Matrix Green"; 18 | ui_tooltip = "How much of Red, Green and Blue the new green value should contain. Should sum to 1.0 if you don't wish to change the brightness."; 19 | > = float3(0.333, 0.667, 0.000); 20 | uniform float3 ColorMatrix_Blue < 21 | ui_type = "drag"; 22 | ui_min = 0.0; ui_max = 1.0; 23 | ui_label = "Matrix Blue"; 24 | ui_tooltip = "How much of Red, Green and Blue the new blue value should contain. Should sum to 1.0 if you don't wish to change the brightness."; 25 | > = float3(0.000, 0.125, 0.875); 26 | 27 | uniform float Strength < 28 | ui_type = "drag"; 29 | ui_min = 0.0; ui_max = 1.0; 30 | > = 1.0; 31 | 32 | #include "ReShade.fxh" 33 | 34 | float3 ColorMatrixPass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target 35 | { 36 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 37 | 38 | const float3x3 ColorMatrix = float3x3(ColorMatrix_Red, ColorMatrix_Green, ColorMatrix_Blue); 39 | color = lerp(color, mul(ColorMatrix, color), Strength); 40 | 41 | return saturate(color); 42 | } 43 | 44 | technique ColorMatrix 45 | { 46 | pass 47 | { 48 | VertexShader = PostProcessVS; 49 | PixelShader = ColorMatrixPass; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/DPX.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * DPX/Cineon shader by Loadus 3 | */ 4 | 5 | uniform float3 RGB_Curve < 6 | ui_type = "drag"; 7 | ui_min = 1.0; ui_max = 15.0; 8 | ui_label = "RGB Curve"; 9 | > = float3(8.0, 8.0, 8.0); 10 | uniform float3 RGB_C < 11 | ui_type = "drag"; 12 | ui_min = 0.2; ui_max = 0.5; 13 | ui_label = "RGB C"; 14 | > = float3(0.36, 0.36, 0.34); 15 | 16 | uniform float Contrast < 17 | ui_type = "drag"; 18 | ui_min = 0.0; ui_max = 1.0; 19 | > = 0.1; 20 | uniform float Saturation < 21 | ui_type = "drag"; 22 | ui_min = 0.0; ui_max = 8.0; 23 | > = 3.0; 24 | uniform float Colorfulness < 25 | ui_type = "drag"; 26 | ui_min = 0.1; ui_max = 2.5; 27 | > = 2.5; 28 | 29 | uniform float Strength < 30 | ui_type = "drag"; 31 | ui_min = 0.0; ui_max = 1.0; 32 | > = 0.20; 33 | 34 | #include "ReShade.fxh" 35 | 36 | static const float3x3 RGB = float3x3( 37 | 2.6714711726599600, -1.2672360578624100, -0.4109956021722270, 38 | -1.0251070293466400, 1.9840911624108900, 0.0439502493584124, 39 | 0.0610009456429445, -0.2236707508128630, 1.1590210416706100 40 | ); 41 | static const float3x3 XYZ = float3x3( 42 | 0.5003033835433160, 0.3380975732227390, 0.1645897795458570, 43 | 0.2579688942747580, 0.6761952591447060, 0.0658358459823868, 44 | 0.0234517888692628, 0.1126992737203000, 0.8668396731242010 45 | ); 46 | 47 | float3 DPXPass(float4 vois : SV_Position, float2 texcoord : TexCoord) : SV_Target 48 | { 49 | float3 input = tex2D(ReShade::BackBuffer, texcoord).rgb; 50 | 51 | float3 B = input; 52 | B = B * (1.0 - Contrast) + (0.5 * Contrast); 53 | float3 Btemp = (1.0 / (1.0 + exp(RGB_Curve / 2.0))); 54 | B = ((1.0 / (1.0 + exp(-RGB_Curve * (B - RGB_C)))) / (-2.0 * Btemp + 1.0)) + (-Btemp / (-2.0 * Btemp + 1.0)); 55 | 56 | float value = max(max(B.r, B.g), B.b); 57 | float3 color = B / value; 58 | color = pow(abs(color), 1.0 / Colorfulness); 59 | 60 | float3 c0 = color * value; 61 | c0 = mul(XYZ, c0); 62 | float luma = dot(c0, float3(0.30, 0.59, 0.11)); 63 | c0 = (1.0 - Saturation) * luma + Saturation * c0; 64 | c0 = mul(RGB, c0); 65 | 66 | return lerp(input, c0, Strength); 67 | } 68 | 69 | technique DPX 70 | { 71 | pass 72 | { 73 | VertexShader = PostProcessVS; 74 | PixelShader = DPXPass; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Daltonize.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Daltonization algorithm by daltonize.org 3 | * http://www.daltonize.org/2010/05/lms-daltonization-algorithm.html 4 | * Originally ported to ReShade by IDDQD, modified for ReShade 3.0 by crosire 5 | */ 6 | 7 | uniform int Type < 8 | ui_type = "combo"; 9 | ui_items = "Protanopia\0Deuteranopia\0Tritanopia\0"; 10 | > = 0; 11 | 12 | #include "ReShade.fxh" 13 | 14 | float3 PS_DaltonizeFXmain(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 15 | { 16 | float3 input = tex2D(ReShade::BackBuffer, texcoord).rgb; 17 | 18 | // RGB to LMS matrix conversion 19 | float OnizeL = (17.8824f * input.r) + (43.5161f * input.g) + (4.11935f * input.b); 20 | float OnizeM = (3.45565f * input.r) + (27.1554f * input.g) + (3.86714f * input.b); 21 | float OnizeS = (0.0299566f * input.r) + (0.184309f * input.g) + (1.46709f * input.b); 22 | 23 | // Simulate color blindness 24 | float Daltl, Daltm, Dalts; 25 | 26 | if (Type == 0) // Protanopia - reds are greatly reduced (1% men) 27 | { 28 | Daltl = 0.0f * OnizeL + 2.02344f * OnizeM + -2.52581f * OnizeS; 29 | Daltm = 0.0f * OnizeL + 1.0f * OnizeM + 0.0f * OnizeS; 30 | Dalts = 0.0f * OnizeL + 0.0f * OnizeM + 1.0f * OnizeS; 31 | } 32 | else if (Type == 1) // Deuteranopia - greens are greatly reduced (1% men) 33 | { 34 | Daltl = 1.0f * OnizeL + 0.0f * OnizeM + 0.0f * OnizeS; 35 | Daltm = 0.494207f * OnizeL + 0.0f * OnizeM + 1.24827f * OnizeS; 36 | Dalts = 0.0f * OnizeL + 0.0f * OnizeM + 1.0f * OnizeS; 37 | } 38 | else if (Type == 2) // Tritanopia - blues are greatly reduced (0.003% population) 39 | { 40 | Daltl = 1.0f * OnizeL + 0.0f * OnizeM + 0.0f * OnizeS; 41 | Daltm = 0.0f * OnizeL + 1.0f * OnizeM + 0.0f * OnizeS; 42 | Dalts = -0.395913f * OnizeL + 0.801109f * OnizeM + 0.0f * OnizeS; 43 | } 44 | 45 | // LMS to RGB matrix conversion 46 | float3 error; 47 | error.r = (0.0809444479f * Daltl) + (-0.130504409f * Daltm) + (0.116721066f * Dalts); 48 | error.g = (-0.0102485335f * Daltl) + (0.0540193266f * Daltm) + (-0.113614708f * Dalts); 49 | error.b = (-0.000365296938f * Daltl) + (-0.00412161469f * Daltm) + (0.693511405f * Dalts); 50 | 51 | // Isolate invisible colors to color vision deficiency (calculate error matrix) 52 | error = (input - error); 53 | 54 | // Shift colors towards visible spectrum (apply error modifications) 55 | float3 correction; 56 | correction.r = 0; // (error.r * 0.0) + (error.g * 0.0) + (error.b * 0.0); 57 | correction.g = (error.r * 0.7) + (error.g * 1.0); // + (error.b * 0.0); 58 | correction.b = (error.r * 0.7) + (error.b * 1.0); // + (error.g * 0.0); 59 | 60 | // Add compensation to original values 61 | correction = input + correction; 62 | 63 | return correction; 64 | } 65 | 66 | technique Daltonize 67 | { 68 | pass 69 | { 70 | VertexShader = PostProcessVS; 71 | PixelShader = PS_DaltonizeFXmain; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Denoise.fx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Shader Library/Recommended/Denoise.fx -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/DisplayDepth.fx: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////// 2 | // Ported from Reshade v2.x. Original by CeeJay. 3 | // Displays the depth buffer: further away is more white than close by. 4 | // Use this to configure the depth buffer preprocessor settings 5 | // in Reshade's settings. (The RESHADE_DEPTH_INPUT_* ones) 6 | /////////////////////////////////////////////////////// 7 | 8 | #include "Reshade.fxh" 9 | 10 | void PS_DisplayDepth(in float4 position : SV_Position, in float2 texcoord : TEXCOORD0, out float3 color : SV_Target) 11 | { 12 | color.rgb = ReShade::GetLinearizedDepth(texcoord).rrr; 13 | 14 | float dither_bit = 8.0; //Number of bits per channel. Should be 8 for most monitors. 15 | 16 | //color = (tex.x*0.3+0.1); //draw a gradient for testing. 17 | //#define dither_method 2 //override method for testing purposes 18 | 19 | /*------------------------. 20 | | :: Ordered Dithering :: | 21 | '------------------------*/ 22 | //Calculate grid position 23 | float grid_position = frac( dot(texcoord, (ReShade::ScreenSize * float2(1.0/16.0,10.0/36.0) )+(0.25) ) ); 24 | 25 | //Calculate how big the shift should be 26 | float dither_shift = (0.25) * (1.0 / (pow(2,dither_bit) - 1.0)); 27 | 28 | //Shift the individual colors differently, thus making it even harder to see the dithering pattern 29 | float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift); //subpixel dithering 30 | 31 | //modify shift acording to grid position. 32 | dither_shift_RGB = lerp(2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position); //shift acording to grid position. 33 | 34 | //shift the color by dither_shift 35 | color.rgb += dither_shift_RGB; 36 | } 37 | 38 | technique DisplayDepth 39 | { 40 | pass 41 | { 42 | VertexShader = PostProcessVS; 43 | PixelShader = PS_DisplayDepth; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/FXAA.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * FXAA 3.11 3 | * 4 | * for ReShade 3.0 5 | */ 6 | 7 | uniform float Subpix < 8 | ui_type = "drag"; 9 | ui_min = 0.0; ui_max = 1.0; 10 | ui_tooltip = "Amount of sub-pixel aliasing removal. Higher values makes the image softer/blurrier."; 11 | > = 0.25; 12 | 13 | uniform float EdgeThreshold < 14 | ui_type = "drag"; 15 | ui_min = 0.0; ui_max = 1.0; 16 | ui_label = "Edge Detection Threshold"; 17 | ui_tooltip = "The minimum amount of local contrast required to apply algorithm."; 18 | > = 0.125; 19 | uniform float EdgeThresholdMin < 20 | ui_type = "drag"; 21 | ui_min = 0.0; ui_max = 1.0; 22 | ui_label = "Darkness Threshold"; 23 | ui_tooltip = "Pixels darker than this are not processed in order to increase performance."; 24 | > = 0.0; 25 | 26 | //------------------------------ Non-GUI-settings ------------------------------------------------- 27 | 28 | #ifndef FXAA_QUALITY__PRESET 29 | // Valid Quality Presets 30 | // 10 to 15 - default medium dither (10=fastest, 15=highest quality) 31 | // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) 32 | // 39 - no dither, very expensive 33 | #define FXAA_QUALITY__PRESET 15 34 | #endif 35 | 36 | #ifndef FXAA_GREEN_AS_LUMA 37 | #define FXAA_GREEN_AS_LUMA 0 38 | #endif 39 | 40 | #ifndef FXAA_LINEAR_LIGHT 41 | #define FXAA_LINEAR_LIGHT 1 42 | #endif 43 | 44 | //------------------------------------------------------------------------------------------------- 45 | 46 | #if (__RENDERER__ == 0xb000 || __RENDERER__ == 0xb100) 47 | #define FXAA_GATHER4_ALPHA 1 48 | #define FxaaTexAlpha4(t, p) tex2Dgather(t, p, 3) 49 | #define FxaaTexOffAlpha4(t, p, o) tex2Dgatheroffset(t, p, o, 3) 50 | #define FxaaTexGreen4(t, p) tex2Dgather(t, p, 1) 51 | #define FxaaTexOffGreen4(t, p, o) tex2Dgatheroffset(t, p, o, 1) 52 | #endif 53 | 54 | #define FXAA_PC 1 55 | #define FXAA_HLSL_3 1 56 | 57 | #include "FXAA.fxh" 58 | #include "ReShade.fxh" 59 | 60 | // Samplers 61 | 62 | sampler FXAATexture 63 | { 64 | Texture = ReShade::BackBufferTex; 65 | MinFilter = Linear; MagFilter = Linear; 66 | #if FXAA_LINEAR_LIGHT 67 | SRGBTexture = true; 68 | #endif 69 | }; 70 | 71 | // Pixel shaders 72 | 73 | #if !FXAA_GREEN_AS_LUMA 74 | float4 FXAALumaPass(float4 vpos : SV_Position, noperspective float2 texcoord : TEXCOORD) : SV_Target 75 | { 76 | float4 color = tex2D(ReShade::BackBuffer, texcoord.xy); 77 | color.a = sqrt(dot(color.rgb * color.rgb, float3(0.299, 0.587, 0.114))); 78 | return color; 79 | } 80 | #endif 81 | 82 | float4 FXAAPixelShader(float4 vpos : SV_Position, noperspective float2 texcoord : TEXCOORD) : SV_Target 83 | { 84 | return FxaaPixelShader( 85 | texcoord, // pos 86 | 0, // fxaaConsolePosPos 87 | FXAATexture, // tex 88 | FXAATexture, // fxaaConsole360TexExpBiasNegOne 89 | FXAATexture, // fxaaConsole360TexExpBiasNegTwo 90 | ReShade::PixelSize, // fxaaQualityRcpFrame 91 | 0, // fxaaConsoleRcpFrameOpt 92 | 0, // fxaaConsoleRcpFrameOpt2 93 | 0, // fxaaConsole360RcpFrameOpt2 94 | Subpix, // fxaaQualitySubpix 95 | EdgeThreshold, // fxaaQualityEdgeThreshold 96 | EdgeThresholdMin, // fxaaQualityEdgeThresholdMin 97 | 0, // fxaaConsoleEdgeSharpness 98 | 0, // fxaaConsoleEdgeThreshold 99 | 0, // fxaaConsoleEdgeThresholdMin 100 | 0 // fxaaConsole360ConstDir 101 | ); 102 | } 103 | 104 | // Rendering passes 105 | 106 | technique FXAA 107 | { 108 | #if !FXAA_GREEN_AS_LUMA 109 | pass 110 | { 111 | VertexShader = PostProcessVS; 112 | PixelShader = FXAALumaPass; 113 | } 114 | #endif 115 | pass 116 | { 117 | VertexShader = PostProcessVS; 118 | PixelShader = FXAAPixelShader; 119 | #if FXAA_LINEAR_LIGHT 120 | SRGBWriteEnable = true; 121 | #endif 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/FakeMotionBlur.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 Ganossa (mediehawk@gmail.com) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software with restriction, including without limitation the rights to 7 | * use and/or sell copies of the Software, and to permit persons to whom the Software 8 | * is furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and the permission notices (this and below) shall 11 | * be included in all copies or substantial portions of the Software. 12 | * 13 | * Permission needs to be specifically granted by the author of the software to any 14 | * person obtaining a copy of this software and associated documentation files 15 | * (the "Software"), to deal in the Software without restriction, including without 16 | * limitation the rights to copy, modify, merge, publish, distribute, and/or 17 | * sublicense the Software, and subject to the following conditions: 18 | * 19 | * The above copyright notice and the permission notices (this and above) shall 20 | * be included in all copies or substantial portions of the Software. 21 | * 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | * SOFTWARE. 29 | */ 30 | 31 | uniform float mbRecall < 32 | ui_type = "drag"; 33 | ui_min = 0.0; ui_max = 1.0; 34 | ui_tooltip = "Motion blur intensity"; 35 | > = 0.40; 36 | uniform float mbSoftness < 37 | ui_type = "drag"; 38 | ui_min = 0.0; ui_max = 2.0; 39 | ui_tooltip = "Blur strength of consequential streaks"; 40 | > = 1.00; 41 | 42 | #include "ReShade.fxh" 43 | 44 | texture2D currTex { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 45 | texture2D prevSingleTex { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 46 | texture2D prevTex { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 47 | 48 | sampler2D currColor { Texture = currTex; }; 49 | sampler2D prevSingleColor { Texture = prevSingleTex; }; 50 | sampler2D prevColor { Texture = prevTex; }; 51 | 52 | void PS_Combine(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 color : SV_Target) 53 | { 54 | float4 curr = tex2D(currColor, texcoord); 55 | float4 prevSingle = tex2D(prevSingleColor, texcoord); 56 | float4 prev = tex2D(prevColor, texcoord); 57 | 58 | float3 diff3 = abs(prevSingle.rgb - curr.rgb) * 2.0f; 59 | float diff = min(diff3.r + diff3.g + diff3.b, mbRecall); 60 | 61 | const float weight[11] = { 0.082607, 0.040484, 0.038138, 0.034521, 0.030025, 0.025094, 0.020253, 0.015553, 0.011533, 0.008218, 0.005627 }; 62 | prev *= weight[0]; 63 | 64 | float pixelBlur = (mbSoftness * 13 * (diff)) * (BUFFER_RCP_WIDTH); 65 | float pixelBlur2 = (mbSoftness * 11 * (diff)) * (BUFFER_RCP_HEIGHT); 66 | 67 | [unroll] 68 | for (int z = 1; z < 11; z++) 69 | { 70 | prev += tex2D(prevColor, texcoord + float2(z * pixelBlur, 0.0f)) * weight[z]; 71 | prev += tex2D(prevColor, texcoord - float2(z * pixelBlur, 0.0f)) * weight[z]; 72 | prev += tex2D(prevColor, texcoord + float2(0.0f, z * pixelBlur2)) * weight[z]; 73 | prev += tex2D(prevColor, texcoord - float2(0.0f, z * pixelBlur2)) * weight[z]; 74 | } 75 | 76 | color = lerp(curr, prev, diff+0.1); 77 | } 78 | 79 | void PS_CopyFrame(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 color : SV_Target) 80 | { 81 | color = tex2D(ReShade::BackBuffer, texcoord); 82 | } 83 | void PS_CopyPreviousFrame(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 prevSingle : SV_Target0, out float4 prev : SV_Target1) 84 | { 85 | prevSingle = tex2D(currColor, texcoord); 86 | prev = tex2D(ReShade::BackBuffer, texcoord); 87 | } 88 | 89 | technique MotionBlur 90 | { 91 | pass CopyFrame 92 | { 93 | VertexShader = PostProcessVS; 94 | PixelShader = PS_CopyFrame; 95 | RenderTarget = currTex; 96 | } 97 | 98 | pass Combine 99 | { 100 | VertexShader = PostProcessVS; 101 | PixelShader = PS_Combine; 102 | } 103 | 104 | pass PrevColor 105 | { 106 | VertexShader = PostProcessVS; 107 | PixelShader = PS_CopyPreviousFrame; 108 | RenderTarget0 = prevSingleTex; 109 | RenderTarget1 = prevTex; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/FilmGrain.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * FilmGrain version 1.0 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Computes a noise pattern and blends it with the image to create a film grain look. 6 | */ 7 | 8 | uniform float Intensity < 9 | ui_type = "drag"; 10 | ui_min = 0.0; ui_max = 1.0; 11 | ui_tooltip = "How visible the grain is. Higher is more visible."; 12 | > = 0.50; 13 | uniform float Variance < 14 | ui_type = "drag"; 15 | ui_min = 0.0; ui_max = 1.0; 16 | ui_tooltip = "Controls the variance of the Gaussian noise. Lower values look smoother."; 17 | > = 0.40; 18 | uniform float Mean = 0.5; 19 | uniform int SignalToNoiseRatio < 20 | ui_type = "drag"; 21 | ui_min = 0; ui_max = 16; 22 | ui_label = "Signal-to-Noise Ratio"; 23 | ui_tooltip = "Higher Signal-to-Noise Ratio values give less grain to brighter pixels. 0 disables this feature."; 24 | > = 6; 25 | 26 | uniform float Timer < source = "timer"; >; 27 | 28 | #include "ReShade.fxh" 29 | 30 | float3 FilmGrainPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 31 | { 32 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 33 | 34 | //float inv_luma = dot(color, float3(-0.2126, -0.7152, -0.0722)) + 1.0; 35 | float inv_luma = dot(color, float3(-1.0/3.0, -1.0/3.0, -1.0/3.0)) + 1.0; //Calculate the inverted luma so it can be used later to control the variance of the grain 36 | 37 | /*---------------------. 38 | | :: Generate Grain :: | 39 | '---------------------*/ 40 | 41 | const float PI = 3.1415927; 42 | 43 | //time counter using requested counter from ReShade 44 | float t = Timer * 0.0022337; 45 | 46 | //PRNG 2D - create two uniform noise values and save one DP2ADD 47 | float seed = dot(texcoord, float2(12.9898, 78.233));// + t; 48 | float sine = sin(seed); 49 | float cosine = cos(seed); 50 | float uniform_noise1 = frac(sine * 43758.5453 + t); //I just salt with t because I can 51 | float uniform_noise2 = frac(cosine * 53758.5453 - t); // and it doesn't cost any extra ASM 52 | 53 | //Get settings 54 | float stn = SignalToNoiseRatio != 0 ? pow(inv_luma, (float)SignalToNoiseRatio) : 1.0; // Signal to noise feature - Brighter pixels get less noise. 55 | float variance = (Variance*Variance) * stn; 56 | float mean = Mean; 57 | 58 | //Box-Muller transform 59 | uniform_noise1 = (uniform_noise1 < 0.0001) ? 0.0001 : uniform_noise1; //fix log(0) 60 | 61 | float r = sqrt(-log(uniform_noise1)); 62 | r = (uniform_noise1 < 0.0001) ? PI : r; //fix log(0) - PI happened to be the right answer for uniform_noise == ~ 0.0000517.. Close enough and we can reuse a constant. 63 | float theta = (2.0 * PI) * uniform_noise2; 64 | 65 | float gauss_noise1 = variance * r * cos(theta) + mean; 66 | //float gauss_noise2 = variance * r * sin(theta) + mean; //we can get two gaussians out of it :) 67 | 68 | //gauss_noise1 = (ddx(gauss_noise1) - ddy(gauss_noise1)) * 0.50 + gauss_noise2; 69 | 70 | 71 | //Calculate how big the shift should be 72 | //float grain = lerp(1.0 - Intensity, 1.0 + Intensity, gauss_noise1); 73 | float grain = lerp(1.0 + Intensity, 1.0 - Intensity, gauss_noise1); 74 | 75 | //float grain2 = (2.0 * Intensity) * gauss_noise1 + (1.0 - Intensity); 76 | 77 | //Apply grain 78 | color = color * grain; 79 | 80 | //color = (grain-1.0) *2.0 + 0.5; 81 | 82 | //color = lerp(color,colorInput.rgb,sqrt(luma)); 83 | 84 | /*-------------------------. 85 | | :: Debugging features :: | 86 | '-------------------------*/ 87 | 88 | //color.rgb = frac(gauss_noise1).xxx; //show the noise 89 | //color.rgb = (gauss_noise1 > 0.999) ? float3(1.0,1.0,0.0) : 0.0 ; //does it reach 1.0? 90 | 91 | return color.rgb; 92 | } 93 | 94 | technique FilmGrain 95 | { 96 | pass 97 | { 98 | VertexShader = PostProcessVS; 99 | PixelShader = FilmGrainPass; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/FilmicAnamorphSharpen.fx: -------------------------------------------------------------------------------- 1 | /* 2 | Filmic Anamorph Sharpen PS v1.1.7 (c) 2018 Jacob Maximilian Fober 3 | 4 | This work is licensed under the Creative Commons 5 | Attribution-ShareAlike 4.0 International License. 6 | To view a copy of this license, visit 7 | http://creativecommons.org/licenses/by-sa/4.0/. 8 | */ 9 | 10 | //////////////////// 11 | /////// MENU /////// 12 | //////////////////// 13 | 14 | uniform float Strength < 15 | ui_label = "Sharpen strength"; 16 | ui_type = "drag"; 17 | ui_min = 0.0; ui_max = 3.0; ui_step = 0.005; 18 | > = 1.0; 19 | 20 | uniform int Coefficient < 21 | ui_label = "Luma coefficient"; 22 | ui_tooltip = "Change if objects with relatively same brightness but different color get sharpened"; 23 | ui_type = "combo"; 24 | ui_items = "BT.709\0BT.601\0"; 25 | > = 0; 26 | 27 | uniform float Clamp < 28 | ui_label = "Sharpen clamping"; 29 | ui_type = "drag"; 30 | ui_min = 0.5; ui_max = 1.0; ui_step = 0.001; 31 | > = 1.0; 32 | 33 | uniform int Offset < 34 | ui_label = "High-pass offset"; 35 | ui_tooltip = "High-pass cross offset in pixels"; 36 | ui_type = "drag"; 37 | ui_min = 0; ui_max = 2; 38 | > = 1; 39 | 40 | uniform int Contrast < 41 | ui_label = "Edges mask"; 42 | ui_tooltip = "Depth high-pass mask amount"; 43 | ui_type = "drag"; 44 | ui_min = 0; ui_max = 2000; ui_step = 1; 45 | > = 128; 46 | 47 | uniform bool Preview < 48 | ui_label = "Preview"; 49 | ui_tooltip = "Preview sharpen layer and mask for adjustment. If you don't see red strokes, try changing Preprocessor Definitions in the Settings tab."; 50 | ui_category = "Debug View"; 51 | > = false; 52 | 53 | ////////////////////// 54 | /////// SHADER /////// 55 | ////////////////////// 56 | 57 | #include "ReShade.fxh" 58 | 59 | // Overlay blending mode 60 | float Overlay(float LayerA, float LayerB) 61 | { 62 | float MinA = min(LayerA, 0.5); 63 | float MinB = min(LayerB, 0.5); 64 | float MaxA = max(LayerA, 0.5); 65 | float MaxB = max(LayerB, 0.5); 66 | return 2 * (MinA * MinB + MaxA + MaxB - MaxA * MaxB) - 1.5; 67 | } 68 | 69 | // Sharpen pass 70 | float3 FilmicAnamorphSharpenPS(float4 vois : SV_Position, float2 UvCoord : TexCoord) : SV_Target 71 | { 72 | float2 Pixel = ReShade::PixelSize; 73 | 74 | float2 DepthPixel = Pixel * float(Offset + 1); 75 | Pixel *= float(Offset); 76 | // Sample display image 77 | float3 Source = tex2D(ReShade::BackBuffer, UvCoord).rgb; 78 | // Sample display depth image 79 | float SourceDepth = ReShade::GetLinearizedDepth(UvCoord); 80 | 81 | float2 NorSouWesEst[4] = { 82 | float2(UvCoord.x, UvCoord.y + Pixel.y), 83 | float2(UvCoord.x, UvCoord.y - Pixel.y), 84 | float2(UvCoord.x + Pixel.x, UvCoord.y), 85 | float2(UvCoord.x - Pixel.x, UvCoord.y) 86 | }; 87 | 88 | float2 DepthNorSouWesEst[4] = { 89 | float2(UvCoord.x, UvCoord.y + DepthPixel.y), 90 | float2(UvCoord.x, UvCoord.y - DepthPixel.y), 91 | float2(UvCoord.x + DepthPixel.x, UvCoord.y), 92 | float2(UvCoord.x - DepthPixel.x, UvCoord.y) 93 | }; 94 | 95 | // Choose luma coefficient, if True BT.709 Luma, else BT.601 Luma 96 | float3 LumaCoefficient = (Coefficient == 0) ? 97 | float3( 0.2126, 0.7152, 0.0722) : float3( 0.299, 0.587, 0.114); 98 | 99 | // Luma high-pass color 100 | // Luma high-pass depth 101 | float HighPassColor; 102 | float DepthMask; 103 | 104 | for (int s = 0; s < 4; s++) 105 | { 106 | HighPassColor += dot(tex2D(ReShade::BackBuffer, NorSouWesEst[s]).rgb, LumaCoefficient); 107 | DepthMask += ReShade::GetLinearizedDepth(NorSouWesEst[s]) 108 | + ReShade::GetLinearizedDepth(DepthNorSouWesEst[s]); 109 | } 110 | 111 | HighPassColor = 0.5 - 0.5 * (HighPassColor * 0.25 - dot(Source, LumaCoefficient)); 112 | 113 | DepthMask = 1.0 - DepthMask * 0.125 + SourceDepth; 114 | DepthMask = min(1.0, DepthMask) + 1.0 - max(1.0, DepthMask); 115 | DepthMask = saturate(Contrast * DepthMask + 1.0 - Contrast); 116 | 117 | // Sharpen strength 118 | HighPassColor = lerp(0.5, HighPassColor, Strength * DepthMask); 119 | 120 | // Clamping sharpen 121 | HighPassColor = max(min(HighPassColor, Clamp), 1 - Clamp); 122 | 123 | float3 Sharpen = float3( 124 | Overlay(Source.r, HighPassColor), 125 | Overlay(Source.g, HighPassColor), 126 | Overlay(Source.b, HighPassColor) 127 | ); 128 | 129 | if (Preview) // Preview mode ON 130 | { 131 | float PreviewChannel = lerp(HighPassColor, HighPassColor * DepthMask, 0.5); 132 | return float3( 133 | 1.0 - DepthMask * (1.0 - HighPassColor), 134 | PreviewChannel, 135 | PreviewChannel 136 | ); 137 | } 138 | else 139 | { 140 | return Sharpen; 141 | } 142 | } 143 | 144 | technique FilmicAnamorphSharpen 145 | { 146 | pass 147 | { 148 | VertexShader = PostProcessVS; 149 | PixelShader = FilmicAnamorphSharpenPS; 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/FilmicPass.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * FilmicPass 3 | * 4 | * Applies some common color adjustments to mimic a more cinema-like look. 5 | */ 6 | 7 | uniform float Strength < 8 | ui_type = "drag"; 9 | ui_min = 0.05; ui_max = 1.5; 10 | ui_toolip = "Strength of the color curve altering"; 11 | > = 0.85; 12 | 13 | uniform float Fade < 14 | ui_type = "drag"; 15 | ui_min = 0.0; ui_max = 0.6; 16 | ui_tooltip = "Decreases contrast to imitate faded image"; 17 | > = 0.4; 18 | uniform float Contrast < 19 | ui_type = "drag"; 20 | ui_min = 0.5; ui_max = 2.0; 21 | > = 1.0; 22 | uniform float Linearization < 23 | ui_type = "drag"; 24 | ui_min = 0.5; ui_max = 2.0; 25 | > = 0.5; 26 | uniform float Bleach < 27 | ui_type = "drag"; 28 | ui_min = -0.5; ui_max = 1.0; 29 | ui_tooltip = "More bleach means more contrasted and less colorful image"; 30 | > = 0.0; 31 | uniform float Saturation < 32 | ui_type = "drag"; 33 | ui_min = -1.0; ui_max = 1.0; 34 | > = -0.15; 35 | 36 | uniform float RedCurve < 37 | ui_type = "drag"; 38 | ui_min = 0.0; ui_max = 2.0; 39 | > = 1.0; 40 | uniform float GreenCurve < 41 | ui_type = "drag"; 42 | ui_min = 0.0; ui_max = 2.0; 43 | > = 1.0; 44 | uniform float BlueCurve < 45 | ui_type = "drag"; 46 | ui_min = 0.0; ui_max = 2.0; 47 | > = 1.0; 48 | uniform float BaseCurve < 49 | ui_type = "drag"; 50 | ui_min = 0.0; ui_max = 2.0; 51 | > = 1.5; 52 | 53 | uniform float BaseGamma < 54 | ui_type = "drag"; 55 | ui_min = 0.7; ui_max = 2.0; 56 | ui_tooltip = "Gamma Curve"; 57 | > = 1.0; 58 | uniform float EffectGamma < 59 | ui_type = "drag"; 60 | ui_min = 0.0; ui_max = 2.0; 61 | > = 0.65; 62 | uniform float EffectGammaR < 63 | ui_type = "drag"; 64 | ui_min = 0.0; ui_max = 2.0; 65 | > = 1.0; 66 | uniform float EffectGammaG < 67 | ui_type = "drag"; 68 | ui_min = 0.0; ui_max = 2.0; 69 | > = 1.0; 70 | uniform float EffectGammaB < 71 | ui_type = "drag"; 72 | ui_min = 0.0; ui_max = 2.0; 73 | > = 1.0; 74 | 75 | uniform float3 LumCoeff < 76 | > = float3(0.212656, 0.715158, 0.072186); 77 | 78 | #include "ReShade.fxh" 79 | 80 | float3 FilmPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 81 | { 82 | float3 B = tex2D(ReShade::BackBuffer, texcoord).rgb; 83 | float3 G = B; 84 | float3 H = 0.01; 85 | 86 | B = saturate(B); 87 | B = pow(B, Linearization); 88 | B = lerp(H, B, Contrast); 89 | 90 | float A = dot(B.rgb, LumCoeff); 91 | float3 D = A; 92 | 93 | B = pow(B, 1.0 / BaseGamma); 94 | 95 | float a = RedCurve; 96 | float b = GreenCurve; 97 | float c = BlueCurve; 98 | float d = BaseCurve; 99 | 100 | float y = 1.0 / (1.0 + exp(a / 2.0)); 101 | float z = 1.0 / (1.0 + exp(b / 2.0)); 102 | float w = 1.0 / (1.0 + exp(c / 2.0)); 103 | float v = 1.0 / (1.0 + exp(d / 2.0)); 104 | 105 | float3 C = B; 106 | 107 | D.r = (1.0 / (1.0 + exp(-a * (D.r - 0.5))) - y) / (1.0 - 2.0 * y); 108 | D.g = (1.0 / (1.0 + exp(-b * (D.g - 0.5))) - z) / (1.0 - 2.0 * z); 109 | D.b = (1.0 / (1.0 + exp(-c * (D.b - 0.5))) - w) / (1.0 - 2.0 * w); 110 | 111 | D = pow(D, 1.0 / EffectGamma); 112 | 113 | float3 Di = 1.0 - D; 114 | 115 | D = lerp(D, Di, Bleach); 116 | 117 | D.r = pow(abs(D.r), 1.0 / EffectGammaR); 118 | D.g = pow(abs(D.g), 1.0 / EffectGammaG); 119 | D.b = pow(abs(D.b), 1.0 / EffectGammaB); 120 | 121 | if (D.r < 0.5) 122 | C.r = (2.0 * D.r - 1.0) * (B.r - B.r * B.r) + B.r; 123 | else 124 | C.r = (2.0 * D.r - 1.0) * (sqrt(B.r) - B.r) + B.r; 125 | 126 | if (D.g < 0.5) 127 | C.g = (2.0 * D.g - 1.0) * (B.g - B.g * B.g) + B.g; 128 | else 129 | C.g = (2.0 * D.g - 1.0) * (sqrt(B.g) - B.g) + B.g; 130 | 131 | if (D.b < 0.5) 132 | C.b = (2.0 * D.b - 1.0) * (B.b - B.b * B.b) + B.b; 133 | else 134 | C.b = (2.0 * D.b - 1.0) * (sqrt(B.b) - B.b) + B.b; 135 | 136 | float3 F = lerp(B, C, Strength); 137 | 138 | F = (1.0 / (1.0 + exp(-d * (F - 0.5))) - v) / (1.0 - 2.0 * v); 139 | 140 | float r2R = 1.0 - Saturation; 141 | float g2R = 0.0 + Saturation; 142 | float b2R = 0.0 + Saturation; 143 | 144 | float r2G = 0.0 + Saturation; 145 | float g2G = (1.0 - Fade) - Saturation; 146 | float b2G = (0.0 + Fade) + Saturation; 147 | 148 | float r2B = 0.0 + Saturation; 149 | float g2B = (0.0 + Fade) + Saturation; 150 | float b2B = (1.0 - Fade) - Saturation; 151 | 152 | float3 iF = F; 153 | 154 | F.r = (iF.r * r2R + iF.g * g2R + iF.b * b2R); 155 | F.g = (iF.r * r2G + iF.g * g2G + iF.b * b2G); 156 | F.b = (iF.r * r2B + iF.g * g2B + iF.b * b2B); 157 | 158 | float N = dot(F.rgb, LumCoeff); 159 | float3 Cn = F; 160 | 161 | if (N < 0.5) 162 | Cn = (2.0 * N - 1.0) * (F - F * F) + F; 163 | else 164 | Cn = (2.0 * N - 1.0) * (sqrt(F) - F) + F; 165 | 166 | Cn = pow(max(Cn,0), 1.0 / Linearization); 167 | 168 | float3 Fn = lerp(B, Cn, Strength); 169 | return Fn; 170 | } 171 | 172 | technique FilmicPass 173 | { 174 | pass 175 | { 176 | VertexShader = PostProcessVS; 177 | PixelShader = FilmPass; 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/FineSharp.fx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Shader Library/Recommended/FineSharp.fx -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/HQ4X.fx: -------------------------------------------------------------------------------- 1 | // hq4x filter from https://www.shadertoy.com/view/MslGRS 2 | 3 | uniform float s < 4 | ui_type = "drag"; 5 | ui_min = 0.1; ui_max = 10.0; 6 | ui_label = "Strength"; 7 | ui_tooltip = "Strength of the effect"; 8 | > = 1.5; 9 | uniform float mx < 10 | ui_type = "drag"; 11 | ui_min = 0.0; ui_max = 1.0; 12 | ui_label = "Smoothing"; 13 | > = 1.0; 14 | uniform float k < 15 | ui_type = "drag"; 16 | ui_min = -2.0; ui_max = 0.0; 17 | ui_label = "Weight Decrease Factor"; 18 | > = -1.10; 19 | uniform float max_w < 20 | ui_type = "drag"; 21 | ui_min = 0.0; ui_max = 1.0; 22 | ui_label = "Max Filter Weight"; 23 | > = 0.75; 24 | uniform float min_w < 25 | ui_type = "drag"; 26 | ui_min = 0.0; ui_max = 1.0; 27 | ui_label = "Min Filter Weight"; 28 | > = 0.03; 29 | uniform float lum_add < 30 | ui_type = "drag"; 31 | ui_min = 0.0; ui_max = 1.0; 32 | ui_label = "Effects Smoothing"; 33 | > = 0.33; 34 | 35 | #include "ReShade.fxh" 36 | 37 | float3 PS_HQ4X(float4 pos : SV_Position, float2 uv : TexCoord) : SV_Target 38 | { 39 | float x = s * ReShade::PixelSize.x; 40 | float y = s * ReShade::PixelSize.y; 41 | 42 | const float3 dt = 1.0 * float3(1.0, 1.0, 1.0); 43 | 44 | float2 dg1 = float2( x, y); 45 | float2 dg2 = float2(-x, y); 46 | 47 | float2 sd1 = dg1 * 0.5; 48 | float2 sd2 = dg2 * 0.5; 49 | 50 | float2 ddx = float2(x, 0.0); 51 | float2 ddy = float2(0.0, y); 52 | 53 | float4 t1 = float4(uv - sd1, uv - ddy); 54 | float4 t2 = float4(uv - sd2, uv + ddx); 55 | float4 t3 = float4(uv + sd1, uv + ddy); 56 | float4 t4 = float4(uv + sd2, uv - ddx); 57 | float4 t5 = float4(uv - dg1, uv - dg2); 58 | float4 t6 = float4(uv + dg1, uv + dg2); 59 | 60 | float3 c = tex2D(ReShade::BackBuffer, uv).rgb; 61 | 62 | float3 i1 = tex2D(ReShade::BackBuffer, t1.xy).rgb; 63 | float3 i2 = tex2D(ReShade::BackBuffer, t2.xy).rgb; 64 | float3 i3 = tex2D(ReShade::BackBuffer, t3.xy).rgb; 65 | float3 i4 = tex2D(ReShade::BackBuffer, t4.xy).rgb; 66 | 67 | float3 o1 = tex2D(ReShade::BackBuffer, t5.xy).rgb; 68 | float3 o3 = tex2D(ReShade::BackBuffer, t6.xy).rgb; 69 | float3 o2 = tex2D(ReShade::BackBuffer, t5.zw).rgb; 70 | float3 o4 = tex2D(ReShade::BackBuffer, t6.zw).rgb; 71 | 72 | float3 s1 = tex2D(ReShade::BackBuffer, t1.zw).rgb; 73 | float3 s2 = tex2D(ReShade::BackBuffer, t2.zw).rgb; 74 | float3 s3 = tex2D(ReShade::BackBuffer, t3.zw).rgb; 75 | float3 s4 = tex2D(ReShade::BackBuffer, t4.zw).rgb; 76 | 77 | float ko1 = dot(abs(o1 - c), dt); 78 | float ko2 = dot(abs(o2 - c), dt); 79 | float ko3 = dot(abs(o3 - c), dt); 80 | float ko4 = dot(abs(o4 - c), dt); 81 | 82 | float k1=min(dot(abs(i1 - i3), dt), max(ko1, ko3)); 83 | float k2=min(dot(abs(i2 - i4), dt), max(ko2, ko4)); 84 | 85 | float w1 = k2; if (ko3 < ko1) w1 *= ko3 / ko1; 86 | float w2 = k1; if (ko4 < ko2) w2 *= ko4 / ko2; 87 | float w3 = k2; if (ko1 < ko3) w3 *= ko1 / ko3; 88 | float w4 = k1; if (ko2 < ko4) w4 *= ko2 / ko4; 89 | 90 | c = (w1 * o1 + w2 * o2 + w3 * o3 + w4 * o4 + 0.001 * c) / (w1 + w2 + w3 + w4 + 0.001); 91 | w1 = k * dot(abs(i1 - c) + abs(i3 - c), dt) / (0.125 * dot(i1 + i3, dt) + lum_add); 92 | w2 = k * dot(abs(i2 - c) + abs(i4 - c), dt) / (0.125 * dot(i2 + i4, dt) + lum_add); 93 | w3 = k * dot(abs(s1 - c) + abs(s3 - c), dt) / (0.125 * dot(s1 + s3, dt) + lum_add); 94 | w4 = k * dot(abs(s2 - c) + abs(s4 - c), dt) / (0.125 * dot(s2 + s4, dt) + lum_add); 95 | 96 | w1 = clamp(w1 + mx, min_w, max_w); 97 | w2 = clamp(w2 + mx, min_w, max_w); 98 | w3 = clamp(w3 + mx, min_w, max_w); 99 | w4 = clamp(w4 + mx, min_w, max_w); 100 | 101 | return ( 102 | w1 * (i1 + i3) + 103 | w2 * (i2 + i4) + 104 | w3 * (s1 + s3) + 105 | w4 * (s2 + s4) + 106 | c) / (2.0 * (w1 + w2 + w3 + w4) + 1.0); 107 | } 108 | 109 | technique HQ4X 110 | { 111 | pass 112 | { 113 | VertexShader = PostProcessVS; 114 | PixelShader = PS_HQ4X; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Layer.fx: -------------------------------------------------------------------------------- 1 | /*------------------. 2 | | :: Description :: | 3 | '-------------------/ 4 | 5 | Layer (version 0.1) 6 | 7 | Author: CeeJay.dk 8 | License: MIT 9 | 10 | About: 11 | Blends an image with the game. 12 | The idea is to give users with graphics skills the ability to create effects using a layer just like in an image editor. 13 | Maybe they could use this to create custom CRT effects, custom vignettes, logos, custom hud elements, toggable help screens and crafting tables or something I haven't thought of. 14 | 15 | Ideas for future improvement: 16 | * More blend modes 17 | * Texture size, placement and tiling control 18 | * A default Layer texture with something useful in it 19 | 20 | History: 21 | (*) Feature (+) Improvement (x) Bugfix (-) Information (!) Compatibility 22 | 23 | Version 0.1 24 | * 25 | */ 26 | 27 | #include "ReShade.fxh" 28 | 29 | #if LAYER_SINGLECHANNEL //I plan to have some option to let users set this for performance sake. 30 | #define TEXFORMAT R8 31 | #else 32 | #define TEXFORMAT RGBA8 33 | #endif 34 | 35 | //TODO blend by alpha 36 | uniform float Layer_Blend < 37 | ui_label = "Layer Blend"; 38 | ui_tooltip = "How much to blend layer with the original image."; 39 | ui_type = "drag"; 40 | ui_min = 0.0; 41 | ui_max = 1.0; 42 | ui_step = 0.002; 43 | > = 1.0; 44 | 45 | texture Layer_texture { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format=TEXFORMAT; }; 46 | 47 | sampler Layer_sampler { Texture = Layer_texture; }; 48 | 49 | float3 PS_Layer(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target { 50 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 51 | float4 layer = tex2D(Layer_sampler, texcoord).rgba; 52 | 53 | color = lerp(color, layer.rgb, layer.a * Layer_Blend); 54 | 55 | return color; 56 | //return layer.aaa; 57 | } 58 | 59 | technique Layer { 60 | pass 61 | { 62 | VertexShader = PostProcessVS; 63 | PixelShader = PS_Layer; 64 | } 65 | } -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/LiftGammaGain.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Lift Gamma Gain version 1.1 3 | * by 3an and CeeJay.dk 4 | */ 5 | 6 | uniform float3 RGB_Lift < 7 | ui_type = "drag"; 8 | ui_min = 0.0; ui_max = 2.0; 9 | ui_label = "RGB Lift"; 10 | ui_tooltip = "Adjust shadows for Red, Green and Blue."; 11 | > = float3(1.0, 1.0, 1.0); 12 | uniform float3 RGB_Gamma < 13 | ui_type = "drag"; 14 | ui_min = 0.0; ui_max = 2.0; 15 | ui_label = "RGB Gamma"; 16 | ui_tooltip = "Adjust midtones for Red, Green and Blue."; 17 | > = float3(1.0, 1.0, 1.0); 18 | uniform float3 RGB_Gain < 19 | ui_type = "drag"; 20 | ui_min = 0.0; ui_max = 2.0; 21 | ui_label = "RGB Gain"; 22 | ui_tooltip = "Adjust highlights for Red, Green and Blue."; 23 | > = float3(1.0, 1.0, 1.0); 24 | 25 | 26 | #include "ReShade.fxh" 27 | 28 | float3 LiftGammaGainPass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target 29 | { 30 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 31 | 32 | // -- Lift -- 33 | color = color * (1.5 - 0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5; 34 | color = saturate(color); // Is not strictly necessary, but does not cost performance 35 | 36 | // -- Gain -- 37 | color *= RGB_Gain; 38 | 39 | // -- Gamma -- 40 | color = pow(color, 1.0 / RGB_Gamma); 41 | 42 | return saturate(color); 43 | } 44 | 45 | 46 | technique LiftGammaGain 47 | { 48 | pass 49 | { 50 | VertexShader = PostProcessVS; 51 | PixelShader = LiftGammaGainPass; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Monochrome.fx: -------------------------------------------------------------------------------- 1 | /*------------------. 2 | | :: Description :: | 3 | '-------------------/ 4 | 5 | Monochrome (version 1.1) 6 | 7 | Author: CeeJay.dk 8 | License: MIT 9 | 10 | About: 11 | Removes color making everything monochrome. 12 | 13 | Ideas for future improvement: 14 | * Tinting 15 | * Select a hue to keep its color, thus making it stand out against a monochrome background 16 | * Try Lab colorspace 17 | * Apply color gradient 18 | * Add an option to normalize the coefficients 19 | * Publish best-selling book titled "256 shades of grey" 20 | 21 | History: 22 | (*) Feature (+) Improvement (x) Bugfix (-) Information (!) Compatibility 23 | 24 | Version 1.0 25 | * Converts image to monochrome 26 | * Allows users to add saturation back in. 27 | 28 | Version 1.1 29 | * Added many presets based on B/W camera films 30 | + Improved settings UI 31 | ! Made settings backwards compatible with SweetFX 32 | 33 | */ 34 | 35 | 36 | /*---------------. 37 | | :: Includes :: | 38 | '---------------*/ 39 | 40 | #include "ReShade.fxh" 41 | 42 | uniform int Monochrome_preset < 43 | ui_type = "combo"; 44 | ui_label = "Preset"; 45 | ui_tooltip = "Choose a preset"; 46 | //ui_category = ""; 47 | ui_items = "Custom\0" 48 | "Monitor or modern TV\0" 49 | "Equal weight\0" 50 | "Agfa 200X\0" 51 | "Agfapan 25\0" 52 | "Agfapan 100\0" 53 | "Agfapan 400\0" 54 | "Ilford Delta 100\0" 55 | "Ilford Delta 400\0" 56 | "Ilford Delta 400 Pro & 3200\0" 57 | "Ilford FP4\0" 58 | "Ilford HP5\0" 59 | "Ilford Pan F\0" 60 | "Ilford SFX\0" 61 | "Ilford XP2 Super\0" 62 | "Kodak Tmax 100\0" 63 | "Kodak Tmax 400\0" 64 | "Kodak Tri-X\0"; 65 | > = 0; 66 | 67 | uniform float3 Monochrome_conversion_values < 68 | ui_type = "color"; 69 | ui_label = "Custom Conversion values"; 70 | > = float3(0.21, 0.72, 0.07); 71 | 72 | /* 73 | uniform bool Normalize < 74 | ui_label = "Normalize"; 75 | ui_tooltip = "Normalize the coefficients?"; 76 | > = false; 77 | */ 78 | 79 | uniform float Monochrome_color_saturation < 80 | ui_label = "Saturation"; 81 | ui_type = "drag"; 82 | ui_min = 0.0; ui_max = 1.0; 83 | > = 0.0; 84 | 85 | float3 MonochromePass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 86 | { 87 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 88 | 89 | float3 Coefficients = float3(0.21, 0.72, 0.07); 90 | 91 | float3 Coefficients_array[18] = 92 | { 93 | Monochrome_conversion_values, //Custom 94 | float3(0.21, 0.72, 0.07), //sRGB monitor 95 | float3(0.3333333, 0.3333334, 0.3333333), //Equal weight 96 | float3(0.18, 0.41, 0.41), //Agfa 200X 97 | float3(0.25, 0.39, 0.36), //Agfapan 25 98 | float3(0.21, 0.40, 0.39), //Agfapan 100 99 | float3(0.20, 0.41, 0.39), //Agfapan 400 100 | float3(0.21, 0.42, 0.37), //Ilford Delta 100 101 | float3(0.22, 0.42, 0.36), //Ilford Delta 400 102 | float3(0.31, 0.36, 0.33), //Ilford Delta 400 Pro & 3200 103 | float3(0.28, 0.41, 0.31), //Ilford FP4 104 | float3(0.23, 0.37, 0.40), //Ilford HP5 105 | float3(0.33, 0.36, 0.31), //Ilford Pan F 106 | float3(0.36, 0.31, 0.33), //Ilford SFX 107 | float3(0.21, 0.42, 0.37), //Ilford XP2 Super 108 | float3(0.24, 0.37, 0.39), //Kodak Tmax 100 109 | float3(0.27, 0.36, 0.37), //Kodak Tmax 400 110 | float3(0.25, 0.35, 0.40) //Kodak Tri-X 111 | }; 112 | 113 | Coefficients = Coefficients_array[Monochrome_preset]; 114 | 115 | // Calculate monochrome 116 | float3 grey = dot(Coefficients, color); 117 | 118 | // Adjust the remaining saturation 119 | color = lerp(grey, color, Monochrome_color_saturation); 120 | 121 | // Return the result 122 | return saturate(color); 123 | } 124 | 125 | technique Monochrome 126 | { 127 | pass 128 | { 129 | VertexShader = PostProcessVS; 130 | PixelShader = MonochromePass; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/MultiLUT.fx: -------------------------------------------------------------------------------- 1 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | // ReShade effect file 3 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 | // Multi-LUT shader, using a texture atlas with multiple LUTs 5 | // by Otis / Infuse Project. 6 | // Based on Marty's LUT shader 1.0 for ReShade 3.0 7 | // Copyright © 2008-2016 Marty McFly 8 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 9 | 10 | #ifndef fLUT_TextureName 11 | #define fLUT_TextureName "MultiLut_Atlas1.png" 12 | #endif 13 | #ifndef fLUT_TileSizeXY 14 | #define fLUT_TileSizeXY 32 15 | #endif 16 | #ifndef fLUT_TileAmount 17 | #define fLUT_TileAmount 32 18 | #endif 19 | #ifndef fLUT_LutAmount 20 | #define fLUT_LutAmount 12 21 | #endif 22 | 23 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 24 | // 25 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 26 | 27 | uniform int fLUT_LutSelector < 28 | ui_type = "combo"; 29 | ui_min= 0; ui_max=11; 30 | ui_items="Neutral\0Color1\0Color2\0Color3 (Blue oriented)\0Color4 (Hollywood)\0Color5\0Color6\0Color7\0Color8\0Sepia\0\B&W mid constrast\0\B&W high contrast\0"; 31 | ui_label = "The LUT to use"; 32 | ui_tooltip = "The LUT to use for color transformation. 'Neutral' doesn't do any color transformation."; 33 | > = 0; 34 | 35 | uniform float fLUT_AmountChroma < 36 | ui_type = "drag"; 37 | ui_min = 0.00; ui_max = 1.00; 38 | ui_label = "LUT chroma amount"; 39 | ui_tooltip = "Intensity of color/chroma change of the LUT."; 40 | > = 1.00; 41 | 42 | uniform float fLUT_AmountLuma < 43 | ui_type = "drag"; 44 | ui_min = 0.00; ui_max = 1.00; 45 | ui_label = "LUT luma amount"; 46 | ui_tooltip = "Intensity of luma change of the LUT."; 47 | > = 1.00; 48 | 49 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 50 | // 51 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 52 | 53 | #include "ReShade.fxh" 54 | texture texMultiLUT < source = fLUT_TextureName; > { Width = fLUT_TileSizeXY*fLUT_TileAmount; Height = fLUT_TileSizeXY * fLUT_LutAmount; Format = RGBA8; }; 55 | sampler SamplerMultiLUT { Texture = texMultiLUT; }; 56 | 57 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 58 | // 59 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 60 | 61 | void PS_MultiLUT_Apply(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 res : SV_Target0) 62 | { 63 | float4 color = tex2D(ReShade::BackBuffer, texcoord.xy); 64 | float2 texelsize = 1.0 / fLUT_TileSizeXY; 65 | texelsize.x /= fLUT_TileAmount; 66 | 67 | float3 lutcoord = float3((color.xy*fLUT_TileSizeXY-color.xy+0.5)*texelsize.xy,color.z*fLUT_TileSizeXY-color.z); 68 | lutcoord.y /= fLUT_LutAmount; 69 | lutcoord.y += (float(fLUT_LutSelector)/ fLUT_LutAmount); 70 | float lerpfact = frac(lutcoord.z); 71 | lutcoord.x += (lutcoord.z-lerpfact)*texelsize.y; 72 | 73 | float3 lutcolor = lerp(tex2D(SamplerMultiLUT, lutcoord.xy).xyz, tex2D(SamplerMultiLUT, float2(lutcoord.x+texelsize.y,lutcoord.y)).xyz,lerpfact); 74 | 75 | color.xyz = lerp(normalize(color.xyz), normalize(lutcolor.xyz), fLUT_AmountChroma) * 76 | lerp(length(color.xyz), length(lutcolor.xyz), fLUT_AmountLuma); 77 | 78 | res.xyz = color.xyz; 79 | res.w = 1.0; 80 | } 81 | 82 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 83 | // 84 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 85 | 86 | 87 | technique MultiLUT 88 | { 89 | pass MultiLUT_Apply 90 | { 91 | VertexShader = PostProcessVS; 92 | PixelShader = PS_MultiLUT_Apply; 93 | } 94 | } -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/NightVision.fx: -------------------------------------------------------------------------------- 1 | #include "ReShade.fxh" 2 | 3 | uniform float iGlobalTime < source = "timer"; >; 4 | 5 | float hash(in float n) { return frac(sin(n)*43758.5453123); } 6 | 7 | float mod(float x, float y) 8 | { 9 | return x - y * floor (x/y); 10 | } 11 | 12 | float3 PS_Nightvision(float4 pos : SV_Position, float2 uv : TEXCOORD0) : SV_Target 13 | { 14 | float2 p = uv; 15 | 16 | float2 u = p * 2. - 1.; 17 | float2 n = u * float2(ReShade::ScreenSize.x / ReShade::ScreenSize.y, 1.0); 18 | float3 c = tex2D(ReShade::BackBuffer, uv).xyz; 19 | 20 | // flicker, grain, vignette, fade in 21 | c += sin(hash(iGlobalTime*0.001)) * 0.01; 22 | c += hash((hash(n.x) + n.y) * iGlobalTime*0.001) * 0.5; 23 | c *= smoothstep(length(n * n * n * float2(0.0, 0.0)), 1.0, 0.4); 24 | c *= smoothstep(0.001, 3.5, iGlobalTime*0.001) * 1.5; 25 | 26 | c = dot(c, float3(0.2126, 0.7152, 0.0722)) 27 | * float3(0.2, 1.5 - hash(iGlobalTime*0.001) * 0.1,0.4); 28 | 29 | return c; 30 | } 31 | 32 | technique Nightvision { 33 | pass Nightvision { 34 | VertexShader=PostProcessVS; 35 | PixelShader=PS_Nightvision; 36 | } 37 | } -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Prism.fx: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2018 Jacob Maximilian Fober 3 | 4 | This work is licensed under the Creative Commons 5 | Attribution-NonCommercial-ShareAlike 4.0 International License. 6 | To view a copy of this license, visit 7 | http://creativecommons.org/licenses/by-nc-sa/4.0/. 8 | */ 9 | 10 | // Chromatic Aberration PS (Prism) v1.2.0 11 | // inspired by Marty McFly YACA shader 12 | 13 | //////////////////// 14 | /////// MENU /////// 15 | //////////////////// 16 | 17 | #ifndef ShaderAnalyzer 18 | 19 | uniform int Aberration < 20 | ui_label = "Aberration scale in pixels"; 21 | ui_type = "drag"; 22 | ui_min = -48; ui_max = 48; 23 | > = 6; 24 | 25 | uniform float Curve < 26 | ui_label = "Aberration curve"; 27 | ui_type = "drag"; 28 | ui_min = 0.0; ui_max = 4.0; ui_step = 0.01; 29 | > = 1.0; 30 | 31 | uniform bool Automatic < 32 | ui_label = "Automatic sample count"; 33 | ui_tooltip = "Amount of samples will be adjusted automatically"; 34 | ui_category = "Performance"; 35 | > = true; 36 | 37 | uniform int SampleCount < 38 | ui_label = "Samples"; 39 | ui_tooltip = "Amount of samples (only even numbers are accepted, odd numbers will be clamped)"; 40 | ui_type = "drag"; 41 | ui_min = 6; ui_max = 32; 42 | ui_category = "Performance"; 43 | > = 8; 44 | 45 | #endif 46 | 47 | ////////////////////// 48 | /////// SHADER /////// 49 | ////////////////////// 50 | 51 | #include "ReShade.fxh" 52 | 53 | // Special Hue generator by JMF 54 | float3 Spectrum(float Hue) 55 | { 56 | float Hue4 = Hue * 4.0; 57 | float3 HueColor = abs(Hue4 - float3(1.0, 2.0, 1.0)); 58 | HueColor = saturate(1.5 - HueColor); 59 | HueColor.xz += saturate(Hue4 - 3.5); 60 | HueColor.z = 1.0 - HueColor.z; 61 | return HueColor; 62 | } 63 | 64 | // Define screen texture with mirror tiles 65 | sampler SamplerColor 66 | { 67 | Texture = ReShade::BackBufferTex; 68 | AddressU = MIRROR; 69 | AddressV = MIRROR; 70 | }; 71 | 72 | void ChromaticAberrationPS(float4 vois : SV_Position, float2 texcoord : TexCoord, 73 | out float3 BluredImage : SV_Target) 74 | { 75 | // Grab Aspect Ratio 76 | float Aspect = ReShade::AspectRatio; 77 | // Grab Pixel V size 78 | float Pixel = ReShade::PixelSize.y; 79 | 80 | // Adjust number of samples 81 | // IF Automatic IS True Ceil odd numbers to even with minimum 6, else Clamp odd numbers to even 82 | int Samples = Automatic ? max(6, 2 * ceil(abs(Aberration) * 0.5) + 2) : floor(SampleCount * 0.5) * 2; 83 | // Clamp maximum sample count 84 | Samples = min(Samples, 48); 85 | 86 | // Convert UVs to radial coordinates with correct Aspect Ratio 87 | float2 RadialCoord = texcoord * 2.0 - 1.0; 88 | RadialCoord.x *= Aspect; 89 | 90 | // Generate radial mask from center (0) to the corner of the screen (1) 91 | float Mask = pow(length(RadialCoord) * rsqrt(Aspect * Aspect + 1.0), Curve); 92 | 93 | float OffsetBase = Mask * Aberration * Pixel * 2.0; 94 | 95 | // Each loop represents one pass 96 | if (abs(OffsetBase) < Pixel) 97 | { 98 | BluredImage = tex2D(SamplerColor, texcoord).rgb; 99 | } 100 | else 101 | { 102 | for (int P = 0; P < Samples && P <= 48; P++) 103 | { 104 | // Calculate current sample 105 | float CurrentProgress = float(P) / float(Samples); 106 | 107 | float Offset = OffsetBase * (CurrentProgress - 0.5) + 1.0; 108 | 109 | // Scale UVs at center 110 | float2 Position = RadialCoord / Offset; 111 | // Convert aspect ratio back to square 112 | Position.x /= Aspect; 113 | // Convert radial coordinates to UV 114 | Position = Position * 0.5 + 0.5; 115 | 116 | // Multiply texture sample by HUE color 117 | BluredImage += Spectrum(CurrentProgress) * tex2Dlod(SamplerColor, float4(Position, 0, 0)).rgb; 118 | } 119 | BluredImage = BluredImage / Samples * 2.0; 120 | } 121 | } 122 | 123 | technique ChromaticAberration 124 | { 125 | pass 126 | { 127 | VertexShader = PostProcessVS; 128 | PixelShader = ChromaticAberrationPS; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Sepia.fx: -------------------------------------------------------------------------------- 1 | uniform float3 Tint < 2 | ui_type = "color"; 3 | > = float3(0.55, 0.43, 0.42); 4 | 5 | uniform float Strength < 6 | ui_type = "drag"; 7 | ui_min = 0.0; ui_max = 1.0; 8 | > = 0.58; 9 | 10 | #include "ReShade.fxh" 11 | 12 | float3 TintPass(float4 vois : SV_Position, float2 texcoord : TexCoord) : SV_Target 13 | { 14 | float3 col = tex2D(ReShade::BackBuffer, texcoord).rgb; 15 | 16 | return lerp(col, col * Tint * 2.55, Strength); 17 | } 18 | 19 | technique Tint 20 | { 21 | pass 22 | { 23 | VertexShader = PostProcessVS; 24 | PixelShader = TintPass; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Technicolor.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Technicolor version 1.1 3 | * Original by DKT70 4 | * Optimized by CeeJay.dk 5 | */ 6 | 7 | uniform float Power < 8 | ui_type = "drag"; 9 | ui_min = 0.0; ui_max = 8.0; 10 | > = 4.0; 11 | uniform float3 RGBNegativeAmount < 12 | ui_type = "color"; 13 | > = float3(0.88, 0.88, 0.88); 14 | 15 | uniform float Strength < 16 | ui_type = "drag"; 17 | ui_min = 0.0; ui_max = 1.0; 18 | > = 0.4; 19 | 20 | #include "ReShade.fxh" 21 | 22 | float3 TechnicolorPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 23 | { 24 | const float3 cyanfilter = float3(0.0, 1.30, 1.0); 25 | const float3 magentafilter = float3(1.0, 0.0, 1.05); 26 | const float3 yellowfilter = float3(1.6, 1.6, 0.05); 27 | const float2 redorangefilter = float2(1.05, 0.620); // RG_ 28 | const float2 greenfilter = float2(0.30, 1.0); // RG_ 29 | const float2 magentafilter2 = magentafilter.rb; // R_B 30 | 31 | float3 tcol = tex2D(ReShade::BackBuffer, texcoord).rgb; 32 | 33 | float2 negative_mul_r = tcol.rg * (1.0 / (RGBNegativeAmount.r * Power)); 34 | float2 negative_mul_g = tcol.rg * (1.0 / (RGBNegativeAmount.g * Power)); 35 | float2 negative_mul_b = tcol.rb * (1.0 / (RGBNegativeAmount.b * Power)); 36 | float3 output_r = dot(redorangefilter, negative_mul_r).xxx + cyanfilter; 37 | float3 output_g = dot(greenfilter, negative_mul_g).xxx + magentafilter; 38 | float3 output_b = dot(magentafilter2, negative_mul_b).xxx + yellowfilter; 39 | 40 | return lerp(tcol, output_r * output_g * output_b, Strength); 41 | } 42 | 43 | technique Technicolor 44 | { 45 | pass 46 | { 47 | VertexShader = PostProcessVS; 48 | PixelShader = TechnicolorPass; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Technicolor2.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Technicolor2 version 1.0 3 | * Original by Prod80 4 | * Optimized by CeeJay.dk 5 | */ 6 | 7 | uniform float3 ColorStrength < 8 | ui_type = "color"; 9 | ui_tooltip = "Higher means darker and more intense colors."; 10 | > = float3(0.2, 0.2, 0.2); 11 | 12 | uniform float Brightness < 13 | ui_type = "drag"; 14 | ui_min = 0.5; ui_max = 1.5; 15 | ui_tooltip = "Higher means brighter image."; 16 | > = 1.0; 17 | uniform float Saturation < 18 | ui_type = "drag"; 19 | ui_min = 0.0; ui_max = 1.5; 20 | ui_tooltip = "Additional saturation control since this effect tends to oversaturate the image."; 21 | > = 1.0; 22 | 23 | uniform float Strength < 24 | ui_type = "drag"; 25 | ui_min = 0.0; ui_max = 1.0; 26 | > = 1.0; 27 | 28 | #include "ReShade.fxh" 29 | 30 | float3 TechnicolorPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 31 | { 32 | float3 color = saturate(tex2D(ReShade::BackBuffer, texcoord).rgb); 33 | 34 | float3 temp = 1.0 - color; 35 | float3 target = temp.grg; 36 | float3 target2 = temp.bbr; 37 | float3 temp2 = color * target; 38 | temp2 *= target2; 39 | 40 | temp = temp2 * ColorStrength; 41 | temp2 *= Brightness; 42 | 43 | target = temp.grg; 44 | target2 = temp.bbr; 45 | 46 | temp = color - target; 47 | temp += temp2; 48 | temp2 = temp - target2; 49 | 50 | color = lerp(color, temp2, Strength); 51 | color = lerp(dot(color, 0.333), color, Saturation); 52 | 53 | return color; 54 | } 55 | 56 | technique Technicolor2 57 | { 58 | pass 59 | { 60 | VertexShader = PostProcessVS; 61 | PixelShader = TechnicolorPass; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/TiltShift.fx: -------------------------------------------------------------------------------- 1 | /* 2 | Tilt-Shift PS v1.0.5 (c) 2018 Jacob Maximilian Fober, 3 | (based on TiltShift effect (c) 2016 kingeric1992) 4 | 5 | This work is licensed under the Creative Commons 6 | Attribution-ShareAlike 4.0 International License. 7 | To view a copy of this license, visit 8 | http://creativecommons.org/licenses/by-sa/4.0/. 9 | */ 10 | 11 | uniform bool Line < 12 | ui_label = "Show Center Line"; 13 | > = false; 14 | 15 | uniform int Axis < 16 | ui_label = "Angle"; 17 | ui_type = "drag"; 18 | ui_min = -89; ui_max = 90; ui_step = 1; 19 | > = 0; 20 | 21 | uniform float Offset < 22 | ui_type = "drag"; 23 | ui_min = -1.41; ui_max = 1.41; ui_step = 0.01; 24 | > = 0.05; 25 | 26 | uniform float BlurCurve < 27 | ui_label = "Blur Curve"; 28 | ui_type = "drag"; 29 | ui_min = 1.0; ui_max = 5.0; ui_step = 0.01; 30 | ui_label = "Blur Curve"; 31 | > = 1.0; 32 | uniform float BlurMultiplier < 33 | ui_label = "Blur Multiplier"; 34 | ui_type = "drag"; 35 | ui_min = 0.0; ui_max = 100.0; ui_step = 0.2; 36 | > = 6.0; 37 | 38 | // First pass render target, to make sure Alpha channel exists 39 | texture TiltShiftTarget { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 40 | sampler TiltShiftSampler { Texture = TiltShiftTarget; }; 41 | 42 | #include "ReShade.fxh" 43 | 44 | void TiltShiftPass1PS(float4 vpos : SV_Position, float2 UvCoord : TEXCOORD, out float4 Image : SV_Target) 45 | { 46 | const float Weight[11] = 47 | { 48 | 0.082607, 49 | 0.080977, 50 | 0.076276, 51 | 0.069041, 52 | 0.060049, 53 | 0.050187, 54 | 0.040306, 55 | 0.031105, 56 | 0.023066, 57 | 0.016436, 58 | 0.011254 59 | }; 60 | // Grab screen texture 61 | Image.rgb = tex2D(ReShade::BackBuffer, UvCoord).rgb; 62 | // Correct Aspect Ratio 63 | float2 UvCoordAspect = UvCoord; 64 | UvCoordAspect.y += ReShade::AspectRatio * 0.5 - 0.5; 65 | UvCoordAspect.y /= ReShade::AspectRatio; 66 | // Center coordinates 67 | UvCoordAspect = UvCoordAspect * 2 - 1; 68 | // Tilt vector 69 | float Angle = radians(-Axis); 70 | float2 TiltVector = float2(sin(Angle), cos(Angle)); 71 | // Blur mask 72 | float BlurMask = abs(dot(TiltVector, UvCoordAspect) + Offset); 73 | BlurMask = max(0, min(1, BlurMask)); 74 | // Set alpha channel 75 | Image.a = BlurMask; 76 | BlurMask = pow(Image.a, BlurCurve); 77 | // Horizontal gaussian blur 78 | if (BlurMask > 0) 79 | { 80 | float UvOffset = ReShade::PixelSize.x * BlurMask * BlurMultiplier; 81 | Image.rgb *= Weight[0]; 82 | for (int i = 1; i < 11; i++) 83 | { 84 | float SampleOffset = i * UvOffset; 85 | Image.rgb += ( 86 | tex2Dlod(ReShade::BackBuffer, float4(UvCoord.xy + float2(SampleOffset, 0), 0, 0)).rgb 87 | + tex2Dlod(ReShade::BackBuffer, float4(UvCoord.xy - float2(SampleOffset, 0), 0, 0)).rgb 88 | ) * Weight[i]; 89 | } 90 | } 91 | } 92 | 93 | void TiltShiftPass2PS(float4 vpos : SV_Position, float2 UvCoord : TEXCOORD, out float4 Image : SV_Target) 94 | { 95 | const float Weight[11] = 96 | { 97 | 0.082607, 98 | 0.080977, 99 | 0.076276, 100 | 0.069041, 101 | 0.060049, 102 | 0.050187, 103 | 0.040306, 104 | 0.031105, 105 | 0.023066, 106 | 0.016436, 107 | 0.011254 108 | }; 109 | // Grab second pass screen texture 110 | Image = tex2D(TiltShiftSampler, UvCoord); 111 | // Blur mask 112 | float BlurMask = pow(Image.a, BlurCurve); 113 | // Vertical gaussian blur 114 | if (BlurMask > 0) 115 | { 116 | float UvOffset = ReShade::PixelSize.y * BlurMask * BlurMultiplier; 117 | Image.rgb *= Weight[0]; 118 | for (int i = 1; i < 11; i++) 119 | { 120 | float SampleOffset = i * UvOffset; 121 | Image.rgb += ( 122 | tex2Dlod(TiltShiftSampler, float4(UvCoord.xy + float2(0, SampleOffset), 0, 0)).rgb 123 | + tex2Dlod(TiltShiftSampler, float4(UvCoord.xy - float2(0, SampleOffset), 0, 0)).rgb 124 | ) * Weight[i]; 125 | } 126 | } 127 | // Draw red line 128 | // Image IS Red IF (Line IS True AND Image.a < 0.01), ELSE Image IS Image 129 | Image.rgb = (Line && Image.a < 0.01) ? float3(1, 0, 0) : Image.rgb; 130 | } 131 | 132 | technique TiltShift 133 | { 134 | pass AlphaAndHorizontalGaussianBlur 135 | { 136 | VertexShader = PostProcessVS; 137 | PixelShader = TiltShiftPass1PS; 138 | RenderTarget = TiltShiftTarget; 139 | } 140 | pass VerticalGaussianBlurAndRedLine 141 | { 142 | VertexShader = PostProcessVS; 143 | PixelShader = TiltShiftPass2PS; 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/Tonemap.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Tonemap version 1.1 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | */ 5 | 6 | uniform float Gamma < 7 | ui_type = "drag"; 8 | ui_min = 0.0; ui_max = 2.0; 9 | ui_tooltip = "Adjust midtones. 1.000 is neutral. This setting does exactly the same as the one in Lift Gamma Gain, only with less control."; 10 | > = 1.0; 11 | uniform float Exposure < 12 | ui_type = "drag"; 13 | ui_min = -1.0; ui_max = 1.0; 14 | ui_tooltip = "Adjust exposure"; 15 | > = 0.0; 16 | uniform float Saturation < 17 | ui_type = "drag"; 18 | ui_min = -1.0; ui_max = 1.0; 19 | ui_tooltip = "Adjust saturation"; 20 | > = 0.0; 21 | 22 | uniform float Bleach < 23 | ui_type = "drag"; 24 | ui_min = 0.0; ui_max = 1.0; 25 | ui_tooltip = "Brightens the shadows and fades the colors"; 26 | > = 0.0; 27 | 28 | uniform float Defog < 29 | ui_type = "drag"; 30 | ui_min = 0.0; ui_max = 1.0; 31 | ui_tooltip = "How much of the color tint to remove"; 32 | > = 0.0; 33 | uniform float3 FogColor < 34 | ui_type = "color"; 35 | ui_label = "Defog Color"; 36 | ui_tooltip = "Which color tint to remove"; 37 | > = float3(0.0, 0.0, 1.0); 38 | 39 | 40 | #include "ReShade.fxh" 41 | 42 | float3 TonemapPass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target 43 | { 44 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 45 | color = saturate(color - Defog * FogColor * 2.55); // Defog 46 | color *= pow(2.0f, Exposure); // Exposure 47 | color = pow(color, Gamma); // Gamma 48 | 49 | const float3 coefLuma = float3(0.2126, 0.7152, 0.0722); 50 | float lum = dot(coefLuma, color); 51 | 52 | float L = saturate(10.0 * (lum - 0.45)); 53 | float3 A2 = Bleach * color; 54 | 55 | float3 result1 = 2.0f * color * lum; 56 | float3 result2 = 1.0f - 2.0f * (1.0f - lum) * (1.0f - color); 57 | 58 | float3 newColor = lerp(result1, result2, L); 59 | float3 mixRGB = A2 * newColor; 60 | color += ((1.0f - A2) * mixRGB); 61 | 62 | float3 middlegray = dot(color, (1.0 / 3.0)); 63 | float3 diffcolor = color - middlegray; 64 | color = (color + diffcolor * Saturation) / (1 + (diffcolor * Saturation)); // Saturation 65 | 66 | return color; 67 | } 68 | 69 | technique Tonemap 70 | { 71 | pass 72 | { 73 | VertexShader = PostProcessVS; 74 | PixelShader = TonemapPass; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/UIDetect.fx: -------------------------------------------------------------------------------- 1 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | // ReShade effect file 3 | // UIDetect by brussell 4 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 | 6 | /* 7 | This shader can be used to toggle effects depending on the visibility 8 | of UI elements. Unlike UIMask, that uses a mask to decide which area of 9 | the screen should be effect-free, this one automatically turns off effects 10 | for the whole screen. It's useful for games, where one wants to use post- 11 | processing like DOF, CA or AO, which however shouldn't be active when 12 | certain UI elements are displayed (e.g. inventory, map, dialoque boxes, 13 | options menu etc.). Each UI is characterized by a number of user defined 14 | pixels, while the workflow to get their values could be like this: 15 | 16 | -take a screenshot without any effects when the UI is visible 17 | -open the screenshot in an image processing tool 18 | -look for a static and opaque area in the UI layer that is usually 19 | out of reach for user actions like the mouse cursor, tooltips etc. 20 | (usually somewhere in a corner of the screen) 21 | -use a color picker tool and choose two, three or more pixels, 22 | which are near to each other but differ greatly in color and brightness, 23 | and note the pixels coordinates and RGB values (thus choose pixels that 24 | do not likely occur in non-UI game situations, so that effects couldn't 25 | get toggled accidently when there is no UI visible) 26 | 27 | After that, write the pixel coordinates and RGB values to UIDetect.fxh 28 | (see further description there) 29 | 30 | Effect ordering: 31 | -UIDetect //must be first in pipeline (needs unaltered backbuffer) 32 | ... effects that affect UIs 33 | -UIDetect_Before //place before effects that shouldn't affect UI 34 | ... effects that should not affect UIs 35 | -UIDetect_After //place after effects that shouldn't affect UI 36 | ... effects that affect UIs 37 | 38 | Drawbacks: 39 | -does not work for transparent or nonstatic UIs obviously 40 | -pixels are only valid for one game resolution 41 | -pixel values can change with different hardware anti aliasing settings 42 | */ 43 | 44 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 45 | 46 | #include "ReShade.fxh" 47 | 48 | //textures and samplers 49 | texture texColor_Orig { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; }; 50 | sampler Color_Orig { Texture = texColor_Orig; }; 51 | 52 | texture texUIDetect { Width = 1; Height = 1; Format = R8; }; 53 | sampler UIDetect { Texture = texUIDetect; }; 54 | 55 | //pixel shaders 56 | float PS_UIDetect(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target { 57 | #include "UIDetect.fxh" 58 | 59 | float diff; 60 | float ui_detected = 0; 61 | float uilayer = 1; 62 | float nextuilayer = 0; 63 | 64 | for (int i=0; i < PIXELNUMBER; i++) 65 | { 66 | [branch] 67 | if (UIPixelCoord[i].z - uilayer == 0){ 68 | if (nextuilayer == 0){ 69 | diff = pow(dot(tex2Dlod(ReShade::BackBuffer, float4(UIPixelCoord[i].xy * ReShade::PixelSize.xy, 0, 0)).xyz - UIPixelRGB[i].xyz / 255.0, 0.333), 2); 70 | if (diff < 0.00001) { 71 | ui_detected = 1; 72 | }else{ 73 | ui_detected = 0; 74 | nextuilayer = 1; 75 | } 76 | } 77 | }else{ 78 | if (ui_detected == 1){ return ui_detected; } 79 | uilayer += 1; 80 | nextuilayer = 0; 81 | i -= 1; 82 | } 83 | } 84 | return ui_detected; 85 | } 86 | 87 | float4 PS_StoreColor(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target { 88 | return tex2D(ReShade::BackBuffer, texcoord); 89 | } 90 | 91 | float4 PS_RestoreColor(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target { 92 | float4 color = tex2D(UIDetect, float2(0,0)).x == 1.0 ? tex2D(Color_Orig, texcoord) : tex2D(ReShade::BackBuffer, texcoord); 93 | return color; 94 | } 95 | 96 | //techniques 97 | technique UIDetect { 98 | pass { 99 | VertexShader = PostProcessVS; 100 | PixelShader = PS_UIDetect; 101 | RenderTarget = texUIDetect; 102 | } 103 | } 104 | 105 | technique UIDetect_Before { 106 | pass { 107 | VertexShader = PostProcessVS; 108 | PixelShader = PS_StoreColor; 109 | RenderTarget = texColor_Orig; 110 | } 111 | } 112 | 113 | technique UIDetect_After { 114 | pass { 115 | VertexShader = PostProcessVS; 116 | PixelShader = PS_RestoreColor; 117 | } 118 | } -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shader Library/Recommended/qUINT_common.fxh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if !defined(__RESHADE__) || __RESHADE__ < 30000 4 | #error "ReShade 3.0+ is required to use this header file" 5 | #endif 6 | 7 | #ifndef RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 8 | #define RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 0 9 | #endif 10 | #ifndef RESHADE_DEPTH_INPUT_IS_REVERSED 11 | #define RESHADE_DEPTH_INPUT_IS_REVERSED 0 12 | #endif 13 | #ifndef RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 14 | #define RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 0 15 | #endif 16 | #ifndef RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 17 | #define RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 1000.0 18 | #endif 19 | 20 | namespace qUINT 21 | { 22 | uniform float FRAME_TIME ; 23 | 24 | static const float2 ASPECT_RATIO = float2(1.0, BUFFER_WIDTH * BUFFER_RCP_HEIGHT); 25 | static const float2 PIXEL_SIZE = float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT); 26 | static const float2 SCREEN_SIZE = float2(BUFFER_WIDTH, BUFFER_HEIGHT); 27 | 28 | // Global textures and samplers 29 | texture BackBufferTex : COLOR; 30 | texture DepthBufferTex : DEPTH; 31 | 32 | sampler sBackBufferTex { Texture = BackBufferTex; }; 33 | sampler sDepthBufferTex { Texture = DepthBufferTex; }; 34 | 35 | //reusable textures for the shaders 36 | texture2D CommonTex0 { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 37 | texture2D CommonTex1 { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 38 | 39 | sampler2D sCommonTex0 { Texture = CommonTex0; }; 40 | sampler2D sCommonTex1 { Texture = CommonTex1; }; 41 | 42 | // Helper functions 43 | float linear_depth(float2 uv) 44 | { 45 | #if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 46 | uv.y = 1.0 - uv.y; 47 | #endif 48 | float depth = tex2Dlod(sDepthBufferTex, float4(uv, 0, 0)).x; 49 | 50 | #if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 51 | const float C = 0.01; 52 | depth = (exp(depth * log(C + 1.0)) - 1.0) / C; 53 | #endif 54 | #if RESHADE_DEPTH_INPUT_IS_REVERSED 55 | depth = 1.0 - depth; 56 | #endif 57 | const float N = 1.0; 58 | depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N); 59 | 60 | return depth; 61 | } 62 | } 63 | 64 | // Vertex shader generating a triangle covering the entire screen 65 | void PostProcessVS(in uint id : SV_VertexID, out float4 vpos : SV_Position, out float2 uv : TEXCOORD) 66 | { 67 | uv.x = (id == 2) ? 2.0 : 0.0; 68 | uv.y = (id == 1) ? 2.0 : 0.0; 69 | vpos = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 70 | } -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shaders/README.txt: -------------------------------------------------------------------------------- 1 | Drop your favorite shaders here... -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shaders/ReShade.fxh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if !defined(__RESHADE__) || __RESHADE__ < 30000 4 | #error "ReShade 3.0+ is required to use this header file" 5 | #endif 6 | 7 | #ifndef RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 8 | #define RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 0 9 | #endif 10 | #ifndef RESHADE_DEPTH_INPUT_IS_REVERSED 11 | #define RESHADE_DEPTH_INPUT_IS_REVERSED 1 12 | #endif 13 | #ifndef RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 14 | #define RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 0 15 | #endif 16 | #ifndef RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 17 | #define RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 1000.0 18 | #endif 19 | 20 | namespace ReShade 21 | { 22 | // Global variables 23 | #if defined(__RESHADE_FXC__) 24 | float GetAspectRatio() { return BUFFER_WIDTH * BUFFER_RCP_HEIGHT; } 25 | float2 GetPixelSize() { return float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT); } 26 | float2 GetScreenSize() { return float2(BUFFER_WIDTH, BUFFER_HEIGHT); } 27 | #define AspectRatio GetAspectRatio() 28 | #define PixelSize GetPixelSize() 29 | #define ScreenSize GetScreenSize() 30 | #else 31 | static const float AspectRatio = BUFFER_WIDTH * BUFFER_RCP_HEIGHT; 32 | static const float2 PixelSize = float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT); 33 | static const float2 ScreenSize = float2(BUFFER_WIDTH, BUFFER_HEIGHT); 34 | #endif 35 | 36 | // Global textures and samplers 37 | texture BackBufferTex : COLOR; 38 | texture DepthBufferTex : DEPTH; 39 | 40 | sampler BackBuffer { Texture = BackBufferTex; }; 41 | sampler DepthBuffer { Texture = DepthBufferTex; }; 42 | 43 | // Helper functions 44 | float GetLinearizedDepth(float2 texcoord) 45 | { 46 | #if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 47 | texcoord.y = 1.0 - texcoord.y; 48 | #endif 49 | float depth = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x; 50 | 51 | #if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 52 | const float C = 0.01; 53 | depth = (exp(depth * log(C + 1.0)) - 1.0) / C; 54 | #endif 55 | #if RESHADE_DEPTH_INPUT_IS_REVERSED 56 | depth = 1.0 - depth; 57 | #endif 58 | const float N = 1.0; 59 | depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N); 60 | 61 | return depth; 62 | } 63 | } 64 | 65 | // Vertex shader generating a triangle covering the entire screen 66 | void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD) 67 | { 68 | texcoord.x = (id == 2) ? 2.0 : 0.0; 69 | texcoord.y = (id == 1) ? 2.0 : 0.0; 70 | position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 71 | } 72 | -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shaders/UIDetect.fxh: -------------------------------------------------------------------------------- 1 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | //UIDetect header file 3 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 | 5 | /* 6 | Description: 7 | 8 | PIXELNUMBER //total number of pixels used for UI detection 9 | UIPixelCoord[PIXELNUMBER] //the UI pixels screen space coordinates (top left is 0,0) and UI number; 10 | { 11 | float3(x1,y1,UI1), 12 | float3(x2,y2,UI1), 13 | float3(x3,y3,UI1), 14 | float3(x4,y4,UI2), 15 | float3(x5,y5,UI3), 16 | ... 17 | } 18 | UIPixelRGB[PIXELNUMBER] //the UI pixels RGB values 19 | { 20 | float3(Red1,Green1,Blue1), 21 | float3(Red2,Green2,Blue2), 22 | ... 23 | } 24 | */ 25 | 26 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 27 | 28 | 29 | //Game: COD4:MW 30 | //Resolution: 1920x1080 31 | 32 | #define PIXELNUMBER 8 33 | 34 | static const float3 UIPixelCoord[PIXELNUMBER]= 35 | { 36 | float3(562,121,1), //TAB - Mission details 37 | float3(614,121,1), 38 | float3(1589,106,2), //ESC - Menu 39 | float3(1695,106,2), 40 | float3(272,40,3), //Options, Controls 41 | float3(272,33,3), 42 | float3(1238,174,4), //Main Menu 43 | float3(1273,174,4), 44 | }; 45 | 46 | static const float3 UIPixelRGB[PIXELNUMBER]= 47 | { 48 | float3(255,204,102), 49 | float3(255,204,102), 50 | float3(255,204,102), 51 | float3(255,204,102), 52 | float3(255,204,102), 53 | float3(255,204,102), 54 | float3(255,255,250), 55 | float3(255,255,249), 56 | }; -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Shaders/qUINT_common.fxh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if !defined(__RESHADE__) || __RESHADE__ < 30000 4 | #error "ReShade 3.0+ is required to use this header file" 5 | #endif 6 | 7 | #ifndef RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 8 | #define RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 0 9 | #endif 10 | #ifndef RESHADE_DEPTH_INPUT_IS_REVERSED 11 | #define RESHADE_DEPTH_INPUT_IS_REVERSED 0 12 | #endif 13 | #ifndef RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 14 | #define RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 0 15 | #endif 16 | #ifndef RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 17 | #define RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 1000.0 18 | #endif 19 | 20 | namespace qUINT 21 | { 22 | uniform float FRAME_TIME ; 23 | 24 | static const float2 ASPECT_RATIO = float2(1.0, BUFFER_WIDTH * BUFFER_RCP_HEIGHT); 25 | static const float2 PIXEL_SIZE = float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT); 26 | static const float2 SCREEN_SIZE = float2(BUFFER_WIDTH, BUFFER_HEIGHT); 27 | 28 | // Global textures and samplers 29 | texture BackBufferTex : COLOR; 30 | texture DepthBufferTex : DEPTH; 31 | 32 | sampler sBackBufferTex { Texture = BackBufferTex; }; 33 | sampler sDepthBufferTex { Texture = DepthBufferTex; }; 34 | 35 | //reusable textures for the shaders 36 | texture2D CommonTex0 { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 37 | texture2D CommonTex1 { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 38 | 39 | sampler2D sCommonTex0 { Texture = CommonTex0; }; 40 | sampler2D sCommonTex1 { Texture = CommonTex1; }; 41 | 42 | // Helper functions 43 | float linear_depth(float2 uv) 44 | { 45 | #if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 46 | uv.y = 1.0 - uv.y; 47 | #endif 48 | float depth = tex2Dlod(sDepthBufferTex, float4(uv, 0, 0)).x; 49 | 50 | #if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 51 | const float C = 0.01; 52 | depth = (exp(depth * log(C + 1.0)) - 1.0) / C; 53 | #endif 54 | #if RESHADE_DEPTH_INPUT_IS_REVERSED 55 | depth = 1.0 - depth; 56 | #endif 57 | const float N = 1.0; 58 | depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N); 59 | 60 | return depth; 61 | } 62 | } 63 | 64 | // Vertex shader generating a triangle covering the entire screen 65 | void PostProcessVS(in uint id : SV_VertexID, out float4 vpos : SV_Position, out float2 uv : TEXCOORD) 66 | { 67 | uv.x = (id == 2) ? 2.0 : 0.0; 68 | uv.y = (id == 1) ? 2.0 : 0.0; 69 | vpos = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 70 | } -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/AreaTex.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/AreaTex.dds -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/Dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/Dirt.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/DirtOVB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/DirtOVB.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/DirtOVR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/DirtOVR.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/FontAtlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/FontAtlas.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/Layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/Layer.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/LensDB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/LensDB.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/LensDB2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/LensDB2.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/LensDOV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/LensDOV.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/LensDUV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/LensDUV.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/LensSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/LensSprite.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/MagicBloom_Dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/MagicBloom_Dirt.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/MultiLut_atlas1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/MultiLut_atlas1.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/SearchTex.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/SearchTex.dds -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/UIMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/UIMask.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/bayer16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/bayer16x16.png -------------------------------------------------------------------------------- /v3.X/reshade-shaders/Textures/lut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v3.X/reshade-shaders/Textures/lut.png -------------------------------------------------------------------------------- /v4.X/ReShade.ini: -------------------------------------------------------------------------------- 1 | [DX11_BUFFER_DETECTION] 2 | DepthBufferRetrievalMode=0 3 | DepthBufferTextureFormat=0 4 | ExtendedDepthBufferDetection=0 5 | DepthBufferClearingNumber=0 6 | 7 | [GENERAL] 8 | PerformanceMode=0 9 | TutorialProgress=5 10 | PreprocessorDefinitions=RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=1000.0,RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0,RESHADE_DEPTH_INPUT_IS_REVERSED=0,RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0 11 | ScreenshotFormat=1 12 | ShowClock=0 13 | ShowFPS=0 14 | FontGlobalScale=1.000000 15 | NoReloadOnInit=0 16 | SaveWindowState=1 17 | EffectSearchPaths=.\reshade-shaders\Shaders 18 | TextureSearchPaths=.\reshade-shaders\Textures -------------------------------------------------------------------------------- /v4.X/dxgi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/dxgi.dll -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Alternate/LUT.fx: -------------------------------------------------------------------------------- 1 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | // ReShade effect file 3 | // visit facebook.com/MartyMcModding for news/updates 4 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 | // Marty's LUT shader 1.0 for ReShade 3.0 6 | // Copyright © 2008-2016 Marty McFly 7 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 | 9 | #ifndef fLUT_TextureName 10 | #define fLUT_TextureName "lut.png" 11 | #endif 12 | #ifndef fLUT_TileSizeXY 13 | #define fLUT_TileSizeXY 32 14 | #endif 15 | #ifndef fLUT_TileAmount 16 | #define fLUT_TileAmount 32 17 | #endif 18 | 19 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 20 | // 21 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 22 | 23 | #include "ReShadeUI.fxh" 24 | 25 | uniform float fLUT_AmountChroma < __UNIFORM_SLIDER_FLOAT1 26 | ui_min = 0.00; ui_max = 1.00; 27 | ui_label = "LUT chroma amount"; 28 | ui_tooltip = "Intensity of color/chroma change of the LUT."; 29 | > = 1.00; 30 | 31 | uniform float fLUT_AmountLuma < __UNIFORM_SLIDER_FLOAT1 32 | ui_min = 0.00; ui_max = 1.00; 33 | ui_label = "LUT luma amount"; 34 | ui_tooltip = "Intensity of luma change of the LUT."; 35 | > = 1.00; 36 | 37 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 38 | // 39 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 40 | 41 | #include "ReShade.fxh" 42 | texture texLUT < source = fLUT_TextureName; > { Width = fLUT_TileSizeXY*fLUT_TileAmount; Height = fLUT_TileSizeXY; Format = RGBA8; }; 43 | sampler SamplerLUT { Texture = texLUT; }; 44 | 45 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 46 | // 47 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 48 | 49 | void PS_LUT_Apply(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 res : SV_Target0) 50 | { 51 | float4 color = tex2D(ReShade::BackBuffer, texcoord.xy); 52 | float2 texelsize = 1.0 / fLUT_TileSizeXY; 53 | texelsize.x /= fLUT_TileAmount; 54 | 55 | float3 lutcoord = float3((color.xy*fLUT_TileSizeXY-color.xy+0.5)*texelsize.xy,color.z*fLUT_TileSizeXY-color.z); 56 | float lerpfact = frac(lutcoord.z); 57 | lutcoord.x += (lutcoord.z-lerpfact)*texelsize.y; 58 | 59 | float3 lutcolor = lerp(tex2D(SamplerLUT, lutcoord.xy).xyz, tex2D(SamplerLUT, float2(lutcoord.x+texelsize.y,lutcoord.y)).xyz,lerpfact); 60 | 61 | color.xyz = lerp(normalize(color.xyz), normalize(lutcolor.xyz), fLUT_AmountChroma) * 62 | lerp(length(color.xyz), length(lutcolor.xyz), fLUT_AmountLuma); 63 | 64 | res.xyz = color.xyz; 65 | res.w = 1.0; 66 | } 67 | 68 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 69 | // 70 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 71 | 72 | 73 | technique LUT 74 | { 75 | pass LUT_Apply 76 | { 77 | VertexShader = PostProcessVS; 78 | PixelShader = PS_LUT_Apply; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Alternate/Levels.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Levels version 1.2 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Allows you to set a new black and a white level. 6 | * This increases contrast, but clips any colors outside the new range to either black or white 7 | * and so some details in the shadows or highlights can be lost. 8 | * 9 | * The shader is very useful for expanding the 16-235 TV range to 0-255 PC range. 10 | * You might need it if you're playing a game meant to display on a TV with an emulator that does not do this. 11 | * But it's also a quick and easy way to uniformly increase the contrast of an image. 12 | * 13 | * -- Version 1.0 -- 14 | * First release 15 | * -- Version 1.1 -- 16 | * Optimized to only use 1 instruction (down from 2 - a 100% performance increase :) ) 17 | * -- Version 1.2 -- 18 | * Added the ability to highlight clipping regions of the image with #define HighlightClipping 1 19 | */ 20 | 21 | #include "ReShadeUI.fxh" 22 | 23 | uniform int BlackPoint < __UNIFORM_SLIDER_INT1 24 | ui_min = 0; ui_max = 255; 25 | ui_tooltip = "The black point is the new black - literally. Everything darker than this will become completely black."; 26 | > = 16; 27 | 28 | uniform int WhitePoint < __UNIFORM_SLIDER_INT1 29 | ui_min = 0; ui_max = 255; 30 | ui_tooltip = "The new white point. Everything brighter than this becomes completely white"; 31 | > = 235; 32 | 33 | uniform bool HighlightClipping < 34 | ui_tooltip = "Colors between the two points will stretched, which increases contrast, but details above and below the points are lost (this is called clipping).\n" 35 | "This setting marks the pixels that clip.\n" 36 | "Red: Some detail is lost in the highlights\n" 37 | "Yellow: All detail is lost in the highlights\n" 38 | "Blue: Some detail is lost in the shadows\n" 39 | "Cyan: All detail is lost in the shadows."; 40 | > = false; 41 | 42 | #include "ReShade.fxh" 43 | 44 | float3 LevelsPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 45 | { 46 | float black_point_float = BlackPoint / 255.0; 47 | float white_point_float = WhitePoint == BlackPoint ? (255.0 / 0.00025) : (255.0 / (WhitePoint - BlackPoint)); // Avoid division by zero if the white and black point are the same 48 | 49 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 50 | color = color * white_point_float - (black_point_float * white_point_float); 51 | 52 | if (HighlightClipping) 53 | { 54 | float3 clipped_colors; 55 | 56 | clipped_colors = any(color > saturate(color)) // any colors whiter than white? 57 | ? float3(1.0, 0.0, 0.0) 58 | : color; 59 | clipped_colors = all(color > saturate(color)) // all colors whiter than white? 60 | ? float3(1.0, 1.0, 0.0) 61 | : clipped_colors; 62 | clipped_colors = any(color < saturate(color)) // any colors blacker than black? 63 | ? float3(0.0, 0.0, 1.0) 64 | : clipped_colors; 65 | clipped_colors = all(color < saturate(color)) // all colors blacker than black? 66 | ? float3(0.0, 1.0, 1.0) 67 | : clipped_colors; 68 | 69 | color = clipped_colors; 70 | } 71 | 72 | return color; 73 | } 74 | 75 | technique Levels 76 | { 77 | pass 78 | { 79 | VertexShader = PostProcessVS; 80 | PixelShader = LevelsPass; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Alternate/Vibrance.fx: -------------------------------------------------------------------------------- 1 | /** 2 | Vibrance 3 | by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | 5 | Vibrance intelligently boosts the saturation of pixels so pixels that had little color get a larger boost than pixels that had a lot. 6 | This avoids oversaturation of pixels that were already very saturated. 7 | 8 | History: 9 | 10 | Version 1.0 by Ceejay.dk 11 | - Original 12 | Version 1.1 by CeeJay.dk 13 | - Introduced RBG balance to help colorblind users 14 | Version 1.1.1 15 | - Minor UI improvements for Reshade 3.x 16 | */ 17 | 18 | #include "ReShadeUI.fxh" 19 | 20 | uniform float Vibrance < __UNIFORM_SLIDER_FLOAT1 21 | ui_min = -1.0; ui_max = 1.0; 22 | ui_tooltip = "Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation."; 23 | > = 0.15; 24 | 25 | uniform float3 VibranceRGBBalance < 26 | ui_type = "drag"; 27 | ui_min = 0.0; ui_max = 10.0; 28 | ui_label = "RGB Balance"; 29 | ui_tooltip = "A per channel multiplier to the Vibrance strength so you can give more boost to certain colors over others.\nThis is handy if you are colorblind and less sensitive to a specific color.\nYou can then boost that color more than the others."; 30 | > = float3(1.0, 1.0, 1.0); 31 | 32 | /* 33 | uniform int Vibrance_Luma < 34 | ui_type = "combo"; 35 | ui_label = "Luma type"; 36 | ui_items = "Perceptual\0Even\0"; 37 | > = 0; 38 | */ 39 | 40 | #include "ReShade.fxh" 41 | 42 | float3 VibrancePass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target 43 | { 44 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 45 | 46 | float3 coefLuma = float3(0.212656, 0.715158, 0.072186); 47 | 48 | /* 49 | if (Vibrance_Luma) 50 | coefLuma = float3(0.333333, 0.333334, 0.333333); 51 | */ 52 | 53 | float luma = dot(coefLuma, color); 54 | 55 | 56 | float max_color = max(color.r, max(color.g, color.b)); // Find the strongest color 57 | float min_color = min(color.r, min(color.g, color.b)); // Find the weakest color 58 | 59 | float color_saturation = max_color - min_color; // The difference between the two is the saturation 60 | 61 | // Extrapolate between luma and original by 1 + (1-saturation) - current 62 | float3 coeffVibrance = float3(VibranceRGBBalance * Vibrance); 63 | color = lerp(luma, color, 1.0 + (coeffVibrance * (1.0 - (sign(coeffVibrance) * color_saturation)))); 64 | 65 | return color; 66 | } 67 | 68 | technique Vibrance 69 | { 70 | pass 71 | { 72 | VertexShader = PostProcessVS; 73 | PixelShader = VibrancePass; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Alternate/Vignette.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Vignette version 1.3 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Darkens the edges of the image to make it look more like it was shot with a camera lens. 6 | * May cause banding artifacts. 7 | */ 8 | 9 | #include "ReShadeUI.fxh" 10 | 11 | uniform int Type < 12 | ui_type = "combo"; 13 | ui_items = "Original\0New\0TV style\0Untitled 1\0Untitled 2\0Untitled 3\0Untitled 4\0"; 14 | > = 0; 15 | uniform float Ratio < __UNIFORM_SLIDER_FLOAT1 16 | ui_min = 0.15; ui_max = 6.0; 17 | ui_tooltip = "Sets a width to height ratio. 1.00 (1/1) is perfectly round, while 1.60 (16/10) is 60 % wider than it's high."; 18 | > = 1.0; 19 | uniform float Radius < __UNIFORM_SLIDER_FLOAT1 20 | ui_min = -1.0; ui_max = 3.0; 21 | ui_tooltip = "lower values = stronger radial effect from center"; 22 | > = 2.0; 23 | uniform float Amount < __UNIFORM_SLIDER_FLOAT1 24 | ui_min = -2.0; ui_max = 1.0; 25 | ui_tooltip = "Strength of black. -2.00 = Max Black, 1.00 = Max White."; 26 | > = -1.0; 27 | uniform int Slope < __UNIFORM_SLIDER_INT1 28 | ui_min = 2; ui_max = 16; 29 | ui_tooltip = "How far away from the center the change should start to really grow strong (odd numbers cause a larger fps drop than even numbers)."; 30 | > = 2; 31 | uniform float2 Center < __UNIFORM_SLIDER_FLOAT2 32 | ui_min = 0.0; ui_max = 1.0; 33 | ui_tooltip = "Center of effect for 'Original' vignette type. 'New' and 'TV style' do not obey this setting."; 34 | > = float2(0.5, 0.5); 35 | 36 | #include "ReShade.fxh" 37 | 38 | float4 VignettePass(float4 vpos : SV_Position, float2 tex : TexCoord) : SV_Target 39 | { 40 | float4 color = tex2D(ReShade::BackBuffer, tex); 41 | 42 | if (Type == 0) 43 | { 44 | // Set the center 45 | float2 distance_xy = tex - Center; 46 | 47 | // Adjust the ratio 48 | distance_xy *= float2((ReShade::PixelSize.y / ReShade::PixelSize.x), Ratio); 49 | 50 | // Calculate the distance 51 | distance_xy /= Radius; 52 | float distance = dot(distance_xy, distance_xy); 53 | 54 | // Apply the vignette 55 | color.rgb *= (1.0 + pow(distance, Slope * 0.5) * Amount); //pow - multiply 56 | } 57 | 58 | if (Type == 1) // New round (-x*x+x) + (-y*y+y) method. 59 | { 60 | tex = -tex * tex + tex; 61 | color.rgb = saturate(((ReShade::PixelSize.y / ReShade::PixelSize.x)*(ReShade::PixelSize.y / ReShade::PixelSize.x) * Ratio * tex.x + tex.y) * 4.0) * color.rgb; 62 | } 63 | 64 | if (Type == 2) // New (-x*x+x) * (-y*y+y) TV style method. 65 | { 66 | tex = -tex * tex + tex; 67 | color.rgb = saturate(tex.x * tex.y * 100.0) * color.rgb; 68 | } 69 | 70 | if (Type == 3) 71 | { 72 | tex = abs(tex - 0.5); 73 | float tc = dot(float4(-tex.x, -tex.x, tex.x, tex.y), float4(tex.y, tex.y, 1.0, 1.0)); //XOR 74 | 75 | tc = saturate(tc - 0.495); 76 | color.rgb *= (pow((1.0 - tc * 200), 4) + 0.25); //or maybe abs(tc*100-1) (-(tc*100)-1) 77 | } 78 | 79 | if (Type == 4) 80 | { 81 | tex = abs(tex - 0.5); 82 | float tc = dot(float4(-tex.x, -tex.x, tex.x, tex.y), float4(tex.y, tex.y, 1.0, 1.0)); //XOR 83 | 84 | tc = saturate(tc - 0.495) - 0.0002; 85 | color.rgb *= (pow((1.0 - tc * 200), 4) + 0.0); //or maybe abs(tc*100-1) (-(tc*100)-1) 86 | } 87 | 88 | if (Type == 5) // MAD version of 2 89 | { 90 | tex = abs(tex - 0.5); 91 | float tc = tex.x * (-2.0 * tex.y + 1.0) + tex.y; //XOR 92 | 93 | tc = saturate(tc - 0.495); 94 | color.rgb *= (pow((-tc * 200 + 1.0), 4) + 0.25); //or maybe abs(tc*100-1) (-(tc*100)-1) 95 | //color.rgb *= (pow(((tc*200.0)-1.0),4)); //or maybe abs(tc*100-1) (-(tc*100)-1) 96 | } 97 | 98 | if (Type == 6) // New round (-x*x+x) * (-y*y+y) method. 99 | { 100 | //tex.y /= float2((ReShade::PixelSize.y / ReShade::PixelSize.x), Ratio); 101 | float tex_xy = dot(float4(tex, tex), float4(-tex, 1.0, 1.0)); //dot is actually slower 102 | color.rgb = saturate(tex_xy * 4.0) * color.rgb; 103 | } 104 | 105 | return color; 106 | } 107 | 108 | technique Vignette 109 | { 110 | pass 111 | { 112 | VertexShader = PostProcessVS; 113 | PixelShader = VignettePass; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Border.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Border version 1.4.1 3 | * 4 | * -- Version 1.0 by Oomek -- 5 | * Fixes light, one pixel thick border in some games when forcing MSAA like i.e. Dishonored 6 | * -- Version 1.1 by CeeJay.dk -- 7 | * Optimized the shader. It still does the same but now it runs faster. 8 | * -- Version 1.2 by CeeJay.dk -- 9 | * Added border_width and border_color features 10 | * -- Version 1.3 by CeeJay.dk -- 11 | * Optimized the performance further 12 | * -- Version 1.4 by CeeJay.dk -- 13 | * Added the border_ratio feature 14 | * -- Version 1.4.1 by CeeJay.dk -- 15 | * Cleaned up setting for Reshade 3.x 16 | */ 17 | 18 | #include "ReShade.fxh" 19 | #include "ReShadeUI.fxh" 20 | 21 | /* 22 | uniform float2 border_width < 23 | ui_type = "input"; 24 | ui_label = "Size"; 25 | ui_tooltip = "Measured in pixels. If this is set to zero then the ratio will be used instead."; 26 | > = float2(0.0, 0.0); 27 | */ 28 | 29 | uniform float2 border_width < 30 | ui_type = "drag"; 31 | ui_label = "Size"; 32 | ui_tooltip = "Measured in pixels. If this is set to zero then the ratio will be used instead."; 33 | ui_min = 0.0; ui_max = (BUFFER_WIDTH * 0.5); 34 | ui_step = 1.0; 35 | > = float2(0.0, 0.0); 36 | 37 | uniform float border_ratio < 38 | ui_type = "input"; 39 | ui_label = "Size Ratio"; 40 | ui_tooltip = "Set the desired ratio for the visible area."; 41 | > = 2.35; 42 | 43 | uniform float3 border_color < 44 | ui_type = "color"; 45 | ui_label = "Border Color"; 46 | > = float3(0.0, 0.0, 0.0); 47 | 48 | float3 BorderPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 49 | { 50 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 51 | 52 | // -- calculate the right border_width for a given border_ratio -- 53 | float2 border_width_variable = border_width; 54 | if (border_width.x == -border_width.y) // If width is not used 55 | if (ReShade::AspectRatio < border_ratio) 56 | border_width_variable = float2(0.0, (ReShade::ScreenSize.y - (ReShade::ScreenSize.x / border_ratio)) * 0.5); 57 | else 58 | border_width_variable = float2((ReShade::ScreenSize.x - (ReShade::ScreenSize.y * border_ratio)) * 0.5, 0.0); 59 | 60 | float2 border = (ReShade::PixelSize * border_width_variable); // Translate integer pixel width to floating point 61 | float2 within_border = saturate((-texcoord * texcoord + texcoord) - (-border * border + border)); // Becomes positive when inside the border and zero when outside 62 | 63 | return all(within_border) ? color : border_color; 64 | } 65 | 66 | technique Border 67 | { 68 | pass 69 | { 70 | VertexShader = PostProcessVS; 71 | PixelShader = BorderPass; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Cartoon.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Cartoon 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | */ 5 | 6 | #include "ReShadeUI.fxh" 7 | 8 | uniform float Power < __UNIFORM_SLIDER_FLOAT1 9 | ui_min = 0.1; ui_max = 10.0; 10 | ui_tooltip = "Amount of effect you want."; 11 | > = 1.5; 12 | uniform float EdgeSlope < __UNIFORM_SLIDER_FLOAT1 13 | ui_min = 0.1; ui_max = 6.0; 14 | ui_label = "Edge Slope"; 15 | ui_tooltip = "Raise this to filter out fainter edges. You might need to increase the power to compensate. Whole numbers are faster."; 16 | > = 1.5; 17 | 18 | #include "ReShade.fxh" 19 | 20 | float3 CartoonPass(float4 position : SV_Position, float2 texcoord : TEXCOORD0) : SV_Target 21 | { 22 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 23 | const float3 coefLuma = float3(0.2126, 0.7152, 0.0722); 24 | 25 | float diff1 = dot(coefLuma, tex2D(ReShade::BackBuffer, texcoord + ReShade::PixelSize).rgb); 26 | diff1 = dot(float4(coefLuma, -1.0), float4(tex2D(ReShade::BackBuffer, texcoord - ReShade::PixelSize).rgb , diff1)); 27 | float diff2 = dot(coefLuma, tex2D(ReShade::BackBuffer, texcoord + ReShade::PixelSize * float2(1, -1)).rgb); 28 | diff2 = dot(float4(coefLuma, -1.0), float4(tex2D(ReShade::BackBuffer, texcoord + ReShade::PixelSize * float2(-1, 1)).rgb , diff2)); 29 | 30 | float edge = dot(float2(diff1, diff2), float2(diff1, diff2)); 31 | 32 | return saturate(pow(abs(edge), EdgeSlope) * -Power + color); 33 | } 34 | 35 | technique Cartoon 36 | { 37 | pass 38 | { 39 | VertexShader = PostProcessVS; 40 | PixelShader = CartoonPass; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Chromakey.fx: -------------------------------------------------------------------------------- 1 | /* 2 | Chromakey PS v1.4.0 (c) 2018 Jacob Maximilian Fober 3 | 4 | This work is licensed under the Creative Commons 5 | Attribution-ShareAlike 4.0 International License. 6 | To view a copy of this license, visit 7 | http://creativecommons.org/licenses/by-sa/4.0/. 8 | */ 9 | 10 | #include "ReShade.fxh" 11 | #include "ReShadeUI.fxh" 12 | 13 | 14 | //////////// 15 | /// MENU /// 16 | //////////// 17 | 18 | uniform float Threshold < __UNIFORM_SLIDER_FLOAT1 19 | ui_min = 0.0; ui_max = 0.999; ui_step = 0.001; 20 | ui_category = "Distance adjustment"; 21 | > = 0.5; 22 | 23 | uniform bool RadialX < 24 | ui_label = "Horizontally radial depth"; 25 | ui_category = "Radial distance"; 26 | > = false; 27 | uniform bool RadialY < 28 | ui_label = "Vertically radial depth"; 29 | ui_category = "Radial distance"; 30 | > = false; 31 | 32 | uniform int FOV < __UNIFORM_SLIDER_INT1 33 | ui_label = "FOV (horizontal)"; 34 | ui_tooltip = "Field of view in degrees"; 35 | #if __RESHADE__ < 40000 36 | ui_step = 1; 37 | #endif 38 | ui_min = 0; ui_max = 170; 39 | ui_category = "Radial distance"; 40 | > = 90; 41 | 42 | uniform int Pass < __UNIFORM_RADIO_INT1 43 | ui_label = "Keying type"; 44 | ui_items = "Background key\0Foreground key\0"; 45 | ui_category = "Direction adjustment"; 46 | > = 0; 47 | 48 | uniform int Color < __UNIFORM_RADIO_INT1 49 | ui_label = "Keying color"; 50 | ui_tooltip = "Ultimatte(tm) Super Blue and Green are industry standard colors for chromakey"; 51 | ui_items = "Super Blue Ultimatte(tm)\0Green Ultimatte(tm)\0Custom\0"; 52 | ui_category = "Color settings"; 53 | > = 1; 54 | 55 | uniform float3 CustomColor < __UNIFORM_COLOR_FLOAT3 56 | ui_label = "Custom color"; 57 | ui_category = "Color settings"; 58 | > = float3(1.0, 0.0, 0.0); 59 | 60 | uniform bool AntiAliased < 61 | ui_label = "Anti-aliased mask"; 62 | ui_tooltip = "Disabling this option will reduce masking gaps"; 63 | ui_category = "Color settings"; 64 | > = true; 65 | 66 | 67 | ///////////////// 68 | /// FUNCTIONS /// 69 | ///////////////// 70 | 71 | float MaskAA(float2 texcoord) 72 | { 73 | // Sample depth image 74 | float Depth = ReShade::GetLinearizedDepth(texcoord); 75 | 76 | // Convert to radial depth 77 | float2 Size; 78 | Size.x = tan(radians(FOV*0.5)); 79 | Size.y = Size.x / ReShade::AspectRatio; 80 | if(RadialX) Depth *= length(float2((texcoord.x-0.5)*Size.x, 1.0)); 81 | if(RadialY) Depth *= length(float2((texcoord.y-0.5)*Size.y, 1.0)); 82 | 83 | // Return jagged mask 84 | if(!AntiAliased) return step(Threshold, Depth); 85 | 86 | // Get half-pixel size in depth value 87 | float hPixel = fwidth(Depth)*0.5; 88 | 89 | return smoothstep(Threshold-hPixel, Threshold+hPixel, Depth); 90 | } 91 | 92 | 93 | ////////////// 94 | /// SHADER /// 95 | ////////////// 96 | 97 | float3 ChromakeyPS(float4 vois : SV_Position, float2 texcoord : TexCoord) : SV_Target 98 | { 99 | // Define chromakey color, Ultimatte(tm) Super Blue, Ultimatte(tm) Green, or user color 100 | float3 Screen; 101 | switch(Color) 102 | { 103 | case 0:{ Screen = float3(0.07, 0.18, 0.72); break; } // Ultimatte(tm) Super Blue 104 | case 1:{ Screen = float3(0.29, 0.84, 0.36); break; } // Ultimatte(tm) Green 105 | case 2:{ Screen = CustomColor; break; } // User defined color 106 | } 107 | 108 | // Generate depth mask 109 | float DepthMask = MaskAA(texcoord); 110 | if(bool(Pass)) DepthMask = 1.0-DepthMask; 111 | 112 | return lerp(tex2D(ReShade::BackBuffer, texcoord).rgb, Screen, DepthMask); 113 | } 114 | 115 | 116 | ////////////// 117 | /// OUTPUT /// 118 | ////////////// 119 | 120 | technique Chromakey < ui_tooltip = "Generate green-screen wall based of depth"; > 121 | { 122 | pass 123 | { 124 | VertexShader = PostProcessVS; 125 | PixelShader = ChromakeyPS; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/ChromaticAberration.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Chromatic Aberration 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Distorts the image by shifting each color component, which creates color artifacts similar to those in a very cheap lens or a cheap sensor. 6 | */ 7 | 8 | #include "ReShadeUI.fxh" 9 | 10 | uniform float2 Shift < __UNIFORM_SLIDER_FLOAT2 11 | ui_min = -10; ui_max = 10; 12 | ui_tooltip = "Distance (X,Y) in pixels to shift the color components. For a slightly blurred look try fractional values (.5) between two pixels."; 13 | > = float2(2.5, -0.5); 14 | uniform float Strength < __UNIFORM_SLIDER_FLOAT1 15 | ui_min = 0.0; ui_max = 1.0; 16 | > = 0.5; 17 | 18 | #include "ReShade.fxh" 19 | 20 | float3 ChromaticAberrationPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 21 | { 22 | float3 color, colorInput = tex2D(ReShade::BackBuffer, texcoord).rgb; 23 | // Sample the color components 24 | color.r = tex2D(ReShade::BackBuffer, texcoord + (ReShade::PixelSize * Shift)).r; 25 | color.g = colorInput.g; 26 | color.b = tex2D(ReShade::BackBuffer, texcoord - (ReShade::PixelSize * Shift)).b; 27 | 28 | // Adjust the strength of the effect 29 | return lerp(colorInput, color, Strength); 30 | } 31 | 32 | technique CA 33 | { 34 | pass 35 | { 36 | VertexShader = PostProcessVS; 37 | PixelShader = ChromaticAberrationPass; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/ColorMatrix.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Color Matrix version 1.0 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * ColorMatrix allow the user to transform the colors using a color matrix 6 | */ 7 | 8 | #include "ReShadeUI.fxh" 9 | 10 | uniform float3 ColorMatrix_Red < __UNIFORM_SLIDER_FLOAT3 11 | ui_min = 0.0; ui_max = 1.0; 12 | ui_label = "Matrix Red"; 13 | ui_tooltip = "How much of Red, Green and Blue the new red value should contain. Should sum to 1.0 if you don't wish to change the brightness."; 14 | > = float3(0.817, 0.183, 0.000); 15 | uniform float3 ColorMatrix_Green < __UNIFORM_SLIDER_FLOAT3 16 | ui_min = 0.0; ui_max = 1.0; 17 | ui_label = "Matrix Green"; 18 | ui_tooltip = "How much of Red, Green and Blue the new green value should contain. Should sum to 1.0 if you don't wish to change the brightness."; 19 | > = float3(0.333, 0.667, 0.000); 20 | uniform float3 ColorMatrix_Blue < __UNIFORM_SLIDER_FLOAT3 21 | ui_min = 0.0; ui_max = 1.0; 22 | ui_label = "Matrix Blue"; 23 | ui_tooltip = "How much of Red, Green and Blue the new blue value should contain. Should sum to 1.0 if you don't wish to change the brightness."; 24 | > = float3(0.000, 0.125, 0.875); 25 | 26 | uniform float Strength < __UNIFORM_SLIDER_FLOAT1 27 | ui_min = 0.0; ui_max = 1.0; 28 | > = 1.0; 29 | 30 | #include "ReShade.fxh" 31 | 32 | float3 ColorMatrixPass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target 33 | { 34 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 35 | 36 | const float3x3 ColorMatrix = float3x3(ColorMatrix_Red, ColorMatrix_Green, ColorMatrix_Blue); 37 | color = lerp(color, mul(ColorMatrix, color), Strength); 38 | 39 | return saturate(color); 40 | } 41 | 42 | technique ColorMatrix 43 | { 44 | pass 45 | { 46 | VertexShader = PostProcessVS; 47 | PixelShader = ColorMatrixPass; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/DPX.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * DPX/Cineon shader by Loadus 3 | */ 4 | 5 | #include "ReShadeUI.fxh" 6 | 7 | uniform float3 RGB_Curve < __UNIFORM_SLIDER_FLOAT3 8 | ui_min = 1.0; ui_max = 15.0; 9 | ui_label = "RGB Curve"; 10 | > = float3(8.0, 8.0, 8.0); 11 | uniform float3 RGB_C < __UNIFORM_SLIDER_FLOAT3 12 | ui_min = 0.2; ui_max = 0.5; 13 | ui_label = "RGB C"; 14 | > = float3(0.36, 0.36, 0.34); 15 | 16 | uniform float Contrast < __UNIFORM_SLIDER_FLOAT1 17 | ui_min = 0.0; ui_max = 1.0; 18 | > = 0.1; 19 | uniform float Saturation < __UNIFORM_SLIDER_FLOAT1 20 | ui_min = 0.0; ui_max = 8.0; 21 | > = 3.0; 22 | uniform float Colorfulness < __UNIFORM_SLIDER_FLOAT1 23 | ui_min = 0.1; ui_max = 2.5; 24 | > = 2.5; 25 | 26 | uniform float Strength < __UNIFORM_SLIDER_FLOAT1 27 | ui_min = 0.0; ui_max = 1.0; 28 | > = 0.20; 29 | 30 | #include "ReShade.fxh" 31 | 32 | static const float3x3 RGB = float3x3( 33 | 2.6714711726599600, -1.2672360578624100, -0.4109956021722270, 34 | -1.0251070293466400, 1.9840911624108900, 0.0439502493584124, 35 | 0.0610009456429445, -0.2236707508128630, 1.1590210416706100 36 | ); 37 | static const float3x3 XYZ = float3x3( 38 | 0.5003033835433160, 0.3380975732227390, 0.1645897795458570, 39 | 0.2579688942747580, 0.6761952591447060, 0.0658358459823868, 40 | 0.0234517888692628, 0.1126992737203000, 0.8668396731242010 41 | ); 42 | 43 | float3 DPXPass(float4 vois : SV_Position, float2 texcoord : TexCoord) : SV_Target 44 | { 45 | float3 input = tex2D(ReShade::BackBuffer, texcoord).rgb; 46 | 47 | float3 B = input; 48 | B = B * (1.0 - Contrast) + (0.5 * Contrast); 49 | float3 Btemp = (1.0 / (1.0 + exp(RGB_Curve / 2.0))); 50 | B = ((1.0 / (1.0 + exp(-RGB_Curve * (B - RGB_C)))) / (-2.0 * Btemp + 1.0)) + (-Btemp / (-2.0 * Btemp + 1.0)); 51 | 52 | float value = max(max(B.r, B.g), B.b); 53 | float3 color = B / value; 54 | color = pow(abs(color), 1.0 / Colorfulness); 55 | 56 | float3 c0 = color * value; 57 | c0 = mul(XYZ, c0); 58 | float luma = dot(c0, float3(0.30, 0.59, 0.11)); 59 | c0 = (1.0 - Saturation) * luma + Saturation * c0; 60 | c0 = mul(RGB, c0); 61 | 62 | return lerp(input, c0, Strength); 63 | } 64 | 65 | technique DPX 66 | { 67 | pass 68 | { 69 | VertexShader = PostProcessVS; 70 | PixelShader = DPXPass; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Daltonize.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Daltonization algorithm by daltonize.org 3 | * http://www.daltonize.org/2010/05/lms-daltonization-algorithm.html 4 | * Originally ported to ReShade by IDDQD, modified for ReShade 3.0 by crosire 5 | */ 6 | 7 | uniform int Type < 8 | ui_type = "combo"; 9 | ui_items = "Protanopia\0Deuteranopia\0Tritanopia\0"; 10 | > = 0; 11 | 12 | #include "ReShade.fxh" 13 | 14 | float3 PS_DaltonizeFXmain(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 15 | { 16 | float3 input = tex2D(ReShade::BackBuffer, texcoord).rgb; 17 | 18 | // RGB to LMS matrix conversion 19 | float OnizeL = (17.8824f * input.r) + (43.5161f * input.g) + (4.11935f * input.b); 20 | float OnizeM = (3.45565f * input.r) + (27.1554f * input.g) + (3.86714f * input.b); 21 | float OnizeS = (0.0299566f * input.r) + (0.184309f * input.g) + (1.46709f * input.b); 22 | 23 | // Simulate color blindness 24 | float Daltl, Daltm, Dalts; 25 | 26 | if (Type == 0) // Protanopia - reds are greatly reduced (1% men) 27 | { 28 | Daltl = 0.0f * OnizeL + 2.02344f * OnizeM + -2.52581f * OnizeS; 29 | Daltm = 0.0f * OnizeL + 1.0f * OnizeM + 0.0f * OnizeS; 30 | Dalts = 0.0f * OnizeL + 0.0f * OnizeM + 1.0f * OnizeS; 31 | } 32 | else if (Type == 1) // Deuteranopia - greens are greatly reduced (1% men) 33 | { 34 | Daltl = 1.0f * OnizeL + 0.0f * OnizeM + 0.0f * OnizeS; 35 | Daltm = 0.494207f * OnizeL + 0.0f * OnizeM + 1.24827f * OnizeS; 36 | Dalts = 0.0f * OnizeL + 0.0f * OnizeM + 1.0f * OnizeS; 37 | } 38 | else if (Type == 2) // Tritanopia - blues are greatly reduced (0.003% population) 39 | { 40 | Daltl = 1.0f * OnizeL + 0.0f * OnizeM + 0.0f * OnizeS; 41 | Daltm = 0.0f * OnizeL + 1.0f * OnizeM + 0.0f * OnizeS; 42 | Dalts = -0.395913f * OnizeL + 0.801109f * OnizeM + 0.0f * OnizeS; 43 | } 44 | 45 | // LMS to RGB matrix conversion 46 | float3 error; 47 | error.r = (0.0809444479f * Daltl) + (-0.130504409f * Daltm) + (0.116721066f * Dalts); 48 | error.g = (-0.0102485335f * Daltl) + (0.0540193266f * Daltm) + (-0.113614708f * Dalts); 49 | error.b = (-0.000365296938f * Daltl) + (-0.00412161469f * Daltm) + (0.693511405f * Dalts); 50 | 51 | // Isolate invisible colors to color vision deficiency (calculate error matrix) 52 | error = (input - error); 53 | 54 | // Shift colors towards visible spectrum (apply error modifications) 55 | float3 correction; 56 | correction.r = 0; // (error.r * 0.0) + (error.g * 0.0) + (error.b * 0.0); 57 | correction.g = (error.r * 0.7) + (error.g * 1.0); // + (error.b * 0.0); 58 | correction.b = (error.r * 0.7) + (error.b * 1.0); // + (error.g * 0.0); 59 | 60 | // Add compensation to original values 61 | correction = input + correction; 62 | 63 | return correction; 64 | } 65 | 66 | technique Daltonize 67 | { 68 | pass 69 | { 70 | VertexShader = PostProcessVS; 71 | PixelShader = PS_DaltonizeFXmain; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/FXAA.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * FXAA 3.11 3 | * 4 | * for ReShade 3.0+ 5 | */ 6 | 7 | #include "ReShadeUI.fxh" 8 | 9 | uniform float Subpix < __UNIFORM_SLIDER_FLOAT1 10 | ui_min = 0.0; ui_max = 1.0; 11 | ui_tooltip = "Amount of sub-pixel aliasing removal. Higher values makes the image softer/blurrier."; 12 | > = 0.25; 13 | 14 | uniform float EdgeThreshold < __UNIFORM_SLIDER_FLOAT1 15 | ui_min = 0.0; ui_max = 1.0; 16 | ui_label = "Edge Detection Threshold"; 17 | ui_tooltip = "The minimum amount of local contrast required to apply algorithm."; 18 | > = 0.125; 19 | uniform float EdgeThresholdMin < __UNIFORM_SLIDER_FLOAT1 20 | ui_min = 0.0; ui_max = 1.0; 21 | ui_label = "Darkness Threshold"; 22 | ui_tooltip = "Pixels darker than this are not processed in order to increase performance."; 23 | > = 0.0; 24 | 25 | //------------------------------ Non-GUI-settings ------------------------------------------------- 26 | 27 | #ifndef FXAA_QUALITY__PRESET 28 | // Valid Quality Presets 29 | // 10 to 15 - default medium dither (10=fastest, 15=highest quality) 30 | // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) 31 | // 39 - no dither, very expensive 32 | #define FXAA_QUALITY__PRESET 15 33 | #endif 34 | 35 | #ifndef FXAA_GREEN_AS_LUMA 36 | #define FXAA_GREEN_AS_LUMA 0 37 | #endif 38 | 39 | #ifndef FXAA_LINEAR_LIGHT 40 | #define FXAA_LINEAR_LIGHT 0 41 | #endif 42 | 43 | //------------------------------------------------------------------------------------------------- 44 | 45 | #if (__RENDERER__ == 0xb000 || __RENDERER__ == 0xb100) 46 | #define FXAA_GATHER4_ALPHA 1 47 | #define FxaaTexAlpha4(t, p) tex2Dgather(t, p, 3) 48 | #define FxaaTexOffAlpha4(t, p, o) tex2Dgatheroffset(t, p, o, 3) 49 | #define FxaaTexGreen4(t, p) tex2Dgather(t, p, 1) 50 | #define FxaaTexOffGreen4(t, p, o) tex2Dgatheroffset(t, p, o, 1) 51 | #endif 52 | 53 | #define FXAA_PC 1 54 | #define FXAA_HLSL_3 1 55 | 56 | // Green as luma requires non-linear colorspace 57 | #if FXAA_GREEN_AS_LUMA 58 | #undef FXAA_LINEAR_LIGHT 59 | #endif 60 | 61 | #include "FXAA.fxh" 62 | #include "ReShade.fxh" 63 | 64 | // Samplers 65 | 66 | sampler FXAATexture 67 | { 68 | Texture = ReShade::BackBufferTex; 69 | MinFilter = Linear; MagFilter = Linear; 70 | #if FXAA_LINEAR_LIGHT 71 | SRGBTexture = true; 72 | #endif 73 | }; 74 | 75 | // Pixel shaders 76 | 77 | #if !FXAA_GREEN_AS_LUMA 78 | float4 FXAALumaPass(float4 vpos : SV_Position, noperspective float2 texcoord : TEXCOORD) : SV_Target 79 | { 80 | float4 color = tex2D(ReShade::BackBuffer, texcoord.xy); 81 | color.a = sqrt(dot(color.rgb * color.rgb, float3(0.299, 0.587, 0.114))); 82 | return color; 83 | } 84 | #endif 85 | 86 | float4 FXAAPixelShader(float4 vpos : SV_Position, noperspective float2 texcoord : TEXCOORD) : SV_Target 87 | { 88 | return FxaaPixelShader( 89 | texcoord, // pos 90 | 0, // fxaaConsolePosPos 91 | FXAATexture, // tex 92 | FXAATexture, // fxaaConsole360TexExpBiasNegOne 93 | FXAATexture, // fxaaConsole360TexExpBiasNegTwo 94 | ReShade::PixelSize, // fxaaQualityRcpFrame 95 | 0, // fxaaConsoleRcpFrameOpt 96 | 0, // fxaaConsoleRcpFrameOpt2 97 | 0, // fxaaConsole360RcpFrameOpt2 98 | Subpix, // fxaaQualitySubpix 99 | EdgeThreshold, // fxaaQualityEdgeThreshold 100 | EdgeThresholdMin, // fxaaQualityEdgeThresholdMin 101 | 0, // fxaaConsoleEdgeSharpness 102 | 0, // fxaaConsoleEdgeThreshold 103 | 0, // fxaaConsoleEdgeThresholdMin 104 | 0 // fxaaConsole360ConstDir 105 | ); 106 | } 107 | 108 | // Rendering passes 109 | 110 | technique FXAA 111 | { 112 | #if !FXAA_GREEN_AS_LUMA 113 | pass 114 | { 115 | VertexShader = PostProcessVS; 116 | PixelShader = FXAALumaPass; 117 | } 118 | #endif 119 | pass 120 | { 121 | VertexShader = PostProcessVS; 122 | PixelShader = FXAAPixelShader; 123 | #if FXAA_LINEAR_LIGHT 124 | SRGBWriteEnable = true; 125 | #endif 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/FakeHDR.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * HDR 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Not actual HDR - It just tries to mimic an HDR look (relatively high performance cost) 6 | */ 7 | 8 | #include "ReShadeUI.fxh" 9 | 10 | uniform float HDRPower < __UNIFORM_SLIDER_FLOAT1 11 | ui_min = 0.0; ui_max = 8.0; 12 | ui_label = "Power"; 13 | > = 1.30; 14 | uniform float radius1 < __UNIFORM_SLIDER_FLOAT1 15 | ui_min = 0.0; ui_max = 8.0; 16 | ui_label = "Radius 1"; 17 | > = 0.793; 18 | uniform float radius2 < __UNIFORM_SLIDER_FLOAT1 19 | ui_min = 0.0; ui_max = 8.0; 20 | ui_label = "Radius 2"; 21 | ui_tooltip = "Raising this seems to make the effect stronger and also brighter."; 22 | > = 0.87; 23 | 24 | #include "ReShade.fxh" 25 | 26 | float3 HDRPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 27 | { 28 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 29 | 30 | float3 bloom_sum1 = tex2D(ReShade::BackBuffer, texcoord + float2(1.5, -1.5) * radius1 * ReShade::PixelSize).rgb; 31 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2(-1.5, -1.5) * radius1 * ReShade::PixelSize).rgb; 32 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2( 1.5, 1.5) * radius1 * ReShade::PixelSize).rgb; 33 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2(-1.5, 1.5) * radius1 * ReShade::PixelSize).rgb; 34 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2( 0.0, -2.5) * radius1 * ReShade::PixelSize).rgb; 35 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2( 0.0, 2.5) * radius1 * ReShade::PixelSize).rgb; 36 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2(-2.5, 0.0) * radius1 * ReShade::PixelSize).rgb; 37 | bloom_sum1 += tex2D(ReShade::BackBuffer, texcoord + float2( 2.5, 0.0) * radius1 * ReShade::PixelSize).rgb; 38 | 39 | bloom_sum1 *= 0.005; 40 | 41 | float3 bloom_sum2 = tex2D(ReShade::BackBuffer, texcoord + float2(1.5, -1.5) * radius2 * ReShade::PixelSize).rgb; 42 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2(-1.5, -1.5) * radius2 * ReShade::PixelSize).rgb; 43 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2( 1.5, 1.5) * radius2 * ReShade::PixelSize).rgb; 44 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2(-1.5, 1.5) * radius2 * ReShade::PixelSize).rgb; 45 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2( 0.0, -2.5) * radius2 * ReShade::PixelSize).rgb; 46 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2( 0.0, 2.5) * radius2 * ReShade::PixelSize).rgb; 47 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2(-2.5, 0.0) * radius2 * ReShade::PixelSize).rgb; 48 | bloom_sum2 += tex2D(ReShade::BackBuffer, texcoord + float2( 2.5, 0.0) * radius2 * ReShade::PixelSize).rgb; 49 | 50 | bloom_sum2 *= 0.010; 51 | 52 | float dist = radius2 - radius1; 53 | float3 HDR = (color + (bloom_sum2 - bloom_sum1)) * dist; 54 | float3 blend = HDR + color; 55 | color = pow(abs(blend), abs(HDRPower)) + HDR; // pow - don't use fractions for HDRpower 56 | 57 | return saturate(color); 58 | } 59 | 60 | technique HDR 61 | { 62 | pass 63 | { 64 | VertexShader = PostProcessVS; 65 | PixelShader = HDRPass; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/FakeMotionBlur.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 Ganossa (mediehawk@gmail.com) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software with restriction, including without limitation the rights to 7 | * use and/or sell copies of the Software, and to permit persons to whom the Software 8 | * is furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and the permission notices (this and below) shall 11 | * be included in all copies or substantial portions of the Software. 12 | * 13 | * Permission needs to be specifically granted by the author of the software to any 14 | * person obtaining a copy of this software and associated documentation files 15 | * (the "Software"), to deal in the Software without restriction, including without 16 | * limitation the rights to copy, modify, merge, publish, distribute, and/or 17 | * sublicense the Software, and subject to the following conditions: 18 | * 19 | * The above copyright notice and the permission notices (this and above) shall 20 | * be included in all copies or substantial portions of the Software. 21 | * 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | * SOFTWARE. 29 | */ 30 | 31 | #include "ReShadeUI.fxh" 32 | 33 | uniform float mbRecall < __UNIFORM_SLIDER_FLOAT1 34 | ui_min = 0.0; ui_max = 1.0; 35 | ui_tooltip = "Motion blur intensity"; 36 | > = 0.40; 37 | uniform float mbSoftness < __UNIFORM_SLIDER_FLOAT1 38 | ui_min = 0.0; ui_max = 2.0; 39 | ui_tooltip = "Blur strength of consequential streaks"; 40 | > = 1.00; 41 | 42 | #include "ReShade.fxh" 43 | 44 | texture2D currTex { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 45 | texture2D prevSingleTex { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 46 | texture2D prevTex { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 47 | 48 | sampler2D currColor { Texture = currTex; }; 49 | sampler2D prevSingleColor { Texture = prevSingleTex; }; 50 | sampler2D prevColor { Texture = prevTex; }; 51 | 52 | void PS_Combine(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 color : SV_Target) 53 | { 54 | float4 curr = tex2D(currColor, texcoord); 55 | float4 prevSingle = tex2D(prevSingleColor, texcoord); 56 | float4 prev = tex2D(prevColor, texcoord); 57 | 58 | float3 diff3 = abs(prevSingle.rgb - curr.rgb) * 2.0f; 59 | float diff = min(diff3.r + diff3.g + diff3.b, mbRecall); 60 | 61 | const float weight[11] = { 0.082607, 0.040484, 0.038138, 0.034521, 0.030025, 0.025094, 0.020253, 0.015553, 0.011533, 0.008218, 0.005627 }; 62 | prev *= weight[0]; 63 | 64 | float pixelBlur = (mbSoftness * 13 * (diff)) * (BUFFER_RCP_WIDTH); 65 | float pixelBlur2 = (mbSoftness * 11 * (diff)) * (BUFFER_RCP_HEIGHT); 66 | 67 | [unroll] 68 | for (int z = 1; z < 11; z++) 69 | { 70 | prev += tex2D(prevColor, texcoord + float2(z * pixelBlur, 0.0f)) * weight[z]; 71 | prev += tex2D(prevColor, texcoord - float2(z * pixelBlur, 0.0f)) * weight[z]; 72 | prev += tex2D(prevColor, texcoord + float2(0.0f, z * pixelBlur2)) * weight[z]; 73 | prev += tex2D(prevColor, texcoord - float2(0.0f, z * pixelBlur2)) * weight[z]; 74 | } 75 | 76 | color = lerp(curr, prev, diff+0.1); 77 | } 78 | 79 | void PS_CopyFrame(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 color : SV_Target) 80 | { 81 | color = tex2D(ReShade::BackBuffer, texcoord); 82 | } 83 | void PS_CopyPreviousFrame(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 prevSingle : SV_Target0, out float4 prev : SV_Target1) 84 | { 85 | prevSingle = tex2D(currColor, texcoord); 86 | prev = tex2D(ReShade::BackBuffer, texcoord); 87 | } 88 | 89 | technique MotionBlur 90 | { 91 | pass CopyFrame 92 | { 93 | VertexShader = PostProcessVS; 94 | PixelShader = PS_CopyFrame; 95 | RenderTarget = currTex; 96 | } 97 | 98 | pass Combine 99 | { 100 | VertexShader = PostProcessVS; 101 | PixelShader = PS_Combine; 102 | } 103 | 104 | pass PrevColor 105 | { 106 | VertexShader = PostProcessVS; 107 | PixelShader = PS_CopyPreviousFrame; 108 | RenderTarget0 = prevSingleTex; 109 | RenderTarget1 = prevTex; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/FilmGrain.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * FilmGrain version 1.0 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | * 5 | * Computes a noise pattern and blends it with the image to create a film grain look. 6 | */ 7 | 8 | #include "ReShadeUI.fxh" 9 | 10 | uniform float Intensity < __UNIFORM_SLIDER_FLOAT1 11 | ui_min = 0.0; ui_max = 1.0; 12 | ui_tooltip = "How visible the grain is. Higher is more visible."; 13 | > = 0.50; 14 | uniform float Variance < __UNIFORM_SLIDER_FLOAT1 15 | ui_min = 0.0; ui_max = 1.0; 16 | ui_tooltip = "Controls the variance of the Gaussian noise. Lower values look smoother."; 17 | > = 0.40; 18 | uniform float Mean = 0.5; 19 | uniform int SignalToNoiseRatio < __UNIFORM_SLIDER_INT1 20 | ui_min = 0; ui_max = 16; 21 | ui_label = "Signal-to-Noise Ratio"; 22 | ui_tooltip = "Higher Signal-to-Noise Ratio values give less grain to brighter pixels. 0 disables this feature."; 23 | > = 6; 24 | 25 | uniform float Timer < source = "timer"; >; 26 | 27 | #include "ReShade.fxh" 28 | 29 | float3 FilmGrainPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 30 | { 31 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 32 | 33 | //float inv_luma = dot(color, float3(-0.2126, -0.7152, -0.0722)) + 1.0; 34 | float inv_luma = dot(color, float3(-1.0/3.0, -1.0/3.0, -1.0/3.0)) + 1.0; //Calculate the inverted luma so it can be used later to control the variance of the grain 35 | 36 | /*---------------------. 37 | | :: Generate Grain :: | 38 | '---------------------*/ 39 | 40 | const float PI = 3.1415927; 41 | 42 | //time counter using requested counter from ReShade 43 | float t = Timer * 0.0022337; 44 | 45 | //PRNG 2D - create two uniform noise values and save one DP2ADD 46 | float seed = dot(texcoord, float2(12.9898, 78.233));// + t; 47 | float sine = sin(seed); 48 | float cosine = cos(seed); 49 | float uniform_noise1 = frac(sine * 43758.5453 + t); //I just salt with t because I can 50 | float uniform_noise2 = frac(cosine * 53758.5453 - t); // and it doesn't cost any extra ASM 51 | 52 | //Get settings 53 | float stn = SignalToNoiseRatio != 0 ? pow(abs(inv_luma), (float)SignalToNoiseRatio) : 1.0; // Signal to noise feature - Brighter pixels get less noise. 54 | float variance = (Variance*Variance) * stn; 55 | float mean = Mean; 56 | 57 | //Box-Muller transform 58 | uniform_noise1 = (uniform_noise1 < 0.0001) ? 0.0001 : uniform_noise1; //fix log(0) 59 | 60 | float r = sqrt(-log(uniform_noise1)); 61 | r = (uniform_noise1 < 0.0001) ? PI : r; //fix log(0) - PI happened to be the right answer for uniform_noise == ~ 0.0000517.. Close enough and we can reuse a constant. 62 | float theta = (2.0 * PI) * uniform_noise2; 63 | 64 | float gauss_noise1 = variance * r * cos(theta) + mean; 65 | //float gauss_noise2 = variance * r * sin(theta) + mean; //we can get two gaussians out of it :) 66 | 67 | //gauss_noise1 = (ddx(gauss_noise1) - ddy(gauss_noise1)) * 0.50 + gauss_noise2; 68 | 69 | 70 | //Calculate how big the shift should be 71 | //float grain = lerp(1.0 - Intensity, 1.0 + Intensity, gauss_noise1); 72 | float grain = lerp(1.0 + Intensity, 1.0 - Intensity, gauss_noise1); 73 | 74 | //float grain2 = (2.0 * Intensity) * gauss_noise1 + (1.0 - Intensity); 75 | 76 | //Apply grain 77 | color = color * grain; 78 | 79 | //color = (grain-1.0) *2.0 + 0.5; 80 | 81 | //color = lerp(color,colorInput.rgb,sqrt(luma)); 82 | 83 | /*-------------------------. 84 | | :: Debugging features :: | 85 | '-------------------------*/ 86 | 87 | //color.rgb = frac(gauss_noise1).xxx; //show the noise 88 | //color.rgb = (gauss_noise1 > 0.999) ? float3(1.0,1.0,0.0) : 0.0 ; //does it reach 1.0? 89 | 90 | return color.rgb; 91 | } 92 | 93 | technique FilmGrain 94 | { 95 | pass 96 | { 97 | VertexShader = PostProcessVS; 98 | PixelShader = FilmGrainPass; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Glitch.fx: -------------------------------------------------------------------------------- 1 | #include "ReShade.fxh" 2 | 3 | #define PI 3.14159265 4 | #define TILE_SIZE 16.0 5 | 6 | uniform float Timer < source = "timer"; >; 7 | 8 | #include "ReShadeUI.fxh" 9 | 10 | uniform float Amount < __UNIFORM_SLIDER_FLOAT1 11 | ui_min = 0.0; 12 | ui_max = 10.0; 13 | ui_tooltip = "Glitch Amount [Glitch B]"; 14 | > = 1.0; 15 | 16 | uniform bool bUseUV < __UNIFORM_COMBO_BOOL1 17 | ui_tooltip = "Use UV for Glitch [Glitch B]"; 18 | > = false; 19 | 20 | float fmod(float a, float b) { 21 | float c = frac(abs(a / b)) * abs(b); 22 | return a < 0 ? -c : c; 23 | } 24 | float2 fmod(float2 a, float2 b) { 25 | float2 c = frac(abs(a / b)) * abs(b); 26 | return a < 0 ? -c : c; 27 | } 28 | 29 | float3 rgb2hsv(float3 c) 30 | { 31 | float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 32 | float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g)); 33 | float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r)); 34 | 35 | float d = q.x - min(q.w, q.y); 36 | float e = 1.0e-10; 37 | return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 38 | } 39 | 40 | float3 hsv2rgb(float3 c) 41 | { 42 | float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); 43 | float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www); 44 | return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); 45 | } 46 | 47 | float3 posterize(float3 color, float steps) 48 | { 49 | return floor(color * steps) / steps; 50 | } 51 | 52 | float quantize(float n, float steps) 53 | { 54 | return floor(n * steps) / steps; 55 | } 56 | 57 | float4 downsample(sampler2D samp, float2 uv, float pixelSize) 58 | { 59 | return tex2D(samp, uv - fmod(uv, float2(pixelSize,pixelSize) / ReShade::ScreenSize.xy)); 60 | } 61 | 62 | float rand(float n) 63 | { 64 | return frac(sin(n) * 43758.5453123); 65 | } 66 | 67 | float noise(float p) 68 | { 69 | float fl = floor(p); 70 | float fc = frac(p); 71 | return lerp(rand(fl), rand(fl + 1.0), fc); 72 | } 73 | 74 | float rand(float2 n) 75 | { 76 | return frac(sin(dot(n, float2(12.9898, 4.1414))) * 43758.5453); 77 | } 78 | 79 | float noise(float2 p) 80 | { 81 | float2 ip = floor(p); 82 | float2 u = frac(p); 83 | u = u * u * (3.0 - 2.0 * u); 84 | 85 | float res = lerp( 86 | lerp(rand(ip), rand(ip + float2(1.0, 0.0)), u.x), 87 | lerp(rand(ip + float2(0.0,1.0)), rand(ip + float2(1.0,1.0)), u.x), u.y); 88 | return res * res; 89 | } 90 | 91 | float3 edge(sampler2D samp, float2 uv, float sampleSize) 92 | { 93 | float dx = sampleSize / ReShade::ScreenSize.x; 94 | float dy = sampleSize / ReShade::ScreenSize.y; 95 | return ( 96 | lerp(downsample(samp, uv - float2(dx, 0.0), sampleSize), downsample(samp, uv + float2(dx, 0.0), sampleSize), fmod(uv.x, dx) / dx) + 97 | lerp(downsample(samp, uv - float2(0.0, dy), sampleSize), downsample(samp, uv + float2(0.0, dy), sampleSize), fmod(uv.y, dy) / dy) 98 | ).rgb / 2.0 - tex2D(samp, uv).rgb; 99 | } 100 | 101 | float3 distort(sampler2D samp, float2 uv, float edgeSize) 102 | { 103 | float2 pixel = float2(1.0,1.0) / ReShade::ScreenSize.xy; 104 | float3 field = rgb2hsv(edge(samp, uv, edgeSize)); 105 | float2 distort = pixel * sin((field.rb) * PI * 2.0); 106 | float shiftx = noise(float2(quantize(uv.y + 31.5, ReShade::ScreenSize.y / TILE_SIZE) * Timer*0.001, frac(Timer*0.001) * 300.0)); 107 | float shifty = noise(float2(quantize(uv.x + 11.5, ReShade::ScreenSize.x / TILE_SIZE) * Timer*0.001, frac(Timer*0.001) * 100.0)); 108 | float3 rgb = tex2D(samp, uv + (distort + (pixel - pixel / 2.0) * float2(shiftx, shifty) * (50.0 + 100.0 * Amount)) * Amount).rgb; 109 | float3 hsv = rgb2hsv(rgb); 110 | hsv.y = fmod(hsv.y + shifty * pow(Amount, 5.0) * 0.25, 1.0); 111 | return posterize(hsv2rgb(hsv), floor(lerp(256.0, pow(1.0 - hsv.z - 0.5, 2.0) * 64.0 * shiftx + 4.0, 1.0 - pow(1.0 - Amount, 5.0)))); 112 | } 113 | 114 | float4 PS_Glitch ( float4 pos : SV_Position, float2 fragCoord : TEXCOORD0) : SV_Target 115 | { 116 | float4 fragColor; 117 | float wow; 118 | float Amount; 119 | 120 | float2 texcoord = fragCoord * ReShade::ScreenSize; //this is because the original shader uses OpenGL's fragCoord, which is in texels rather than pixels 121 | float2 uv = texcoord.xy / ReShade::ScreenSize.xy; 122 | if (bUseUV) { 123 | Amount = uv.x; // Just erase this line if you want to use the control at the top 124 | } 125 | wow = clamp(fmod(noise(Timer*0.001 + uv.y), 1.0), 0.0, 1.0) * 2.0 - 1.0; 126 | float3 finalColor; 127 | finalColor += distort(ReShade::BackBuffer, uv, 8.0); 128 | return float4(finalColor, 1.0); 129 | } 130 | 131 | technique GlitchB { 132 | pass GlitchB { 133 | VertexShader=PostProcessVS; 134 | PixelShader=PS_Glitch; 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/HQ4X.fx: -------------------------------------------------------------------------------- 1 | // hq4x filter from https://www.shadertoy.com/view/MslGRS 2 | 3 | #include "ReShadeUI.fxh" 4 | 5 | uniform float s < __UNIFORM_SLIDER_FLOAT1 6 | ui_min = 0.1; ui_max = 10.0; 7 | ui_label = "Strength"; 8 | ui_tooltip = "Strength of the effect"; 9 | > = 1.5; 10 | uniform float mx < __UNIFORM_SLIDER_FLOAT1 11 | ui_min = 0.0; ui_max = 1.0; 12 | ui_label = "Smoothing"; 13 | > = 1.0; 14 | uniform float k < __UNIFORM_SLIDER_FLOAT1 15 | ui_min = -2.0; ui_max = 0.0; 16 | ui_label = "Weight Decrease Factor"; 17 | > = -1.10; 18 | uniform float max_w < __UNIFORM_SLIDER_FLOAT1 19 | ui_min = 0.0; ui_max = 1.0; 20 | ui_label = "Max Filter Weight"; 21 | > = 0.75; 22 | uniform float min_w < __UNIFORM_SLIDER_FLOAT1 23 | ui_min = 0.0; ui_max = 1.0; 24 | ui_label = "Min Filter Weight"; 25 | > = 0.03; 26 | uniform float lum_add < __UNIFORM_SLIDER_FLOAT1 27 | ui_min = 0.0; ui_max = 1.0; 28 | ui_label = "Effects Smoothing"; 29 | > = 0.33; 30 | 31 | #include "ReShade.fxh" 32 | 33 | float3 PS_HQ4X(float4 pos : SV_Position, float2 uv : TexCoord) : SV_Target 34 | { 35 | float x = s * ReShade::PixelSize.x; 36 | float y = s * ReShade::PixelSize.y; 37 | 38 | const float3 dt = 1.0 * float3(1.0, 1.0, 1.0); 39 | 40 | float2 dg1 = float2( x, y); 41 | float2 dg2 = float2(-x, y); 42 | 43 | float2 sd1 = dg1 * 0.5; 44 | float2 sd2 = dg2 * 0.5; 45 | 46 | float2 ddx = float2(x, 0.0); 47 | float2 ddy = float2(0.0, y); 48 | 49 | float4 t1 = float4(uv - sd1, uv - ddy); 50 | float4 t2 = float4(uv - sd2, uv + ddx); 51 | float4 t3 = float4(uv + sd1, uv + ddy); 52 | float4 t4 = float4(uv + sd2, uv - ddx); 53 | float4 t5 = float4(uv - dg1, uv - dg2); 54 | float4 t6 = float4(uv + dg1, uv + dg2); 55 | 56 | float3 c = tex2D(ReShade::BackBuffer, uv).rgb; 57 | 58 | float3 i1 = tex2D(ReShade::BackBuffer, t1.xy).rgb; 59 | float3 i2 = tex2D(ReShade::BackBuffer, t2.xy).rgb; 60 | float3 i3 = tex2D(ReShade::BackBuffer, t3.xy).rgb; 61 | float3 i4 = tex2D(ReShade::BackBuffer, t4.xy).rgb; 62 | 63 | float3 o1 = tex2D(ReShade::BackBuffer, t5.xy).rgb; 64 | float3 o3 = tex2D(ReShade::BackBuffer, t6.xy).rgb; 65 | float3 o2 = tex2D(ReShade::BackBuffer, t5.zw).rgb; 66 | float3 o4 = tex2D(ReShade::BackBuffer, t6.zw).rgb; 67 | 68 | float3 s1 = tex2D(ReShade::BackBuffer, t1.zw).rgb; 69 | float3 s2 = tex2D(ReShade::BackBuffer, t2.zw).rgb; 70 | float3 s3 = tex2D(ReShade::BackBuffer, t3.zw).rgb; 71 | float3 s4 = tex2D(ReShade::BackBuffer, t4.zw).rgb; 72 | 73 | float ko1 = dot(abs(o1 - c), dt); 74 | float ko2 = dot(abs(o2 - c), dt); 75 | float ko3 = dot(abs(o3 - c), dt); 76 | float ko4 = dot(abs(o4 - c), dt); 77 | 78 | float k1=min(dot(abs(i1 - i3), dt), max(ko1, ko3)); 79 | float k2=min(dot(abs(i2 - i4), dt), max(ko2, ko4)); 80 | 81 | float w1 = k2; if (ko3 < ko1) w1 *= ko3 / ko1; 82 | float w2 = k1; if (ko4 < ko2) w2 *= ko4 / ko2; 83 | float w3 = k2; if (ko1 < ko3) w3 *= ko1 / ko3; 84 | float w4 = k1; if (ko2 < ko4) w4 *= ko2 / ko4; 85 | 86 | c = (w1 * o1 + w2 * o2 + w3 * o3 + w4 * o4 + 0.001 * c) / (w1 + w2 + w3 + w4 + 0.001); 87 | w1 = k * dot(abs(i1 - c) + abs(i3 - c), dt) / (0.125 * dot(i1 + i3, dt) + lum_add); 88 | w2 = k * dot(abs(i2 - c) + abs(i4 - c), dt) / (0.125 * dot(i2 + i4, dt) + lum_add); 89 | w3 = k * dot(abs(s1 - c) + abs(s3 - c), dt) / (0.125 * dot(s1 + s3, dt) + lum_add); 90 | w4 = k * dot(abs(s2 - c) + abs(s4 - c), dt) / (0.125 * dot(s2 + s4, dt) + lum_add); 91 | 92 | w1 = clamp(w1 + mx, min_w, max_w); 93 | w2 = clamp(w2 + mx, min_w, max_w); 94 | w3 = clamp(w3 + mx, min_w, max_w); 95 | w4 = clamp(w4 + mx, min_w, max_w); 96 | 97 | return ( 98 | w1 * (i1 + i3) + 99 | w2 * (i2 + i4) + 100 | w3 * (s1 + s3) + 101 | w4 * (s2 + s4) + 102 | c) / (2.0 * (w1 + w2 + w3 + w4) + 1.0); 103 | } 104 | 105 | technique HQ4X 106 | { 107 | pass 108 | { 109 | VertexShader = PostProcessVS; 110 | PixelShader = PS_HQ4X; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Layer.fx: -------------------------------------------------------------------------------- 1 | /*------------------. 2 | | :: Description :: | 3 | '-------------------/ 4 | 5 | Layer (version 0.2) 6 | 7 | Author: CeeJay.dk 8 | License: MIT 9 | 10 | About: 11 | Blends an image with the game. 12 | The idea is to give users with graphics skills the ability to create effects using a layer just like in an image editor. 13 | Maybe they could use this to create custom CRT effects, custom vignettes, logos, custom hud elements, toggable help screens and crafting tables or something I haven't thought of. 14 | 15 | Ideas for future improvement: 16 | * More blend modes 17 | * Tiling control 18 | * A default Layer texture with something useful in it 19 | 20 | History: 21 | (*) Feature (+) Improvement (x) Bugfix (-) Information (!) Compatibility 22 | 23 | Version 0.2 by seri14 & Marot Satil 24 | * Added the ability to scale and move the layer around on XY axis 25 | */ 26 | 27 | #include "ReShade.fxh" 28 | 29 | #ifndef LAYER_SOURCE 30 | #define LAYER_SOURCE "layer.png" 31 | #endif 32 | #ifndef LAYER_SIZE_X 33 | #define LAYER_SIZE_X 1280 34 | #endif 35 | #ifndef LAYER_SIZE_Y 36 | #define LAYER_SIZE_Y 720 37 | #endif 38 | 39 | #if LAYER_SINGLECHANNEL 40 | #define TEXFORMAT R8 41 | #else 42 | #define TEXFORMAT RGBA8 43 | #endif 44 | 45 | #include "ReShadeUI.fxh" 46 | 47 | uniform float2 Layer_Pos < __UNIFORM_DRAG_FLOAT2 48 | ui_label = "Layer Position"; 49 | ui_min = 0.0; ui_max = 1.0; 50 | ui_step = (1.0 / 200.0); 51 | > = float2(0.5, 0.5); 52 | 53 | uniform float Layer_Scale < __UNIFORM_DRAG_FLOAT1 54 | ui_label = "Layer Scale"; 55 | ui_min = (1.0 / 100.0); ui_max = 4.0; 56 | ui_step = (1.0 / 250.0); 57 | > = 1.0; 58 | 59 | uniform float Layer_Blend < __UNIFORM_COLOR_FLOAT1 60 | ui_label = "Layer Blend"; 61 | ui_tooltip = "How much to blend layer with the original image."; 62 | ui_min = 0.0; ui_max = 1.0; 63 | ui_step = (1.0 / 255.0); // for slider and drag 64 | > = 1.0; 65 | 66 | texture Layer_Tex < 67 | source = LAYER_SOURCE; 68 | > { 69 | Format = TEXFORMAT; 70 | Width = LAYER_SIZE_X; 71 | Height = LAYER_SIZE_Y; 72 | }; 73 | 74 | sampler Layer_Sampler 75 | { 76 | Texture = Layer_Tex; 77 | AddressU = BORDER; 78 | AddressV = BORDER; 79 | }; 80 | 81 | void PS_Layer(float4 pos : SV_Position, float2 texCoord : TEXCOORD, out float4 passColor : SV_Target) 82 | { 83 | const float4 backColor = tex2D(ReShade::BackBuffer, texCoord); 84 | const float2 pixelSize = 1.0 / (float2(LAYER_SIZE_X, LAYER_SIZE_Y) * Layer_Scale / ReShade::ScreenSize); 85 | const float4 layer = tex2D(Layer_Sampler, texCoord * pixelSize + Layer_Pos * (1.0 - pixelSize)); 86 | 87 | passColor = lerp(backColor, layer, layer.a * Layer_Blend); 88 | passColor.a = backColor.a; 89 | } 90 | 91 | technique Layer 92 | { 93 | pass 94 | { 95 | VertexShader = PostProcessVS; 96 | PixelShader = PS_Layer; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/LiftGammaGain.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Lift Gamma Gain version 1.1 3 | * by 3an and CeeJay.dk 4 | */ 5 | 6 | #include "ReShadeUI.fxh" 7 | 8 | uniform float3 RGB_Lift < __UNIFORM_SLIDER_FLOAT3 9 | ui_min = 0.0; ui_max = 2.0; 10 | ui_label = "RGB Lift"; 11 | ui_tooltip = "Adjust shadows for Red, Green and Blue."; 12 | > = float3(1.0, 1.0, 1.0); 13 | uniform float3 RGB_Gamma < __UNIFORM_SLIDER_FLOAT3 14 | ui_min = 0.0; ui_max = 2.0; 15 | ui_label = "RGB Gamma"; 16 | ui_tooltip = "Adjust midtones for Red, Green and Blue."; 17 | > = float3(1.0, 1.0, 1.0); 18 | uniform float3 RGB_Gain < __UNIFORM_SLIDER_FLOAT3 19 | ui_min = 0.0; ui_max = 2.0; 20 | ui_label = "RGB Gain"; 21 | ui_tooltip = "Adjust highlights for Red, Green and Blue."; 22 | > = float3(1.0, 1.0, 1.0); 23 | 24 | 25 | #include "ReShade.fxh" 26 | 27 | float3 LiftGammaGainPass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target 28 | { 29 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 30 | 31 | // -- Lift -- 32 | color = color * (1.5 - 0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5; 33 | color = saturate(color); // Is not strictly necessary, but does not cost performance 34 | 35 | // -- Gain -- 36 | color *= RGB_Gain; 37 | 38 | // -- Gamma -- 39 | color = pow(abs(color), 1.0 / RGB_Gamma); 40 | 41 | return saturate(color); 42 | } 43 | 44 | 45 | technique LiftGammaGain 46 | { 47 | pass 48 | { 49 | VertexShader = PostProcessVS; 50 | PixelShader = LiftGammaGainPass; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Monochrome.fx: -------------------------------------------------------------------------------- 1 | /*------------------. 2 | | :: Description :: | 3 | '-------------------/ 4 | 5 | Monochrome (version 1.1) 6 | 7 | Author: CeeJay.dk 8 | License: MIT 9 | 10 | About: 11 | Removes color making everything monochrome. 12 | 13 | Ideas for future improvement: 14 | * Tinting 15 | * Select a hue to keep its color, thus making it stand out against a monochrome background 16 | * Try Lab colorspace 17 | * Apply color gradient 18 | * Add an option to normalize the coefficients 19 | * Publish best-selling book titled "256 shades of grey" 20 | 21 | History: 22 | (*) Feature (+) Improvement (x) Bugfix (-) Information (!) Compatibility 23 | 24 | Version 1.0 25 | * Converts image to monochrome 26 | * Allows users to add saturation back in. 27 | 28 | Version 1.1 29 | * Added many presets based on B/W camera films 30 | + Improved settings UI 31 | ! Made settings backwards compatible with SweetFX 32 | 33 | */ 34 | 35 | 36 | /*---------------. 37 | | :: Includes :: | 38 | '---------------*/ 39 | 40 | #include "ReShade.fxh" 41 | #include "ReShadeUI.fxh" 42 | 43 | uniform int Monochrome_preset < 44 | ui_type = "combo"; 45 | ui_label = "Preset"; 46 | ui_tooltip = "Choose a preset"; 47 | //ui_category = ""; 48 | ui_items = "Custom\0" 49 | "Monitor or modern TV\0" 50 | "Equal weight\0" 51 | "Agfa 200X\0" 52 | "Agfapan 25\0" 53 | "Agfapan 100\0" 54 | "Agfapan 400\0" 55 | "Ilford Delta 100\0" 56 | "Ilford Delta 400\0" 57 | "Ilford Delta 400 Pro & 3200\0" 58 | "Ilford FP4\0" 59 | "Ilford HP5\0" 60 | "Ilford Pan F\0" 61 | "Ilford SFX\0" 62 | "Ilford XP2 Super\0" 63 | "Kodak Tmax 100\0" 64 | "Kodak Tmax 400\0" 65 | "Kodak Tri-X\0"; 66 | > = 0; 67 | 68 | uniform float3 Monochrome_conversion_values < __UNIFORM_COLOR_FLOAT3 69 | ui_label = "Custom Conversion values"; 70 | > = float3(0.21, 0.72, 0.07); 71 | 72 | /* 73 | uniform bool Normalize < 74 | ui_label = "Normalize"; 75 | ui_tooltip = "Normalize the coefficients?"; 76 | > = false; 77 | */ 78 | 79 | uniform float Monochrome_color_saturation < __UNIFORM_SLIDER_FLOAT1 80 | ui_label = "Saturation"; 81 | ui_min = 0.0; ui_max = 1.0; 82 | > = 0.0; 83 | 84 | float3 MonochromePass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 85 | { 86 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 87 | 88 | float3 Coefficients = float3(0.21, 0.72, 0.07); 89 | 90 | float3 Coefficients_array[18] = 91 | { 92 | Monochrome_conversion_values, //Custom 93 | float3(0.21, 0.72, 0.07), //sRGB monitor 94 | float3(0.3333333, 0.3333334, 0.3333333), //Equal weight 95 | float3(0.18, 0.41, 0.41), //Agfa 200X 96 | float3(0.25, 0.39, 0.36), //Agfapan 25 97 | float3(0.21, 0.40, 0.39), //Agfapan 100 98 | float3(0.20, 0.41, 0.39), //Agfapan 400 99 | float3(0.21, 0.42, 0.37), //Ilford Delta 100 100 | float3(0.22, 0.42, 0.36), //Ilford Delta 400 101 | float3(0.31, 0.36, 0.33), //Ilford Delta 400 Pro & 3200 102 | float3(0.28, 0.41, 0.31), //Ilford FP4 103 | float3(0.23, 0.37, 0.40), //Ilford HP5 104 | float3(0.33, 0.36, 0.31), //Ilford Pan F 105 | float3(0.36, 0.31, 0.33), //Ilford SFX 106 | float3(0.21, 0.42, 0.37), //Ilford XP2 Super 107 | float3(0.24, 0.37, 0.39), //Kodak Tmax 100 108 | float3(0.27, 0.36, 0.37), //Kodak Tmax 400 109 | float3(0.25, 0.35, 0.40) //Kodak Tri-X 110 | }; 111 | 112 | Coefficients = Coefficients_array[Monochrome_preset]; 113 | 114 | // Calculate monochrome 115 | float3 grey = dot(Coefficients, color); 116 | 117 | // Adjust the remaining saturation 118 | color = lerp(grey, color, Monochrome_color_saturation); 119 | 120 | // Return the result 121 | return saturate(color); 122 | } 123 | 124 | technique Monochrome 125 | { 126 | pass 127 | { 128 | VertexShader = PostProcessVS; 129 | PixelShader = MonochromePass; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/MultiLUT.fx: -------------------------------------------------------------------------------- 1 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | // ReShade effect file 3 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 | // Multi-LUT shader, using a texture atlas with multiple LUTs 5 | // by Otis / Infuse Project. 6 | // Based on Marty's LUT shader 1.0 for ReShade 3.0 7 | // Copyright © 2008-2016 Marty McFly 8 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 9 | 10 | #ifndef fLUT_TextureName 11 | #define fLUT_TextureName "MultiLut_Atlas1.png" 12 | #endif 13 | #ifndef fLUT_TileSizeXY 14 | #define fLUT_TileSizeXY 32 15 | #endif 16 | #ifndef fLUT_TileAmount 17 | #define fLUT_TileAmount 32 18 | #endif 19 | #ifndef fLUT_LutAmount 20 | #define fLUT_LutAmount 17 21 | #endif 22 | 23 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 24 | // 25 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 26 | 27 | #include "ReShadeUI.fxh" 28 | 29 | uniform int fLUT_LutSelector < 30 | ui_type = "combo"; 31 | ui_items="Neutral\0Color1\0Color2\0Color3 (Blue oriented)\0Color4 (Hollywood)\0Color5\0Color6\0Color7\0Color8\0Cool light\0Flat & green\0Red lift matte\0Cross process\0Azure Red Dual Tone\0Sepia\0\B&W mid constrast\0\B&W high contrast\0"; 32 | ui_label = "The LUT to use"; 33 | ui_tooltip = "The LUT to use for color transformation. 'Neutral' doesn't do any color transformation."; 34 | > = 0; 35 | 36 | uniform float fLUT_AmountChroma < __UNIFORM_SLIDER_FLOAT1 37 | ui_min = 0.00; ui_max = 1.00; 38 | ui_label = "LUT chroma amount"; 39 | ui_tooltip = "Intensity of color/chroma change of the LUT."; 40 | > = 1.00; 41 | 42 | uniform float fLUT_AmountLuma < __UNIFORM_SLIDER_FLOAT1 43 | ui_min = 0.00; ui_max = 1.00; 44 | ui_label = "LUT luma amount"; 45 | ui_tooltip = "Intensity of luma change of the LUT."; 46 | > = 1.00; 47 | 48 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 49 | // 50 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 51 | 52 | #include "ReShade.fxh" 53 | texture texMultiLUT < source = fLUT_TextureName; > { Width = fLUT_TileSizeXY*fLUT_TileAmount; Height = fLUT_TileSizeXY * fLUT_LutAmount; Format = RGBA8; }; 54 | sampler SamplerMultiLUT { Texture = texMultiLUT; }; 55 | 56 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 57 | // 58 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 59 | 60 | void PS_MultiLUT_Apply(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float4 res : SV_Target0) 61 | { 62 | float4 color = tex2D(ReShade::BackBuffer, texcoord.xy); 63 | float2 texelsize = 1.0 / fLUT_TileSizeXY; 64 | texelsize.x /= fLUT_TileAmount; 65 | 66 | float3 lutcoord = float3((color.xy*fLUT_TileSizeXY-color.xy+0.5)*texelsize.xy,color.z*fLUT_TileSizeXY-color.z); 67 | lutcoord.y /= fLUT_LutAmount; 68 | lutcoord.y += (float(fLUT_LutSelector)/ fLUT_LutAmount); 69 | float lerpfact = frac(lutcoord.z); 70 | lutcoord.x += (lutcoord.z-lerpfact)*texelsize.y; 71 | 72 | float3 lutcolor = lerp(tex2D(SamplerMultiLUT, lutcoord.xy).xyz, tex2D(SamplerMultiLUT, float2(lutcoord.x+texelsize.y,lutcoord.y)).xyz,lerpfact); 73 | 74 | color.xyz = lerp(normalize(color.xyz), normalize(lutcolor.xyz), fLUT_AmountChroma) * 75 | lerp(length(color.xyz), length(lutcolor.xyz), fLUT_AmountLuma); 76 | 77 | res.xyz = color.xyz; 78 | res.w = 1.0; 79 | } 80 | 81 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 82 | // 83 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 84 | 85 | 86 | technique MultiLUT 87 | { 88 | pass MultiLUT_Apply 89 | { 90 | VertexShader = PostProcessVS; 91 | PixelShader = PS_MultiLUT_Apply; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/NightVision.fx: -------------------------------------------------------------------------------- 1 | #include "ReShade.fxh" 2 | 3 | uniform float iGlobalTime < source = "timer"; >; 4 | 5 | float hash(in float n) { return frac(sin(n)*43758.5453123); } 6 | 7 | float mod(float x, float y) 8 | { 9 | return x - y * floor (x/y); 10 | } 11 | 12 | float3 PS_Nightvision(float4 pos : SV_Position, float2 uv : TEXCOORD0) : SV_Target 13 | { 14 | float2 p = uv; 15 | 16 | float2 u = p * 2. - 1.; 17 | float2 n = u * float2(ReShade::ScreenSize.x / ReShade::ScreenSize.y, 1.0); 18 | float3 c = tex2D(ReShade::BackBuffer, uv).xyz; 19 | 20 | // flicker, grain, vignette, fade in 21 | c += sin(hash(iGlobalTime*0.001)) * 0.01; 22 | c += hash((hash(n.x) + n.y) * iGlobalTime*0.001) * 0.5; 23 | c *= smoothstep(length(n * n * n * float2(0.0, 0.0)), 1.0, 0.4); 24 | c *= smoothstep(0.001, 3.5, iGlobalTime*0.001) * 1.5; 25 | 26 | c = dot(c, float3(0.2126, 0.7152, 0.0722)) 27 | * float3(0.2, 1.5 - hash(iGlobalTime*0.001) * 0.1,0.4); 28 | 29 | return c; 30 | } 31 | 32 | technique Nightvision { 33 | pass Nightvision { 34 | VertexShader=PostProcessVS; 35 | PixelShader=PS_Nightvision; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Prism.fx: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2018 Jacob Maximilian Fober 3 | 4 | This work is licensed under the Creative Commons 5 | Attribution-NonCommercial-ShareAlike 4.0 International License. 6 | To view a copy of this license, visit 7 | http://creativecommons.org/licenses/by-nc-sa/4.0/. 8 | */ 9 | 10 | // Chromatic Aberration PS (Prism) v1.2.4 11 | // inspired by Marty McFly YACA shader 12 | 13 | 14 | //////////// 15 | /// MENU /// 16 | //////////// 17 | 18 | #ifndef PrismLimit 19 | #define PrismLimit 48 // Maximum sample count 20 | #endif 21 | 22 | #include "ReShadeUI.fxh" 23 | 24 | uniform int Aberration < __UNIFORM_SLIDER_INT1 25 | ui_label = "Aberration scale in pixels"; 26 | ui_min = -48; ui_max = 48; 27 | > = 6; 28 | 29 | uniform float Curve < __UNIFORM_SLIDER_FLOAT1 30 | ui_label = "Aberration curve"; 31 | ui_min = 0.0; ui_max = 4.0; ui_step = 0.01; 32 | > = 1.0; 33 | 34 | uniform bool Automatic < 35 | ui_label = "Automatic sample count"; 36 | ui_tooltip = "Amount of samples will be adjusted automatically"; 37 | ui_category = "Performance"; 38 | > = true; 39 | 40 | uniform int SampleCount < __UNIFORM_SLIDER_INT1 41 | ui_label = "Samples"; 42 | ui_tooltip = "Amount of samples (only even numbers are accepted, odd numbers will be clamped)"; 43 | ui_min = 6; ui_max = 32; 44 | ui_category = "Performance"; 45 | > = 8; 46 | 47 | 48 | ////////////// 49 | /// SHADER /// 50 | ////////////// 51 | 52 | #include "ReShade.fxh" 53 | 54 | // Special Hue generator by JMF 55 | float3 Spectrum(float Hue) 56 | { 57 | float Hue4 = Hue * 4.0; 58 | float3 HueColor = abs(Hue4 - float3(1.0, 2.0, 1.0)); 59 | HueColor = saturate(1.5 - HueColor); 60 | HueColor.xz += saturate(Hue4 - 3.5); 61 | HueColor.z = 1.0 - HueColor.z; 62 | return HueColor; 63 | } 64 | 65 | // Define screen texture with mirror tiles 66 | sampler SamplerColor 67 | { 68 | Texture = ReShade::BackBufferTex; 69 | AddressU = MIRROR; 70 | AddressV = MIRROR; 71 | }; 72 | 73 | void ChromaticAberrationPS(float4 vois : SV_Position, float2 texcoord : TexCoord, out float3 BluredImage : SV_Target) 74 | { 75 | // Grab Aspect Ratio 76 | float Aspect = ReShade::AspectRatio; 77 | // Grab Pixel V size 78 | float Pixel = ReShade::PixelSize.y; 79 | 80 | // Adjust number of samples 81 | // IF Automatic IS True Ceil odd numbers to even with minimum 6, else Clamp odd numbers to even 82 | float Samples = Automatic ? max(6.0, 2.0 * ceil(abs(Aberration) * 0.5) + 2.0) : floor(SampleCount * 0.5) * 2.0; 83 | // Clamp maximum sample count 84 | Samples = min(Samples, PrismLimit); 85 | // Calculate sample offset 86 | float Sample = 1.0 / Samples; 87 | 88 | // Convert UVs to centered coordinates with correct Aspect Ratio 89 | float2 RadialCoord = texcoord - 0.5; 90 | RadialCoord.x *= Aspect; 91 | 92 | // Generate radial mask from center (0) to the corner of the screen (1) 93 | float Mask = pow(2.0 * length(RadialCoord) * rsqrt(Aspect * Aspect + 1.0), Curve); 94 | 95 | float OffsetBase = Mask * Aberration * Pixel * 2.0; 96 | 97 | // Each loop represents one pass 98 | if(abs(OffsetBase) < Pixel) BluredImage = tex2D(SamplerColor, texcoord).rgb; 99 | else 100 | { 101 | BluredImage = 0.0; 102 | for (float P = 0.0; P < Samples; P++) 103 | { 104 | float Progress = P / Samples; 105 | float Offset = OffsetBase * (Progress - 0.5) + 1.0; 106 | 107 | // Scale UVs at center 108 | float2 Position = RadialCoord / Offset; 109 | // Convert aspect ratio back to square 110 | Position.x /= Aspect; 111 | // Convert centered coordinates to UV 112 | Position += 0.5; 113 | 114 | // Multiply texture sample by HUE color 115 | BluredImage += Spectrum(Progress) * tex2Dlod(SamplerColor, float4(Position, 0.0, 0.0)).rgb; 116 | } 117 | BluredImage *= 2.0 / Samples; 118 | } 119 | } 120 | 121 | 122 | ////////////// 123 | /// OUTPUT /// 124 | ////////////// 125 | 126 | technique ChromaticAberration < ui_label = "Chromatic Aberration"; > 127 | { 128 | pass 129 | { 130 | VertexShader = PostProcessVS; 131 | PixelShader = ChromaticAberrationPS; 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Sepia.fx: -------------------------------------------------------------------------------- 1 | #include "ReShadeUI.fxh" 2 | 3 | uniform float3 Tint < __UNIFORM_COLOR_FLOAT3 4 | > = float3(0.55, 0.43, 0.42); 5 | 6 | uniform float Strength < __UNIFORM_SLIDER_FLOAT1 7 | ui_min = 0.0; ui_max = 1.0; 8 | > = 0.58; 9 | 10 | #include "ReShade.fxh" 11 | 12 | float3 TintPass(float4 vois : SV_Position, float2 texcoord : TexCoord) : SV_Target 13 | { 14 | float3 col = tex2D(ReShade::BackBuffer, texcoord).rgb; 15 | 16 | return lerp(col, col * Tint * 2.55, Strength); 17 | } 18 | 19 | technique Tint 20 | { 21 | pass 22 | { 23 | VertexShader = PostProcessVS; 24 | PixelShader = TintPass; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/StageDepth.fx: -------------------------------------------------------------------------------- 1 | // Made by Marot Satil for the GShade ReShade package! 2 | // You can follow me via @MarotSatil on Twitter, but I don't use it all that much. 3 | // Follow @GPOSERS_FFXIV on Twitter and join us on Discord (https://discord.gg/39WpvU2) 4 | // for the latest GShade package updates! 5 | // 6 | // This shader was designed in the same vein as GreenScreenDepth.fx, but instead of applying a 7 | // green screen with adjustable distance, it applies a PNG texture with adjustable opacity. 8 | // 9 | // PNG transparency is fully supported, so you could for example add another moon to the sky 10 | // just as readily as create a "green screen" stage like in real life. 11 | // 12 | // Copyright (c) 2019, Marot Satil 13 | // All rights reserved. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions 17 | // are met: 18 | // 1. Redistributions of source code must retain the above copyright 19 | // notice, the header above it, this list of conditions, and the following disclaimer 20 | // in this position and unchanged. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, the header above it, this list of conditions, and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 25 | // THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 26 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 27 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 28 | // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 30 | // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 | // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | 37 | #include "Reshade.fxh" 38 | 39 | #define TEXFORMAT RGBA8 40 | 41 | #include "ReShadeUI.fxh" 42 | 43 | uniform float Stage_Opacity < __UNIFORM_SLIDER_FLOAT1 44 | ui_label = "Opacity"; 45 | ui_tooltip = "Set the transparency of the image."; 46 | ui_min = 0.0; 47 | ui_max = 1.0; 48 | ui_step = 0.002; 49 | > = 1.0; 50 | 51 | uniform float Stage_depth < __UNIFORM_SLIDER_FLOAT1 52 | ui_min = 0.0; 53 | ui_max = .987; 54 | ui_label = "Depth Slider"; 55 | > = 0.97; 56 | 57 | texture Stage_texture { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format=TEXFORMAT; }; 58 | 59 | sampler Stage_sampler { Texture = Stage_texture; }; 60 | 61 | void PS_StageDepth(in float4 position : SV_Position, in float2 texcoord : TEXCOORD0, out float3 color : SV_Target) 62 | { 63 | float4 stage = tex2D(Stage_sampler, texcoord).rgba; 64 | color = tex2D(ReShade::BackBuffer, texcoord).rgb; 65 | 66 | float depth = 1 - ReShade::GetLinearizedDepth(texcoord).r; 67 | 68 | if( depth < Stage_depth ) 69 | { 70 | color = lerp(color, stage.rgb, stage.a * Stage_Opacity); 71 | } 72 | } 73 | 74 | technique StageDepth 75 | { 76 | pass 77 | { 78 | VertexShader = PostProcessVS; 79 | PixelShader = PS_StageDepth; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Technicolor.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Technicolor version 1.1 3 | * Original by DKT70 4 | * Optimized by CeeJay.dk 5 | */ 6 | 7 | #include "ReShadeUI.fxh" 8 | 9 | uniform float Power < __UNIFORM_SLIDER_FLOAT1 10 | ui_min = 0.0; ui_max = 8.0; 11 | > = 4.0; 12 | uniform float3 RGBNegativeAmount < __UNIFORM_COLOR_FLOAT3 13 | > = float3(0.88, 0.88, 0.88); 14 | 15 | uniform float Strength < __UNIFORM_SLIDER_FLOAT1 16 | ui_min = 0.0; ui_max = 1.0; 17 | > = 0.4; 18 | 19 | #include "ReShade.fxh" 20 | 21 | float3 TechnicolorPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 22 | { 23 | const float3 cyanfilter = float3(0.0, 1.30, 1.0); 24 | const float3 magentafilter = float3(1.0, 0.0, 1.05); 25 | const float3 yellowfilter = float3(1.6, 1.6, 0.05); 26 | const float2 redorangefilter = float2(1.05, 0.620); // RG_ 27 | const float2 greenfilter = float2(0.30, 1.0); // RG_ 28 | const float2 magentafilter2 = magentafilter.rb; // R_B 29 | 30 | float3 tcol = tex2D(ReShade::BackBuffer, texcoord).rgb; 31 | 32 | float2 negative_mul_r = tcol.rg * (1.0 / (RGBNegativeAmount.r * Power)); 33 | float2 negative_mul_g = tcol.rg * (1.0 / (RGBNegativeAmount.g * Power)); 34 | float2 negative_mul_b = tcol.rb * (1.0 / (RGBNegativeAmount.b * Power)); 35 | float3 output_r = dot(redorangefilter, negative_mul_r).xxx + cyanfilter; 36 | float3 output_g = dot(greenfilter, negative_mul_g).xxx + magentafilter; 37 | float3 output_b = dot(magentafilter2, negative_mul_b).xxx + yellowfilter; 38 | 39 | return lerp(tcol, output_r * output_g * output_b, Strength); 40 | } 41 | 42 | technique Technicolor 43 | { 44 | pass 45 | { 46 | VertexShader = PostProcessVS; 47 | PixelShader = TechnicolorPass; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Technicolor2.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Technicolor2 version 1.0 3 | * Original by Prod80 4 | * Optimized by CeeJay.dk 5 | */ 6 | 7 | #include "ReShadeUI.fxh" 8 | 9 | uniform float3 ColorStrength < __UNIFORM_COLOR_FLOAT3 10 | ui_tooltip = "Higher means darker and more intense colors."; 11 | > = float3(0.2, 0.2, 0.2); 12 | 13 | uniform float Brightness < __UNIFORM_SLIDER_FLOAT1 14 | ui_min = 0.5; ui_max = 1.5; 15 | ui_tooltip = "Higher means brighter image."; 16 | > = 1.0; 17 | uniform float Saturation < __UNIFORM_SLIDER_FLOAT1 18 | ui_min = 0.0; ui_max = 1.5; 19 | ui_tooltip = "Additional saturation control since this effect tends to oversaturate the image."; 20 | > = 1.0; 21 | 22 | uniform float Strength < __UNIFORM_SLIDER_FLOAT1 23 | ui_min = 0.0; ui_max = 1.0; 24 | > = 1.0; 25 | 26 | #include "ReShade.fxh" 27 | 28 | float3 TechnicolorPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target 29 | { 30 | float3 color = saturate(tex2D(ReShade::BackBuffer, texcoord).rgb); 31 | 32 | float3 temp = 1.0 - color; 33 | float3 target = temp.grg; 34 | float3 target2 = temp.bbr; 35 | float3 temp2 = color * target; 36 | temp2 *= target2; 37 | 38 | temp = temp2 * ColorStrength; 39 | temp2 *= Brightness; 40 | 41 | target = temp.grg; 42 | target2 = temp.bbr; 43 | 44 | temp = color - target; 45 | temp += temp2; 46 | temp2 = temp - target2; 47 | 48 | color = lerp(color, temp2, Strength); 49 | color = lerp(dot(color, 0.333), color, Saturation); 50 | 51 | return color; 52 | } 53 | 54 | technique Technicolor2 55 | { 56 | pass 57 | { 58 | VertexShader = PostProcessVS; 59 | PixelShader = TechnicolorPass; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/TiltShift.fx: -------------------------------------------------------------------------------- 1 | /* 2 | Tilt-Shift PS v1.1.3 (c) 2018 Jacob Maximilian Fober, 3 | (based on TiltShift effect (c) 2016 kingeric1992) 4 | 5 | This work is licensed under the Creative Commons 6 | Attribution-ShareAlike 4.0 International License. 7 | To view a copy of this license, visit 8 | http://creativecommons.org/licenses/by-sa/4.0/. 9 | */ 10 | 11 | 12 | //////////// 13 | /// MENU /// 14 | //////////// 15 | 16 | #include "ReShadeUI.fxh" 17 | 18 | uniform bool Line < 19 | ui_label = "Show Center Line"; 20 | > = false; 21 | 22 | uniform int Axis < __UNIFORM_SLIDER_INT1 23 | ui_label = "Angle"; 24 | #if __RESHADE__ < 40000 25 | ui_step = 1; 26 | #endif 27 | ui_min = -89; ui_max = 90; 28 | > = 0; 29 | 30 | uniform float Offset < __UNIFORM_SLIDER_FLOAT1 31 | ui_min = -1.41; ui_max = 1.41; ui_step = 0.01; 32 | > = 0.05; 33 | 34 | uniform float BlurCurve < __UNIFORM_SLIDER_FLOAT1 35 | ui_label = "Blur Curve"; 36 | ui_min = 1.0; ui_max = 5.0; ui_step = 0.01; 37 | ui_label = "Blur Curve"; 38 | > = 1.0; 39 | 40 | uniform float BlurMultiplier < __UNIFORM_SLIDER_FLOAT1 41 | ui_label = "Blur Multiplier"; 42 | ui_min = 0.0; ui_max = 100.0; ui_step = 0.2; 43 | > = 6.0; 44 | 45 | // First pass render target, to make sure Alpha channel exists 46 | texture TiltShiftTarget { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 47 | sampler TiltShiftSampler { Texture = TiltShiftTarget; }; 48 | 49 | 50 | ////////////// 51 | /// SHADER /// 52 | ////////////// 53 | 54 | #include "ReShade.fxh" 55 | 56 | void TiltShiftPass1PS(float4 vpos : SV_Position, float2 UvCoord : TEXCOORD, out float4 Image : SV_Target) 57 | { 58 | const float Weight[11] = 59 | { 60 | 0.082607, 61 | 0.080977, 62 | 0.076276, 63 | 0.069041, 64 | 0.060049, 65 | 0.050187, 66 | 0.040306, 67 | 0.031105, 68 | 0.023066, 69 | 0.016436, 70 | 0.011254 71 | }; 72 | // Grab screen texture 73 | Image.rgb = tex2D(ReShade::BackBuffer, UvCoord).rgb; 74 | // Correct Aspect Ratio 75 | float2 UvCoordAspect = UvCoord; 76 | UvCoordAspect.y += ReShade::AspectRatio * 0.5 - 0.5; 77 | UvCoordAspect.y /= ReShade::AspectRatio; 78 | // Center coordinates 79 | UvCoordAspect = UvCoordAspect * 2.0 - 1.0; 80 | // Tilt vector 81 | float Angle = radians(-Axis); 82 | float2 TiltVector = float2(sin(Angle), cos(Angle)); 83 | // Blur mask 84 | float BlurMask = abs(dot(TiltVector, UvCoordAspect) + Offset); 85 | BlurMask = max(0.0, min(1.0, BlurMask)); 86 | // Set alpha channel 87 | Image.a = BlurMask; 88 | BlurMask = pow(Image.a, BlurCurve); 89 | // Horizontal gaussian blur 90 | if(BlurMask > 0) 91 | { 92 | float UvOffset = ReShade::PixelSize.x * BlurMask * BlurMultiplier; 93 | Image.rgb *= Weight[0]; 94 | [unroll] 95 | for (int i = 1; i < 11; i++) 96 | { 97 | float SampleOffset = i * UvOffset; 98 | Image.rgb += ( 99 | tex2Dlod(ReShade::BackBuffer, float4(UvCoord.xy + float2(SampleOffset, 0.0), 0.0, 0.0)).rgb 100 | + tex2Dlod(ReShade::BackBuffer, float4(UvCoord.xy - float2(SampleOffset, 0.0), 0.0, 0.0)).rgb 101 | ) * Weight[i]; 102 | } 103 | } 104 | } 105 | 106 | void TiltShiftPass2PS(float4 vpos : SV_Position, float2 UvCoord : TEXCOORD, out float4 Image : SV_Target) 107 | { 108 | const float Weight[11] = 109 | { 110 | 0.082607, 111 | 0.080977, 112 | 0.076276, 113 | 0.069041, 114 | 0.060049, 115 | 0.050187, 116 | 0.040306, 117 | 0.031105, 118 | 0.023066, 119 | 0.016436, 120 | 0.011254 121 | }; 122 | // Grab second pass screen texture 123 | Image = tex2D(TiltShiftSampler, UvCoord); 124 | // Blur mask 125 | float BlurMask = pow(abs(Image.a), BlurCurve); 126 | // Vertical gaussian blur 127 | if(BlurMask > 0) 128 | { 129 | float UvOffset = ReShade::PixelSize.y * BlurMask * BlurMultiplier; 130 | Image.rgb *= Weight[0]; 131 | [unroll] 132 | for (int i = 1; i < 11; i++) 133 | { 134 | float SampleOffset = i * UvOffset; 135 | Image.rgb += ( 136 | tex2Dlod(TiltShiftSampler, float4(UvCoord.xy + float2(0.0, SampleOffset), 0.0, 0.0)).rgb 137 | + tex2Dlod(TiltShiftSampler, float4(UvCoord.xy - float2(0.0, SampleOffset), 0.0, 0.0)).rgb 138 | ) * Weight[i]; 139 | } 140 | } 141 | // Draw red line 142 | // Image IS Red IF (Line IS True AND Image.a < 0.01), ELSE Image IS Image 143 | Image.rgb = (Line && Image.a < 0.01) ? float3(1.0, 0.0, 0.0) : Image.rgb; 144 | } 145 | 146 | 147 | ////////////// 148 | /// OUTPUT /// 149 | ////////////// 150 | 151 | technique TiltShift < ui_label = "Tilt Shift"; > 152 | { 153 | pass AlphaAndHorizontalGaussianBlur 154 | { 155 | VertexShader = PostProcessVS; 156 | PixelShader = TiltShiftPass1PS; 157 | RenderTarget = TiltShiftTarget; 158 | } 159 | pass VerticalGaussianBlurAndRedLine 160 | { 161 | VertexShader = PostProcessVS; 162 | PixelShader = TiltShiftPass2PS; 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/Tonemap.fx: -------------------------------------------------------------------------------- 1 | /** 2 | * Tonemap version 1.1 3 | * by Christian Cann Schuldt Jensen ~ CeeJay.dk 4 | */ 5 | 6 | #include "ReShadeUI.fxh" 7 | 8 | uniform float Gamma < __UNIFORM_SLIDER_FLOAT1 9 | ui_min = 0.0; ui_max = 2.0; 10 | ui_tooltip = "Adjust midtones. 1.000 is neutral. This setting does exactly the same as the one in Lift Gamma Gain, only with less control."; 11 | > = 1.0; 12 | uniform float Exposure < __UNIFORM_SLIDER_FLOAT1 13 | ui_min = -1.0; ui_max = 1.0; 14 | ui_tooltip = "Adjust exposure"; 15 | > = 0.0; 16 | uniform float Saturation < __UNIFORM_SLIDER_FLOAT1 17 | ui_min = -1.0; ui_max = 1.0; 18 | ui_tooltip = "Adjust saturation"; 19 | > = 0.0; 20 | 21 | uniform float Bleach < __UNIFORM_SLIDER_FLOAT1 22 | ui_min = 0.0; ui_max = 1.0; 23 | ui_tooltip = "Brightens the shadows and fades the colors"; 24 | > = 0.0; 25 | 26 | uniform float Defog < __UNIFORM_SLIDER_FLOAT1 27 | ui_min = 0.0; ui_max = 1.0; 28 | ui_tooltip = "How much of the color tint to remove"; 29 | > = 0.0; 30 | uniform float3 FogColor < __UNIFORM_COLOR_FLOAT3 31 | ui_label = "Defog Color"; 32 | ui_tooltip = "Which color tint to remove"; 33 | > = float3(0.0, 0.0, 1.0); 34 | 35 | 36 | #include "ReShade.fxh" 37 | 38 | float3 TonemapPass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target 39 | { 40 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 41 | color = saturate(color - Defog * FogColor * 2.55); // Defog 42 | color *= pow(2.0f, Exposure); // Exposure 43 | color = pow(color, Gamma); // Gamma 44 | 45 | const float3 coefLuma = float3(0.2126, 0.7152, 0.0722); 46 | float lum = dot(coefLuma, color); 47 | 48 | float L = saturate(10.0 * (lum - 0.45)); 49 | float3 A2 = Bleach * color; 50 | 51 | float3 result1 = 2.0f * color * lum; 52 | float3 result2 = 1.0f - 2.0f * (1.0f - lum) * (1.0f - color); 53 | 54 | float3 newColor = lerp(result1, result2, L); 55 | float3 mixRGB = A2 * newColor; 56 | color += ((1.0f - A2) * mixRGB); 57 | 58 | float3 middlegray = dot(color, (1.0 / 3.0)); 59 | float3 diffcolor = color - middlegray; 60 | color = (color + diffcolor * Saturation) / (1 + (diffcolor * Saturation)); // Saturation 61 | 62 | return color; 63 | } 64 | 65 | technique Tonemap 66 | { 67 | pass 68 | { 69 | VertexShader = PostProcessVS; 70 | PixelShader = TonemapPass; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/TriDither.fx: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // Triangular Dither // 3 | // By The Sandvich Maker // 4 | // Ported to ReShade by TreyM // 5 | //////////////////////////////////////////////////////////// 6 | 7 | #include "ReShade.fxh" 8 | 9 | uniform float Timer < source = "timer"; >; 10 | #define remap(v, a, b) (((v) - (a)) / ((b) - (a))) 11 | 12 | // FUNCTIONS ///////////////////////////////////// 13 | float rand21(float2 uv) 14 | { 15 | float2 noise = frac(sin(dot(uv, float2(12.9898, 78.233) * 2.0)) * 43758.5453); 16 | return (noise.x + noise.y) * 0.5; 17 | } 18 | float rand11(float x) { return frac(x * 0.024390243); } 19 | float permute(float x) { return ((34.0 * x + 1.0) * x) % 289.0; } 20 | 21 | float3 triDither(float3 color, float2 uv, float timer) 22 | { 23 | static const float bitstep = pow(2.0, 8) - 1.0; 24 | static const float lsb = 1.0 / bitstep; 25 | static const float lobit = 0.5 / bitstep; 26 | static const float hibit = (bitstep - 0.5) / bitstep; 27 | 28 | float3 m = float3(uv, rand21(uv + timer)) + 1.0; 29 | float h = permute(permute(permute(m.x) + m.y) + m.z); 30 | 31 | float3 noise1, noise2; 32 | noise1.x = rand11(h); h = permute(h); 33 | noise2.x = rand11(h); h = permute(h); 34 | noise1.y = rand11(h); h = permute(h); 35 | noise2.y = rand11(h); h = permute(h); 36 | noise1.z = rand11(h); h = permute(h); 37 | noise2.z = rand11(h); 38 | 39 | float3 lo = saturate(remap(color.xyz, 0.0, lobit)); 40 | float3 hi = saturate(remap(color.xyz, 1.0, hibit)); 41 | float3 uni = noise1 - 0.5; 42 | float3 tri = noise1 - noise2; 43 | return lerp(uni, tri, min(lo, hi)) * lsb; 44 | } 45 | 46 | // SHADER //////////////////////////////////////// 47 | float3 PS_TriDither(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 48 | { 49 | float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb; 50 | 51 | // Blend 52 | color.rgb += triDither(color.rgb, texcoord, Timer.x); 53 | 54 | // Output 55 | return color; 56 | } 57 | 58 | // TECHNIQUE ///////////////////////////////////// 59 | technique TriDither 60 | { 61 | pass 62 | { 63 | VertexShader = PostProcessVS; 64 | PixelShader = PS_TriDither; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shader Library/Recommended/UIDetect.fx: -------------------------------------------------------------------------------- 1 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | // ReShade effect file 3 | // UIDetect by brussell 4 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 | 6 | /* 7 | This shader can be used to toggle effects depending on the visibility 8 | of UI elements. Unlike UIMask, that uses a mask to decide which area of 9 | the screen should be effect-free, this one automatically turns off effects 10 | for the whole screen. It's useful for games, where one wants to use post- 11 | processing like DOF, CA or AO, which however shouldn't be active when 12 | certain UI elements are displayed (e.g. inventory, map, dialoque boxes, 13 | options menu etc.). Each UI is characterized by a number of user defined 14 | pixels, while the workflow to get their values could be like this: 15 | 16 | -take a screenshot without any effects when the UI is visible 17 | -open the screenshot in an image processing tool 18 | -look for a static and opaque area in the UI layer that is usually 19 | out of reach for user actions like the mouse cursor, tooltips etc. 20 | (usually somewhere in a corner of the screen) 21 | -use a color picker tool and choose two, three or more pixels, 22 | which are near to each other but differ greatly in color and brightness, 23 | and note the pixels coordinates and RGB values (thus choose pixels that 24 | do not likely occur in non-UI game situations, so that effects couldn't 25 | get toggled accidently when there is no UI visible) 26 | 27 | After that, write the pixel coordinates and RGB values to UIDetect.fxh 28 | (see further description there) 29 | 30 | Effect ordering: 31 | -UIDetect //must be first in pipeline (needs unaltered backbuffer) 32 | ... effects that affect UIs 33 | -UIDetect_Before //place before effects that shouldn't affect UI 34 | ... effects that should not affect UIs 35 | -UIDetect_After //place after effects that shouldn't affect UI 36 | ... effects that affect UIs 37 | 38 | Drawbacks: 39 | -does not work for transparent or nonstatic UIs obviously 40 | -pixels are only valid for one game resolution 41 | -pixel values can change with different hardware anti aliasing settings 42 | */ 43 | 44 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 45 | 46 | #include "ReShade.fxh" 47 | 48 | //textures and samplers 49 | texture texColor_Orig { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; }; 50 | sampler Color_Orig { Texture = texColor_Orig; }; 51 | 52 | texture texUIDetect { Width = 1; Height = 1; Format = R8; }; 53 | sampler UIDetect { Texture = texUIDetect; }; 54 | 55 | //pixel shaders 56 | float PS_UIDetect(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target { 57 | #include "UIDetect.fxh" 58 | 59 | float diff; 60 | float ui_detected = 0; 61 | float uilayer = 1; 62 | float nextuilayer = 0; 63 | 64 | for (int i=0; i < PIXELNUMBER; i++) 65 | { 66 | [branch] 67 | if (UIPixelCoord[i].z - uilayer == 0){ 68 | if (nextuilayer == 0){ 69 | diff = pow(dot(tex2Dlod(ReShade::BackBuffer, float4(UIPixelCoord[i].xy * ReShade::PixelSize.xy, 0, 0)).xyz - UIPixelRGB[i].xyz / 255.0, 0.333), 2); 70 | if (diff < 0.00001) { 71 | ui_detected = 1; 72 | }else{ 73 | ui_detected = 0; 74 | nextuilayer = 1; 75 | } 76 | } 77 | }else{ 78 | if (ui_detected == 1){ return ui_detected; } 79 | uilayer += 1; 80 | nextuilayer = 0; 81 | i -= 1; 82 | } 83 | } 84 | return ui_detected; 85 | } 86 | 87 | float4 PS_StoreColor(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target { 88 | return tex2D(ReShade::BackBuffer, texcoord); 89 | } 90 | 91 | float4 PS_RestoreColor(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target { 92 | float4 color = tex2D(UIDetect, float2(0,0)).x == 1.0 ? tex2D(Color_Orig, texcoord) : tex2D(ReShade::BackBuffer, texcoord); 93 | return color; 94 | } 95 | 96 | //techniques 97 | technique UIDetect { 98 | pass { 99 | VertexShader = PostProcessVS; 100 | PixelShader = PS_UIDetect; 101 | RenderTarget = texUIDetect; 102 | } 103 | } 104 | 105 | technique UIDetect_Before { 106 | pass { 107 | VertexShader = PostProcessVS; 108 | PixelShader = PS_StoreColor; 109 | RenderTarget = texColor_Orig; 110 | } 111 | } 112 | 113 | technique UIDetect_After { 114 | pass { 115 | VertexShader = PostProcessVS; 116 | PixelShader = PS_RestoreColor; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shaders/ReShade.fxh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if !defined(__RESHADE__) || __RESHADE__ < 30000 4 | #error "ReShade 3.0+ is required to use this header file" 5 | #endif 6 | 7 | #ifndef RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 8 | #define RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 0 9 | #endif 10 | #ifndef RESHADE_DEPTH_INPUT_IS_REVERSED 11 | #define RESHADE_DEPTH_INPUT_IS_REVERSED 1 12 | #endif 13 | #ifndef RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 14 | #define RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 0 15 | #endif 16 | #ifndef RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 17 | #define RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 1000.0 18 | #endif 19 | 20 | namespace ReShade 21 | { 22 | // Global variables 23 | #if defined(__RESHADE_FXC__) 24 | float GetAspectRatio() { return BUFFER_WIDTH * BUFFER_RCP_HEIGHT; } 25 | float2 GetPixelSize() { return float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT); } 26 | float2 GetScreenSize() { return float2(BUFFER_WIDTH, BUFFER_HEIGHT); } 27 | #define AspectRatio GetAspectRatio() 28 | #define PixelSize GetPixelSize() 29 | #define ScreenSize GetScreenSize() 30 | #else 31 | static const float AspectRatio = BUFFER_WIDTH * BUFFER_RCP_HEIGHT; 32 | static const float2 PixelSize = float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT); 33 | static const float2 ScreenSize = float2(BUFFER_WIDTH, BUFFER_HEIGHT); 34 | #endif 35 | 36 | // Global textures and samplers 37 | texture BackBufferTex : COLOR; 38 | texture DepthBufferTex : DEPTH; 39 | 40 | sampler BackBuffer { Texture = BackBufferTex; }; 41 | sampler DepthBuffer { Texture = DepthBufferTex; }; 42 | 43 | // Helper functions 44 | float GetLinearizedDepth(float2 texcoord) 45 | { 46 | #if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 47 | texcoord.y = 1.0 - texcoord.y; 48 | #endif 49 | float depth = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x; 50 | 51 | #if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 52 | const float C = 0.01; 53 | depth = (exp(depth * log(C + 1.0)) - 1.0) / C; 54 | #endif 55 | #if RESHADE_DEPTH_INPUT_IS_REVERSED 56 | depth = 1.0 - depth; 57 | #endif 58 | const float N = 1.0; 59 | depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N); 60 | 61 | return depth; 62 | } 63 | } 64 | 65 | // Vertex shader generating a triangle covering the entire screen 66 | void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD) 67 | { 68 | texcoord.x = (id == 2) ? 2.0 : 0.0; 69 | texcoord.y = (id == 1) ? 2.0 : 0.0; 70 | position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 71 | } 72 | -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shaders/UIDetect.fxh: -------------------------------------------------------------------------------- 1 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | //UIDetect header file 3 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 | 5 | /* 6 | Description: 7 | 8 | PIXELNUMBER //total number of pixels used for UI detection 9 | UIPixelCoord[PIXELNUMBER] //the UI pixels screen space coordinates (top left is 0,0) and UI number; 10 | { 11 | float3(x1,y1,UI1), 12 | float3(x2,y2,UI1), 13 | float3(x3,y3,UI1), 14 | float3(x4,y4,UI2), 15 | float3(x5,y5,UI3), 16 | ... 17 | } 18 | UIPixelRGB[PIXELNUMBER] //the UI pixels RGB values 19 | { 20 | float3(Red1,Green1,Blue1), 21 | float3(Red2,Green2,Blue2), 22 | ... 23 | } 24 | */ 25 | 26 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 27 | 28 | 29 | //Game: COD4:MW 30 | //Resolution: 1920x1080 31 | 32 | #define PIXELNUMBER 8 33 | 34 | static const float3 UIPixelCoord[PIXELNUMBER]= 35 | { 36 | float3(562,121,1), //TAB - Mission details 37 | float3(614,121,1), 38 | float3(1589,106,2), //ESC - Menu 39 | float3(1695,106,2), 40 | float3(272,40,3), //Options, Controls 41 | float3(272,33,3), 42 | float3(1238,174,4), //Main Menu 43 | float3(1273,174,4), 44 | }; 45 | 46 | static const float3 UIPixelRGB[PIXELNUMBER]= 47 | { 48 | float3(255,204,102), 49 | float3(255,204,102), 50 | float3(255,204,102), 51 | float3(255,204,102), 52 | float3(255,204,102), 53 | float3(255,204,102), 54 | float3(255,255,250), 55 | float3(255,255,249), 56 | }; -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Shaders/qUINT_common.fxh: -------------------------------------------------------------------------------- 1 | /* 2 | DO NOT EDIT 3 | DO NOT EDIT 4 | DO NOT EDIT 5 | 6 | I cannot stress this enough - if you don't want to break 7 | EVERY shader that depends on this file, do not edit. 8 | 9 | */ 10 | 11 | #pragma once 12 | 13 | #if !defined(__RESHADE__) || __RESHADE__ < 40000 14 | #error "ReShade 4.0+ is required to use this header file" 15 | #endif 16 | 17 | #ifndef RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 18 | #define RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 0 19 | #endif 20 | #ifndef RESHADE_DEPTH_INPUT_IS_REVERSED 21 | #define RESHADE_DEPTH_INPUT_IS_REVERSED 0 22 | #endif 23 | #ifndef RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 24 | #define RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 0 25 | #endif 26 | #ifndef RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 27 | #define RESHADE_DEPTH_LINEARIZATION_FAR_PLANE 1000.0 28 | #endif 29 | 30 | namespace qUINT 31 | { 32 | uniform float FRAME_TIME ; 33 | 34 | static const float2 ASPECT_RATIO = float2(1.0, BUFFER_WIDTH * BUFFER_RCP_HEIGHT); 35 | static const float2 PIXEL_SIZE = float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT); 36 | static const float2 SCREEN_SIZE = float2(BUFFER_WIDTH, BUFFER_HEIGHT); 37 | 38 | // Global textures and samplers 39 | texture BackBufferTex : COLOR; 40 | texture DepthBufferTex : DEPTH; 41 | 42 | sampler sBackBufferTex { Texture = BackBufferTex; }; 43 | sampler sDepthBufferTex { Texture = DepthBufferTex; }; 44 | 45 | //reusable textures for the shaders 46 | texture2D CommonTex0 { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 47 | texture2D CommonTex1 { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 48 | 49 | sampler2D sCommonTex0 { Texture = CommonTex0; }; 50 | sampler2D sCommonTex1 { Texture = CommonTex1; }; 51 | 52 | // Helper functions 53 | float linear_depth(float2 uv) 54 | { 55 | #if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN 56 | uv.y = 1.0 - uv.y; 57 | #endif 58 | float depth = tex2Dlod(sDepthBufferTex, float4(uv, 0, 0)).x; 59 | 60 | #if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC 61 | const float C = 0.01; 62 | depth = (exp(depth * log(C + 1.0)) - 1.0) / C; 63 | #endif 64 | #if RESHADE_DEPTH_INPUT_IS_REVERSED 65 | depth = 1.0 - depth; 66 | #endif 67 | const float N = 1.0; 68 | depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N); 69 | 70 | return depth; 71 | } 72 | } 73 | 74 | // Vertex shader generating a triangle covering the entire screen 75 | void PostProcessVS(in uint id : SV_VertexID, out float4 vpos : SV_Position, out float2 uv : TEXCOORD) 76 | { 77 | uv.x = (id == 2) ? 2.0 : 0.0; 78 | uv.y = (id == 1) ? 2.0 : 0.0; 79 | vpos = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 80 | } -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/AreaTex.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/AreaTex.dds -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/Dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/Dirt.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/DirtOVB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/DirtOVB.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/DirtOVR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/DirtOVR.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/FontAtlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/FontAtlas.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/Layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/Layer.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/LensDB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/LensDB.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/LensDB2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/LensDB2.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/LensDOV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/LensDOV.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/LensDUV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/LensDUV.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/LensSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/LensSprite.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/MagicBloom_Dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/MagicBloom_Dirt.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/MultiLut_atlas1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/MultiLut_atlas1.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/SearchTex.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/SearchTex.dds -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/Stage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/Stage.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/UIMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/UIMask.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/bayer16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/bayer16x16.png -------------------------------------------------------------------------------- /v4.X/reshade-shaders/Textures/lut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Otakumouse/stormshade/6dad6589fe505e998b01295dc6c647b031386e74/v4.X/reshade-shaders/Textures/lut.png --------------------------------------------------------------------------------