├── .github ├── CompanionAppInstall.gif ├── Depth3DAdjustDepth.gif ├── Depth3DAutoAdjust.gif ├── Depth3DDepthFlip.gif ├── Depth3DLogo.png ├── Depth3DMenu.png ├── Depth3DOffset.gif ├── Depth3DReverseDepth.gif ├── DepthOptions.png ├── FUNDING.yml ├── ReShadeAPITab.gif ├── ReShadeDownload.png ├── ReShadeInstall.gif ├── WrongSizedBuffer.png └── WrongSizedBufferFix.png ├── Other Shaders ├── 3DToElse.fx ├── Depth_Tool.fx ├── Dimension_Plus.fx ├── Polynomial_Barrel_Distortion_for_HMDs.fx ├── SuperDepth3D_WoWvx.fx └── VirtualNose.fx ├── README.md ├── Shaders ├── AXAA.fxh ├── Overwatch.fxh └── SuperDepth3D.fx ├── Textures └── dummy └── _config.yml /.github/CompanionAppInstall.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/CompanionAppInstall.gif -------------------------------------------------------------------------------- /.github/Depth3DAdjustDepth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/Depth3DAdjustDepth.gif -------------------------------------------------------------------------------- /.github/Depth3DAutoAdjust.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/Depth3DAutoAdjust.gif -------------------------------------------------------------------------------- /.github/Depth3DDepthFlip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/Depth3DDepthFlip.gif -------------------------------------------------------------------------------- /.github/Depth3DLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/Depth3DLogo.png -------------------------------------------------------------------------------- /.github/Depth3DMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/Depth3DMenu.png -------------------------------------------------------------------------------- /.github/Depth3DOffset.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/Depth3DOffset.gif -------------------------------------------------------------------------------- /.github/Depth3DReverseDepth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/Depth3DReverseDepth.gif -------------------------------------------------------------------------------- /.github/DepthOptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/DepthOptions.png -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ["https://www.buymeacoffee.com/BlueSkyDefender"] 13 | -------------------------------------------------------------------------------- /.github/ReShadeAPITab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/ReShadeAPITab.gif -------------------------------------------------------------------------------- /.github/ReShadeDownload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/ReShadeDownload.png -------------------------------------------------------------------------------- /.github/ReShadeInstall.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/ReShadeInstall.gif -------------------------------------------------------------------------------- /.github/WrongSizedBuffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/WrongSizedBuffer.png -------------------------------------------------------------------------------- /.github/WrongSizedBufferFix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/.github/WrongSizedBufferFix.png -------------------------------------------------------------------------------- /Other Shaders/3DToElse.fx: -------------------------------------------------------------------------------- 1 | ////------------// 2 | ///**3DToElse**/// 3 | //------------//// 4 | 5 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 6 | //* Stereo Input Converter 1.2 *// 7 | //* For Reshade 3.0 *// 8 | //* -------------------------- *// 9 | //* This work is licensed under a Creative Commons Attribution 3.0 Unported License. *// 10 | //* So you are free to share, modify and adapt it for your needs, and even use it for commercial use. *// 11 | //* I would also love to hear about a project you are using it with. *// 12 | //* https://creativecommons.org/licenses/by/3.0/us/ *// 13 | //* *// 14 | //* Have fun, *// 15 | //* Jose Negrete AKA BlueSkyDefender *// 16 | //* *// 17 | //* http://reshade.me/forum/shader-presentation/2128-sidebyside-3d-depth-map-based-stereoscopic-shader *// 18 | //* --------------------------------- *// 19 | //* *// 20 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 21 | 22 | uniform int SbS_Half_Full < 23 | ui_type = "combo"; 24 | ui_items = "Off\0Full in/Half out\0Half in/Full out\0"; 25 | ui_label = "Half / Full"; 26 | ui_tooltip = "Switch Aspect Ratio From Half/Full in to Full/Half out for Side by Side Video."; 27 | ui_category = "Stereoscopic Conversion"; 28 | > = 0; 29 | 30 | uniform int Stereoscopic_Mode_Input < 31 | ui_type = "combo"; 32 | ui_items = "Off\0Side by Side\0Top and Bottom\0Line Interlaced\0Checkerboard 3D\0Frame Sequential\0"; 33 | ui_label = "Stereoscopic Mode Input"; 34 | ui_tooltip = "Change to the proper stereoscopic input."; 35 | ui_category = "Stereoscopic Conversion"; 36 | > = 0; 37 | 38 | uniform int Stereoscopic_Mode < 39 | ui_type = "combo"; 40 | ui_items = "Side by Side\0Top and Bottom\0Line Interlaced\0Column Interlaced\0Checkerboard 3D\0Anaglyph\0"; 41 | ui_label = "3D Display Mode"; 42 | ui_tooltip = "Stereoscopic 3D display output selection."; 43 | ui_category = "Stereoscopic Conversion"; 44 | > = 0; 45 | 46 | uniform int Anaglyph_Colors < 47 | ui_type = "combo"; 48 | ui_items = "Anaglyph 3D Red/Cyan\0Anaglyph 3D Red/Cyan Dubois\0Anaglyph 3D Red/Cyan Anachrome\0Anaglyph 3D Green/Magenta\0Anaglyph 3D Green/Magenta Dubois\0Anaglyph 3D Green/Magenta Triochrome\0Anaglyph 3D Blue/Amber ColorCode\0"; 49 | ui_label = "Anaglyph Color Mode"; 50 | ui_tooltip = "Select colors for your 3D anaglyph glasses."; 51 | ui_category = "Stereoscopic Conversion"; 52 | > = 0; 53 | 54 | uniform int Perspective < 55 | ui_type = "drag"; 56 | ui_min = -100; ui_max = 100; 57 | ui_label = "Perspective Slider"; 58 | ui_tooltip = "Determines the perspective point."; 59 | ui_category = "Stereoscopic Options"; 60 | > = 0; 61 | 62 | uniform int Scaling_Support < 63 | ui_type = "combo"; 64 | ui_items = " 2160p\0 Native\0 1080p A\0 1080p B\0 1050p A\0 1050p B\0 720p A\0 720p B\0"; 65 | ui_label = "Scaling Support"; 66 | ui_tooltip = "Dynamic Super Resolution , Virtual Super Resolution, downscaling, or Upscaling support for Line Interlaced, Column Interlaced, & Checkerboard 3D displays."; 67 | ui_category = "Stereoscopic Options"; 68 | > = 1; 69 | 70 | uniform float2 Interlace_Anaglyph < 71 | ui_type = "drag"; 72 | ui_min = 0.0; ui_max = 1.0; 73 | ui_label = " Interlace & Anaglyph"; 74 | ui_tooltip = "Interlace Optimization is used to reduce aliasing in a Line or Column interlaced image. This has the side effect of softening the image.\n" 75 | "Anaglyph Desaturation allows for removing color from an anaglyph 3D image. Zero is Black & White, One is full color.\n" 76 | "Default for Interlace Optimization is 0.5 and for Anaglyph Desaturation is One."; 77 | ui_category = "Stereoscopic Options"; 78 | > = float2(0.5,1.0); 79 | 80 | uniform bool Eye_Swap < 81 | ui_label = "Eye Swap"; 82 | ui_tooltip = "Left right image change."; 83 | ui_category = "Stereoscopic Options"; 84 | > = true; 85 | 86 | /////////////////////////////////////////////D3D Starts Here///////////////////////////////////////////////////////////////// 87 | #define pix float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT) 88 | #define TextureSize float2(BUFFER_WIDTH, BUFFER_HEIGHT) 89 | uniform float frametime < source = "frametime";>; 90 | uniform float timer < source = "timer"; >; 91 | 92 | texture BackBufferTex : COLOR; 93 | 94 | sampler BackBuffer 95 | { 96 | Texture = BackBufferTex; 97 | MagFilter = POINT; 98 | MinFilter = POINT; 99 | MipFilter = POINT; 100 | }; 101 | 102 | texture texCL { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;}; 103 | texture texCR { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;}; 104 | 105 | sampler SamplerCL 106 | { 107 | Texture = texCL; 108 | AddressU = BORDER; 109 | AddressV = BORDER; 110 | AddressW = BORDER; 111 | }; 112 | 113 | sampler SamplerCR 114 | { 115 | Texture = texCR; 116 | AddressU = BORDER; 117 | AddressV = BORDER; 118 | AddressW = BORDER; 119 | }; 120 | 121 | texture Current_BackBuffer_Tex { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 122 | 123 | sampler CBackBuffer 124 | { 125 | Texture = Current_BackBuffer_Tex; 126 | MagFilter = POINT; 127 | MinFilter = POINT; 128 | MipFilter = POINT; 129 | }; 130 | 131 | texture PastSingleBackBuffer { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;}; 132 | sampler PSBackBuffer 133 | { 134 | Texture = PastSingleBackBuffer; 135 | MagFilter = POINT; 136 | MinFilter = POINT; 137 | MipFilter = POINT; 138 | }; 139 | 140 | ////////////////////////////////////////////////Left/Right Eye//////////////////////////////////////////////////////// 141 | uniform uint framecount < source = "framecount"; >; 142 | //Total amount of frames since the game started. 143 | 144 | float fmod(float a, float b) 145 | { 146 | float c = frac(abs(a / b)) * abs(b); 147 | return a < 0 ? -c : c; 148 | } 149 | 150 | //Stereo Texture grabber 151 | float4 BB_Texture(float2 TC) 152 | { 153 | if(Stereoscopic_Mode_Input == 1) 154 | TC.y = (SbS_Half_Full == 1) ? TC.y * 0.5 + 0.25 : TC.y; 155 | TC.y = (SbS_Half_Full == 2) ? TC.y * 2.0 - 0.5 : TC.y; 156 | if (TC.y < 0.0 || TC.y > 1.0) 157 | return float4(0,0,0,0); 158 | 159 | float4 Color = tex2Dlod(BackBuffer, float4(TC,0,0) ), Exp_Darks, Exp_Brights; 160 | 161 | float3 AdaptColor = tex2Dlod(BackBuffer, float4(TC,0,0) ).rgb; 162 | 163 | return float4(Color.rgb,max(AdaptColor.r, max(AdaptColor.g, AdaptColor.b))); 164 | } 165 | 166 | //Unilinear Left / Right 167 | float4 U_LR(in float2 texcoord,in int Switcher) 168 | { 169 | float gridy = floor(texcoord.y*TextureSize.y); //Native 170 | if(Switcher == 1) 171 | return fmod(gridy,2) ? 0 : tex2Dlod(CBackBuffer, float4(texcoord,0,0) ) ; 172 | else 173 | return fmod(gridy,2) ? tex2Dlod(CBackBuffer, float4(texcoord,0,0) ) : 0 ; 174 | } 175 | 176 | float4 Uni_LR(in float2 texcoord,in int Switcher ) 177 | { 178 | float4 tl = U_LR(texcoord, Switcher), 179 | tr = U_LR(texcoord + float2(0.0,-pix.y), Switcher), 180 | bl = U_LR(texcoord + float2(0.0, pix.y), Switcher); 181 | float2 f = frac( texcoord * TextureSize ); 182 | float4 tA = lerp( tl, tr, f.x ); 183 | float4 tB = lerp( tl, bl, f.x ); 184 | float4 done = lerp( tA, tB, f.y ) * 2.0;//2.0 Gamma correction. 185 | return done; 186 | } 187 | 188 | //Bilinear Left 189 | float4 B_LR(in float2 texcoord,in int Switcher) 190 | { 191 | float gridy = floor(texcoord.y*(BUFFER_HEIGHT)); //Native 192 | float gridx = floor(texcoord.x*(BUFFER_WIDTH)); //Native 193 | if(Switcher == 1) 194 | return fmod(gridy+gridx,2) ? 0 : tex2Dlod(CBackBuffer, float4(texcoord,0,0) ) ; 195 | else 196 | return fmod(gridy+gridx,2) ? tex2Dlod(CBackBuffer, float4(texcoord,0,0) ) : 0 ; 197 | } 198 | 199 | float4 Bi_LR(in float2 texcoord,in int Switcher ) 200 | { 201 | float4 tl = B_LR(texcoord, Switcher); 202 | float4 tr = B_LR(texcoord + float2( pix.x, 0.0 ), Switcher); 203 | float4 bl = B_LR(texcoord + float2( 0.0 , pix.y), Switcher); 204 | float4 br = B_LR(texcoord + float2( pix.x, pix.y), Switcher); 205 | float2 f = frac( texcoord * TextureSize ); 206 | float4 tA = lerp( tl, tr, f.x ); 207 | float4 tB = lerp( bl, br, f.x ); 208 | float4 done = lerp( tA, tB, f.y ) * 2.0;//2.0 Gamma correction. 209 | return done; 210 | } 211 | 212 | void PS_InputLR(in float4 position : SV_Position, in float2 texcoord : TEXCOORD0, out float4 colorA : SV_Target0 , out float4 colorB: SV_Target1) 213 | { 214 | float4 Left, Right; 215 | float P = Perspective * pix.x; 216 | 217 | if(Stereoscopic_Mode_Input == 1) //SbS 218 | { 219 | Left = BB_Texture(float2((texcoord.x*0.5) + P,texcoord.y)); 220 | Right = BB_Texture(float2((texcoord.x*0.5+0.5)- P,texcoord.y)); 221 | } 222 | else if(Stereoscopic_Mode_Input == 2) //TnB 223 | { 224 | Left = BB_Texture(float2(texcoord.x + P,texcoord.y*0.5)); 225 | Right = BB_Texture(float2(texcoord.x - P,texcoord.y*0.5+0.5)); 226 | } 227 | else if(Stereoscopic_Mode_Input == 3) //Line_Interlaced Unilateral. 228 | { 229 | Left = Uni_LR(float2(texcoord.x + P,texcoord.y), 0); 230 | Right = Uni_LR(float2(texcoord.x - P,texcoord.y), 1); 231 | } 232 | else if(Stereoscopic_Mode_Input == 4) //CB_3D Bilateral Reconstruction. 233 | { 234 | Left = Bi_LR(float2(texcoord.x + P,texcoord.y), 0); 235 | Right = Bi_LR(float2(texcoord.x - P,texcoord.y), 1); 236 | } 237 | if(Stereoscopic_Mode_Input == 5) //Frame Sequential Conversion. 238 | { 239 | float OddEven = framecount % 2 == 0; 240 | //Past Single Frame 241 | Left = tex2D(PSBackBuffer,float2(texcoord.x + P,texcoord.y)); 242 | Right = tex2D(PSBackBuffer,float2(texcoord.x - P,texcoord.y)); 243 | //Current Single Frame 244 | if (OddEven) 245 | Left = BB_Texture(float2(texcoord.x+P,texcoord.y)); 246 | else 247 | Right = BB_Texture(float2(texcoord.x-P,texcoord.y)); 248 | } 249 | 250 | 251 | colorA = Left; 252 | colorB = Right; 253 | } 254 | 255 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 256 | float4 toElse(float2 texcoord) 257 | { 258 | float4 image = 1, cL, cR, L, R, Out, accum; 259 | float2 TCL, TCR, StoreTC = texcoord; 260 | float P = 0;//Perspective * pix.x; 261 | 262 | if (Stereoscopic_Mode == 0) 263 | { 264 | TCR.x = (texcoord.x*2-1) - P; 265 | TCL.x = (texcoord.x*2) + P; 266 | TCR.y = texcoord.y; 267 | TCL.y = texcoord.y; 268 | } 269 | else if(Stereoscopic_Mode == 1) 270 | { 271 | TCR.x = texcoord.x - P; 272 | TCL.x = texcoord.x + P; 273 | TCR.y = (texcoord.y*2-1); 274 | TCL.y = (texcoord.y*2); 275 | } 276 | else 277 | { 278 | TCR.x = texcoord.x - P; 279 | TCL.x = texcoord.x + P; 280 | TCR.y = texcoord.y; 281 | TCL.y = texcoord.y; 282 | } 283 | 284 | //Optimization for line & column interlaced out. 285 | if (Stereoscopic_Mode == 2) 286 | { 287 | TCL.y = TCL.y + (Interlace_Anaglyph.x * pix.y); 288 | TCR.y = TCR.y - (Interlace_Anaglyph.x * pix.y); 289 | } 290 | else if (Stereoscopic_Mode == 3) 291 | { 292 | TCL.x = TCL.x + (Interlace_Anaglyph.x * pix.x); 293 | TCR.x = TCR.x - (Interlace_Anaglyph.x * pix.x); 294 | } 295 | 296 | if(Eye_Swap) 297 | { 298 | cL = tex2D(SamplerCL,float2(TCL.x,TCL.y)); 299 | cR = tex2D(SamplerCR,float2(TCR.x,TCR.y)); 300 | } 301 | else 302 | { 303 | cL = tex2D(SamplerCR,float2(TCL.x,TCL.y)); 304 | cR = tex2D(SamplerCL,float2(TCR.x,TCR.y)); 305 | } 306 | 307 | float2 gridxy; 308 | 309 | if(Scaling_Support == 0) 310 | gridxy = floor(float2(texcoord.x*3840.0,texcoord.y*2160.0)); 311 | else if(Scaling_Support == 1) 312 | gridxy = floor(float2(texcoord.x*BUFFER_WIDTH,texcoord.y*BUFFER_HEIGHT)); 313 | else if(Scaling_Support == 2) 314 | gridxy = floor(float2((texcoord.x*1920.0)*0.5,(texcoord.y*1080.0)*0.5)); 315 | else if(Scaling_Support == 3) 316 | gridxy = floor(float2((texcoord.x*1921.0)*0.5,(texcoord.y*1081.0)*0.5)); 317 | else if(Scaling_Support == 4) 318 | gridxy = floor(float2((texcoord.x*1680.0)*0.5,(texcoord.y*1050.0)*0.5)); 319 | else if(Scaling_Support == 5) 320 | gridxy = floor(float2((texcoord.x*1681.0)*0.5,(texcoord.y*1051.0)*0.5)); 321 | else if(Scaling_Support == 6) 322 | gridxy = floor(float2((texcoord.x*1280.0)*0.5,(texcoord.y*720.0)*0.5)); 323 | else if(Scaling_Support == 7) 324 | gridxy = floor(float2((texcoord.x*1281.0)*0.5,(texcoord.y*721.0)*0.5)); 325 | 326 | 327 | if(Stereoscopic_Mode == 0) 328 | Out = texcoord.x < 0.5 ? cL : cR; 329 | else if(Stereoscopic_Mode == 1) 330 | Out = texcoord.y < 0.5 ? cL : cR; 331 | else if(Stereoscopic_Mode == 2) 332 | Out = fmod(gridxy.y,2.0) ? cR : cL; 333 | else if(Stereoscopic_Mode == 3) 334 | Out = fmod(gridxy.x,2.0) ? cR : cL; 335 | else if(Stereoscopic_Mode == 4) 336 | Out = fmod(gridxy.x+gridxy.y,2.0) ? cR : cL; 337 | else if(Stereoscopic_Mode == 5) 338 | { 339 | float Contrast = 1.0, DeGhost = 0.06, LOne, ROne; 340 | float3 HalfLA = dot(cL.rgb,float3(0.299, 0.587, 0.114)); 341 | float3 HalfRA = dot(cR.rgb,float3(0.299, 0.587, 0.114)); 342 | float3 LMA = lerp(HalfLA,cL.rgb,Interlace_Anaglyph.y); 343 | float3 RMA = lerp(HalfRA,cR.rgb,Interlace_Anaglyph.y); 344 | float contrast = (Contrast*0.5)+0.5; 345 | 346 | // Left/Right Image 347 | float4 cA = float4(LMA,1); 348 | float4 cB = float4(RMA,1); 349 | 350 | if (Anaglyph_Colors == 0) // Anaglyph 3D Colors Red/Cyan 351 | Out = float4(cA.r,cB.g,cB.b,1.0); 352 | else if (Anaglyph_Colors == 1) // Anaglyph 3D Dubois Red/Cyan 353 | { 354 | float red = 0.437 * cA.r + 0.449 * cA.g + 0.164 * cA.b - 0.011 * cB.r - 0.032 * cB.g - 0.007 * cB.b; 355 | 356 | if (red > 1) { red = 1; } if (red < 0) { red = 0; } 357 | 358 | float green = -0.062 * cA.r -0.062 * cA.g -0.024 * cA.b + 0.377 * cB.r + 0.761 * cB.g + 0.009 * cB.b; 359 | 360 | if (green > 1) { green = 1; } if (green < 0) { green = 0; } 361 | 362 | float blue = -0.048 * cA.r - 0.050 * cA.g - 0.017 * cA.b -0.026 * cB.r -0.093 * cB.g + 1.234 * cB.b; 363 | 364 | if (blue > 1) { blue = 1; } if (blue < 0) { blue = 0; } 365 | 366 | Out = float4(red, green, blue, 0); 367 | } 368 | else if (Anaglyph_Colors == 2) // Anaglyph 3D Deghosted Red/Cyan Code From http://iaian7.com/quartz/AnaglyphCompositing & vectorform.com by John Einselen 369 | { 370 | LOne = contrast*0.45; 371 | ROne = contrast; 372 | DeGhost *= 0.1; 373 | 374 | accum = saturate(cA*float4(LOne,(1.0-LOne)*0.5,(1.0-LOne)*0.5,1.0)); 375 | image.r = pow(accum.r+accum.g+accum.b, 1.00); 376 | image.a = accum.a; 377 | 378 | accum = saturate(cB*float4(1.0-ROne,ROne,0.0,1.0)); 379 | image.g = pow(accum.r+accum.g+accum.b, 1.15); 380 | image.a = image.a+accum.a; 381 | 382 | accum = saturate(cB*float4(1.0-ROne,0.0,ROne,1.0)); 383 | image.b = pow(accum.r+accum.g+accum.b, 1.15); 384 | image.a = (image.a+accum.a)/3.0; 385 | 386 | accum = image; 387 | image.r = (accum.r+(accum.r*DeGhost)+(accum.g*(DeGhost*-0.5))+(accum.b*(DeGhost*-0.5))); 388 | image.g = (accum.g+(accum.r*(DeGhost*-0.25))+(accum.g*(DeGhost*0.5))+(accum.b*(DeGhost*-0.25))); 389 | image.b = (accum.b+(accum.r*(DeGhost*-0.25))+(accum.g*(DeGhost*-0.25))+(accum.b*(DeGhost*0.5))); 390 | Out = image; 391 | } 392 | else if (Anaglyph_Colors == 3) // Anaglyph 3D Green/Magenta 393 | Out = float4(cB.r,cA.g,cB.b,1.0); 394 | else if (Anaglyph_Colors == 4) // Anaglyph 3D Dubois Green/Magenta 395 | { 396 | 397 | float red = -0.062 * cA.r -0.158 * cA.g -0.039 * cA.b + 0.529 * cB.r + 0.705 * cB.g + 0.024 * cB.b; 398 | 399 | if (red > 1) { red = 1; } if (red < 0) { red = 0; } 400 | 401 | float green = 0.284 * cA.r + 0.668 * cA.g + 0.143 * cA.b - 0.016 * cB.r - 0.015 * cB.g + 0.065 * cB.b; 402 | 403 | if (green > 1) { green = 1; } if (green < 0) { green = 0; } 404 | 405 | float blue = -0.015 * cA.r -0.027 * cA.g + 0.021 * cA.b + 0.009 * cB.r + 0.075 * cB.g + 0.937 * cB.b; 406 | 407 | if (blue > 1) { blue = 1; } if (blue < 0) { blue = 0; } 408 | 409 | Out = float4(red, green, blue, 0); 410 | } 411 | else if (Anaglyph_Colors == 5)// Anaglyph 3D Deghosted Green/Magenta Code From http://iaian7.com/quartz/AnaglyphCompositing & vectorform.com by John Einselen 412 | { 413 | LOne = contrast*0.45; 414 | ROne = contrast*0.8; 415 | DeGhost *= 0.275; 416 | 417 | accum = saturate(cB*float4(ROne,1.0-ROne,0.0,1.0)); 418 | image.r = pow(accum.r+accum.g+accum.b, 1.15); 419 | image.a = accum.a; 420 | 421 | accum = saturate(cA*float4((1.0-LOne)*0.5,LOne,(1.0-LOne)*0.5,1.0)); 422 | image.g = pow(accum.r+accum.g+accum.b, 1.05); 423 | image.a = image.a+accum.a; 424 | 425 | accum = saturate(cB*float4(0.0,1.0-ROne,ROne,1.0)); 426 | image.b = pow(accum.r+accum.g+accum.b, 1.15); 427 | image.a = (image.a+accum.a)*0.33333333; 428 | 429 | accum = image; 430 | image.r = accum.r+(accum.r*(DeGhost*0.5))+(accum.g*(DeGhost*-0.25))+(accum.b*(DeGhost*-0.25)); 431 | image.g = accum.g+(accum.r*(DeGhost*-0.5))+(accum.g*(DeGhost*0.25))+(accum.b*(DeGhost*-0.5)); 432 | image.b = accum.b+(accum.r*(DeGhost*-0.25))+(accum.g*(DeGhost*-0.25))+(accum.b*(DeGhost*0.5)); 433 | Out = image; 434 | } 435 | else if (Anaglyph_Colors == 6) // Anaglyph 3D Blue/Amber Code From http://iaian7.com/quartz/AnaglyphCompositing & vectorform.com by John Einselen 436 | { 437 | LOne = contrast*0.45; 438 | ROne = contrast; 439 | float D[1];//The Chronicles of Riddick: Assault on Dark Athena FIX I don't know why it works....... 440 | DeGhost *= 0.275; 441 | 442 | accum = saturate(cA*float4(ROne,0.0,1.0-ROne,1.0)); 443 | image.r = pow(accum.r+accum.g+accum.b, 1.05); 444 | image.a = accum.a; 445 | 446 | accum = saturate(cA*float4(0.0,ROne,1.0-ROne,1.0)); 447 | image.g = pow(accum.r+accum.g+accum.b, 1.10); 448 | image.a = image.a+accum.a; 449 | 450 | accum = saturate(cB*float4((1.0-LOne)*0.5,(1.0-LOne)*0.5,LOne,1.0)); 451 | image.b = pow(accum.r+accum.g+accum.b, 1.0); 452 | image.b = lerp(pow(image.b,(DeGhost*0.15)+1.0),1.0-pow(abs(1.0-image.b),(DeGhost*0.15)+1.0),image.b); 453 | image.a = (image.a+accum.a)*0.33333333; 454 | 455 | accum = image; 456 | image.r = accum.r+(accum.r*(DeGhost*1.5))+(accum.g*(DeGhost*-0.75))+(accum.b*(DeGhost*-0.75)); 457 | image.g = accum.g+(accum.r*(DeGhost*-0.75))+(accum.g*(DeGhost*1.5))+(accum.b*(DeGhost*-0.75)); 458 | image.b = accum.b+(accum.r*(DeGhost*-1.5))+(accum.g*(DeGhost*-1.5))+(accum.b*(DeGhost*3.0)); 459 | Out = saturate(image); 460 | } 461 | } 462 | 463 | return Out; 464 | } 465 | 466 | void Current_BackBuffer(float4 position : SV_Position, float2 texcoord : TEXCOORD, out float4 color : SV_Target) 467 | { 468 | color = BB_Texture(texcoord); 469 | } 470 | 471 | void Past_BackBuffer(float4 position : SV_Position, float2 texcoord : TEXCOORD, out float4 PastSingle : SV_Target0) 472 | { 473 | PastSingle = tex2D(CBackBuffer,texcoord); 474 | } 475 | ////////////////////////////////////////////////////////Fin///////////////////////////////////////////////////////////////////////// 476 | float4 Out(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 477 | { 478 | float3 Color = Stereoscopic_Mode_Input == 0 ? BB_Texture(texcoord).rgb : toElse(texcoord).rgb; 479 | return float4(Color,1.); 480 | } 481 | 482 | ///////////////////////////////////////////////////////////ReShade.fxh///////////////////////////////////////////////////////////// 483 | // Vertex shader generating a triangle covering the entire screen 484 | void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD) 485 | { 486 | texcoord.x = (id == 2) ? 2.0 : 0.0; 487 | texcoord.y = (id == 1) ? 2.0 : 0.0; 488 | position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 489 | } 490 | 491 | //*Rendering passes*// 492 | technique To_Else 493 | { 494 | pass PBB 495 | { 496 | VertexShader = PostProcessVS; 497 | PixelShader = Past_BackBuffer; 498 | RenderTarget = PastSingleBackBuffer; 499 | } 500 | pass CBB 501 | { 502 | VertexShader = PostProcessVS; 503 | PixelShader = Current_BackBuffer; 504 | RenderTarget = Current_BackBuffer_Tex; 505 | } 506 | pass StereoInput 507 | { 508 | VertexShader = PostProcessVS; 509 | PixelShader = PS_InputLR; 510 | RenderTarget0 = texCL; 511 | RenderTarget1 = texCR; 512 | } 513 | pass StereoToElse 514 | { 515 | VertexShader = PostProcessVS; 516 | PixelShader = Out; 517 | } 518 | } 519 | -------------------------------------------------------------------------------- /Other Shaders/Depth_Tool.fx: -------------------------------------------------------------------------------- 1 | ////--------------// 2 | ///**Depth Tool**/// 3 | //--------------//// 4 | 5 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 6 | //* Depth Map Shader *// 7 | //* For Reshade 3.0 *// 8 | //* -------------------------- *// 9 | //* This work is licensed under a Creative Commons Attribution 3.0 Unported License. *// 10 | //* So you are free to share, modify and adapt it for your needs, and even use it for commercial use. *// 11 | //* I would also love to hear about a project you are using it with. *// 12 | //* https://creativecommons.org/licenses/by/3.0/us/ *// 13 | //* *// 14 | //* Have fun, *// 15 | //* Jose Negrete AKA BlueSkyDefender *// 16 | //* *// 17 | //* http://reshade.me/forum/shader-presentation/2128-sidebyside-3d-depth-map-based-stereoscopic-shader *// 18 | //* --------------------------------- *// *// 19 | //* *// 20 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 21 | 22 | //Packed Depth Code from this link. 23 | //https://stackoverflow.com/questions/48288154/pack-depth-information-in-a-rgba-texture-using-mediump-precison 24 | // Use this to unpack depth from XYZ to X 25 | /* 26 | float UnpackDepth24( in float3 pack ) 27 | { 28 | float depth = dot( pack, 1.0 / float3(1.0, 256.0, 256.0*256.0) ); 29 | return depth * (256.0*256.0*256.0) / (256.0*256.0*256.0 - 1.0); 30 | } 31 | */ 32 | 33 | uniform bool Dither < 34 | ui_label = "Enable Dither"; 35 | ui_tooltip = "Lets turn Dither on or off."; 36 | > = false; 37 | 38 | uniform float Dither_Bit < 39 | ui_type = "drag"; 40 | ui_min = 1; ui_max = 15; 41 | ui_label = "Dither Bit"; 42 | ui_tooltip = "Dither is an intentionally applied form of noise used to randomize quantization error, preventing banding in images."; 43 | > = 6; 44 | 45 | uniform int Depth_Map < 46 | ui_type = "combo"; 47 | ui_items = "Normal\0Reversed\0"; 48 | ui_label = "Custom Depth Map"; 49 | ui_tooltip = "Pick your Depth Map."; 50 | > = 0; 51 | 52 | uniform float Depth_Map_Adjust < 53 | ui_type = "drag"; 54 | ui_min = 0.25; ui_max = 250.0; 55 | ui_label = "Depth Map Adjustment"; 56 | ui_tooltip = "Adjust the depth map and sharpness."; 57 | > = 5.0; 58 | 59 | uniform float Offset < 60 | ui_type = "drag"; 61 | ui_min = 0; ui_max = 1.0; 62 | ui_label = "Offset"; 63 | ui_tooltip = "Offset is for the Special Depth Map Only"; 64 | > = 0.0; 65 | 66 | uniform bool PackDepth < 67 | ui_label = "PackDepth 24"; 68 | ui_tooltip = "Use this toggle to pack depth in to RGB So it can be unpacked later."; 69 | > = false; 70 | 71 | uniform bool Depth_Map_Flip < 72 | ui_label = "Depth Map Flip"; 73 | ui_tooltip = "Flip the depth map if it is upside down."; 74 | > = false; 75 | 76 | uniform bool LP < 77 | ui_label = "Linear or Point"; 78 | ui_tooltip = "You try coming up with names on the fly."; 79 | > = false; 80 | 81 | uniform int Plus_Depth < 82 | ui_type = "combo"; 83 | ui_items = " Color\0 2D + Depth Side by Side\0 2D + Depth Side by Side AR\0 2D + Depth Top n Bottom\0 Stored Color\0 Stored Depth\0"; 84 | ui_label = "2D + Depth Selection"; 85 | ui_tooltip = "Pick your Output."; 86 | > = 0; 87 | 88 | uniform bool SCD < 89 | ui_label = "Store Color & Depth"; 90 | ui_tooltip = "Use this to store Color and Depth."; 91 | > = false; 92 | 93 | /////////////////////////////////////////////D3D Starts Here///////////////////////////////////////////////////////////////// 94 | 95 | texture BackBufferTex : COLOR; 96 | 97 | sampler BackBufferL 98 | { 99 | Texture = BackBufferTex; 100 | }; 101 | 102 | sampler BackBufferP 103 | { 104 | Texture = BackBufferTex; 105 | MagFilter = LINEAR; 106 | MinFilter = LINEAR; 107 | MipFilter = LINEAR; 108 | }; 109 | 110 | 111 | texture DepthBufferTex : DEPTH; 112 | 113 | sampler DepthBufferL 114 | { 115 | Texture = DepthBufferTex; 116 | }; 117 | 118 | sampler DepthBufferP 119 | { 120 | Texture = DepthBufferTex; 121 | MagFilter = LINEAR; 122 | MinFilter = LINEAR; 123 | MipFilter = LINEAR; 124 | }; 125 | 126 | texture SPC { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;}; 127 | 128 | sampler SPColor 129 | { 130 | Texture = SPC; 131 | }; 132 | texture SPD { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA32F;}; 133 | 134 | sampler SPDepth 135 | { 136 | Texture = SPD; 137 | }; 138 | 139 | texture SC { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;}; 140 | 141 | sampler SColor 142 | { 143 | Texture = SC; 144 | }; 145 | 146 | texture SD { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA32F;}; 147 | 148 | sampler SDepth 149 | { 150 | Texture = SD; 151 | }; 152 | 153 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 154 | #define pix float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT) 155 | 156 | float3 PackDepth24( in float depth ) 157 | { 158 | float depthVal = depth * (256.0*256.0*256.0 - 1.0) / (256.0*256.0*256.0); 159 | float4 encode = frac( depthVal * float4(1.0, 256.0, 256.0*256.0, 256.0*256.0*256.0) ); 160 | return encode.xyz - encode.yzw / 256.0 + 1.0/512.0; 161 | } 162 | 163 | uniform float frametime < source = "frametime"; >; 164 | float zBuffer(in float2 texcoord : TEXCOORD0) 165 | { 166 | if (Depth_Map_Flip) 167 | texcoord.y = 1 - texcoord.y; 168 | 169 | float DM, zBuffer = tex2D(DepthBufferL, texcoord).x; //Depth Buffer 170 | 171 | if(LP) 172 | zBuffer = tex2D(DepthBufferP, texcoord).x; 173 | 174 | //Conversions to linear space..... 175 | //Near & Far Adjustment 176 | float Far = 1.0, Near = 0.125/Depth_Map_Adjust; //Division Depth Map Adjust - Near 177 | 178 | float2 Offsets = float2(1 + Offset,1 - Offset), Z = float2( zBuffer, 1-zBuffer ); 179 | 180 | if (Offset > 0) 181 | Z = min( 1, float2( Z.x*Offsets.x , ( Z.y - 0.0 ) / ( Offsets.y - 0.0 ) ) ); 182 | 183 | if (Depth_Map == 0)//DM0. Normal 184 | { 185 | DM = 2.0 * Near * Far / (Far + Near - (2.0 * Z.x - 1.0) * (Far - Near)); 186 | } 187 | else if (Depth_Map == 1)//DM1. Reverse 188 | { 189 | DM = 2.0 * Near * Far / (Far + Near - (1.375 * Z.y - 0.375) * (Far - Near)); 190 | } 191 | 192 | // Dither for DepthBuffer adapted from gedosato ramdom dither https://github.com/PeterTh/gedosato/blob/master/pack/assets/dx9/deband.fx 193 | // I noticed in some games the depth buffer started to have banding so this is used to remove that. 194 | 195 | float DB = Dither_Bit; 196 | float noise = frac(sin(dot(texcoord * frametime, float2(12.9898, 78.233))) * 43758.5453); 197 | float dither_shift = (1.0 / (pow(2,DB) - 1.0)); 198 | float dither_shift_half = (dither_shift * 0.5); 199 | dither_shift = dither_shift * noise - dither_shift_half; 200 | 201 | if(Dither) 202 | { 203 | DM += -dither_shift; 204 | DM += dither_shift; 205 | DM += -dither_shift; 206 | } 207 | // Dither End 208 | 209 | return saturate(DM); 210 | } 211 | 212 | void S_CD(float4 position : SV_Position, float2 texcoord : TEXCOORD, out float4 C : SV_Target0, out float4 D : SV_Target1) 213 | { 214 | C = tex2D(BackBufferL, texcoord); 215 | D = float4(PackDepth24( zBuffer(texcoord).x ),1.0); 216 | float4 PC = tex2Dlod(SPColor, float4(texcoord,0,0)); 217 | float4 PD = tex2Dlod(SPDepth, float4(texcoord,0,0)); 218 | float S = SCD; 219 | //Didn't even needed to do it this way. But, I was lazy. :D 220 | C = lerp(C , PC, S); 221 | D = lerp(D , PD, S); 222 | } 223 | 224 | float4 Out(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 225 | { float2 StoreTC = texcoord,TCL,TCR; 226 | float4 color; 227 | 228 | float2 Z_A = float2(1.0,0.5); 229 | if(Plus_Depth == 2) 230 | { 231 | Z_A = float2(1.0,1.0); 232 | } 233 | //Texture Zoom & Aspect Ratio// 234 | float X = Z_A.x; 235 | float Y = Z_A.y * Z_A.x * 2; 236 | float midW = (X - 1)*(BUFFER_WIDTH*0.5)*pix.x; 237 | float midH = (Y - 1)*(BUFFER_HEIGHT*0.5)*pix.y; 238 | 239 | texcoord = float2((texcoord.x*X)-midW,(texcoord.y*Y)-midH); 240 | 241 | 242 | if (Plus_Depth == 1 || Plus_Depth == 2) 243 | { 244 | TCL = float2(texcoord.x*2,texcoord.y); 245 | TCR = float2(texcoord.x*2-1,texcoord.y); 246 | } 247 | else if(Plus_Depth == 3) 248 | { 249 | TCL = float2(texcoord.x,texcoord.y*2); 250 | TCR = float2(texcoord.x,texcoord.y*2-1); 251 | } 252 | 253 | float4 Co = tex2D(BackBufferL,TCL); 254 | 255 | if(LP) 256 | Co = tex2D(BackBufferP,TCL); 257 | 258 | 259 | if(texcoord.y > 0 && texcoord.y < 1) 260 | { 261 | if(Plus_Depth == 1 || Plus_Depth == 2) 262 | color = texcoord.x < 0.5 ? Co : PackDepth ? float4(PackDepth24( zBuffer(TCR).x ),1.0) : zBuffer(TCR).x; 263 | else if(Plus_Depth == 3) 264 | color = texcoord.y < 0.5 ? Co : PackDepth ? float4(PackDepth24( zBuffer(TCR).x ),1.0) : zBuffer(TCR).x; 265 | } 266 | 267 | if(Plus_Depth == 4) 268 | color = tex2D(SColor,StoreTC); 269 | 270 | if(Plus_Depth == 5) 271 | color = tex2D(SDepth,StoreTC); 272 | 273 | if (Plus_Depth == 0) 274 | color = tex2D(BackBufferL, texcoord); 275 | 276 | return color; 277 | } 278 | 279 | void S_BB(float4 position : SV_Position, float2 texcoord : TEXCOORD, out float4 PastC : SV_Target0, out float4 PastD : SV_Target1) 280 | { 281 | PastC = tex2D(SColor,texcoord); 282 | PastD = tex2D(SDepth,texcoord); 283 | } 284 | 285 | ///////////////////////////////////////////////////////////ReShade.fxh///////////////////////////////////////////////////////////// 286 | 287 | // Vertex shader generating a triangle covering the entire screen 288 | void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD) 289 | { 290 | texcoord.x = (id == 2) ? 2.0 : 0.0; 291 | texcoord.y = (id == 1) ? 2.0 : 0.0; 292 | position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 293 | } 294 | 295 | technique Depth_Tool 296 | { 297 | pass StoreColorDepth 298 | { 299 | VertexShader = PostProcessVS; 300 | PixelShader = S_CD; 301 | RenderTarget0 = SC; 302 | RenderTarget1 = SD; 303 | } 304 | pass DepthMap 305 | { 306 | VertexShader = PostProcessVS; 307 | PixelShader = Out; 308 | } 309 | pass Past 310 | { 311 | VertexShader = PostProcessVS; 312 | PixelShader = S_BB; 313 | RenderTarget0 = SPC; 314 | RenderTarget1 = SPD; 315 | } 316 | } 317 | -------------------------------------------------------------------------------- /Other Shaders/Dimension_Plus.fx: -------------------------------------------------------------------------------- 1 | ////-----------// 2 | ///**Depth3D**/// 3 | //-----------//// 4 | 5 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 6 | //* Depth Map Based 3D post-process shader Depth3D v1.4.0 7 | //* For Reshade 3.0 & 4.0 8 | //* --------------------------------------------------------------------------------------------------- 9 | //* 10 | //* This Shader is an simplified version of SuperDepth3D.fx a shader I made for ReShade's collection standard effects. For the use with stereo 3D screens. 11 | //* Also had to rework Philippe David http://graphics.cs.brown.edu/games/SteepParallax/index.html code to work with reshade. This is used for the parallax effect. 12 | //* This idea was taken from this shader here located at https://github.com/Fubaxiusz/fubax-shaders/blob/596d06958e156d59ab6cd8717db5f442e95b2e6b/Shaders/VR.fx#L395 13 | //* It's also based on Philippe David Steep Parallax mapping code. If I missed any information please contact me so I can make corrections. 14 | //* Multi-licensing 15 | //* LICENSE 16 | //* ============ 17 | //* Overwatch & Code out side the work of people mention above is licenses under: Attribution-NoDerivatives 4.0 International 18 | //* 19 | //* You are free to: 20 | //* Share - copy and redistribute the material in any medium or format 21 | //* for any purpose, even commercially. 22 | //* The licensor cannot revoke these freedoms as long as you follow the license terms. 23 | //* Under the following terms: 24 | //* Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. 25 | // *You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 26 | //* 27 | //* NoDerivatives - If you remix, transform, or build upon the material, you may not distribute the modified material. 28 | //* 29 | //* No additional restrictions - You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 30 | //* 31 | //* https://creativecommons.org/licenses/by-nd/4.0/ 32 | //* 33 | //* Have fun, 34 | //* Jose Negrete AKA BlueSkyDefender 35 | //* 36 | //* https://github.com/BlueSkyDefender/Depth3D 37 | //* http://reshade.me/forum/shader-presentation/2128-sidebyside-3d-depth-map-based-stereoscopic-shader 38 | //* 39 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 40 | 41 | //USER EDITABLE PREPROCESSOR FUNCTIONS START// 42 | #define Image_Size 0.0 //Set Image Size 43 | //USER EDITABLE PREPROCESSOR FUNCTIONS END// 44 | /* //Not used 45 | uniform float Elevation_Sigma< 46 | ui_type = "drag"; 47 | ui_min = -5; ui_max = 5; 48 | > = 0; 49 | */ 50 | uniform float Divergence < 51 | ui_type = "drag"; 52 | ui_min = 1; ui_max = 100; ui_step = 0.5; 53 | ui_label = "·Divergence Slider·"; 54 | ui_tooltip = "Divergence increases differences between the left and right retinal images and allows you to experience depth.\n" 55 | "The process of deriving binocular depth information is called stereopsis.\n" 56 | "You can override this value."; 57 | ui_category = "Divergence & Convergence"; 58 | > = 50.0; 59 | 60 | uniform float Pivot_Point < 61 | ui_type = "drag"; 62 | ui_min = 0; ui_max = 1; 63 | ui_label = "·Pivot Point Slider·"; 64 | ui_tooltip = "Pivot Point works like convergence in an 3D image."; 65 | ui_category = "Divergence & Convergence"; 66 | > = 0.5; 67 | 68 | uniform bool invertX < 69 | ui_label = " Invert X"; 70 | ui_tooltip = "Invert X."; 71 | > = false; 72 | /* 73 | uniform bool invertY < 74 | ui_label = " Invert Y"; 75 | ui_tooltip = "Invert Y."; 76 | > = false; 77 | */ 78 | //Depth Buffer Adjust// 79 | uniform int Depth_Map < 80 | ui_type = "combo"; 81 | ui_items = "Z-Buffer Normal\0Z-Buffer Reversed\0"; 82 | ui_label = "·Z-Buffer Selection·"; 83 | ui_tooltip = "Select Depth Buffer Linearization."; 84 | ui_category = "Depth Buffer Adjust"; 85 | > = 0; 86 | 87 | uniform float Depth_Map_Adjust < 88 | ui_type = "drag"; 89 | ui_min = 1.0; ui_max = 250.0; ui_step = 0.125; 90 | ui_label = " Z-Buffer Adjustment"; 91 | ui_tooltip = "This allows for you to adjust Depth Buffer Precision.\n" 92 | "Try to adjust this to keep it as low as possible.\n" 93 | "Don't go too high with this adjustment.\n" 94 | "Default is 5.0"; 95 | ui_category = "Depth Buffer Adjust"; 96 | > = 5.0; 97 | 98 | uniform float Offset < 99 | ui_type = "drag"; 100 | ui_min = 0.0; ui_max = 1.0; 101 | ui_label = " Depth Map Offset"; 102 | ui_tooltip = "Depth Map Offset is for non conforming ZBuffer.\n" 103 | "It's rare if you need to use this in any game.\n" 104 | "Use this to make adjustments to DM 0 or DM 1.\n" 105 | "Default and starts at Zero and it's Off."; 106 | ui_category = "Depth Buffer Adjust"; 107 | > = 0; 108 | 109 | uniform bool Depth_Map_View < 110 | ui_label = " Display Depth"; 111 | ui_tooltip = "Display the Depth Buffer."; 112 | ui_category = "Depth Buffer Adjust"; 113 | > = false; 114 | 115 | uniform bool Depth_Map_Flip < 116 | ui_label = " Flip Depth"; 117 | ui_tooltip = "Flip the Depth Buffer if it is upside down."; 118 | ui_category = "Depth Buffer Adjust"; 119 | > = false; 120 | 121 | uniform bool Debug_Mode < 122 | ui_label = " Debug"; 123 | ui_tooltip = "Use this to view head Postion in relation to the screen.\n" 124 | "It's how eye see you........................"; 125 | ui_category = "Depth Buffer Adjust"; 126 | > = false; 127 | 128 | /////////////////////////////////////////////D3D Starts Here///////////////////////////////////////////////////////////////// 129 | #define pix float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT) 130 | #define AR 1.77 //BUFFER_WIDTH / BUFFER_HEIGHT Don't work ??? 131 | texture DepthBufferTex : DEPTH; 132 | 133 | sampler DepthBuffer 134 | { 135 | Texture = DepthBufferTex; 136 | }; 137 | 138 | texture BackBufferTex : COLOR; 139 | 140 | sampler BackBuffer 141 | { 142 | Texture = BackBufferTex; 143 | AddressU = BORDER; 144 | AddressV = BORDER; 145 | AddressW = BORDER; 146 | }; 147 | 148 | texture texDiplus {Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8;}; //Sample at 256x256/2 and a mip bias of 8 should be 1x1 149 | 150 | sampler SamplerDiplus 151 | { 152 | Texture = texDiplus; 153 | AddressU = BORDER; 154 | AddressV = BORDER; 155 | AddressW = BORDER; 156 | }; 157 | 158 | void A0(float2 texcoord,float PosX,float PosY,inout float D, inout float E, inout float P, inout float T, inout float H, inout float III, inout float DD ) 159 | { 160 | float PosXD = -0.035+PosX, offsetD = 0.001;D = all( abs(float2( texcoord.x -PosXD, texcoord.y-PosY)) < float2(0.0025,0.009));D -= all( abs(float2( texcoord.x -PosXD-offsetD, texcoord.y-PosY)) < float2(0.0025,0.007)); 161 | float PosXE = -0.028+PosX, offsetE = 0.0005;E = all( abs(float2( texcoord.x -PosXE, texcoord.y-PosY)) < float2(0.003,0.009));E -= all( abs(float2( texcoord.x -PosXE-offsetE, texcoord.y-PosY)) < float2(0.0025,0.007));E += all( abs(float2( texcoord.x -PosXE, texcoord.y-PosY)) < float2(0.003,0.001)); 162 | float PosXP = -0.0215+PosX, PosYP = -0.0025+PosY, offsetP = 0.001, offsetP1 = 0.002;P = all( abs(float2( texcoord.x -PosXP, texcoord.y-PosYP)) < float2(0.0025,0.009*0.775));P -= all( abs(float2( texcoord.x -PosXP-offsetP, texcoord.y-PosYP)) < float2(0.0025,0.007*0.680));P += all( abs(float2( texcoord.x -PosXP+offsetP1, texcoord.y-PosY)) < float2(0.0005,0.009)); 163 | float PosXT = -0.014+PosX, PosYT = -0.008+PosY;T = all( abs(float2( texcoord.x -PosXT, texcoord.y-PosYT)) < float2(0.003,0.001));T += all( abs(float2( texcoord.x -PosXT, texcoord.y-PosY)) < float2(0.000625,0.009)); 164 | float PosXH = -0.0072+PosX;H = all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.002,0.001));H -= all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.002,0.009));H += all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.00325,0.009)); 165 | float offsetFive = 0.001, PosX3 = -0.001+PosX;III = all( abs(float2( texcoord.x -PosX3, texcoord.y-PosY)) < float2(0.002,0.009));III -= all( abs(float2( texcoord.x -PosX3 - offsetFive, texcoord.y-PosY)) < float2(0.003,0.007));III += all( abs(float2( texcoord.x -PosX3, texcoord.y-PosY)) < float2(0.002,0.001)); 166 | float PosXDD = 0.006+PosX, offsetDD = 0.001;DD = all( abs(float2( texcoord.x -PosXDD, texcoord.y-PosY)) < float2(0.0025,0.009));DD -= all( abs(float2( texcoord.x -PosXDD-offsetDD, texcoord.y-PosY)) < float2(0.0025,0.007)); 167 | } 168 | 169 | /////////////////////////////////////////////////////////////////////////////////Depth Map Information///////////////////////////////////////////////////////////////////////////////// 170 | uniform float3 motion[2] < source = "freepie"; index = 0; >; 171 | //. motion[0] is yaw, pitch, roll and motion[1] is x,y,z. 172 | float3 FP_IO_Rot(){return motion[0];} 173 | float3 FP_IO_Pos(){return motion[1];} 174 | 175 | float2 Depth(in float2 texcoord : TEXCOORD) 176 | { 177 | if (Depth_Map_Flip) 178 | texcoord.y = 1 - texcoord.y; 179 | 180 | float zBuffer = tex2Dlod(DepthBuffer,float4(texcoord,0,0)).x; //Depth Buffer 181 | 182 | //Conversions to linear space..... 183 | //Near & Far Adjustment 184 | float Far = 1., Near = 0.125/Depth_Map_Adjust, DA = Depth_Map_Adjust * 2.0f; //Depth Map Adjust - Near 185 | 186 | float2 Offsets = float2(1 + Offset,1 - Offset), Z = float2( zBuffer, 1-zBuffer ); 187 | 188 | if (Offset > 0) 189 | Z = min( 1, float2( Z.x * Offsets.x , Z.y / Offsets.y )); 190 | 191 | 192 | [branch] if (Depth_Map == 0)//DM0. Normal 193 | zBuffer = pow(abs(Z.x),DA); 194 | else if (Depth_Map == 1)//DM1. Reverse 195 | zBuffer = pow(abs(Z.y),DA); 196 | float StoreZ = zBuffer; 197 | [branch] if (Depth_Map == 0)//DM0. Normal 198 | zBuffer = Far * Near / (Far + Z.x * (Near - Far)); 199 | else if (Depth_Map == 1)//DM1. Reverse 200 | zBuffer = Far * Near / (Far + Z.y * (Near - Far)); 201 | 202 | 203 | return saturate(float2(zBuffer,StoreZ)); 204 | } 205 | 206 | float Scale(float val,float max,float min) //Scale to 0 - 1 207 | { 208 | return (val - min) / (max - min); 209 | } 210 | 211 | float zBuffer(in float2 texcoord : TEXCOORD0) 212 | { 213 | float2 DM = Depth(texcoord); 214 | 215 | float Conv = 1-0.025/DM.x; 216 | return lerp(Scale(Conv,1,0) ,DM.y,0.125); 217 | } 218 | 219 | float2 Parallax( float2 Diverge, float2 Coordinates) 220 | { 221 | float D = abs(length(Diverge)) ; 222 | float Cal_Steps = D + (D * 0.05); 223 | //ParallaxSteps 224 | float Steps = clamp(Cal_Steps,1,255); 225 | // Offset per step progress & Limit 226 | float LayerDepth = rcp(Steps); 227 | //Offsets listed here Max Seperation is 3% - 8% of screen space with Depth Offsets & Netto layer offset change based on MS. 228 | float2 MS = Diverge * pix; 229 | float2 deltaCoordinates = MS * LayerDepth, ParallaxCoord = Coordinates , DB_Offset = (Diverge * 0.025) * pix; 230 | float CurrentDepthMapValue = zBuffer(ParallaxCoord), CurrentLayerDepth = 0; 231 | 232 | [loop] //Steep parallax mapping 233 | for ( int i = 0; i < Steps; i++ ) 234 | { // Doing it this way should stop crashes in older version of reshade, I hope. 235 | if (CurrentDepthMapValue <= CurrentLayerDepth) 236 | break; // Once we hit the limit Stop Exit Loop. 237 | // Shift coordinates horizontally in linear fasion 238 | ParallaxCoord -= deltaCoordinates; 239 | // Get depth value at current coordinates 240 | CurrentDepthMapValue = zBuffer( ParallaxCoord - DB_Offset); 241 | // Get depth of next layer 242 | CurrentLayerDepth += LayerDepth; 243 | } 244 | // Parallax Occlusion Mapping 245 | float2 PrevParallaxCoord = ParallaxCoord + deltaCoordinates, DepthDifference; 246 | float afterDepthValue = CurrentDepthMapValue - CurrentLayerDepth; 247 | float beforeDepthValue = zBuffer( ParallaxCoord ) + CurrentLayerDepth + LayerDepth; 248 | 249 | // Interpolate coordinates 250 | float weight = afterDepthValue / (afterDepthValue - beforeDepthValue); 251 | ParallaxCoord = PrevParallaxCoord * max(0,weight) + ParallaxCoord * min(1,1.0f - weight); 252 | 253 | ParallaxCoord += DB_Offset; 254 | 255 | return ParallaxCoord ; 256 | } 257 | 258 | float4 PS_calcLRUD(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 259 | { 260 | float2 IS = float2(1+Image_Size,Image_Size * 0.5); 261 | texcoord *= IS.x; 262 | texcoord -= IS.y; 263 | 264 | float2 TexCoords = texcoord,Center; 265 | float4 color; 266 | float2 coordsXY; 267 | 268 | coordsXY.xy = float2(FP_IO_Pos().x,FP_IO_Pos().y); 269 | 270 | Center.x = coordsXY.x; 271 | //Center.y = MousecoordsXY.y + Elevation_Sigma ; 272 | if( invertX ) 273 | Center.x = -Center.x; 274 | //if( invertY ) 275 | //Center.y = -Center.y; 276 | float PP = Divergence * Pivot_Point; 277 | 278 | float2 Per = (Center * pix) * PP ; 279 | 280 | texcoord = Parallax(float2(Center.x * Divergence,Center.y * Divergence) , texcoord + Per); 281 | 282 | if(!Depth_Map_View) 283 | color = tex2Dlod(BackBuffer, float4(texcoord,0,0)); 284 | else 285 | color = zBuffer(texcoord).xx; 286 | 287 | float2 TC_A = invertX ? TexCoords - Per : TexCoords + Per; 288 | float2 TC_B = invertX ? TexCoords - (Per * 0.9375) : TexCoords + (Per * 0.9375); 289 | /* //Used to show the Parallax 290 | float2 TC_A = TexCoords - Per; 291 | float2 TC_B = TexCoords - (Per * 0.5); 292 | if(TC_A.x > 0.51 || TC_A.x < 0.490 || TC_A.y > 0.515 || TC_A.y < 0.485 ) 293 | { 294 | if(TC_B.x > 0.52 || TC_B.x < 0.48 || TC_B.y > 0.530 || TC_B.y < 0.47) 295 | { 296 | if (TexCoords.x > 0.54 || TexCoords.x < 0.46 || TexCoords.y > 0.545 || TexCoords.y < 0.455) 297 | return float4(color.rgb,1.0); 298 | else 299 | return 1; 300 | } 301 | else 302 | return float4(0.25,0.5,0.9,1.0); 303 | } 304 | else 305 | return 0; 306 | */ 307 | if ((TexCoords.x > 0.54 || TexCoords.x < 0.46 || TexCoords.y > 0.545 || TexCoords.y < 0.455) || !Debug_Mode) 308 | return float4(color.rgb,1.0); 309 | else 310 | { 311 | if(TC_A.x > 0.51 || TC_A.x < 0.490 || TC_A.y > 0.515 || TC_A.y < 0.485 ) 312 | {if (TC_B.x > 0.52 || TC_B.x < 0.48 || TC_B.y > 0.530 || TC_B.y < 0.47) 313 | return 1; 314 | else 315 | return float4(0.25,0.5,0.9,1.0); 316 | } 317 | else 318 | return 0; 319 | } 320 | 321 | } 322 | 323 | 324 | void A1(float2 texcoord,float PosX,float PosY,inout float I, inout float N, inout float F, inout float O) 325 | { 326 | float PosXI = 0.0155+PosX, PosYI = 0.004+PosY, PosYII = 0.008+PosY;I = all( abs(float2( texcoord.x - PosXI, texcoord.y - PosY)) < float2(0.003,0.001));I += all( abs(float2( texcoord.x - PosXI, texcoord.y - PosYI)) < float2(0.000625,0.005));I += all( abs(float2( texcoord.x - PosXI, texcoord.y - PosYII)) < float2(0.003,0.001)); 327 | float PosXN = 0.0225+PosX, PosYN = 0.005+PosY,offsetN = -0.001;N = all( abs(float2( texcoord.x - PosXN, texcoord.y - PosYN)) < float2(0.002,0.004));N -= all( abs(float2( texcoord.x - PosXN, texcoord.y - PosYN - offsetN)) < float2(0.003,0.005)); 328 | float PosXF = 0.029+PosX, PosYF = 0.004+PosY, offsetF = 0.0005, offsetF1 = 0.001;F = all( abs(float2( texcoord.x -PosXF-offsetF, texcoord.y-PosYF-offsetF1)) < float2(0.002,0.004));F -= all( abs(float2( texcoord.x -PosXF, texcoord.y-PosYF)) < float2(0.0025,0.005));F += all( abs(float2( texcoord.x -PosXF, texcoord.y-PosYF)) < float2(0.0015,0.00075)); 329 | float PosXO = 0.035+PosX, PosYO = 0.004+PosY;O = all( abs(float2( texcoord.x -PosXO, texcoord.y-PosYO)) < float2(0.003,0.005));O -= all( abs(float2( texcoord.x -PosXO, texcoord.y-PosYO)) < float2(0.002,0.003)); 330 | } 331 | ////////////////////////////////////////////////////////Logo///////////////////////////////////////////////////////////////////////// 332 | uniform float timer < source = "timer"; >; 333 | float4 Out(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 334 | { 335 | float2 PivotPoint = float2(0.5,0.5); 336 | //float Rot; 337 | //Nope this don't work well with Tobii Need other method..... 338 | //Rot = 0;//radians(-FP_IO_Rot().z); 339 | 340 | float2 Rotationtexcoord = texcoord ; 341 | //float sin_factor = sin(Rot); 342 | //float cos_factor = cos(Rot); 343 | //Rotationtexcoord = mul(Rotationtexcoord - PivotPoint,float2x2(float2( cos_factor, -sin_factor) * float2(1.0,AR),float2( sin_factor, cos_factor) * float2(rcp(AR),1.0))); 344 | //Rotationtexcoord += PivotPoint; 345 | 346 | float3 Color = tex2D(SamplerDiplus,Rotationtexcoord).rgb; 347 | float PosX = 0.9525f*BUFFER_WIDTH*pix.x,PosY = 0.975f*BUFFER_HEIGHT*pix.y,A,B,C,D,E,F,G,H,I,J,K,L,PosXDot = 0.011+PosX, PosYDot = 0.008+PosY;L = all( abs(float2( texcoord.x -PosXDot, texcoord.y-PosYDot)) < float2(0.00075,0.0015));A0(texcoord,PosX,PosY,A,B,C,D,E,F,G );A1(texcoord,PosX,PosY,H,I,J,K); 348 | return timer <= 12500 ? A+B+C+D+E+F+G+H+I+J+K+L ? 1-texcoord.y*50.0+48.35f : float4(Color,1.) : float4(Color,1.); 349 | } 350 | ///////////////////////////////////////////////////////////ReShade.fxh///////////////////////////////////////////////////////////// 351 | void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD) 352 | {// Vertex shader generating a triangle covering the entire screen 353 | texcoord.x = (id == 2) ? 2.0 : 0.0; 354 | texcoord.y = (id == 1) ? 2.0 : 0.0; 355 | position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 356 | } 357 | //*Rendering passes*// 358 | technique Dimension_Plus 359 | < ui_tooltip = "This Shader should be the VERY LAST Shader in your master shader list.\n" 360 | "You can always Drag shaders around by clicking them and moving them.\n" 361 | "For more help you can always contact me at DEPTH3D.info."; >//Website WIP 362 | { 363 | pass Perspective 364 | { 365 | VertexShader = PostProcessVS; 366 | PixelShader = PS_calcLRUD; 367 | RenderTarget = texDiplus; 368 | } 369 | pass StereoOut 370 | { 371 | VertexShader = PostProcessVS; 372 | PixelShader = Out; 373 | } 374 | } 375 | -------------------------------------------------------------------------------- /Other Shaders/Polynomial_Barrel_Distortion_for_HMDs.fx: -------------------------------------------------------------------------------- 1 | ////-----------------------------------------// 2 | ///**Polynomial Barrel Distortion for HMDs**/// 3 | //-----------------------------------------//// 4 | 5 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 6 | //* Barrel Distortion for HMD type Displays *// 7 | //* For Reshade 3.0+ *// 8 | //* -------------------------- *// 9 | //* This work is licensed under a Creative Commons Attribution 3.0 Unported License. *// 10 | //* So you are free to share, modify and adapt it for your needs, and even use it for commercial use. *// 11 | //* I would also love to hear about a project you are using it with. *// 12 | //* https://creativecommons.org/licenses/by/3.0/us/ *// 13 | //* *// 14 | //* Have fun, *// 15 | //* Jose Negrete AKA BlueSkyDefender *// 16 | //* *// 17 | //* http://reshade.me/forum/shader-presentation/2128-sidebyside-3d-depth-map-based-stereoscopic-shader *// 18 | //* --------------------------------- *// 19 | //* Also thank you Zapal for your help with fixing a few things in this shader. *// 20 | //* https://reshade.me/forum/shader-presentation/2128-3d-depth-map-based-stereoscopic-shader?start=900#21236 *// 21 | //* *// *// 22 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 23 | 24 | // Determines Primary and Secondary Shader Toggle. This is used if you want pair this shader up with a other one of the same type. 25 | // One = Primary; 26 | // Zero = Secondary; 27 | #define TOGGLE 1 28 | 29 | #if !defined(__RESHADE__) || __RESHADE__ < 40000 30 | #define Compatibility 1 31 | #else 32 | #define Compatibility 0 33 | #endif 34 | 35 | #ifndef Enable_AA_Filter 36 | #define Enable_AA_Filter 0 37 | #endif 38 | #ifndef Enable_Sharpen_Filter 39 | #define Enable_Sharpen_Filter 0 40 | #endif 41 | 42 | uniform int Interpupillary_Distance < 43 | #if Compatibility 44 | ui_type = "drag"; 45 | #else 46 | ui_type = "slider"; 47 | #endif 48 | ui_min = -100; ui_max = 100; 49 | ui_label = "Interpupillary Distance"; 50 | ui_tooltip = "Determines the distance between your eyes.\n" 51 | "In Monoscopic mode it's x offset calibration.\n" 52 | "Default is 0."; 53 | ui_category = "Eye Focus Adjustment"; 54 | > = 0; 55 | 56 | uniform bool LD_IPD < 57 | ui_label = "Lens Dependent IPD"; 58 | ui_tooltip = "Set Interpupillary Distance by Lens Postion instead of screen space postion.\n" 59 | "This is for HMD that can't move the internal Displays with the Lenses."; 60 | ui_category = "Eye Focus Adjustment"; 61 | > = false; 62 | 63 | uniform int Stereoscopic_Mode_Convert < 64 | ui_type = "combo"; 65 | ui_items = "Side by Side\0Top and Bottom\0SbS to Alt-TnB\0TnB to Alt-TnB\0Monoscopic\0"; 66 | ui_label = "3D Mode Conversions"; 67 | ui_tooltip = "3D Mode Conversion for Head Mounted Displays."; 68 | ui_category = "Stereoscopic Options"; 69 | > = 0; 70 | 71 | uniform float3 Polynomial_Colors_K1 < 72 | #if Compatibility 73 | ui_type = "drag"; 74 | #else 75 | ui_type = "slider"; 76 | #endif 77 | ui_min = 0.0; ui_max = 1.0; 78 | ui_tooltip = "Adjust the Polynomial Distortion K1_Red, K1_Green, & K1_Blue.\n" 79 | "Default is (R 0.22, G 0.22, B 0.22)"; 80 | ui_label = "Polynomial Color Distortion K1"; 81 | ui_category = "Image Distortion Corrections"; 82 | > = float3(0.22, 0.22, 0.22); 83 | 84 | uniform float3 Polynomial_Colors_K2 < 85 | #if Compatibility 86 | ui_type = "drag"; 87 | #else 88 | ui_type = "slider"; 89 | #endif 90 | ui_min = 0.0; ui_max = 1.0; 91 | ui_tooltip = "Adjust the Polynomial Distortion K2_Red, K2_Green, & K2_Blue.\n" 92 | "Default is (R 0.24, G 0.24, B 0.24)"; 93 | ui_label = "Polynomial Color Distortion K2"; 94 | ui_category = "Image Distortion Corrections"; 95 | > = float3(0.24, 0.24, 0.24); 96 | 97 | uniform bool Distortion_Aliment_Grid < 98 | ui_label = "Distortion Grid"; 99 | ui_tooltip = "Use to this White & Black Grid for Distortion Correction."; 100 | ui_category = "Image Distortion Corrections"; 101 | > = false; 102 | 103 | 104 | uniform float2 Zoom_Aspect_Ratio < 105 | #if Compatibility 106 | ui_type = "drag"; 107 | #else 108 | ui_type = "slider"; 109 | #endif 110 | ui_min = 0.5; ui_max = 2; 111 | ui_label = "Lens Zoom & Aspect Ratio"; 112 | ui_tooltip = "Lens Zoom and Aspect Ratio.\n" 113 | "Default is 1.0."; 114 | ui_category = "Image Adjustment"; 115 | > = float2(1.0,1.0); 116 | 117 | uniform float Field_of_View < 118 | #if Compatibility 119 | ui_type = "drag"; 120 | #else 121 | ui_type = "slider"; 122 | #endif 123 | ui_min = 0.0; ui_max = 0.250; 124 | ui_label = "Field of View"; 125 | ui_tooltip = "Lets you adjust the FoV of the Image.\n" 126 | "Default is 0.0."; 127 | ui_category = "Image Adjustment"; 128 | > = 0; 129 | 130 | uniform float2 Degrees < 131 | #if Compatibility 132 | ui_type = "drag"; 133 | #else 134 | ui_type = "slider"; 135 | #endif 136 | ui_min = 0; ui_max = 360; 137 | ui_label = "Independent Rotation"; 138 | ui_tooltip = "Left & Right Rotation Angle known as Degrees.\n" 139 | "Default is Zero"; 140 | ui_category = "Image Repositioning"; 141 | > = float2(0.0,0.0); 142 | 143 | uniform int2 Independent_Vertical_Repositioning < 144 | #if Compatibility 145 | ui_type = "drag"; 146 | #else 147 | ui_type = "slider"; 148 | #endif 149 | ui_min = -500; ui_max = 500; 150 | ui_label = "Independent Vertical Repositioning"; 151 | ui_tooltip = "Please note if you have to use this, please aline and adjust your headset before you use this.\n" 152 | "This tries to correct for Strabismus misalignment.\n" 153 | "Determines the vertical L & R positioning.\n" 154 | "Default is 0."; 155 | ui_category = "Image Repositioning"; 156 | > = int2(0,0); 157 | 158 | uniform int2 Independent_Horizontal_Repositioning < 159 | #if Compatibility 160 | ui_type = "drag"; 161 | #else 162 | ui_type = "slider"; 163 | #endif 164 | ui_min = -500; ui_max = 500; 165 | ui_label = "Independent Horizontal Repositioning"; 166 | ui_tooltip = "Please note if you have to use this, please aline and adjust your headset before you use this.\n" 167 | "This tries to correct for Strabismus misalignment.\n" 168 | "Determines the vertical L & R positioning.\n" 169 | "Default is 0."; 170 | ui_category = "Image Repositioning"; 171 | > = int2(0,0); 172 | 173 | uniform float Tilt_Control < 174 | #if Compatibility 175 | ui_type = "drag"; 176 | #else 177 | ui_type = "slider"; 178 | #endif 179 | ui_min = -0.5; ui_max = 0.5; 180 | ui_label = "Keytone Horizontal & Vertical"; 181 | ui_tooltip = "Shift Horizontal & Vertical Angle to apply the Keystone correction.\n" 182 | "Default is Zero"; 183 | ui_category = "Image Repositioning"; 184 | > = 0.0; 185 | 186 | uniform bool Tied_H_V < 187 | ui_label = "Tied Horiz & Vert Repositioning"; 188 | ui_tooltip = "Lets you control the Horizontal and Vertical with the first value only.\n" 189 | "Default is On."; 190 | ui_category = "Image Repositioning"; 191 | > = true; 192 | 193 | uniform float Vignette < 194 | #if Compatibility 195 | ui_type = "drag"; 196 | #else 197 | ui_type = "slider"; 198 | #endif 199 | ui_min = 0; ui_max = 10; 200 | ui_label = "Vignette"; 201 | ui_tooltip = "Soft edge effect around the image."; 202 | ui_category = "Image Effects"; 203 | > = 0; 204 | 205 | uniform float Saturation < 206 | #if Compatibility 207 | ui_type = "drag"; 208 | #else 209 | ui_type = "slider"; 210 | #endif 211 | ui_min = 0; ui_max = 1; 212 | ui_label = "Saturation"; 213 | ui_tooltip = "Lets you saturate image, Basicly add more color."; 214 | ui_category = "Image Effects"; 215 | > = 0; 216 | #if Enable_Sharpen_Filter 217 | uniform float Sharpen_Power < 218 | #if Compatibility 219 | ui_type = "drag"; 220 | #else 221 | ui_type = "slider"; 222 | #endif 223 | ui_min = 0.0; ui_max = 2.0; 224 | ui_label = "Sharpen Power"; 225 | ui_tooltip = "Adjust this on clear up the image the game, movie piture & ect."; 226 | ui_category = "Image Effects"; 227 | > = 0; 228 | #endif 229 | #if Enable_AA_Filter 230 | uniform bool NFAA_TOGGLE < 231 | ui_label = "NFAA"; 232 | ui_tooltip = "The Adds Normal Filter Anti-Aliasing to the Image before processing.\n" 233 | "Default is off."; 234 | ui_category = "Image Effects"; 235 | > = false; 236 | #endif 237 | uniform bool Lens_Aliment_Marker < 238 | ui_label = "Lens Aliment Marker"; 239 | ui_tooltip = "Use to this green Cross Marker for lens aliment."; 240 | ui_category = "Image Markers"; 241 | > = false; 242 | 243 | uniform bool Image_Aliment_Marker < 244 | ui_label = "Image Aliment Marker"; 245 | ui_tooltip = "Use to this green Cross Marker for image aliment."; 246 | ui_category = "Image Markers"; 247 | > = false; 248 | 249 | uniform bool Diaspora < 250 | ui_label = "Diaspora Fix"; 251 | ui_tooltip = "A small fix for the game Diaspora."; 252 | ui_category = "Internal Matix Correction."; 253 | > = false; 254 | 255 | //////////////////////////////////////////////////HMD Profiles////////////////////////////////////////////////////////////////// 256 | 257 | uniform int HMD_Profiles < 258 | ui_type = "combo"; 259 | ui_items = "Off\0Profile One\0Profile Two\0"; //Add your own Profile here. 260 | ui_label = "HMD Profiles"; 261 | ui_tooltip = "Head Mounted Display Profiles."; 262 | ui_category = "Custom HMD Profiles."; 263 | > = 0; 264 | 265 | float4x4 HMDProfiles() 266 | { 267 | float Zoom = Zoom_Aspect_Ratio.x; 268 | float Aspect_Ratio = Zoom_Aspect_Ratio.y; 269 | 270 | float IPD = Interpupillary_Distance; 271 | float FOV = Field_of_View; 272 | float3 PC2 = Polynomial_Colors_K2; 273 | float Z = Zoom; 274 | float AR = Aspect_Ratio; 275 | float3 PC1 = Polynomial_Colors_K1; 276 | float2 D = Degrees; 277 | float2 IVRPLR = Independent_Vertical_Repositioning; 278 | float2 IHRPLR = Independent_Horizontal_Repositioning; 279 | float4x4 Done; 280 | 281 | //Make your own Profile here. 282 | if (HMD_Profiles == 1) 283 | { 284 | IPD = 0.0; //Interpupillary Distance. Default is 0 285 | FOV = 0.0; 286 | Z = 1.0; //Zoom. Default is 1.0 287 | AR = 1.0; //Aspect Ratio. Default is 1.0 288 | PC1 = float3(0.22,0.22,0.22);//Polynomial Colors K_1. Default is (Red 0.22, Green 0.22, Blue 0.22) 289 | PC2 = float3(0.24,0.24,0.24);//Polynomial Colors K_2. Default is (Red 0.24, Green 0.24, Blue 0.24) 290 | D = float2(0,0); //Left & Right Rotation Angle known as Degrees. 291 | IVRPLR = float2(0,0); //Independent Vertical Repositioning. Left & Right. 292 | IHRPLR = float2(0,0); //Independent Horizontal Repositioning. Left & Right. 293 | } 294 | 295 | //Make your own Profile here. 296 | if (HMD_Profiles == 2) 297 | { 298 | IPD = 25.0; //Interpupillary Distance. 299 | FOV = 0.0; 300 | Z = 1.0; //Zoom. Default is 1.0 301 | AR = 0.925; //Aspect Ratio. Default is 1.0 302 | PC1 = float3(0.22,0.22,0.22);//Polynomial Colors K_1. Default is (Red 0.22, Green 0.22, Blue 0.22) 303 | PC2 = float3(0.24,0.24,0.24);//Polynomial Colors K_2. Default is (Red 0.24, Green 0.24, Blue 0.24) 304 | D = float2(0,0); //Left & Right Rotation Angle known as Degrees. 305 | IVRPLR = float2(0,0); //Independent Vertical Repositioning. Left & Right. 306 | IHRPLR = float2(0,0); //Independent Horizontal Repositioning. Left & Right. 307 | } 308 | 309 | //Rift Profile WIP 310 | if (HMD_Profiles == 3) 311 | { 312 | IPD = 27.25; //Interpupillary Distance. 313 | FOV = 0.0; 314 | Z = 1.0; //Zoom. Default is 1.0 315 | AR = 1.0; //Aspect Ratio. Default is 1.0 316 | PC1 = float3(0.22,0.22,0.22);//Polynomial Colors K_1. Default is (Red 0.22, Green 0.22, Blue 0.22) 317 | PC2 = float3(0.24,0.24,0.24);//Polynomial Colors K_2. Default is (Red 0.24, Green 0.24, Blue 0.24) 318 | D = float2(0,0); //Left & Right Rotation Angle known as Degrees. 319 | IVRPLR = float2(0,0); //Independent Vertical Repositioning. Left & Right. 320 | IHRPLR = float2(0,0); //Independent Horizontal Repositioning. Left & Right. 321 | } 322 | 323 | if(Diaspora) 324 | { 325 | Done = float4x4(float4(IPD,PC1.x,Z,IVRPLR.x),float4(PC2.x,PC1.y,AR,IVRPLR.y),float4(PC2.y,PC1.z,D.x,IHRPLR.x),float4(PC2.z,FOV,D.y,IHRPLR.y)); //Diaspora frak up 4x4 fix 326 | } 327 | else 328 | { 329 | Done = float4x4(float4(IPD,PC2.x,PC2.y,PC2.z),float4(PC1.x,PC1.y,PC1.z,FOV),float4(Z,AR,D.x,D.y),float4(IVRPLR.x,IVRPLR.y,IHRPLR.x,IHRPLR.y)); 330 | } 331 | 332 | return Done; 333 | } 334 | 335 | ////////////////////////////////////////////////HMD Profiles End///////////////////////////////////////////////////////////////// 336 | 337 | //Interpupillary Distance Section// 338 | float IPDS() 339 | { 340 | float IPDS = HMDProfiles()[0][0]; 341 | return IPDS; 342 | } 343 | 344 | //Field of View// 345 | float F_o_V() 346 | { 347 | float F_o_V = HMDProfiles()[1][3]; 348 | return F_o_V; 349 | } 350 | 351 | //Lens Zoom & Aspect Ratio Section// 352 | float2 Z_A() 353 | { 354 | float2 ZA = float2(HMDProfiles()[2][0],HMDProfiles()[2][1]); 355 | return ZA; 356 | } 357 | 358 | //Polynomial Colors Section// 359 | float3 P_C_A()//K_1 360 | { 361 | float3 PC = float3(HMDProfiles()[1][0],HMDProfiles()[1][1],HMDProfiles()[1][2]); 362 | return PC; 363 | } 364 | 365 | //Polynomial Colors Section// 366 | float3 P_C_B()//K_2 367 | { 368 | float3 PC = float3(HMDProfiles()[0][1],HMDProfiles()[0][2],HMDProfiles()[0][3]); 369 | return PC; 370 | } 371 | 372 | //Degrees Section// 373 | float2 DEGREES() 374 | { 375 | float2 Degrees = float2(HMDProfiles()[2][2],HMDProfiles()[2][3]); 376 | return Degrees; 377 | } 378 | 379 | //Independent Vertical Repositioning Section// 380 | float2 IVRePosLR() 381 | { 382 | float2 IVRePosLR = float2(HMDProfiles()[3][0],HMDProfiles()[3][1]); 383 | return IVRePosLR; 384 | } 385 | 386 | //Independent Horizontal Repositioning Section// 387 | float2 IHRePosLR() 388 | { 389 | float2 IHRePosLR = float2(HMDProfiles()[3][2],HMDProfiles()[3][3]); 390 | return IHRePosLR; 391 | } 392 | 393 | /////////////////////////////////////////////D3D Starts Here///////////////////////////////////////////////////////////////// 394 | #define pix float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT) 395 | #define TextureSize float2(BUFFER_WIDTH, BUFFER_HEIGHT) 396 | 397 | float fmod(float a, float b) 398 | { 399 | float c = frac(abs(a / b)) * abs(b); 400 | return a < 0 ? -c : c; 401 | } 402 | 403 | texture BackBufferTex : COLOR; 404 | 405 | sampler BackBuffer 406 | { 407 | Texture = BackBufferTex; 408 | AddressU = BORDER; 409 | AddressV = BORDER; 410 | AddressW = BORDER; 411 | }; 412 | 413 | ////////////////////////////////////////////////////Texture_Intercepter///////////////////////////////////////////////////// 414 | float4 Grid_Lines(float2 texcoords) 415 | { 416 | float4 Out; 417 | float2 UV = (texcoords - 0.5f) * 25.0f, xy = abs(frac(UV)); // adjust coords to visualize in a grid 418 | // Draw a black and white grid. 419 | Out = (xy.x > 0.9 || xy.y > 0.9) ? 1 : 0; 420 | 421 | return Out; 422 | } 423 | 424 | float4 Left(float2 texcoord) 425 | { 426 | float HV; 427 | if(Stereoscopic_Mode_Convert == 0 || Stereoscopic_Mode_Convert == 2) //SbS 428 | { 429 | texcoord = float2(texcoord.x*0.5f,texcoord.y); 430 | HV = texcoord.x; 431 | } 432 | else if(Stereoscopic_Mode_Convert == 1 || Stereoscopic_Mode_Convert == 3) //TnB 433 | { 434 | texcoord = float2(texcoord.x,texcoord.y*0.5f); 435 | HV = texcoord.y; 436 | } 437 | 438 | if (!Distortion_Aliment_Grid) 439 | return HV > 0.5f ? 0 : tex2D(BackBuffer,texcoord); 440 | else 441 | return Grid_Lines(texcoord); 442 | } 443 | 444 | 445 | float4 Right(float2 texcoord) 446 | { 447 | float HV; 448 | if(Stereoscopic_Mode_Convert == 0 || Stereoscopic_Mode_Convert == 2) //SbS 449 | { 450 | texcoord = float2(texcoord.x*0.5f+0.5f,texcoord.y); 451 | HV = texcoord.x; 452 | } 453 | else if(Stereoscopic_Mode_Convert == 1 || Stereoscopic_Mode_Convert == 3) //TnB 454 | { 455 | texcoord = float2(texcoord.x,texcoord.y*0.5f+0.5f); 456 | HV = texcoord.y; 457 | } 458 | 459 | if (!Distortion_Aliment_Grid) 460 | return HV > 0.5f ? tex2D(BackBuffer,texcoord) : 0; 461 | else 462 | return Grid_Lines(texcoord); 463 | } 464 | ////////////////////////////////////////////////////Texture_Modifier///////////////////////////////////////////////////// 465 | float4 Cross_Marker(float2 texcoord) //Cross Marker inside Left Image 466 | { 467 | // Compute anti-aliased world-space grid lines 468 | float2 grid = abs(frac(texcoord - 0.25) - 0.25) / fwidth(texcoord); 469 | float lines = min(grid.x, grid.y) * 0.5; 470 | float GLS = 1.0 - min(lines, 1.0); 471 | return float4(GLS.xxx, 1.0); 472 | } 473 | 474 | float2 rotate(float2 TC, float2 center, float rotate) 475 | { 476 | float s = sin(rotate); 477 | float c = cos(rotate); 478 | TC = mul(TC-center,float2x2(c, s, -s, c)); 479 | return TC + center; 480 | 481 | } 482 | 483 | float2 KeyStoneLight(float2 TC, float2 center, float Tilt_X, float Tilt_Y) 484 | { 485 | // Tilt Y 486 | float2 Direction = float2(TC.x, 0.0); 487 | float2 Alpha_0 = float2(0.0, -1.0), 488 | Beta_0 = Direction - Alpha_0, 489 | Gamma_0 = rotate(float2(-1.0, 0.0), float2(center.x, 0.0), Tilt_Y), 490 | Delta_0 = rotate(float2( 1.0, 0.0), float2(center.x, 0.0), Tilt_Y) - Gamma_0; 491 | // Intersection point 492 | float IP = ( (Gamma_0.y + 1.0) * Delta_0.x - Gamma_0.x * Delta_0.y ) / (Delta_0.x*Beta_0.y-Delta_0.y*Beta_0.x); 493 | // Plane position 494 | float xP = IP * Beta_0.x, yP = IP * TC.y; 495 | // Tilt X 496 | Direction = float2(yP, 0.0); 497 | float2 Beta_1 = Direction - Alpha_0, 498 | Gamma_1 = rotate(float2(-1.0, 0.0), float2(center.y, 0.0), Tilt_X), 499 | Delta_1 = rotate(float2( 1.0, 0.0), float2(center.y, 0.0), Tilt_X) - Gamma_1; 500 | // calculate intersection point 501 | float v = ( (Gamma_1.y + 1.0) * Delta_1.x - Gamma_1.x * Delta_1.y ) / (Delta_1.x*Beta_1.y-Delta_1.y*Beta_1.x); 502 | // Plane position 503 | return float2(v * xP, v * Beta_1.x ); 504 | } 505 | 506 | float4 vignetteL(float2 texcoord) 507 | { 508 | float4 base; 509 | //Texture Rotation// 510 | //Converts the specified value from radians to degrees. 511 | float LD = radians(DEGREES().x); 512 | //Tilt Left 513 | float2 Left_Tilt_Start = float2(Tilt_Control.x > 0 ? 0.0 : 1.0,0.5), Left_Tilt = float2(0.0, Tilt_Control.x); 514 | texcoord = KeyStoneLight(texcoord * 2 - 1, Left_Tilt_Start * 2 - 1, Left_Tilt.x, Left_Tilt.y) * 0.5 + 0.5; 515 | //Texture Position 516 | texcoord.y += IVRePosLR().x * pix.y;//Independent Vertical Repostion Left. 517 | texcoord.x += IHRePosLR().x * pix.x;//Independent Horizontal Repostion Left. 518 | //Left 519 | float2 L_Rotationtexcoord = rotate(texcoord,float2(0.5,0.5), LD); 520 | //Texture Zoom & Aspect Ratio// 521 | float X = Z_A().x; 522 | float Y = Z_A().y * Z_A().x * 2; 523 | float midW = (X - 1)*(BUFFER_WIDTH*0.5)*pix.x; 524 | float midH = (Y - 1)*(BUFFER_HEIGHT*0.5)*pix.y; 525 | 526 | texcoord = float2((L_Rotationtexcoord.x*X)-midW,(L_Rotationtexcoord.y*Y)-midH); 527 | //Field of View 528 | float F = -F_o_V() + 1,HA = (F - 1)*(BUFFER_WIDTH*0.5)*pix.x; 529 | 530 | texcoord.x = (texcoord.x*F)-HA; 531 | //Normal HMDs IPD 532 | float IPDtexL = texcoord.x; 533 | if (!LD_IPD) // https://developers.google.com/vr/jump/rendering-ods-content.pdf Page 10 534 | IPDtexL -= (IPDS()) * pix.x;// Left IPD 535 | //Texture Adjustment End// 536 | 537 | base = Left(float2(IPDtexL,texcoord.y)); 538 | 539 | if( Image_Aliment_Marker ) 540 | base = Cross_Marker(texcoord) ? float4(1.0,1.0,0.0,1) : base; //Yellow 541 | 542 | texcoord = -texcoord * texcoord + texcoord; 543 | 544 | if( Vignette > 0) 545 | base.rgb *= saturate(texcoord.x * texcoord.y * pow(12.5f-Vignette,3)); 546 | 547 | return base; 548 | } 549 | 550 | float4 vignetteR(float2 texcoord) 551 | { 552 | float4 base; 553 | 554 | //Texture Rotation// 555 | //Converts the specified value from radians to degrees. 556 | float RD = radians(DEGREES().y), IVRR = IVRePosLR().y * pix.y, IHRR = IHRePosLR().y * pix.x; 557 | if (Tied_H_V) // only done on the right eye. 558 | { 559 | IVRR = IVRePosLR().x * pix.y; 560 | IHRR = IHRePosLR().x * pix.x; 561 | RD = radians(DEGREES().x); 562 | } 563 | //Tilt Right 564 | float2 Right_Tilt_Start = float2(Tilt_Control.x > 0 ? 1.0 : 0.0,0.5), Right_Tilt = float2(0.0, -Tilt_Control.x); 565 | texcoord = KeyStoneLight(texcoord * 2 - 1, Right_Tilt_Start * 2 - 1, Right_Tilt.x, Right_Tilt.y) * 0.5 + 0.5; 566 | 567 | //Texture Position 568 | texcoord.y += IVRR;//Independent Vertical Repostion Right. 569 | texcoord.x += IHRR;//Independent Horizontal Repostion Right. 570 | //Right 571 | float2 R_Rotationtexcoord = rotate(texcoord,float2(0.5,0.5), RD); 572 | //Texture Zoom & Aspect Ratio// 573 | float X = Z_A().x; 574 | float Y = Z_A().y * Z_A().x * 2; 575 | float midW = (X - 1)*(BUFFER_WIDTH*0.5)*pix.x; 576 | float midH = (Y - 1)*(BUFFER_HEIGHT*0.5)*pix.y; 577 | 578 | texcoord = float2((R_Rotationtexcoord.x*X)-midW,(R_Rotationtexcoord.y*Y)-midH); 579 | //Field of View 580 | float F = -F_o_V() + 1,HA = (F - 1)*(BUFFER_WIDTH*0.5)*pix.x; 581 | 582 | texcoord.x = (texcoord.x*F)-HA; 583 | //Normal HMDs IPD 584 | float IPDtexR = texcoord.x; 585 | if (!LD_IPD) // https://developers.google.com/vr/jump/rendering-ods-content.pdf Page 10 586 | IPDtexR += (IPDS()) * pix.x;// Left IPD 587 | //Texture Adjustment End// 588 | 589 | base = Right(float2(IPDtexR,texcoord.y)); 590 | 591 | if( Image_Aliment_Marker ) 592 | base = Cross_Marker(texcoord) ? float4(1.0,1.0,0.0,1) : base; //Yellow 593 | 594 | texcoord = -texcoord * texcoord + texcoord; 595 | 596 | if( Vignette > 0) 597 | base.rgb *= saturate(texcoord.x * texcoord.y * pow(12.5f-Vignette,3)); 598 | 599 | return base; 600 | } 601 | 602 | ////////////////////////////////////////////////////Polynomial_Distortion///////////////////////////////////////////////////// 603 | 604 | float2 D(float2 p, float k1, float k2) //Polynomial Lens Distortion Left & Right 605 | { 606 | // https://github.com/sobotka/blender/blob/master/intern/libmv/libmv/simple_pipeline/distortion_models.h#L66 607 | float r2 = p.x * p.x + p.y * p.y,r4 = pow(r2,2);//pow is faster 608 | //use this if you want to add K3. 609 | //float r6 = r4 * r2; 610 | //float newRadius = (1.0 + k1*r2 + k2*r4 + k3*r6); 611 | float newRadius = (1.0 + k1 * r2 + k2 * r4); 612 | p.x = p.x * newRadius; 613 | p.y = p.y * newRadius; 614 | float p1, p2; 615 | //p.x = p.x * newRadius + 2.0*p1*p.x*p.y + p2*(r2 + 2.0*p.x*p.x); 616 | //p.y = p.y * newRadius + 2.0*p2*p.x*p.y + p1*(r2 + 2.0*p.y*p.y); 617 | return p; 618 | } 619 | 620 | float4 PDL(float2 texcoord) //Texture = texCL Left 621 | { 622 | float4 color; 623 | float2 uv_red, uv_green, uv_blue, sectorOrigin; 624 | float4 color_red, color_green, color_blue; 625 | float K1_Red = P_C_A().x, K1_Green = P_C_A().y, K1_Blue = P_C_A().z; 626 | float K2_Red = P_C_B().x, K2_Green = P_C_B().y, K2_Blue = P_C_B().z; 627 | // Radial distort around center 628 | sectorOrigin = 0.5f; 629 | 630 | uv_red = D(texcoord.xy-sectorOrigin,K1_Red,K2_Red) + sectorOrigin; 631 | uv_green = D(texcoord.xy-sectorOrigin,K1_Green,K2_Green) + sectorOrigin; 632 | uv_blue = D(texcoord.xy-sectorOrigin,K1_Blue,K2_Blue) + sectorOrigin; 633 | 634 | color_red = vignetteL(uv_red).r; 635 | color_green = vignetteL(uv_green).g; 636 | color_blue = vignetteL(uv_blue).b; 637 | 638 | if( ((uv_red.x > 0) && (uv_red.x < 1) && (uv_red.y > 0) && (uv_red.y < 1))) 639 | { 640 | color = float4(color_red.x, color_green.y, color_blue.z, 1.0); 641 | } 642 | else 643 | { 644 | color = float4(0,0,0,1); 645 | } 646 | 647 | if( Lens_Aliment_Marker ) 648 | color = Cross_Marker(texcoord) ? float4(0.0,1.0,0.0,1) : color; //Green 649 | 650 | return color; 651 | } 652 | 653 | float4 PDR(float2 texcoord) //Texture = texCR Right 654 | { 655 | float4 color; 656 | float2 uv_red, uv_green, uv_blue, sectorOrigin; 657 | float4 color_red, color_green, color_blue; 658 | float K1_Red = P_C_A().x, K1_Green = P_C_A().y, K1_Blue = P_C_A().z; 659 | float K2_Red = P_C_B().x, K2_Green = P_C_B().y, K2_Blue = P_C_B().z; 660 | 661 | // Radial distort around center 662 | sectorOrigin = 0.5f; 663 | 664 | uv_red = D(texcoord.xy-sectorOrigin,K1_Red,K2_Red) + sectorOrigin; 665 | uv_green = D(texcoord.xy-sectorOrigin,K1_Green,K2_Green) + sectorOrigin; 666 | uv_blue = D(texcoord.xy-sectorOrigin,K1_Blue,K2_Blue) + sectorOrigin; 667 | 668 | color_red = vignetteR(uv_red).r; 669 | color_green = vignetteR(uv_green).g; 670 | color_blue = vignetteR(uv_blue).b; 671 | 672 | if( ((uv_red.x > 0) && (uv_red.x < 1) && (uv_red.y > 0) && (uv_red.y < 1))) 673 | { 674 | color = float4(color_red.x, color_green.y, color_blue.z, 1.0); 675 | } 676 | else 677 | { 678 | color = float4(0,0,0,1); 679 | } 680 | 681 | if( Lens_Aliment_Marker ) 682 | color = Cross_Marker(texcoord) ? float4(0.0,1.0,0.0,1) : color; //Green 683 | 684 | return color; 685 | 686 | } 687 | 688 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 689 | float4 PBD(float2 texcoord) 690 | { 691 | float4 Out; 692 | //For Cell HMDs 693 | float IPDtexL = texcoord.x, IPDtexR = texcoord.x; 694 | 695 | if (LD_IPD) // https://developers.google.com/vr/jump/rendering-ods-content.pdf Page 10 696 | { 697 | IPDtexL -= (IPDS() * 0.5) * pix.x;// Left IPD 698 | IPDtexR += (IPDS() * 0.5) * pix.x;// Right IPD 699 | } 700 | 701 | if( Stereoscopic_Mode_Convert == 0 || Stereoscopic_Mode_Convert == 1|| Stereoscopic_Mode_Convert == 5) 702 | Out = texcoord.x < 0.5 ? PDL(float2(IPDtexL*2,texcoord.y)) : PDR(float2(IPDtexR*2-1,texcoord.y)); 703 | else if (Stereoscopic_Mode_Convert == 2 || Stereoscopic_Mode_Convert == 3 ) 704 | Out = texcoord.y < 0.5 ? PDL(float2(IPDtexL,texcoord.y*2)) : PDR(float2(IPDtexR,texcoord.y*2-1)); 705 | else if (Stereoscopic_Mode_Convert == 4 ) 706 | Out = PDL(float2(IPDtexL ,texcoord.y)); 707 | 708 | return Out; 709 | } 710 | #if Enable_AA_Filter 711 | float LI(in float3 value) 712 | { 713 | return dot(value.rgb,float3(0.333, 0.333, 0.333)); 714 | } 715 | 716 | void NFAA(float4 position : SV_Position, float2 texcoord : TEXCOORD, out float4 NFAA : SV_Target0) 717 | { 718 | float3 t, l, r, d; 719 | float2 UV = texcoord.xy, SW = pix, n; 720 | float nl, Mask; //Useing the AA samples for sharpen. 721 | t = tex2D( BackBuffer, float2( UV.x , UV.y - SW.y ) ).rgb; 722 | l = tex2D( BackBuffer, float2( UV.x - SW.x , UV.y ) ).rgb; 723 | r = tex2D( BackBuffer, float2( UV.x + SW.x , UV.y ) ).rgb; 724 | d = tex2D( BackBuffer, float2( UV.x , UV.y + SW.y ) ).rgb; 725 | n = float2(LI(t) - LI(d), LI(r) - LI(l)); 726 | 727 | nl = length(n); 728 | Mask = nl * 0.5f; 729 | 730 | if (Mask > 0.025f) 731 | Mask = 1-Mask; 732 | else 733 | Mask = 1; 734 | 735 | Mask = saturate(lerp(Mask,1,-6.25f)); 736 | 737 | if (NFAA_TOGGLE) 738 | { 739 | if (nl < (1.0 / 16)) 740 | { 741 | NFAA = tex2D(BackBuffer,UV); 742 | } 743 | else 744 | { 745 | n *= pix / (nl * 0.5f); 746 | 747 | float4 o = tex2D( BackBuffer, UV ), 748 | t0 = tex2D( BackBuffer, UV + n * 0.5f) * 0.9f, 749 | t1 = tex2D( BackBuffer, UV - n * 0.5f) * 0.9f, 750 | t2 = tex2D( BackBuffer, UV + n) * 0.75f, 751 | t3 = tex2D( BackBuffer, UV - n) * 0.75f; 752 | 753 | NFAA = (o + t0 + t1 + t2 + t3) / 4.3f; 754 | } 755 | 756 | NFAA = lerp(NFAA,tex2D( BackBuffer,UV), Mask ); 757 | 758 | } 759 | else 760 | { 761 | NFAA = tex2D( BackBuffer,UV); 762 | } 763 | 764 | float greyscale = dot(NFAA.rgb, float3(0.2125, 0.7154, 0.0721)); 765 | NFAA.rgb = lerp(greyscale, NFAA.rgb, Saturation + 1.0); 766 | 767 | NFAA = float4(NFAA.rgb,Mask); 768 | } 769 | #endif 770 | #if Enable_Sharpen_Filter 771 | void USM(float4 position : SV_Position, float2 texcoord : TEXCOORD,out float4 result : SV_Target0) 772 | { 773 | float SP = Sharpen_Power; 774 | 775 | float2 tex_offset = pix; // Gets texel offset 776 | result = tex2D(BackBuffer, float2(texcoord)); 777 | if(Sharpen_Power > 0) 778 | { 779 | result += tex2D(BackBuffer, float2(texcoord + float2( 1, 0) * tex_offset)); 780 | result += tex2D(BackBuffer, float2(texcoord + float2(-1, 0) * tex_offset)); 781 | result += tex2D(BackBuffer, float2(texcoord + float2( 0, 1) * tex_offset)); 782 | result += tex2D(BackBuffer, float2(texcoord + float2( 0,-1) * tex_offset)); 783 | tex_offset *= 0.75; 784 | result += tex2D(BackBuffer, float2(texcoord + float2( 1, 1) * tex_offset)); 785 | result += tex2D(BackBuffer, float2(texcoord + float2(-1,-1) * tex_offset)); 786 | result += tex2D(BackBuffer, float2(texcoord + float2( 1,-1) * tex_offset)); 787 | result += tex2D(BackBuffer, float2(texcoord + float2(-1, 1) * tex_offset)); 788 | result /= 9; 789 | 790 | result = tex2D(BackBuffer, texcoord) + ( tex2D(BackBuffer, texcoord) - result ) * SP; 791 | result = lerp(tex2D(BackBuffer, texcoord) ,result,tex2D(BackBuffer, texcoord).w); 792 | } 793 | } 794 | #endif 795 | 796 | ////////////////////////////////////////////////////////Logo///////////////////////////////////////////////////////////////////////// 797 | uniform float timer < source = "timer"; >; 798 | 799 | float4 Out(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 800 | { 801 | float PosX = 0.5*BUFFER_WIDTH*pix.x,PosY = 0.5*BUFFER_HEIGHT*pix.y; 802 | float4 Color = PBD(texcoord),Done,Website,D,E,P,T,H,Three,DD,Dot,I,N,F,O; 803 | 804 | if(timer <= 10000) 805 | { 806 | //DEPTH 807 | //D 808 | float PosXD = -0.035+PosX, offsetD = 0.001; 809 | float4 OneD = all( abs(float2( texcoord.x -PosXD, texcoord.y-PosY)) < float2(0.0025,0.009)); 810 | float4 TwoD = all( abs(float2( texcoord.x -PosXD-offsetD, texcoord.y-PosY)) < float2(0.0025,0.007)); 811 | D = OneD-TwoD; 812 | 813 | //E 814 | float PosXE = -0.028+PosX, offsetE = 0.0005; 815 | float4 OneE = all( abs(float2( texcoord.x -PosXE, texcoord.y-PosY)) < float2(0.003,0.009)); 816 | float4 TwoE = all( abs(float2( texcoord.x -PosXE-offsetE, texcoord.y-PosY)) < float2(0.0025,0.007)); 817 | float4 ThreeE = all( abs(float2( texcoord.x -PosXE, texcoord.y-PosY)) < float2(0.003,0.001)); 818 | E = (OneE-TwoE)+ThreeE; 819 | 820 | //P 821 | float PosXP = -0.0215+PosX, PosYP = -0.0025+PosY, offsetP = 0.001, offsetP1 = 0.002; 822 | float4 OneP = all( abs(float2( texcoord.x -PosXP, texcoord.y-PosYP)) < float2(0.0025,0.009*0.682)); 823 | float4 TwoP = all( abs(float2( texcoord.x -PosXP-offsetP, texcoord.y-PosYP)) < float2(0.0025,0.007*0.682)); 824 | float4 ThreeP = all( abs(float2( texcoord.x -PosXP+offsetP1, texcoord.y-PosY)) < float2(0.0005,0.009)); 825 | P = (OneP-TwoP) + ThreeP; 826 | 827 | //T 828 | float PosXT = -0.014+PosX, PosYT = -0.008+PosY; 829 | float4 OneT = all( abs(float2( texcoord.x -PosXT, texcoord.y-PosYT)) < float2(0.003,0.001)); 830 | float4 TwoT = all( abs(float2( texcoord.x -PosXT, texcoord.y-PosY)) < float2(0.000625,0.009)); 831 | T = OneT+TwoT; 832 | 833 | //H 834 | float PosXH = -0.0071+PosX; 835 | float4 OneH = all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.002,0.001)); 836 | float4 TwoH = all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.002,0.009)); 837 | float4 ThreeH = all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.003,0.009)); 838 | H = (OneH-TwoH)+ThreeH; 839 | 840 | //Three 841 | float offsetFive = 0.001, PosX3 = -0.001+PosX; 842 | float4 OneThree = all( abs(float2( texcoord.x -PosX3, texcoord.y-PosY)) < float2(0.002,0.009)); 843 | float4 TwoThree = all( abs(float2( texcoord.x -PosX3 - offsetFive, texcoord.y-PosY)) < float2(0.003,0.007)); 844 | float4 ThreeThree = all( abs(float2( texcoord.x -PosX3, texcoord.y-PosY)) < float2(0.002,0.001)); 845 | Three = (OneThree-TwoThree)+ThreeThree; 846 | 847 | //DD 848 | float PosXDD = 0.006+PosX, offsetDD = 0.001; 849 | float4 OneDD = all( abs(float2( texcoord.x -PosXDD, texcoord.y-PosY)) < float2(0.0025,0.009)); 850 | float4 TwoDD = all( abs(float2( texcoord.x -PosXDD-offsetDD, texcoord.y-PosY)) < float2(0.0025,0.007)); 851 | DD = OneDD-TwoDD; 852 | 853 | //Dot 854 | float PosXDot = 0.011+PosX, PosYDot = 0.008+PosY; 855 | float4 OneDot = all( abs(float2( texcoord.x -PosXDot, texcoord.y-PosYDot)) < float2(0.00075,0.0015)); 856 | Dot = OneDot; 857 | 858 | //INFO 859 | //I 860 | float PosXI = 0.0155+PosX, PosYI = 0.004+PosY, PosYII = 0.008+PosY; 861 | float4 OneI = all( abs(float2( texcoord.x - PosXI, texcoord.y - PosY)) < float2(0.003,0.001)); 862 | float4 TwoI = all( abs(float2( texcoord.x - PosXI, texcoord.y - PosYI)) < float2(0.000625,0.005)); 863 | float4 ThreeI = all( abs(float2( texcoord.x - PosXI, texcoord.y - PosYII)) < float2(0.003,0.001)); 864 | I = OneI+TwoI+ThreeI; 865 | 866 | //N 867 | float PosXN = 0.0225+PosX, PosYN = 0.005+PosY,offsetN = -0.001; 868 | float4 OneN = all( abs(float2( texcoord.x - PosXN, texcoord.y - PosYN)) < float2(0.002,0.004)); 869 | float4 TwoN = all( abs(float2( texcoord.x - PosXN, texcoord.y - PosYN - offsetN)) < float2(0.003,0.005)); 870 | N = OneN-TwoN; 871 | 872 | //F 873 | float PosXF = 0.029+PosX, PosYF = 0.004+PosY, offsetF = 0.0005, offsetF1 = 0.001; 874 | float4 OneF = all( abs(float2( texcoord.x -PosXF-offsetF, texcoord.y-PosYF-offsetF1)) < float2(0.002,0.004)); 875 | float4 TwoF = all( abs(float2( texcoord.x -PosXF, texcoord.y-PosYF)) < float2(0.0025,0.005)); 876 | float4 ThreeF = all( abs(float2( texcoord.x -PosXF, texcoord.y-PosYF)) < float2(0.0015,0.00075)); 877 | F = (OneF-TwoF)+ThreeF; 878 | 879 | //O 880 | float PosXO = 0.035+PosX, PosYO = 0.004+PosY; 881 | float4 OneO = all( abs(float2( texcoord.x -PosXO, texcoord.y-PosYO)) < float2(0.003,0.005)); 882 | float4 TwoO = all( abs(float2( texcoord.x -PosXO, texcoord.y-PosYO)) < float2(0.002,0.003)); 883 | O = OneO-TwoO; 884 | } 885 | 886 | Website = D+E+P+T+H+Three+DD+Dot+I+N+F+O ? float4(1.0,1.0,1.0,1) : Color; 887 | 888 | if(timer >= 10000) 889 | { 890 | Done = Color; 891 | } 892 | else 893 | { 894 | Done = Website; 895 | } 896 | 897 | return Done; 898 | } 899 | 900 | ///////////////////////////////////////////////////////////ReShade.fxh///////////////////////////////////////////////////////////// 901 | 902 | // Vertex shader generating a triangle covering the entire screen 903 | void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD) 904 | { 905 | texcoord.x = (id == 2) ? 2.0 : 0.0; 906 | texcoord.y = (id == 1) ? 2.0 : 0.0; 907 | position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 908 | } 909 | 910 | //*Rendering passes*// 911 | #if TOGGLE 912 | technique Polynomial_Barrel_Distortion_P 913 | #else 914 | technique Polynomial_Barrel_Distortion_S 915 | #endif 916 | { 917 | #if Enable_AA_Filter 918 | pass AA_Filter 919 | { 920 | VertexShader = PostProcessVS; 921 | PixelShader = NFAA; 922 | } 923 | #endif 924 | #if Enable_Sharpen_Filter 925 | pass UnSharpMask_Filter 926 | { 927 | VertexShader = PostProcessVS; 928 | PixelShader = USM; 929 | } 930 | #endif 931 | pass PBD 932 | { 933 | VertexShader = PostProcessVS; 934 | PixelShader = Out; 935 | } 936 | } 937 | -------------------------------------------------------------------------------- /Other Shaders/SuperDepth3D_WoWvx.fx: -------------------------------------------------------------------------------- 1 | ////----------------------// 2 | ///**SuperDepth3D_WoWvx**/// 3 | //----------------------//// 4 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 5 | //* Depth Map Based 2D + 3D Shader v3.0.0 6 | //* For Reshade 3.0+ 7 | //* --------------------------------- 8 | //* 9 | //* Original work was based on the shader code by me. The WoWvx stuff was reversed engineered I never had access to the original code. 10 | //* Text rendering code Ported from https://www.shadertoy.com/view/4dtGD2 by Hamneggs to ReshadeFX used for error codes. 11 | //* If I missed any information please contact me so I can make corrections. 12 | //* 13 | //* LICENSE 14 | //* ============ 15 | //* Overwatch Interceptor & Code out side the work of people mention above is licenses under: Copyright (C) Depth3D - All Rights Reserved 16 | //* 17 | //* Unauthorized copying of this file, via any medium is strictly prohibited 18 | //* Proprietary and confidential. 19 | //* 20 | //* You are allowed to obviously download this and use this for your personal use. 21 | //* Just don't redistribute this file unless I authorize it. 22 | //* 23 | //* Have fun, 24 | //* Written by Jose Negrete AKA BlueSkyDefender , December 2019 25 | //* 26 | //* Please feel free to contact me if you want to use this in your project. 27 | //* https://github.com/BlueSkyDefender/Depth3D 28 | //* http://reshade.me/forum/shader-presentation/2128-sidebyside-3d-depth-map-based-stereoscopic-shader 29 | //* https://discord.gg/Q2n97Uj 30 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 31 | #if exists "Overwatch.fxh" //Overwatch Interceptor// 32 | #include "Overwatch.fxh" 33 | #define OSW 0 34 | #else// DA_X = [ZPD] DA_Y = [Depth Adjust] DA_Z = [Offset] DA_W = [Depth Linearization] 35 | static const float DA_X = 0.025, DA_Y = 7.5, DA_Z = 0.0, DA_W = 0.0; 36 | // DB_X = [Depth Flip] DB_Y = [Auto Balance] DB_Z = [Auto Depth] DB_W = [Weapon Hand] 37 | static const float DB_X = 0, DB_Y = 0, DB_Z = 0.1, DB_W = 0.0; 38 | // DC_X = [Barrel Distortion K1] DC_Y = [Barrel Distortion K2] DC_Z = [Barrel Distortion K3] DC_W = [Barrel Distortion Zoom] 39 | static const float DC_X = 0, DC_Y = 0, DC_Z = 0, DC_W = 0; 40 | // DD_X = [Horizontal Size] DD_Y = [Vertical Size] DD_Z = [Horizontal Position] DD_W = [Vertical Position] 41 | static const float DD_X = 1, DD_Y = 1, DD_Z = 0.0, DD_W = 0.0; 42 | // DE_X = [ZPD Boundary Type] DE_Y = [ZPD Boundary Scaling] DE_Z = [ZPD Boundary Fade Time] DE_W = [Weapon Near Depth Max] 43 | static const float DE_X = 0, DE_Y = 0.5, DE_Z = 0.25, DE_W = 0.0; 44 | // DF_X = [Weapon ZPD Boundary] DF_Y = [Separation] DF_Z = [ZPD Balance] DF_W = [HUD] 45 | static const float DF_X = 0.0, DF_Y = 0.0, DF_Z = 0.125, DF_W = 0.0; 46 | // DG_X = [Special Depth X] DG_Y = [Special Depth Y] DG_Z = [Weapon Near Depth Min] DG_W = [Check Depth Limit] 47 | static const float DG_X = 0.0, DG_Y = 0.0, DG_Z = 0.0, DG_W = 0.0; 48 | // DH_X = [LBC Size Offset X] DH_Y = [LBC Size Offset Y] DH_Z = [LBC Pos Offset X] DH_W = [LBC Pos Offset X] 49 | static const float DH_X = 1.0, DH_Y = 1.0, DH_Z = 0.0, DH_W = 0.0; 50 | // DI_X = [LBM Offset X] DI_Y = [LBM Offset Y] DI_Z = [Weapon Near Depth Trim] DI_W = [REF Check Depth Limit] 51 | static const float DI_X = 0.0, DI_Y = 0.0, DI_Z = 0.25, DI_W = 0.0; 52 | // DJ_X = [NULL X] DJ_Y = [NULL Y] DJ_Z = [NULL Z] DJ_W = [Check Depth Limit Weapon] 53 | static const float DJ_X = 0.0, DJ_Y = 0.0, DJ_Z = 0.25, DJ_W = -0.100; 54 | // DK_X = [FPS Focus Method] DK_Y = [Eye Eye Selection] DK_Z = [Eye Fade Selection] DK_W = [Eye Fade Speed Selection] 55 | static const float DK_X = 0, DK_Y = 0.0, DK_Z = 0, DK_W = 0; 56 | // WSM = [Weapon Setting Mode] 57 | #define OW_WP "WP Off\0Custom WP\0" 58 | static const int WSM = 0; 59 | //Triggers 60 | static const int REF = 0, NCW = 0, RHW = 0, NPW = 0, IDF = 0, SPF = 0, BDF = 0, HMT = 0, DFW = 0, NFM = 0, DSW = 0, BMT = 0, LBC = 0, LBM = 0, DAA = 0, NDW = 0, PEW = 0, WPW = 0, FOV = 0, EDW = 0, SDT = 0; 61 | //Overwatch.fxh State 62 | #define OSW 1 63 | #endif 64 | //USER EDITABLE PREPROCESSOR FUNCTIONS START// 65 | 66 | // Zero Parallax Distance Balance Mode allows you to switch control from manual to automatic and vice versa. 67 | #define Balance_Mode 1 //Default 0 is Automatic. One is Manual. 68 | 69 | // RE Fix is used to fix the issue with Resident Evil's 2 Remake 1-Shot cutscenes. 70 | #define RE_Fix 0 //Default 0 is Off. One is High and Ten is Low 1-10 71 | 72 | // Change the Cancel Depth Key. Determines the Cancel Depth Toggle Key using keycode info 73 | // The Key Code for Decimal Point is Number 110. Ex. for Numpad Decimal "." Cancel_Depth_Key 110 74 | #define Cancel_Depth_Key 0 // You can use http://keycode.info/ to figure out what key is what. 75 | 76 | // Rare Games like Among the Sleep Need this to be turned on. 77 | #define Invert_Depth 0 //Default 0 is Off. One is On. 78 | 79 | // Barrel Distortion Correction For SuperDepth3D for non conforming BackBuffer. 80 | #define BD_Correction 0 //Default 0 is Off. One is On. 81 | 82 | // Horizontal & Vertical Depth Buffer Resize for non conforming DepthBuffer. 83 | // Also used to enable Image Position Adjust is used to move the Z-Buffer around. 84 | #define DB_Size_Position 0 //Default 0 is Off. One is On. 85 | 86 | // Auto Letter Box Correction 87 | #define LB_Correction 0 //[Zero is Off] [One is Auto Hoz] [Two is Auto Vert] 88 | // Auto Letter Box Masking 89 | #define LetterBox_Masking 0 //[Zero is Off] [One is Auto Hoz] [Two is Auto Vert] 90 | 91 | // Specialized Depth Triggers 92 | #define SD_Trigger 0 //Default is off. One is Mode A other Modes not added yet. 93 | 94 | // HUD Mode is for Extra UI MASK and Basic HUD Adjustments. This is useful for UI elements that are drawn in the Depth Buffer. 95 | // Such as the game Naruto Shippuden: Ultimate Ninja, TitanFall 2, and or Unreal Gold 277. That have this issue. This also allows for more advance users 96 | // Too Make there Own UI MASK if need be. 97 | // You need to turn this on to use UI Masking options Below. 98 | #define HUD_MODE 0 // Set this to 1 if basic HUD items are drawn in the depth buffer to be adjustable. 99 | 100 | // -=UI Mask Texture Mask Interceptor=- This is used to set Two UI Masks for any game. Keep this in mind when you enable UI_MASK. 101 | // You Will have to create Three PNG Textures named DM_Mask_A.png & DM_Mask_B.png with transparency for this option. 102 | // They will also need to be the same resolution as what you have set for the game and the color black where the UI is. 103 | // This is needed for games like RTS since the UI will be set in depth. This corrects this issue. 104 | #if ((exists "DM_Mask_A.png") || (exists "DM_Mask_B.png")) 105 | #define UI_MASK 1 106 | #else 107 | #define UI_MASK 0 108 | #endif 109 | // To cycle through the textures set a Key. The Key Code for "n" is Key Code Number 78. 110 | #define Set_Key_Code_Here 0 // You can use http://keycode.info/ to figure out what key is what. 111 | // Texture EX. Before |::::::::::| After |**********| 112 | // |::: | |*** | 113 | // |:::_______| |***_______| 114 | // So :::: are UI Elements in game. The *** is what the Mask needs to cover up. 115 | // The game part needs to be transparent and the UI part needs to be black. 116 | 117 | // The Key Code for the mouse is 0-4 key 1 is right mouse button. 118 | #define Cursor_Lock_Key 4 // Set default on mouse 4 119 | #define Fade_Key 1 // Set default on mouse 1 120 | #define Fade_Time_Adjust 0.5625 // From 0 to 1 is the Fade Time adjust for this mode. Default is 0.5625; 121 | 122 | // Delay Frame for instances the depth bufferis 1 frame behind useful for games that need "Copy Depth Buffer 123 | // Before Clear Operation," Is checked in the API Depth Buffer tab in ReShade. 124 | #define D_Frame 0 //This should be set to 0 most of the times this will cause latency by one frame. 125 | 126 | //Text Information Key Default Menu Key 127 | #define Text_Info_Key 93 128 | 129 | //This is to enable manual control over the Lens angle in degrees uses this to set the angle below for "Set_Degrees" 130 | #define Lenticular_Degrees 0 131 | #define Set_Degrees 12.5625 //This is set to my default and may/will not work for your screen. 132 | 133 | //USER EDITABLE PREPROCESSOR FUNCTIONS END// 134 | #if !defined(__RESHADE__) || __RESHADE__ < 40000 135 | #define Compatibility 1 136 | #else 137 | #define Compatibility 0 138 | #endif 139 | 140 | #if __RESHADE__ >= 40300 141 | #define Compatibility_DD 1 142 | #else 143 | #define Compatibility_DD 0 144 | #endif 145 | //FreePie Compatibility 146 | #if __RESHADE__ >= 40600 147 | #if __RESHADE__ > 40700 148 | #define Compatibility_FP 2 149 | #else 150 | #define Compatibility_FP 1 151 | #endif 152 | #else 153 | #define Compatibility_FP 0 154 | #endif 155 | 156 | //Flip Depth for OpenGL and Reshade 5.0 since older Profiles Need this. 157 | #if __RESHADE__ >= 50000 && __RENDERER__ >= 0x10000 && __RENDERER__ <= 0x20000 158 | #define Flip_Opengl_Depth 1 159 | #else 160 | #define Flip_Opengl_Depth 0 161 | #endif 162 | 163 | #if __VENDOR__ == 0x10DE //AMD = 0x1002 //Nv = 0x10DE //Intel = ??? 164 | #define Ven 1 165 | #else 166 | #define Ven 0 167 | #endif 168 | //Resolution Scaling because I can't tell your monitor size. 169 | #if (BUFFER_HEIGHT <= 720) 170 | #define Max_Divergence 25.0 171 | #define Set_Divergence 12.5 172 | #elif (BUFFER_HEIGHT <= 1080) 173 | #define Max_Divergence 50.0 174 | #define Set_Divergence 25.0 175 | #elif (BUFFER_HEIGHT <= 1440) 176 | #define Max_Divergence 75.0 177 | #define Set_Divergence 37.5 178 | #elif (BUFFER_HEIGHT <= 2160) 179 | #define Max_Divergence 100.0 180 | #define Set_Divergence 50.0 181 | #else 182 | #define Max_Divergence 125.0//Wow Must be the future and 8K Plus is normal now. If you are hear use AI infilling...... Future person. 183 | #define Set_Divergence 62.5 184 | #endif //With love <3 Jose Negrete.. 185 | //New ReShade PreProcessor stuff 186 | #if UI_MASK 187 | #ifndef Mask_Cycle_Key 188 | #define Mask_Cycle_Key Set_Key_Code_Here 189 | #endif 190 | #else 191 | #define Mask_Cycle_Key Set_Key_Code_Here 192 | #endif 193 | //Divergence & Convergence// 194 | uniform int Content < 195 | ui_type = "combo"; 196 | ui_items = "NoDepth\0Reserved\0Still\0CGI\0Game\0Movie\0Signage\0"; 197 | ui_label = "·Content Type·"; 198 | ui_tooltip = "Content Type for WOWvx."; 199 | ui_category = "WoWvx Settings"; 200 | > = 0; 201 | 202 | uniform bool Signage_Flip < 203 | ui_label = " Signage Position"; 204 | ui_tooltip = "Set Signage Upper Left or Bottom Left."; 205 | ui_category = "WoWvx Settings"; 206 | > = false; 207 | 208 | uniform int Perspective < 209 | ui_type = "drag"; 210 | ui_min = -100; ui_max = 100; 211 | ui_label = " Perspective Slider"; 212 | ui_tooltip = "Determines the perspective point of the two images this shader produces.\n" 213 | "For an HMD, use Polynomial Barrel Distortion shader to adjust for IPD.\n" 214 | "Do not use this perspective adjustment slider to adjust for IPD.\n" 215 | "Default is Zero."; 216 | ui_category = "Stereoscopic Options"; 217 | > = 0; 218 | 219 | uniform float2 ZPD_Separation < 220 | ui_type = "drag"; 221 | ui_min = 0.0; ui_max = 0.250; 222 | ui_label = " ZPD & Sepration"; 223 | ui_tooltip = "Zero Parallax Distance controls the focus distance for the screen Pop-out effect also known as Convergence.\n" 224 | "Separation is a way to increase the intensity of Divergence without a performance cost.\n" 225 | "For FPS Games keeps this low Since you don't want your gun to pop out of screen.\n" 226 | "Default is 0.025, Zero is off."; 227 | ui_category = "Stereoscopic Options"; 228 | > = float2(DA_X,0.0); 229 | 230 | #if Balance_Mode || BMT 231 | uniform float ZPD_Balance < 232 | ui_type = "drag"; 233 | ui_min = 0.0; ui_max = 1.0; 234 | ui_label = " ZPD Balance"; 235 | ui_tooltip = "Zero Parallax Distance balances between ZPD Depth and Scene Depth.\n" 236 | "Default is Zero is full Convergence and One is Full Depth."; 237 | ui_category = "Stereoscopic Options"; 238 | > = DF_Z; 239 | 240 | static const int Auto_Balance_Ex = 0; 241 | #else 242 | uniform int Auto_Balance_Ex < 243 | #if Compatibility 244 | ui_type = "drag"; 245 | #else 246 | ui_type = "slider"; 247 | #endif 248 | ui_min = 0; ui_max = 5; 249 | ui_label = " Auto Balance"; 250 | ui_tooltip = "Automatically Balance between ZPD Depth and Scene Depth.\n" 251 | "Default is Off."; 252 | ui_category = "Stereoscopic Options"; 253 | > = DB_Y; 254 | #endif 255 | uniform int ZPD_Boundary < 256 | ui_type = "combo"; 257 | ui_items = "BD0 Off\0BD1 Full\0BD2 Narrow\0BD3 Wide\0BD4 FPS Center\0BD5 FPS Narrow\0BD6 FPS Edge\0BD7 FPS Mixed\0"; 258 | ui_label = " ZPD Boundary Detection"; 259 | ui_tooltip = "This selection menu gives extra boundary conditions to ZPD.\n" 260 | "This treats your screen as a virtual wall.\n" 261 | "Default is Off."; 262 | ui_category = "Stereoscopic Options"; 263 | > = DE_X; 264 | 265 | uniform float2 ZPD_Boundary_n_Fade < 266 | #if Compatibility 267 | ui_type = "drag"; 268 | #else 269 | ui_type = "slider"; 270 | #endif 271 | ui_min = 0.0; ui_max = 0.5; 272 | ui_label = " ZPD Boundary & Fade Time"; 273 | ui_tooltip = "This selection menu gives extra boundary conditions to scale ZPD & lets you adjust Fade time."; 274 | ui_category = "Stereoscopic Options"; 275 | > = float2(DE_Y,DE_Z); 276 | 277 | uniform int View_Mode < 278 | ui_type = "combo"; 279 | ui_items = "VM0 Linear\0VM1 Point\0"; 280 | ui_label = "·View Mode·"; 281 | ui_tooltip = "Changes the way the shader fills in the occlude sections in the image.\n" 282 | "Default is Linear."; 283 | ui_category = "Occlusion Masking"; 284 | > = 0; 285 | 286 | uniform float Max_Depth < 287 | #if Compatibility 288 | ui_type = "drag"; 289 | #else 290 | ui_type = "slider"; 291 | #endif 292 | ui_min = 0.5; ui_max = 1.0; 293 | ui_label = " Max Depth"; 294 | ui_tooltip = "Max Depth lets you clamp the max depth range of your scene.\n" 295 | "So it's not hard on your eyes looking off in to the distance .\n" 296 | "Default and starts at One and it's Off."; 297 | ui_category = "Occlusion Masking"; 298 | > = 1.0; 299 | 300 | uniform float Lower_Depth_Res < 301 | #if Compatibility 302 | ui_type = "drag"; 303 | #else 304 | ui_type = "slider"; 305 | #endif 306 | ui_min = 0.0; ui_max = 1.0; 307 | ui_label = " View Mode Res"; 308 | ui_tooltip = "Default and starts at Zero and it's Off."; 309 | ui_category = "Occlusion Masking"; 310 | > = 0; 311 | 312 | uniform float Depth_Edge_Mask < 313 | #if Compatibility 314 | ui_type = "drag"; 315 | #else 316 | ui_type = "slider"; 317 | #endif 318 | ui_min = -0.125; ui_max = 1.5; 319 | ui_label = "·Edge Mask·"; 320 | ui_tooltip = "Use this to adjust for artifacts from a lower resolution Depth Buffer.\n" 321 | "Default is Zero, Off"; 322 | ui_category = "Occlusion Masking"; 323 | > = 0.0; 324 | 325 | uniform float DLSS_FSR_Offset < 326 | #if Compatibility 327 | ui_type = "drag"; 328 | #else 329 | ui_type = "slider"; 330 | #endif 331 | ui_min = 0.0; ui_max = 4.0; 332 | ui_label = " Upscailer Offset"; 333 | ui_tooltip = "This Offset is for non conforming ZBuffer Postion witch is normaly 1 pixel wide.\n" 334 | "This issue only happens sometimes when using things like DLSS or FSR.\n" 335 | "This does not solve for TAA artifacts like Jittering or smearing.\n" 336 | "Default and starts at Zero and it's Off. With a max offset of 4pixels Wide."; 337 | ui_category = "Occlusion Masking"; 338 | > = 0; 339 | 340 | uniform int Depth_Map < 341 | ui_type = "combo"; 342 | ui_items = "DM0 Normal\0DM1 Reversed\0"; 343 | ui_label = "·Depth Map Selection·"; 344 | ui_tooltip = "Linearization for the zBuffer also known as Depth Map.\n" 345 | "DM0 is Z-Normal and DM1 is Z-Reversed.\n"; 346 | ui_category = "Depth Map"; 347 | > = DA_W; 348 | 349 | uniform float Depth_Map_Adjust < 350 | ui_type = "drag"; 351 | ui_min = 1.0; ui_max = 250.0; ui_step = 0.125; 352 | ui_label = " Depth Map Adjustment"; 353 | ui_tooltip = "This allows for you to adjust the DM precision.\n" 354 | "Adjust this to keep it as low as possible.\n" 355 | "Default is 7.5"; 356 | ui_category = "Depth Map"; 357 | > = DA_Y; 358 | 359 | uniform float Offset < 360 | ui_type = "drag"; 361 | ui_min = -1.0; ui_max = 1.0; 362 | ui_label = " Depth Map Offset"; 363 | ui_tooltip = "Depth Map Offset is for non conforming ZBuffer.\n" 364 | "It,s rare if you need to use this in any game.\n" 365 | "Use this to make adjustments to DM 0 or DM 1.\n" 366 | "Default and starts at Zero and it's Off."; 367 | ui_category = "Depth Map"; 368 | > = DA_Z; 369 | 370 | uniform float Auto_Depth_Adjust < 371 | ui_type = "drag"; 372 | ui_min = 0.0; ui_max = 0.625; 373 | ui_label = " Auto Depth Adjust"; 374 | ui_tooltip = "Automatically scales depth so it fights out of game menu pop out.\n" 375 | "Default is 0.1f, Zero is off."; 376 | ui_category = "Depth Map"; 377 | > = DB_Z; 378 | 379 | uniform int Depth_Detection < 380 | ui_type = "combo"; 381 | #if Compatibility_DD 382 | ui_items = "Off\0Detection +Sky\0Detection -Sky\0ReShade's Detection\0"; 383 | #else 384 | ui_items = "Off\0Detection +Sky\0Detection -Sky\0"; 385 | #endif 386 | ui_label = " Depth Detection"; 387 | ui_tooltip = "Use this to disable/enable in game Depth Detection."; 388 | ui_category = "Depth Map"; 389 | #if Compatibility_DD 390 | > = 3; 391 | #else 392 | > = 0; 393 | #endif 394 | uniform bool Depth_Map_Flip < 395 | ui_label = " Depth Map Flip"; 396 | ui_tooltip = "Flip the depth map if it is upside down."; 397 | ui_category = "Depth Map"; 398 | > = DB_X; 399 | #if DB_Size_Position || SPF == 2 || LB_Correction 400 | uniform float2 Horizontal_and_Vertical < 401 | ui_type = "drag"; 402 | ui_min = 0.0; ui_max = 2; 403 | ui_label = "·Horizontal & Vertical Size·"; 404 | ui_tooltip = "Adjust Horizontal and Vertical Resize. Default is 1.0."; 405 | ui_category = "Reposition Depth"; 406 | > = float2(DD_X,DD_Y); 407 | 408 | uniform float2 Image_Position_Adjust< 409 | ui_type = "drag"; 410 | ui_min = -1.0; ui_max = 1.0; 411 | ui_label = " Horizontal & Vertical Position"; 412 | ui_tooltip = "Adjust the Image Position if it's off by a bit. Default is Zero."; 413 | ui_category = "Reposition Depth"; 414 | > = float2(DD_Z,DD_W); 415 | 416 | #if LB_Correction 417 | uniform float2 H_V_Offset < 418 | ui_type = "drag"; 419 | ui_min = 0.0; ui_max = 2; 420 | ui_label = " Horizontal & Vertical Size Offset"; 421 | ui_tooltip = "Adjust Horizontal and Vertical Resize Offset for Letter Box Correction. Default is 1.0."; 422 | ui_category = "Reposition Depth"; 423 | > = float2(1.0,1.0); 424 | 425 | uniform float2 Image_Pos_Offset < 426 | ui_type = "drag"; 427 | ui_min = 0.0; ui_max = 2; 428 | ui_label = " Horizontal & Vertical Position Offset"; 429 | ui_tooltip = "Adjust the Image Position if it's off by a bit for Letter Box Correction. Default is Zero."; 430 | ui_category = "Reposition Depth"; 431 | > = float2(0.0,0.0); 432 | 433 | uniform bool LB_Correction_Switch < 434 | ui_label = " Letter Box Correction Toggle"; 435 | ui_tooltip = "Use this to turn off and on the correction when LetterBox Detection is active."; 436 | ui_category = "Reposition Depth"; 437 | > = true; 438 | #endif 439 | 440 | uniform bool Alinement_View < 441 | ui_label = " Alinement View"; 442 | ui_tooltip = "A Guide to help aline the Depth Buffer to the Image."; 443 | ui_category = "Reposition Depth"; 444 | > = false; 445 | #else 446 | static const bool Alinement_View = false; 447 | static const float2 Horizontal_and_Vertical = float2(DD_X,DD_Y); 448 | static const float2 Image_Position_Adjust = float2(DD_Z,DD_W); 449 | 450 | static const bool LB_Correction_Switch = true; 451 | static const float2 H_V_Offset = float2(DH_X,DH_Y); 452 | static const float2 Image_Pos_Offset = float2(DH_Z,DH_W); 453 | #endif 454 | //Weapon Hand Adjust// 455 | uniform int WP < 456 | ui_type = "combo"; 457 | ui_items = OW_WP; 458 | ui_label = "·Weapon Profiles·"; 459 | ui_tooltip = "Pick Weapon Profile for your game or make your own."; 460 | ui_category = "Weapon Hand Adjust"; 461 | > = DB_W; 462 | 463 | uniform float4 Weapon_Adjust < 464 | ui_type = "drag"; 465 | ui_min = 0.0; ui_max = 250.0; 466 | ui_label = " Weapon Hand Adjust"; 467 | ui_tooltip = "Adjust Weapon depth map for your games.\n" 468 | "X, CutOff Point used to set a different scale for first person hand apart from world scale.\n" 469 | "Y, Precision is used to adjust the first person hand in world scale.\n" 470 | "Z, Tuning is used to fine tune the precision adjustment above.\n" 471 | "W, Scale is used to compress or rescale the weapon.\n" 472 | "Default is float2(X 0.0, Y 0.0, Z 0.0, W 1.0)"; 473 | ui_category = "Weapon Hand Adjust"; 474 | > = float4(0.0,0.0,0.0,0.0); 475 | 476 | uniform float4 WZPD_and_WND < 477 | ui_type = "drag"; 478 | ui_min = 0.0; ui_max = 0.5; 479 | ui_label = " Weapon ZPD, Min, Max, & Trim"; 480 | ui_tooltip = "WZPD controls the focus distance for the screen Pop-out effect also known as Convergence for the weapon hand.\n" 481 | "Weapon ZPD Is for setting a Weapon Profile Convergence, so you should most of the time leave this Default.\n" 482 | "Weapon Min is used to adjust min weapon hand of the weapon hand when looking at the world near you.\n" 483 | "Weapon Max is used to adjust max weapon hand when looking out at a distance.\n" 484 | "Default is (ZPD X 0.03, Min Y 0.0, Max Z 0.0, Trim Z 0.250 ) & Zero is off."; 485 | ui_category = "Weapon Hand Adjust"; 486 | > = float4(0.03,DG_Z,DE_W,DI_Z); 487 | 488 | uniform float Weapon_ZPD_Boundary < 489 | ui_type = "slider"; 490 | ui_min = 0.0; ui_max = 0.5; 491 | ui_label = " Weapon Boundary Detection"; 492 | ui_tooltip = "This selection menu gives extra boundary conditions to WZPD."; 493 | ui_category = "Weapon Hand Adjust"; 494 | > = DF_X; 495 | #if HUD_MODE || HMT 496 | //Heads-Up Display 497 | uniform float2 HUD_Adjust < 498 | ui_type = "drag"; 499 | ui_min = 0.0; ui_max = 1.0; 500 | ui_label = "·HUD Mode·"; 501 | ui_tooltip = "Adjust HUD for your games.\n" 502 | "X, CutOff Point used to set a separation point between world scale and the HUD also used to turn HUD MODE On or Off.\n" 503 | "Y, Pushes or Pulls the HUD in or out of the screen if HUD MODE is on.\n" 504 | "This is only for UI elements that show up in the Depth Buffer.\n" 505 | "Default is float2(X 0.0, Y 0.5)"; 506 | ui_category = "Heads-Up Display"; 507 | > = float2(DF_W,0.5); 508 | #endif 509 | 510 | uniform int FPSDFIO < 511 | ui_type = "combo"; 512 | ui_items = "Off\0Press\0Hold\0"; 513 | ui_label = "·FPS Focus Depth·"; 514 | ui_tooltip = "This lets the shader handle real time depth reduction for aiming down your sights.\n" 515 | "This may induce Eye Strain so take this as an Warning."; 516 | ui_category = "FPS Focus"; 517 | > = DK_X; 518 | 519 | uniform int3 Eye_Fade_Reduction_n_Power < 520 | ui_type = "slider"; 521 | ui_min = 0; ui_max = 2; 522 | ui_label = " Eye Fade Options"; 523 | ui_tooltip ="X, Eye Selection: One is Right Eye only, Two is Left Eye Only, and Zero Both Eyes.\n" 524 | "Y, Fade Reduction: Decreases the depth amount by a current percentage.\n" 525 | "Z, Fade Speed: Decreases or Incresses how fast it changes.\n" 526 | "Default is X[ 0 ] Y[ 0 ] Z[ 1 ]."; 527 | ui_category = "FPS Focus"; 528 | > = int3(DK_Y,DK_Z,DK_W); 529 | 530 | //Cursor Adjustments 531 | uniform int Cursor_Type < 532 | ui_type = "combo"; 533 | ui_items = "Off\0FPS\0ALL\0RTS\0"; 534 | ui_label = "·Cursor Selection·"; 535 | ui_tooltip = "Choose the cursor type you like to use.\n" 536 | "Default is Zero."; 537 | ui_category = "Cursor Adjustments"; 538 | > = 0; 539 | 540 | uniform int3 Cursor_SC < 541 | ui_type = "drag"; 542 | ui_min = 0; ui_max = 10; 543 | ui_label = " Cursor Adjustments"; 544 | ui_tooltip = "This controlls the Size & Color.\n" 545 | "Defaults are ( X 1, Y 0, Z 0)."; 546 | ui_category = "Cursor Adjustments"; 547 | > = int3(1,0,0); 548 | 549 | uniform bool Cursor_Lock < 550 | ui_label = " Cursor Lock"; 551 | ui_tooltip = "Screen Cursor to Screen Crosshair Lock."; 552 | ui_category = "Cursor Adjustments"; 553 | > = false; 554 | #if BD_Correction 555 | uniform int BD_Options < 556 | ui_type = "combo"; 557 | ui_items = "On\0Off\0Guide\0"; 558 | ui_label = "·Distortion Options·"; 559 | ui_tooltip = "Use this to Turn Off, Turn On, & to use the BD Alinement Guide.\n" 560 | "Default is ON."; 561 | ui_category = "Distortion Corrections"; 562 | > = 0; 563 | uniform float3 Colors_K1_K2_K3 < 564 | #if Compatibility 565 | ui_type = "drag"; 566 | #else 567 | ui_type = "slider"; 568 | #endif 569 | ui_min = -2.0; ui_max = 2.0; 570 | ui_tooltip = "Adjust Distortions K1, K2, & K3.\n" 571 | "Default is 0.0"; 572 | ui_label = " Barrel Distortion K1 K2 K3 "; 573 | ui_category = "Distortion Corrections"; 574 | > = float3(DC_X,DC_Y,DC_Z); 575 | 576 | uniform float Zoom < 577 | ui_type = "drag"; 578 | ui_min = -0.5; ui_max = 0.5; 579 | ui_label = " Barrel Distortion Zoom"; 580 | ui_tooltip = "Adjust Distortions Zoom.\n" 581 | "Default is 0.0"; 582 | ui_category = "Distortion Corrections"; 583 | > = DC_W; 584 | #else 585 | #if BDF 586 | uniform bool BD_Options < 587 | ui_label = "·Toggle Barrel Distortion·"; 588 | ui_tooltip = "Use this if you modded the game to remove Barrel Distortion."; 589 | ui_category = "Distortion Corrections"; 590 | > = !true; 591 | #else 592 | static const int BD_Options = 1; 593 | #endif 594 | static const float3 Colors_K1_K2_K3 = float3(DC_X,DC_Y,DC_Z); 595 | static const float Zoom = DC_W; 596 | #endif 597 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 598 | uniform bool Cancel_Depth < source = "key"; keycode = Cancel_Depth_Key; toggle = true; mode = "toggle";>; 599 | uniform bool Mask_Cycle < source = "key"; keycode = Mask_Cycle_Key; toggle = true; mode = "toggle";>; 600 | uniform bool Text_Info < source = "key"; keycode = Text_Info_Key; toggle = true; mode = "toggle";>; 601 | uniform bool CLK < source = "mousebutton"; keycode = Cursor_Lock_Key; toggle = true; mode = "toggle";>; 602 | uniform bool Trigger_Fade_A < source = "mousebutton"; keycode = Fade_Key; toggle = true; mode = "toggle";>; 603 | uniform bool Trigger_Fade_B < source = "mousebutton"; keycode = Fade_Key;>; 604 | uniform float2 Mousecoords < source = "mousepoint"; > ; 605 | uniform float frametime < source = "frametime";>; 606 | uniform float timer < source = "timer"; >; 607 | #if Compatibility_FP 608 | uniform float3 motion[2] < source = "freepie"; index = 0; >; 609 | //. motion[0] is yaw, pitch, roll and motion[1] is x, y, z. In ReShade 4.8+ in ReShade 4.7 it is x = y / y = z 610 | //float3 FP_IO_Rot(){return motion[0];} 611 | float3 FP_IO_Pos() 612 | { 613 | #if Compatibility_FP == 1 614 | #warning "Autostereoscopic enhanced features need ReShade 4.8.0 and above." 615 | return motion[1].yzz; 616 | #elif Compatibility_FP == 2 617 | return motion[1]; 618 | #endif 619 | } 620 | #else 621 | //float3 FP_IO_Rot(){return 0;} 622 | float3 FP_IO_Pos(){return 0;} 623 | #warning "Autostereoscopic Need ReShade 4.6.0 and above." 624 | #endif 625 | 626 | static const float Auto_Balance_Clamp = 0.5; //This Clamps Auto Balance's max Distance. 627 | 628 | #if Compatibility_DD 629 | uniform bool DepthCheck < source = "bufready_depth"; >; 630 | #endif 631 | 632 | #define pix float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT) 633 | #define Res float2(BUFFER_WIDTH, BUFFER_HEIGHT) 634 | #define Per float2( (Perspective * pix.x) * 0.5, 0) //Per is Perspective 635 | #define AI Interlace_Anaglyph_Calibrate.x * 0.5 //Optimization for line interlaced Adjustment. 636 | #define ARatio (BUFFER_WIDTH / BUFFER_HEIGHT) 637 | 638 | 639 | float Scale(float val,float max,float min) //Scale to 0 - 1 640 | { 641 | return (val - min) / (max - min); 642 | } 643 | 644 | float fmod(float a, float b) 645 | { 646 | float c = frac(abs(a / b)) * abs(b); 647 | return a < 0 ? -c : c; 648 | } 649 | ///////////////////////////////////////////////////////////Conversions///////////////////////////////////////////////////////////// 650 | float3 RGBtoYCbCr(float3 rgb) // For Super3D a new Stereo3D output. 651 | { float TCoRF[1];//The Chronicles of Riddick: Assault on Dark Athena FIX I don't know why it works....... 652 | float Y = .299 * rgb.x + .587 * rgb.y + .114 * rgb.z; // Luminance 653 | float Cb = -.169 * rgb.x - .331 * rgb.y + .500 * rgb.z; // Chrominance Blue 654 | float Cr = .500 * rgb.x - .419 * rgb.y - .081 * rgb.z; // Chrominance Red 655 | return float3(Y,Cb + 128./255.,Cr + 128./255.); 656 | }//Code Not used for anything... 657 | ///////////////////////////////////////////////////////////////3D Starts Here/////////////////////////////////////////////////////////// 658 | texture DepthBufferTex : DEPTH; 659 | sampler DepthBuffer 660 | { 661 | Texture = DepthBufferTex; 662 | AddressU = CLAMP; 663 | AddressV = CLAMP; 664 | AddressW = CLAMP; 665 | //Used Point for games like AMID Evil that don't have a proper Filtering. 666 | MagFilter = POINT; 667 | MinFilter = POINT; 668 | MipFilter = POINT; 669 | }; 670 | 671 | texture BackBufferTex : COLOR; 672 | sampler BackBufferMIRROR 673 | { 674 | Texture = BackBufferTex; 675 | AddressU = MIRROR; 676 | AddressV = MIRROR; 677 | AddressW = MIRROR; 678 | }; 679 | 680 | sampler BackBufferBORDER 681 | { 682 | Texture = BackBufferTex; 683 | AddressU = BORDER; 684 | AddressV = BORDER; 685 | AddressW = BORDER; 686 | }; 687 | 688 | sampler BackBufferCLAMP 689 | { 690 | Texture = BackBufferTex; 691 | AddressU = CLAMP; 692 | AddressV = CLAMP; 693 | AddressW = CLAMP; 694 | }; 695 | 696 | #if D_Frame || DFW 697 | texture texCF { Width = BUFFER_WIDTH ; Height = BUFFER_HEIGHT ; Format = RGBA8; }; 698 | 699 | sampler SamplerCF 700 | { 701 | Texture = texCF; 702 | }; 703 | 704 | texture texDF { Width = BUFFER_WIDTH ; Height = BUFFER_HEIGHT ; Format = RGBA8; }; 705 | 706 | sampler SamplerDF 707 | { 708 | Texture = texDF; 709 | }; 710 | #endif 711 | texture texDMWoWvx { Width = BUFFER_WIDTH ; Height = BUFFER_HEIGHT; Format = RGBA16F; }; 712 | 713 | sampler SamplerDMWoWvx 714 | { 715 | Texture = texDMWoWvx; 716 | }; 717 | 718 | texture texzBufferWoWvx_P { Width = BUFFER_WIDTH ; Height = BUFFER_HEIGHT ; Format = RG16F; MipLevels = 6; }; 719 | 720 | sampler SamplerzBufferWoWvx_P 721 | { 722 | Texture = texzBufferWoWvx_P; 723 | MagFilter = POINT; 724 | MinFilter = POINT; 725 | MipFilter = POINT; 726 | }; 727 | 728 | texture texzBufferWoWvx_L { Width = BUFFER_WIDTH ; Height = BUFFER_HEIGHT ; Format = RG16F; MipLevels = 8; }; 729 | 730 | sampler SamplerzBufferWoWvx_L 731 | { 732 | Texture = texzBufferWoWvx_L; 733 | }; 734 | 735 | 736 | #if UI_MASK 737 | texture TexMaskA < source = "DM_Mask_A.png"; > { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 738 | sampler SamplerMaskA { Texture = TexMaskA;}; 739 | texture TexMaskB < source = "DM_Mask_B.png"; > { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; }; 740 | sampler SamplerMaskB { Texture = TexMaskB;}; 741 | #endif 742 | #define Scale_Buffer 160 / BUFFER_WIDTH 743 | ////////////////////////////////////////////////////////Adapted Luminance///////////////////////////////////////////////////////////////////// 744 | texture texLumWoWvx {Width = BUFFER_WIDTH * Scale_Buffer; Height = BUFFER_HEIGHT * Scale_Buffer; Format = RGBA16F; MipLevels = 8;}; 745 | 746 | sampler SamplerLumWoWvx 747 | { 748 | Texture = texLumWoWvx; 749 | }; 750 | 751 | float2 Lum(float2 texcoord) 752 | { 753 | return saturate(tex2Dlod(SamplerLumWoWvx,float4(texcoord,0,11)).xy);//Average Depth Brightnes Texture Sample 754 | } 755 | 756 | ////////////////////////////////////////////////////Distortion Correction////////////////////////////////////////////////////////////////////// 757 | #if BD_Correction || BDF 758 | float2 D(float2 p, float k1, float k2, float k3) //Lens + Radial lens undistort filtering Left & Right 759 | { // Normalize the u,v coordinates in the range [-1;+1] 760 | p = (2. * p - 1.); 761 | // Calculate Zoom 762 | p *= 1 + Zoom; 763 | // Calculate l2 norm 764 | float r2 = p.x*p.x + p.y*p.y; 765 | float r4 = r2 * r2; 766 | float r6 = r4 * r2; 767 | // Forward transform 768 | float x2 = p.x * (1. + k1 * r2 + k2 * r4 + k3 * r6); 769 | float y2 = p.y * (1. + k1 * r2 + k2 * r4 + k3 * r6); 770 | // De-normalize to the original range 771 | p.x = (x2 + 1.) * 1. * 0.5; 772 | p.y = (y2 + 1.) * 1. * 0.5; 773 | 774 | return p; 775 | } 776 | #endif 777 | ///////////////////////////////////////////////////////////3D Image Adjustments///////////////////////////////////////////////////////////////////// 778 | 779 | #if D_Frame || DFW 780 | float4 CurrentFrame(in float4 position : SV_Position, in float2 texcoords : TEXCOORD) : SV_Target 781 | { 782 | return tex2Dlod(BackBufferBORDER,float4(texcoords,0,0)); 783 | } 784 | 785 | float4 DelayFrame(in float4 position : SV_Position, in float2 texcoords : TEXCOORD) : SV_Target 786 | { 787 | return tex2Dlod(SamplerCF,float4(texcoords,0,0)); 788 | } 789 | 790 | float4 CSB(float2 texcoords) 791 | { 792 | return tex2Dlod(SamplerDF,float4(texcoords,0,0)); 793 | } 794 | #else 795 | float4 CSB(float2 texcoords) 796 | { 797 | return tex2Dlod(BackBufferBORDER,float4(texcoords,0,0)); 798 | } 799 | #endif 800 | 801 | #if LBC || LBM || LB_Correction || LetterBox_Masking 802 | float SLLTresh(float2 TCLocations, float MipLevel) 803 | { 804 | return tex2Dlod(SamplerzBufferWoWvx_L,float4(TCLocations,0, MipLevel)).y; 805 | } 806 | 807 | float LBDetection()//Active RGB Detection 808 | { float MipLevel = 5,Center = SLLTresh(float2(0.5,0.5), 8) > 0, Top_Left = SLLTresh(float2(0.1,0.1), MipLevel) == 0; 809 | if ( LetterBox_Masking == 2 || LB_Correction == 2 || LBC == 2 || LBM == 2 ) 810 | return Top_Left && (SLLTresh(float2(0.1,0.5), MipLevel) == 0 ) && (SLLTresh(float2(0.9,0.5), MipLevel) == 0 ) && Center ? 1 : 0; //Vert 811 | else //Left_Center //Right_Center 812 | return Top_Left && (SLLTresh(float2(0.5,0.9), MipLevel) == 0 ) && Center ? 1 : 0; //Hoz 813 | } //Bottom_Center 814 | #endif 815 | 816 | #if SDT || SD_Trigger 817 | float TargetedDepth(float2 TC) 818 | { 819 | return smoothstep(0,1,tex2Dlod(SamplerzBufferWoWvx_P,float4(TC,0,0)).y); 820 | } 821 | 822 | float SDTriggers()//Specialized Depth Triggers 823 | { float Threshold = 0.001;//Both this and the options below may need to be adjusted. A Value lower then 7.5 will break this.!?!?!?! 824 | if ( SD_Trigger == 1 || SDT == 1)//Top _ Left //Center_Left //Botto_Left 825 | return (TargetedDepth(float2(0.95,0.25)) >= Threshold ) && (TargetedDepth(float2(0.95,0.5)) >= Threshold) && (TargetedDepth(float2(0.95,0.75)) >= Threshold) ? 0 : 1; 826 | else 827 | return 0; 828 | } 829 | #endif 830 | /////////////////////////////////////////////////////////////Cursor/////////////////////////////////////////////////////////////////////////// 831 | float4 MouseCursor(float2 texcoord ) 832 | { float4 Out = CSB(texcoord),Color; 833 | float A = 0.959375, TCoRF = 1-A, Cursor; 834 | if(Cursor_Type > 0) 835 | { 836 | float CCA = 0.005, CCB = 0.00025, CCC = 0.25, CCD = 0.00125, Arrow_Size_A = 0.7, Arrow_Size_B = 1.3, Arrow_Size_C = 4.0;//scaling 837 | float2 MousecoordsXY = Mousecoords * pix, center = texcoord, Screen_Ratio = float2(ARatio,1.0), Size_Color = float2(1+Cursor_SC.x,Cursor_SC.y); 838 | float THICC = (2.0+Size_Color.x) * CCB, Size = Size_Color.x * CCA, Size_Cubed = (Size_Color.x*Size_Color.x) * CCD; 839 | 840 | if (Cursor_Lock && !CLK) 841 | MousecoordsXY = float2(0.5,lerp(0.5,0.5725,Scale(Cursor_SC.z,10,0) )); 842 | 843 | float4 Dist_from_Hori_Vert = float4( abs((center.x - (Size* Arrow_Size_B) / Screen_Ratio.x) - MousecoordsXY.x) * Screen_Ratio.x, // S_dist_fromHorizontal 844 | abs(center.x - MousecoordsXY.x) * Screen_Ratio.x, // dist_fromHorizontal 845 | abs((center.y - (Size* Arrow_Size_B)) - MousecoordsXY.y), // S_dist_fromVertical 846 | abs(center.y - MousecoordsXY.y)); // dist_fromVertical 847 | 848 | //Cross Cursor 849 | float B = min(max(THICC - Dist_from_Hori_Vert.y,0),max(Size-Dist_from_Hori_Vert.w,0)), A = min(max(THICC - Dist_from_Hori_Vert.w,0),max(Size-Dist_from_Hori_Vert.y,0)); 850 | float CC = A+B; //Cross Cursor 851 | 852 | //Solid Square Cursor 853 | float SSC = min(max(Size_Cubed - Dist_from_Hori_Vert.y,0),max(Size_Cubed-Dist_from_Hori_Vert.w,0)); //Solid Square Cursor 854 | 855 | if (Cursor_Type == 3) 856 | { 857 | Dist_from_Hori_Vert.y = abs((center.x - Size / Screen_Ratio.x) - MousecoordsXY.x) * Screen_Ratio.x ; 858 | Dist_from_Hori_Vert.w = abs(center.y - Size - MousecoordsXY.y); 859 | } 860 | //Cursor 861 | float C = all(min(max(Size - Dist_from_Hori_Vert.y,0),max(Size - Dist_from_Hori_Vert.w,0)));//removing the line below removes the square. 862 | C -= all(min(max(Size - Dist_from_Hori_Vert.y * Arrow_Size_C,0),max(Size - Dist_from_Hori_Vert.w * Arrow_Size_C,0)));//Need to add this to fix a - bool issue in openGL 863 | C -= all(min(max((Size * Arrow_Size_A) - Dist_from_Hori_Vert.x,0),max((Size * Arrow_Size_A)-Dist_from_Hori_Vert.z,0))); // Cursor Array // 864 | if(Cursor_Type == 1) 865 | Cursor = CC; 866 | else if (Cursor_Type == 2) 867 | Cursor = SSC; 868 | else if (Cursor_Type == 3) 869 | Cursor = C; 870 | 871 | // Cursor Color Array // 872 | float3 CCArray[11] = { 873 | float3(1,1,1),//White 874 | float3(0,0,1),//Blue 875 | float3(0,1,0),//Green 876 | float3(1,0,0),//Red 877 | float3(1,0,1),//Magenta 878 | float3(0,1,1), 879 | float3(1,1,0), 880 | float3(1,0.4,0.7), 881 | float3(1,0.64,0), 882 | float3(0.5,0,0.5), 883 | float3(0,0,0) //Black 884 | }; 885 | int CSTT = clamp(Cursor_SC.y,0,10); 886 | Color.rgb = CCArray[CSTT]; 887 | } 888 | 889 | return Cursor ? Color : Out; 890 | } 891 | //////////////////////////////////////////////////////////Depth Map Information///////////////////////////////////////////////////////////////////// 892 | float DMA() //Small List of internal Multi Game Depth Adjustments. 893 | { float DMA = Depth_Map_Adjust; 894 | #if (__APPLICATION__ == 0xC0052CC4) //Halo The Master Chief Collection 895 | if( WP == 4) // Change on weapon selection. 896 | DMA *= 0.25; 897 | else if( WP == 5) 898 | DMA *= 0.8875; 899 | #endif 900 | return DMA; 901 | } 902 | 903 | float2 TC_SP(float2 texcoord) 904 | { 905 | #if BD_Correction || BDF 906 | if(BD_Options == 0 || BD_Options == 2) 907 | { 908 | float3 K123 = Colors_K1_K2_K3 * 0.1; 909 | texcoord = D(texcoord.xy,K123.x,K123.y,K123.z); 910 | } 911 | #endif 912 | #if DB_Size_Position || SPF || LBC || LB_Correction || SDT || SD_Trigger 913 | 914 | #if SDT || SD_Trigger 915 | float2 X_Y = float2(Image_Position_Adjust.x,Image_Position_Adjust.y) + (SDTriggers() ? float2( DG_X , DG_Y) : 0.0); 916 | #else 917 | #if LBC || LB_Correction 918 | float2 X_Y = Image_Position_Adjust + (LBDetection() && LB_Correction_Switch ? Image_Pos_Offset : 0.0f ); 919 | #else 920 | float2 X_Y = float2(Image_Position_Adjust.x,Image_Position_Adjust.y); 921 | #endif 922 | #endif 923 | 924 | texcoord.xy += float2(-X_Y.x,X_Y.y)*0.5; 925 | 926 | #if LBC || LB_Correction 927 | float2 H_V = Horizontal_and_Vertical * (LBDetection() && LB_Correction_Switch ? H_V_Offset : 1.0f ); 928 | #else 929 | float2 H_V = Horizontal_and_Vertical; 930 | #endif 931 | float2 midHV = (H_V-1) * float2(BUFFER_WIDTH * 0.5,BUFFER_HEIGHT * 0.5) * pix; 932 | texcoord = float2((texcoord.x*H_V.x)-midHV.x,(texcoord.y*H_V.y)-midHV.y); 933 | #endif 934 | return texcoord; 935 | } 936 | 937 | float Depth(float2 texcoord) 938 | { //Conversions to linear space..... 939 | float zBuffer = tex2Dlod(DepthBuffer, float4(texcoord,0,0)).x, Far = 1.0, Near = 0.125/DMA(); //Near & Far Adjustment 940 | //Man Why can't depth buffers Just Be Normal 941 | float2 C = float2( Far / Near, 1.0 - Far / Near ), Z = Offset < 0 ? min( 1.0, zBuffer * ( 1.0 + abs(Offset) ) ) : float2( zBuffer, 1.0 - zBuffer ); 942 | 943 | if(Offset > 0 || Offset < 0) 944 | Z = Offset < 0 ? float2( Z.x, 1.0 - Z.y ) : min( 1.0, float2( Z.x * (1.0 + Offset) , Z.y / (1.0 - Offset) ) ); 945 | //MAD - RCP 946 | if (Depth_Map == 0) //DM0 Normal 947 | zBuffer = rcp(Z.x * C.y + C.x); 948 | else if (Depth_Map == 1) //DM1 Reverse 949 | zBuffer = rcp(Z.y * C.y + C.x); 950 | 951 | return saturate(zBuffer); 952 | } 953 | //Weapon Setting// 954 | float4 WA_XYZW() 955 | { 956 | float4 WeaponSettings_XYZW = Weapon_Adjust; 957 | #if WSM >= 1 958 | WeaponSettings_XYZW = Weapon_Profiles(WP, Weapon_Adjust); 959 | #endif 960 | //"X, CutOff Point used to set a different scale for first person hand apart from world scale.\n" 961 | //"Y, Precision is used to adjust the first person hand in world scale.\n" 962 | //"Z, Tuning is used to fine tune the precision adjustment above.\n" 963 | //"W, Scale is used to compress or rescale the weapon.\n" 964 | return float4(WeaponSettings_XYZW.xyz,-WeaponSettings_XYZW.w + 1); 965 | } 966 | //Weapon Depth Buffer// 967 | float2 WeaponDepth(float2 texcoord) 968 | { //Conversions to linear space..... 969 | float zBufferWH = tex2Dlod(DepthBuffer, float4(texcoord,0,0)).x, Far = 1.0, Near = 0.125/(0.00000001 + WA_XYZW().y); //Near & Far Adjustment 970 | 971 | float2 Offsets = float2(1 + WA_XYZW().z,1 - WA_XYZW().z), Z = float2( zBufferWH, 1-zBufferWH ); 972 | 973 | if (WA_XYZW().z > 0) 974 | Z = min( 1, float2( Z.x * Offsets.x , Z.y / Offsets.y )); 975 | 976 | [branch] if (Depth_Map == 0)//DM0. Normal 977 | zBufferWH = Far * Near / (Far + Z.x * (Near - Far)); 978 | else if (Depth_Map == 1)//DM1. Reverse 979 | zBufferWH = Far * Near / (Far + Z.y * (Near - Far)); 980 | 981 | return float2(saturate(zBufferWH), WA_XYZW().x); 982 | } 983 | //3x2 and 2x3 not supported on older ReShade versions. I had to use 3x3. Old Values for 3x2 984 | float3x3 PrepDepth(float2 texcoord) 985 | { int Flip_Depth = Flip_Opengl_Depth ? !Depth_Map_Flip : Depth_Map_Flip; 986 | 987 | if (Flip_Depth) 988 | texcoord.y = 1 - texcoord.y; 989 | 990 | //Texture Zoom & Aspect Ratio// 991 | //float X = TEST.x; 992 | //float Y = TEST.y * TEST.x * 2; 993 | //float midW = (X - 1)*(BUFFER_WIDTH*0.5)*pix.x; 994 | //float midH = (Y - 1)*(BUFFER_HEIGHT*0.5)*pix.y; 995 | 996 | //texcoord = float2((texcoord.x*X)-midW,(texcoord.y*Y)-midH); 997 | 998 | texcoord.xy -= DLSS_FSR_Offset.x * pix; 999 | 1000 | float4 DM = Depth(TC_SP(texcoord)).xxxx; 1001 | float R, G, B, A, WD = WeaponDepth(TC_SP(texcoord)).x, CoP = WeaponDepth(TC_SP(texcoord)).y, CutOFFCal = (CoP/DMA()) * 0.5; //Weapon Cutoff Calculation 1002 | CutOFFCal = step(DM.x,CutOFFCal); 1003 | 1004 | [branch] if (WP == 0) 1005 | DM.x = DM.x; 1006 | else 1007 | { 1008 | DM.x = lerp(DM.x,WD,CutOFFCal); 1009 | DM.y = lerp(0.0,WD,CutOFFCal); 1010 | DM.z = lerp(0.5,WD,CutOFFCal); 1011 | } 1012 | 1013 | R = DM.x; //Mix Depth 1014 | G = DM.y > saturate(smoothstep(0,2.5,DM.w)); //Weapon Mask 1015 | B = DM.z; //Weapon Hand 1016 | A = ZPD_Boundary >= 4 ? max( G, R) : R; //Grid Depth 1017 | 1018 | return float3x3( saturate(float3(R, G, B)), //[0][0] = R | [0][1] = G | [0][2] = B 1019 | saturate(float3(A, Depth( SDT || SD_Trigger ? texcoord : TC_SP(texcoord) ).x, DM.w)),//[1][0] = A | [1][1] = D | [1][2] = DM 1020 | float3(0,0,0) ); //[2][0] = 0 | [2][1] = 0 | [2][2] = 0 1021 | } 1022 | //////////////////////////////////////////////////////////////Depth HUD Alterations/////////////////////////////////////////////////////////////////////// 1023 | #if UI_MASK 1024 | float HUD_Mask(float2 texcoord ) 1025 | { float Mask_Tex; 1026 | if (Mask_Cycle == 1) 1027 | Mask_Tex = tex2Dlod(SamplerMaskB,float4(texcoord.xy,0,0)).a; 1028 | else 1029 | Mask_Tex = tex2Dlod(SamplerMaskA,float4(texcoord.xy,0,0)).a; 1030 | 1031 | return saturate(Mask_Tex); 1032 | } 1033 | #endif 1034 | /////////////////////////////////////////////////////////Fade In and Out Toggle///////////////////////////////////////////////////////////////////// 1035 | float Fade_in_out(float2 texcoord) 1036 | { float TCoRF[1], Trigger_Fade, AA = Fade_Time_Adjust, PStoredfade = tex2D(SamplerLumWoWvx,float2(0,0.083)).z; 1037 | if(Eye_Fade_Reduction_n_Power.z == 0) 1038 | AA *= 0.5; 1039 | else if(Eye_Fade_Reduction_n_Power.z == 2) 1040 | AA *= 1.5; 1041 | //Fade in toggle. 1042 | if(FPSDFIO == 1 )//|| FPSDFIO == 3 ) 1043 | Trigger_Fade = Trigger_Fade_A; 1044 | else if(FPSDFIO == 2)// || FPSDFIO == 4 ) 1045 | Trigger_Fade = Trigger_Fade_B; 1046 | 1047 | return PStoredfade + (Trigger_Fade - PStoredfade) * (1.0 - exp(-frametime/((1-AA)*1000))); ///exp2 would be even slower 1048 | } 1049 | 1050 | float2 Fade(float2 texcoord) // Maybe make it float2 and pass the 2nd switch to swap it with grater strength onlu if it's beyond -1.0 1051 | { //Check Depth 1052 | float CD, Detect, Detect_Out_of_Range; 1053 | if(ZPD_Boundary > 0) 1054 | { float4 Switch_Array = ZPD_Boundary == 6 ? float4(0.825,0.850,0.875,0.900) : float4(1.0,0.875,0.75,0.625); 1055 | //Normal A & B for both 1056 | float CDArray_A[7] = { 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875}, CDArray_B[7] = { 0.25, 0.375, 0.4375, 0.5, 0.5625, 0.625, 0.75}, CDArray_C[4] = { 0.875, 0.75, 0.5, 0.25}; 1057 | float CDArrayZPD_A[7] = { ZPD_Separation.x * Switch_Array.w, ZPD_Separation.x * Switch_Array.z, ZPD_Separation.x * Switch_Array.y, ZPD_Separation.x * Switch_Array.x, ZPD_Separation.x * Switch_Array.y, ZPD_Separation.x * Switch_Array.z, ZPD_Separation.x * Switch_Array.w }, 1058 | CDArrayZPD_B[7] = { ZPD_Separation.x * 0.3, ZPD_Separation.x * 0.5, ZPD_Separation.x * 0.75, ZPD_Separation.x, ZPD_Separation.x * 0.75, ZPD_Separation.x * 0.5, ZPD_Separation.x * 0.3}, 1059 | CDArrayZPD_C[12] = { ZPD_Separation.x * 0.5, ZPD_Separation.x * 0.625, ZPD_Separation.x * 0.75, ZPD_Separation.x * 0.875, ZPD_Separation.x * 0.9375, 1060 | ZPD_Separation.x, ZPD_Separation.x, 1061 | ZPD_Separation.x * 0.9375, ZPD_Separation.x * 0.875, ZPD_Separation.x * 0.75, ZPD_Separation.x * 0.625, ZPD_Separation.x * 0.5 }; 1062 | //Screen Space Detector 7x7 Grid from between 0 to 1 and ZPD Detection becomes stronger as it gets closer to the Center. 1063 | float2 GridXY; int2 iXY = ZPD_Boundary == 3 ? int2( 12, 4) : int2( 7, 7) ; 1064 | [loop] 1065 | for( int iX = 0 ; iX < iXY.x; iX++ ) 1066 | { [loop] 1067 | for( int iY = 0 ; iY < iXY.y; iY++ ) 1068 | { 1069 | if(ZPD_Boundary == 1 || ZPD_Boundary == 6 || ZPD_Boundary == 7) 1070 | GridXY = float2( CDArray_A[iX], CDArray_A[iY]); 1071 | else if(ZPD_Boundary == 2 || ZPD_Boundary == 5) 1072 | GridXY = float2( CDArray_B[iX], CDArray_A[iY]); 1073 | else if(ZPD_Boundary == 3) 1074 | GridXY = float2( (iX + 1) * rcp(iXY.x + 2),CDArray_C[min(3,iY)]); 1075 | else if(ZPD_Boundary == 4) 1076 | GridXY = float2( CDArray_A[iX], CDArray_B[iY]); 1077 | 1078 | float ZPD_I = ZPD_Boundary == 3 ? CDArrayZPD_C[iX] : (ZPD_Boundary == 2 || ZPD_Boundary == 5 ? CDArrayZPD_B[iX] : CDArrayZPD_A[iX]); 1079 | 1080 | if(ZPD_Boundary >= 4) 1081 | { 1082 | if ( PrepDepth(GridXY)[1][0] == 1 ) 1083 | ZPD_I = 0; 1084 | } 1085 | // CDArrayZPD[i] reads across prepDepth....... 1086 | CD = 1 - ZPD_I / PrepDepth(GridXY)[1][0]; 1087 | 1088 | #if UI_MASK 1089 | CD = max( 1 - ZPD_I / HUD_Mask(GridXY), CD ); 1090 | #endif 1091 | if ( CD < -DG_W )//may lower this to like -0.1 1092 | Detect = 1; 1093 | //Used if Depth Buffer is way out of range. 1094 | if(REF || RE_Fix) 1095 | { 1096 | if ( CD < -DI_W ) 1097 | Detect_Out_of_Range = 1; 1098 | } 1099 | } 1100 | } 1101 | } 1102 | float Trigger_Fade_A = Detect, Trigger_Fade_B = Detect_Out_of_Range, AA = (1-(ZPD_Boundary_n_Fade.y*2.))*1000, 1103 | PStoredfade_A = tex2D(SamplerLumWoWvx,float2(0, 0.250)).z, PStoredfade_B = tex2D(SamplerLumWoWvx,float2(0, 0.416)).z; 1104 | //Fade in toggle. 1105 | return float2( PStoredfade_A + (Trigger_Fade_A - PStoredfade_A) * (1.0 - exp(-frametime/AA)), PStoredfade_B + (Trigger_Fade_B - PStoredfade_B) * (1.0 - exp(-frametime/AA)) ); ///exp2 would be even slower 1106 | } 1107 | #define FadeSpeed_AW 0.25 1108 | float AltWeapon_Fade() 1109 | { 1110 | float ExAd = (1-(FadeSpeed_AW * 2.0))*1000, Current = min(0.75f,smoothstep(0,0.25f,PrepDepth(0.5f)[0][0])), Past = tex2D(SamplerLumWoWvx,float2(0,0.750)).z; 1111 | return Past + (Current - Past) * (1.0 - exp(-frametime/ExAd)); 1112 | } 1113 | 1114 | float Weapon_ZPD_Fade(float Weapon_Con) 1115 | { 1116 | float ExAd = (1-(FadeSpeed_AW * 2.0))*1000, Current = Weapon_Con, Past = tex2D(SamplerLumWoWvx,float2(0,0.916)).z; 1117 | return Past + (Current - Past) * (1.0 - exp(-frametime/ExAd)); 1118 | } 1119 | //////////////////////////////////////////////////////////Depth Map Alterations///////////////////////////////////////////////////////////////////// 1120 | float4 DepthMap(in float4 position : SV_Position,in float2 texcoord : TEXCOORD) : SV_Target 1121 | { 1122 | float4 DM = float4(PrepDepth(texcoord)[0][0],PrepDepth(texcoord)[0][1],PrepDepth(texcoord)[0][2],PrepDepth(texcoord)[1][1]); 1123 | float R = DM.x, G = DM.y, B = DM.z, Auto_Scale = WZPD_and_WND.y > 0.0 ? tex2D(SamplerLumWoWvx,float2(0,0.750)).z : 1; 1124 | 1125 | //Fade Storage 1126 | float ScaleND = saturate(lerp(R,1.0f,smoothstep(min(-WZPD_and_WND.y,-WZPD_and_WND.z * Auto_Scale),1.0f,R))); 1127 | 1128 | if (WZPD_and_WND.y > 0) 1129 | R = saturate(lerp(ScaleND,R,smoothstep(0,WZPD_and_WND.w,ScaleND))); 1130 | 1131 | if(texcoord.x < pix.x * 2 && texcoord.y < pix.y * 2)//TL 1132 | R = Fade_in_out(texcoord); 1133 | if(1-texcoord.x < pix.x * 2 && 1-texcoord.y < pix.y * 2)//BR 1134 | R = Fade(texcoord).x; 1135 | if(texcoord.x < pix.x * 2 && 1-texcoord.y < pix.y * 2)//BL 1136 | R = Fade(texcoord).y; 1137 | 1138 | float Luma_Map = dot(0.333, tex2D(BackBufferCLAMP,texcoord).rgb); 1139 | 1140 | return saturate(float4(R,G,B,Luma_Map)); 1141 | } 1142 | 1143 | float AutoDepthRange(float d, float2 texcoord ) 1144 | { float LumAdjust_ADR = smoothstep(-0.0175,Auto_Depth_Adjust,Lum(texcoord).y); 1145 | return min(1,( d - 0 ) / ( LumAdjust_ADR - 0)); 1146 | } 1147 | 1148 | float3 Conv(float2 MD_WHD,float2 texcoord) 1149 | { float D = MD_WHD.x, Z = ZPD_Separation.x, WZP = 0.5, ZP = 0.5, ALC = abs(Lum(texcoord).x), W_Convergence = WZPD_and_WND.x, WZPDB, Distance_From_Bottom = 0.9375, ZPD_Boundary = ZPD_Boundary_n_Fade.x, Store_WC; 1150 | //Screen Space Detector. 1151 | if (abs(Weapon_ZPD_Boundary) > 0) 1152 | { float WArray[8] = { 0.5, 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375}, 1153 | MWArray[8] = { 0.4375, 0.46875, 0.5, 0.53125, 0.625, 0.75, 0.875, 0.9375}, 1154 | WZDPArray[8] = { 1.0, 0.5, 0.75, 0.5, 0.625, 0.5, 0.55, 0.5};//SoF ZPD Weapon Map 1155 | [unroll] //only really only need to check one point just above the center bottom and to the right. 1156 | for( int i = 0 ; i < 8; i++ ) 1157 | { 1158 | if((WP == 22 || WP == 4) && WSM == 1)//SoF & BL 2 1159 | WZPDB = 1 - (WZPD_and_WND.x * WZDPArray[i]) / tex2Dlod(SamplerDMWoWvx,float4(float2(WArray[i],0.9375),0,0)).z; 1160 | else 1161 | { 1162 | if (Weapon_ZPD_Boundary < 0) //Code for Moving Weapon Hand stablity. 1163 | WZPDB = 1 - WZPD_and_WND.x / tex2Dlod(SamplerDMWoWvx,float4(float2(MWArray[i],Distance_From_Bottom),0,0)).z; 1164 | else //Normal 1165 | WZPDB = 1 - WZPD_and_WND.x / tex2Dlod(SamplerDMWoWvx,float4(float2(WArray[i],Distance_From_Bottom),0,0)).z; 1166 | } 1167 | 1168 | if (WZPDB < -DJ_W) // Default -0.1 1169 | W_Convergence *= 1.0-abs(Weapon_ZPD_Boundary); 1170 | } 1171 | } 1172 | //Store Weapon Convergence for Smoothing. 1173 | Store_WC = W_Convergence; 1174 | 1175 | W_Convergence = 1 - tex2D(SamplerLumWoWvx,float2(0,0.916)).z / MD_WHD.y;// 1-W_Convergence/D 1176 | float WD = MD_WHD.y; //Needed to seperate Depth for the Weapon Hand. It was causing problems with Auto Depth Range below. 1177 | 1178 | if (Auto_Depth_Adjust > 0) 1179 | D = AutoDepthRange(D,texcoord); 1180 | 1181 | #if Balance_Mode || BMT 1182 | ZP = saturate(ZPD_Balance); 1183 | #else 1184 | if(Auto_Balance_Ex > 0 ) 1185 | ZP = saturate(ALC); 1186 | #endif 1187 | float DOoR = smoothstep(0,1,tex2D(SamplerLumWoWvx,float2(0, 0.416)).z), ZDP_Array[16] = { 0.0, 0.0125, 0.025, 0.0375, 0.04375, 0.05, 0.0625, 0.075, 0.0875, 0.09375, 0.1, 0.125, 0.150, 0.175, 0.20, 0.225}; 1188 | 1189 | if(REF || RE_Fix) 1190 | { 1191 | if(RE_Fix) 1192 | ZPD_Boundary = lerp(ZPD_Boundary,ZDP_Array[RE_Fix],DOoR); 1193 | else 1194 | ZPD_Boundary = lerp(ZPD_Boundary,ZDP_Array[REF],DOoR); 1195 | } 1196 | 1197 | Z *= lerp( 1, ZPD_Boundary, smoothstep(0,1,tex2D(SamplerLumWoWvx,float2(0, 0.250)).z)); 1198 | float Convergence = 1 - Z / D; 1199 | if (ZPD_Separation.x == 0) 1200 | ZP = 1; 1201 | 1202 | if (WZPD_and_WND.x <= 0) 1203 | WZP = 1; 1204 | 1205 | if (ALC <= 0.025) 1206 | WZP = 1; 1207 | 1208 | ZP = min(ZP,Auto_Balance_Clamp); 1209 | 1210 | return float3( lerp(Convergence,min(saturate(Max_Depth),D), ZP), lerp(W_Convergence,WD,WZP), Store_WC); 1211 | } 1212 | 1213 | float3 DB_Comb( float2 texcoord) 1214 | { 1215 | // X = Mix Depth | Y = Weapon Mask | Z = Weapon Hand | W = Normal Depth 1216 | float4 DM = float4(tex2Dlod(SamplerDMWoWvx,float4(texcoord,0,0)).xyz,PrepDepth( SDT || SD_Trigger ? TC_SP(texcoord) : texcoord )[1][1]); 1217 | //Hide Temporal passthrough 1218 | if(texcoord.x < pix.x * 2 && texcoord.y < pix.y * 2) 1219 | DM = PrepDepth(texcoord)[0][0]; 1220 | if(1-texcoord.x < pix.x * 2 && 1-texcoord.y < pix.y * 2) 1221 | DM = PrepDepth(texcoord)[0][0]; 1222 | if(texcoord.x < pix.x * 2 && 1-texcoord.y < pix.y * 2) 1223 | DM = PrepDepth(texcoord)[0][0]; 1224 | 1225 | if (WP == 0 || WZPD_and_WND.x <= 0) 1226 | DM.y = 0; 1227 | //Handle Convergence Here 1228 | float3 HandleConvergence = Conv(DM.xz,texcoord).xyz; 1229 | DM.y = lerp( HandleConvergence.x, HandleConvergence.y * WA_XYZW().w, DM.y); 1230 | //Better mixing for eye Comfort 1231 | DM.z = DM.y; 1232 | DM.y += lerp(DM.y,DM.x,DM.w); 1233 | DM.y *= 0.5f; 1234 | DM.y = lerp(DM.y,DM.z,0.9375f); 1235 | #if Compatibility_DD 1236 | if (Depth_Detection == 1 || Depth_Detection == 2) 1237 | { //Check Depth at 3 Point D_A Top_Center / Bottom_Center 1238 | float2 DA_DB = float2(tex2Dlod(SamplerDMWoWvx,float4(float2(0.5,0.0),0,0)).x, tex2Dlod(SamplerDMWoWvx,float4(float2(0.0,1.0),0,0)).x); 1239 | if(Depth_Detection == 2) 1240 | { 1241 | if (DA_DB.x == DA_DB.y) 1242 | DM = 0.0625; 1243 | } 1244 | else 1245 | { //Ignores Sky 1246 | if (DA_DB.x != 1 && DA_DB.y != 1) 1247 | { 1248 | if (DA_DB.x == DA_DB.y) 1249 | DM = 0.0625; 1250 | } 1251 | } 1252 | } 1253 | else if (Depth_Detection == 3) 1254 | { 1255 | if (!DepthCheck) 1256 | DM = 0.0625; 1257 | } 1258 | #else 1259 | if (Depth_Detection == 1 || Depth_Detection == 2) 1260 | { //Check Depth at 3 Point D_A Top_Center / Bottom_Center 1261 | float2 DA_DB = float2(tex2Dlod(SamplerDMWoWvx,float4(float2(0.5,0.0),0,0)).x, tex2Dlod(SamplerDMWoWvx,float4(float2(0.0,1.0),0,0)).x); 1262 | if(Depth_Detection == 2) 1263 | { 1264 | if (DA_DB.x == DA_DB.y) 1265 | DM = 0.0625; 1266 | } 1267 | else 1268 | { //Ignores Sky 1269 | if (DA_DB.x != 1 && DA_DB.y != 1) 1270 | { 1271 | if (DA_DB.x == DA_DB.y) 1272 | DM = 0.0625; 1273 | } 1274 | } 1275 | } 1276 | #endif 1277 | 1278 | if (Cancel_Depth) 1279 | DM = 0.0625; 1280 | 1281 | #if Invert_Depth || IDF 1282 | DM.y = 1 - DM.y; 1283 | #endif 1284 | 1285 | #if UI_MASK 1286 | DM.y = lerp(DM.y,0,step(1.0-HUD_Mask(texcoord),0.5)); 1287 | #endif 1288 | 1289 | if(LBM || LetterBox_Masking) 1290 | { 1291 | float storeDM = DM.y; 1292 | 1293 | DM.y = texcoord.y > DI_Y && texcoord.y < DI_X ? storeDM : 0.0125; 1294 | 1295 | #if LBM || LetterBox_Masking 1296 | if((LBM >= 1 || LetterBox_Masking >= 1) && !LBDetection()) 1297 | DM.y = storeDM; 1298 | #endif 1299 | } 1300 | 1301 | return float3(DM.y,PrepDepth(texcoord)[1][1],HandleConvergence.z); 1302 | } 1303 | ////////////////////////////////////////////////////Depth & Special Depth Triggers////////////////////////////////////////////////////////////////// 1304 | void Mod_Z(in float4 position : SV_Position, in float2 texcoord : TEXCOORD, out float2 Point_Out : SV_Target0 , out float2 Linear_Out : SV_Target1) 1305 | { 1306 | float3 Set_Depth = DB_Comb( texcoord.xy ).xyz; 1307 | 1308 | if(1-texcoord.x < pix.x * 2 && 1-texcoord.y < pix.y * 2) //BR 1309 | Set_Depth.y = AltWeapon_Fade(); 1310 | if( texcoord.x < pix.x * 2 && 1-texcoord.y < pix.y * 2) //BL 1311 | Set_Depth.y = Weapon_ZPD_Fade(Set_Depth.z); 1312 | 1313 | //Luma Map 1314 | float3 Color = tex2D(BackBufferCLAMP,texcoord ).rgb; 1315 | Color.x = max(Color.r, max(Color.g, Color.b)); 1316 | 1317 | Point_Out = Set_Depth.xy; 1318 | Linear_Out = float2(Set_Depth.x,Color.x);//is z when above code is on. 1319 | } 1320 | 1321 | float DB(float2 texcoord) 1322 | { 1323 | float2 DepthBuffer_LP = float2(tex2Dlod(SamplerzBufferWoWvx_L, float4( texcoord, 0, Lower_Depth_Res) ).x,tex2Dlod(SamplerzBufferWoWvx_P, float4( texcoord, 0, Lower_Depth_Res) ).x); 1324 | 1325 | if(View_Mode) 1326 | DepthBuffer_LP.x = DepthBuffer_LP.y; 1327 | 1328 | float Separation = lerp(1.0,5.0,ZPD_Separation.y); 1329 | return 1-(Separation * DepthBuffer_LP.x); 1330 | } 1331 | 1332 | float GetDB(float2 texcoord) 1333 | { 1334 | float Mask = DB( texcoord.xy ); 1335 | if(Depth_Edge_Mask > 0 || Depth_Edge_Mask < 0) 1336 | { 1337 | float t = DB( float2( texcoord.x , texcoord.y - pix.y ) ), 1338 | d = DB( float2( texcoord.x , texcoord.y + pix.y ) ), 1339 | l = DB( float2( texcoord.x - pix.x , texcoord.y ) ), 1340 | r = DB( float2( texcoord.x + pix.x , texcoord.y ) ); 1341 | float2 n = float2(t - d,-(r - l)); 1342 | // Lets make that mask from Edges 1343 | Mask = length(n)*abs(Depth_Edge_Mask); 1344 | Mask = Mask > 0 ? 1-Mask : 1; 1345 | Mask = saturate(lerp(Mask,1,-1));// Super Evil Mix. 1346 | // Final Depth 1347 | if(Depth_Edge_Mask > 0) 1348 | { 1349 | float N = 0.5,F = 2,M = Mask, Z = (t + d + l + r) * 0.25; 1350 | float ZS = ( Z - N ) / ( F - N); 1351 | ZS += Z; 1352 | ZS *= 0.5; 1353 | Mask = lerp(ZS,DB( texcoord.xy ),Mask); 1354 | } 1355 | else if(Depth_Edge_Mask < 0) 1356 | Mask = lerp(1,DB( texcoord.xy ),Mask); 1357 | } 1358 | 1359 | return Mask; 1360 | } 1361 | 1362 | //////////////////////////////////////////////////////////////HUD Alterations/////////////////////////////////////////////////////////////////////// 1363 | #if HUD_MODE || HMT 1364 | float3 HUD(float3 HUD, float2 texcoord ) 1365 | { 1366 | float Mask_Tex, CutOFFCal = ((HUD_Adjust.x * 0.5)/DMA()) * 0.5, COC = step(PrepDepth(texcoord)[1][2],CutOFFCal); //HUD Cutoff Calculation 1367 | //This code is for hud segregation. 1368 | if (HUD_Adjust.x > 0) 1369 | HUD = COC > 0 ? tex2D(BackBufferCLAMP,texcoord).rgb : HUD; 1370 | 1371 | #if UI_MASK 1372 | if (Mask_Cycle == true) 1373 | Mask_Tex = tex2Dlod(SamplerMaskB,float4(texcoord.xy,0,0)).a; 1374 | else 1375 | Mask_Tex = tex2Dlod(SamplerMaskA,float4(texcoord.xy,0,0)).a; 1376 | 1377 | float MAC = step(1.0-Mask_Tex,0.5); //Mask Adjustment Calculation 1378 | //This code is for hud segregation. 1379 | HUD = MAC > 0 ? tex2D(BackBufferCLAMP,texcoord).rgb : HUD; 1380 | #endif 1381 | return HUD; 1382 | } 1383 | #endif 1384 | ///////////////////////////////////////////////////////////2D + Depth + Signage/////////////////////////////////////////////////////////////////////// 1385 | float3 PS_calcLR(float2 texcoord) 1386 | {//WoWvx Code 1387 | float2 ScreenPos = Signage_Flip ? texcoord.xy * Res : float2(texcoord.x,1-texcoord.y) * Res; 1388 | float3 Color; 1389 | //BLOCK ONE 1390 | float A = all(abs(float2(0.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1391 | float B = all(abs(float2(2.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1392 | float C = all(abs(float2(4.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1393 | float D = all(abs(float2(6.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1394 | float E = all(abs(float2(14.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1395 | float F = all(abs(float2(32.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1396 | float G = all(abs(float2(34.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1397 | float H = all(abs(float2(36.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1398 | float I = all(abs(float2(38.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1399 | float J = all(abs(float2(40.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1400 | float K = all(abs(float2(42.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1401 | float L = all(abs(float2(44.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1402 | float M = all(abs(float2(46.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1403 | float N = all(abs(float2(48.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1404 | float BlockOne = A+B+C+D+E+F+G+H+I+J+K+L+M+N; 1405 | 1406 | //NO DEPTH 1407 | float NDA = all(abs(float2(96.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1408 | float NDB = all(abs(float2(98.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1409 | float NDC = all(abs(float2(102.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1410 | float NDD = all(abs(float2(108.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1411 | float NDE = all(abs(float2(110.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1412 | float NDF = all(abs(float2(114.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1413 | float NDG = all(abs(float2(118.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1414 | float NDH = all(abs(float2(124.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1415 | float NDI = all(abs(float2(126.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1416 | float NDJ = all(abs(float2(128.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1417 | float NDK = all(abs(float2(138.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1418 | float NDL = all(abs(float2(152.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1419 | float NDM = all(abs(float2(154.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1420 | float NoDepth = NDA+NDB+NDC+NDD+NDE+NDF+NDG+NDH+NDI+NDJ+NDK+NDL+NDM; 1421 | 1422 | //RESERVED 1423 | float RA = all(abs(float2(26.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1424 | float RB = all(abs(float2(28.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1425 | float RC = all(abs(float2(98.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1426 | float RD = all(abs(float2(100.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1427 | float RE = all(abs(float2(110.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1428 | float RF = all(abs(float2(112.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1429 | float RG = all(abs(float2(116.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1430 | float RH = all(abs(float2(118.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1431 | float RI = all(abs(float2(120.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1432 | float RJ = all(abs(float2(122.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1433 | float RK = all(abs(float2(126.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1434 | float RL = all(abs(float2(128.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1435 | float RM = all(abs(float2(130.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1436 | float RN = all(abs(float2(136.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1437 | float RO = all(abs(float2(144.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1438 | float RP = all(abs(float2(150.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1439 | float RQ = all(abs(float2(154.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1440 | float RR = all(abs(float2(158.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1441 | float Reserved = RA+RB+RC+RD+RE+RF+RG+RH+RI+RJ+RK+RL+RM+RN+RO+RP+RQ+RR; 1442 | 1443 | //STILL 1444 | float SA = all(abs(float2(26.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1445 | float SB = all(abs(float2(30.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1446 | float SC = all(abs(float2(96.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1447 | float SD = all(abs(float2(100.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1448 | float SE = all(abs(float2(102.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1449 | float SF = all(abs(float2(104.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1450 | float SG = all(abs(float2(108.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1451 | float SH = all(abs(float2(112.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1452 | float SI = all(abs(float2(116.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1453 | float SJ = all(abs(float2(120.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1454 | float SK = all(abs(float2(124.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1455 | float SL = all(abs(float2(130.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1456 | float SM = all(abs(float2(132.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1457 | float SN = all(abs(float2(156.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1458 | float Still = SA+SB+SC+SD+SE+SF+SG+SH+SI+SJ+SK+SL+SM+SN; 1459 | 1460 | //CGI 1461 | float CA = all(abs(float2(26.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1462 | float CB = all(abs(float2(96.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1463 | float CC = all(abs(float2(98.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1464 | float CD = all(abs(float2(100.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1465 | float CE = all(abs(float2(102.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1466 | float CF = all(abs(float2(108.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1467 | float CG = all(abs(float2(110.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1468 | float CH = all(abs(float2(112.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1469 | float CI = all(abs(float2(116.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1470 | float CJ = all(abs(float2(122.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1471 | float CK = all(abs(float2(124.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1472 | float CL = all(abs(float2(126.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1473 | float CM = all(abs(float2(138.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1474 | float CN = all(abs(float2(140.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1475 | float CO = all(abs(float2(142.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1476 | float CP = all(abs(float2(144.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1477 | float CQ = all(abs(float2(152.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1478 | float CR = all(abs(float2(154.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1479 | float CS = all(abs(float2(156.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1480 | float CT = all(abs(float2(158.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1481 | float CGI = CA+CB+CC+CD+CE+CF+CG+CH+CI+CJ+CK+CL+CM+CN+CO+CP+CQ+CR+CS+CT; 1482 | 1483 | //GAME 1484 | float GA = all(abs(float2(28.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1485 | float GB = all(abs(float2(30.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1486 | float GC = all(abs(float2(104.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1487 | float GD = all(abs(float2(114.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1488 | float GE = all(abs(float2(122.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1489 | float GF = all(abs(float2(132.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1490 | float GG = all(abs(float2(136.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1491 | float GH = all(abs(float2(138.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1492 | float GI = all(abs(float2(144.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1493 | float GJ = all(abs(float2(150.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1494 | float GK = all(abs(float2(152.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1495 | float GL = all(abs(float2(156.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1496 | float GM = all(abs(float2(158.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1497 | float Game = GA+GB+GB+GC+GD+GE+GF+GG+GH+GI+GJ+GK+GL+GM; 1498 | 1499 | //MOVIE 1500 | float MA = all(abs(float2(28.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1501 | float MB = all(abs(float2(98.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1502 | float MC = all(abs(float2(110.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1503 | float MD = all(abs(float2(114.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1504 | float ME = all(abs(float2(120.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1505 | float MF = all(abs(float2(126.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1506 | float MG = all(abs(float2(130.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1507 | float MH = all(abs(float2(136.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1508 | float MI = all(abs(float2(140.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1509 | float MJ = all(abs(float2(142.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1510 | float MK = all(abs(float2(150.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1511 | float ML = all(abs(float2(154.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1512 | float MM = all(abs(float2(156.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1513 | float Movie = MA+MB+MC+MD+ME+MF+MG+MH+MI+MJ+MK+ML+MM; 1514 | 1515 | //SIGNAGE 1516 | float SSA = all(abs(float2(30.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1517 | float SSB = all(abs(float2(96.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1518 | float SSC = all(abs(float2(102.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1519 | float SSD = all(abs(float2(104.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1520 | float SSE = all(abs(float2(108.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1521 | float SSF = all(abs(float2(114.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1522 | float SSG = all(abs(float2(118.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1523 | float SSH = all(abs(float2(120.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1524 | float SSI = all(abs(float2(122.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1525 | float SSJ = all(abs(float2(124.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1526 | float SSK = all(abs(float2(128.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1527 | float SSL = all(abs(float2(130.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1528 | float SSM = all(abs(float2(132.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1529 | float SSN = all(abs(float2(140.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1530 | float SSO = all(abs(float2(142.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1531 | float SSP = all(abs(float2(144.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1532 | float SSQ = all(abs(float2(158.5,BUFFER_HEIGHT)-ScreenPos.xy) < float2(0.5,1)); 1533 | float Signage = SSA+SSB+SSC+SSD+SSE+SSF+SSG+SSH+SSI+SSJ+SSK+SSL+SSM+SSN+SSO+SSP+SSQ; 1534 | 1535 | float Content_Type; 1536 | 1537 | if (Content == 0) 1538 | Content_Type = NoDepth; 1539 | else if (Content == 1) 1540 | Content_Type = Reserved; 1541 | else if (Content == 2) 1542 | Content_Type = Still; 1543 | else if (Content == 3) 1544 | Content_Type = CGI; 1545 | else if (Content == 4) 1546 | Content_Type = Game; 1547 | else if (Content == 5) 1548 | Content_Type = Movie; 1549 | else 1550 | Content_Type = Signage; 1551 | 1552 | Color = MouseCursor(float2(texcoord.x*2 + Perspective * pix.x,texcoord.y)).rgb; 1553 | 1554 | #if HUD_MODE || HMT 1555 | float HUD_Adjustment = ((0.5 - HUD_Adjust.y)*25.) * pix.x; 1556 | Color.rgb = HUD(Color.rgb,float2(texcoord.x - HUD_Adjustment,texcoord.y)).rgb; 1557 | #endif 1558 | 1559 | Color = texcoord.x < 0.5 ? Color : GetDB(float2(texcoord.x*2-1 + Perspective * pix.x,texcoord.y)).x; 1560 | 1561 | float3 BACK = all(abs(float2(80,BUFFER_HEIGHT)-ScreenPos.xy) < float2(80,1) ) ? 0 : Color; 1562 | 1563 | return BlockOne + Content_Type ? float3(0,0,1) : BACK; 1564 | } 1565 | /////////////////////////////////////////////////////////Average Luminance Textures///////////////////////////////////////////////////////////////// 1566 | float4 Average_Luminance(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 1567 | { 1568 | float4 ABEA, ABEArray[6] = { 1569 | float4(0.0,1.0,0.0, 1.0), //No Edit 1570 | float4(0.0,1.0,0.0, 0.750), //Upper Extra Wide 1571 | float4(0.0,1.0,0.0, 0.5), //Upper Wide 1572 | float4(0.0,1.0, 0.15625, 0.46875), //Upper Short 1573 | float4(0.375, 0.250, 0.4375, 0.125),//Center Small 1574 | float4(0.375, 0.250, 0.0, 1.0) //Center Long 1575 | }; 1576 | ABEA = ABEArray[Auto_Balance_Ex]; 1577 | 1578 | float Average_Lum_ZPD = PrepDepth(float2(ABEA.x + texcoord.x * ABEA.y, ABEA.z + texcoord.y * ABEA.w))[0][0], Average_Lum_Bottom = PrepDepth( texcoord )[0][0]; 1579 | 1580 | const int Num_of_Values = 6; //6 total array values that map to the textures width. 1581 | float Storage__Array[Num_of_Values] = { tex2D(SamplerDMWoWvx,0).x, //0.083 1582 | tex2D(SamplerDMWoWvx,1).x, //0.250 1583 | tex2D(SamplerDMWoWvx,int2(0,1)).x, //0.416 1584 | 1.0, //0.583 1585 | tex2D(SamplerzBufferWoWvx_P,1).y, //0.750 1586 | tex2D(SamplerzBufferWoWvx_P,int2(0,1)).y};//0.916 1587 | 1588 | //Set a avr size for the Number of lines needed in texture storage. 1589 | float Grid = floor(texcoord.y * BUFFER_HEIGHT * BUFFER_RCP_HEIGHT * Num_of_Values); 1590 | 1591 | return float4(Average_Lum_ZPD,Average_Lum_Bottom,Storage__Array[int(fmod(Grid,Num_of_Values))],tex2Dlod(SamplerDMWoWvx,float4(texcoord,0,0)).y); 1592 | } 1593 | ////////////////////////////////////////////////////////////////////Logo//////////////////////////////////////////////////////////////////////////// 1594 | #define _f float // Text rendering code copied/pasted from https://www.shadertoy.com/view/4dtGD2 by Hamneggs 1595 | static const _f CH_A = _f(0x69f99), CH_B = _f(0x79797), CH_C = _f(0xe111e), 1596 | CH_D = _f(0x79997), CH_E = _f(0xf171f), CH_F = _f(0xf1711), 1597 | CH_G = _f(0xe1d96), CH_H = _f(0x99f99), CH_I = _f(0xf444f), 1598 | CH_J = _f(0x88996), CH_K = _f(0x95159), CH_L = _f(0x1111f), 1599 | CH_M = _f(0x9fd99), CH_N = _f(0x9bd99), CH_O = _f(0x69996), 1600 | CH_P = _f(0x79971), CH_Q = _f(0x69b5a), CH_R = _f(0x79759), 1601 | CH_S = _f(0xe1687), CH_T = _f(0xf4444), CH_U = _f(0x99996), 1602 | CH_V = _f(0x999a4), CH_W = _f(0x999f9), CH_X = _f(0x99699), 1603 | CH_Y = _f(0x99e8e), CH_Z = _f(0xf843f), CH_0 = _f(0x6bd96), 1604 | CH_1 = _f(0x46444), CH_2 = _f(0x6942f), CH_3 = _f(0x69496), 1605 | CH_4 = _f(0x99f88), CH_5 = _f(0xf1687), CH_6 = _f(0x61796), 1606 | CH_7 = _f(0xf8421), CH_8 = _f(0x69696), CH_9 = _f(0x69e84), 1607 | CH_APST = _f(0x66400), CH_PI = _f(0x0faa9), CH_UNDS = _f(0x0000f), 1608 | CH_HYPH = _f(0x00600), CH_TILD = _f(0x0a500), CH_PLUS = _f(0x02720), 1609 | CH_EQUL = _f(0x0f0f0), CH_SLSH = _f(0x08421), CH_EXCL = _f(0x33303), 1610 | CH_QUES = _f(0x69404), CH_COMM = _f(0x00032), CH_FSTP = _f(0x00002), 1611 | CH_QUOT = _f(0x55000), CH_BLNK = _f(0x00000), CH_COLN = _f(0x00202), 1612 | CH_LPAR = _f(0x42224), CH_RPAR = _f(0x24442); 1613 | #define MAP_SIZE float2(4,5) 1614 | #undef flt 1615 | //returns the status of a bit in a bitmap. This is done value-wise, so the exact representation of the float doesn't really matter. 1616 | float getBit( float map, float index ) 1617 | { // Ooh -index takes out that divide :) 1618 | return fmod( floor( map * exp2(-index) ), 2.0 ); 1619 | } 1620 | 1621 | float drawChar( float Char, float2 pos, float2 size, float2 TC ) 1622 | { // Subtract our position from the current TC so that we can know if we're inside the bounding box or not. 1623 | TC -= pos; 1624 | // Divide the screen space by the size, so our bounding box is 1x1. 1625 | TC /= size; 1626 | // Create a place to store the result & Branchless bounding box check. 1627 | float res = step(0.0,min(TC.x,TC.y)) - step(1.0,max(TC.x,TC.y)); 1628 | // Go ahead and multiply the TC by the bitmap size so we can work in bitmap space coordinates. 1629 | TC *= MAP_SIZE; 1630 | // Get the appropriate bit and return it. 1631 | res*=getBit( Char, 4.0*floor(TC.y) + floor(TC.x) ); 1632 | return saturate(res); 1633 | } 1634 | 1635 | float3 Out(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 1636 | { 1637 | float2 TC = float2(texcoord.x,1-texcoord.y); 1638 | float Text_Timer = 25000, BT = smoothstep(0,1,sin(timer*(3.75/1000))), Size = 1.1, Depth3D, Read_Help, Supported, ET, ETC, ETTF, ETTC, SetFoV, FoV, Post, Effect, NoPro, NotCom, Mod, Needs, Net, Over, Set, AA, Emu, Not, No, Help, Fix, Need, State, SetAA, SetWP, Work; 1639 | float3 Color = PS_calcLR(texcoord).rgb; //Color = BlurZ(SamplerzBufferN,texcoord); 1640 | 1641 | if(RHW || NCW || NPW || NFM || PEW || DSW || OSW || DAA || NDW || WPW || FOV || EDW) 1642 | Text_Timer = 30000; 1643 | 1644 | [branch] if(timer <= Text_Timer || Text_Info) 1645 | { // Set a general character size... 1646 | float2 charSize = float2(.00875, .0125) * Size; 1647 | // Starting position. 1648 | float2 charPos = float2( 0.009, 0.9725); 1649 | //Needs Copy Depth and/or Depth Selection 1650 | Needs += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1651 | Needs += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1652 | Needs += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1653 | Needs += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1654 | Needs += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1655 | Needs += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1656 | Needs += drawChar( CH_C, charPos, charSize, TC); charPos.x += .01 * Size; 1657 | Needs += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1658 | Needs += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1659 | Needs += drawChar( CH_Y, charPos, charSize, TC); charPos.x += .01 * Size; 1660 | Needs += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1661 | Needs += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1662 | Needs += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1663 | Needs += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1664 | Needs += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1665 | Needs += drawChar( CH_H, charPos, charSize, TC); charPos.x += .01 * Size; 1666 | Needs += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1667 | Needs += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1668 | Needs += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1669 | Needs += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1670 | Needs += drawChar( CH_SLSH, charPos, charSize, TC); charPos.x += .01 * Size; 1671 | Needs += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1672 | Needs += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1673 | Needs += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1674 | Needs += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1675 | Needs += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1676 | Needs += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1677 | Needs += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1678 | Needs += drawChar( CH_H, charPos, charSize, TC); charPos.x += .01 * Size; 1679 | Needs += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1680 | Needs += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1681 | Needs += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1682 | Needs += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1683 | Needs += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1684 | Needs += drawChar( CH_C, charPos, charSize, TC); charPos.x += .01 * Size; 1685 | Needs += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1686 | Needs += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1687 | Needs += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1688 | Needs += drawChar( CH_N, charPos, charSize, TC); 1689 | //Network Play May Need Modded DLL 1690 | charPos = float2( 0.009, 0.955); 1691 | Work += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1692 | Work += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1693 | Work += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1694 | Work += drawChar( CH_W, charPos, charSize, TC); charPos.x += .01 * Size; 1695 | Work += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1696 | Work += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1697 | Work += drawChar( CH_K, charPos, charSize, TC); charPos.x += .01 * Size; 1698 | Work += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1699 | Work += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1700 | Work += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1701 | Work += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1702 | Work += drawChar( CH_Y, charPos, charSize, TC); charPos.x += .01 * Size; 1703 | Work += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1704 | Work += drawChar( CH_M, charPos, charSize, TC); charPos.x += .01 * Size; 1705 | Work += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1706 | Work += drawChar( CH_Y, charPos, charSize, TC); charPos.x += .01 * Size; 1707 | Work += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1708 | Work += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1709 | Work += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1710 | Work += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1711 | Work += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1712 | Work += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1713 | Work += drawChar( CH_M, charPos, charSize, TC); charPos.x += .01 * Size; 1714 | Work += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1715 | Work += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1716 | Work += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1717 | Work += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1718 | Work += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1719 | Work += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1720 | Work += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1721 | Work += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1722 | Work += drawChar( CH_L, charPos, charSize, TC); 1723 | //Supported Emulator Detected 1724 | charPos = float2( 0.009, 0.9375); 1725 | Supported += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1726 | Supported += drawChar( CH_U, charPos, charSize, TC); charPos.x += .01 * Size; 1727 | Supported += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1728 | Supported += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1729 | Supported += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1730 | Supported += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1731 | Supported += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1732 | Supported += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1733 | Supported += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1734 | Supported += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1735 | Supported += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1736 | Supported += drawChar( CH_M, charPos, charSize, TC); charPos.x += .01 * Size; 1737 | Supported += drawChar( CH_U, charPos, charSize, TC); charPos.x += .01 * Size; 1738 | Supported += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1739 | Supported += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1740 | Supported += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1741 | Supported += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1742 | Supported += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1743 | Supported += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1744 | Supported += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1745 | Supported += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1746 | Supported += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1747 | Supported += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1748 | Supported += drawChar( CH_C, charPos, charSize, TC); charPos.x += .01 * Size; 1749 | Supported += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1750 | Supported += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1751 | Supported += drawChar( CH_D, charPos, charSize, TC); 1752 | //Disable CA/MB/Dof/Grain 1753 | charPos = float2( 0.009, 0.920); 1754 | Effect += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1755 | Effect += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1756 | Effect += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1757 | Effect += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1758 | Effect += drawChar( CH_B, charPos, charSize, TC); charPos.x += .01 * Size; 1759 | Effect += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1760 | Effect += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1761 | Effect += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1762 | Effect += drawChar( CH_C, charPos, charSize, TC); charPos.x += .01 * Size; 1763 | Effect += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1764 | Effect += drawChar( CH_SLSH, charPos, charSize, TC); charPos.x += .01 * Size; 1765 | Effect += drawChar( CH_M, charPos, charSize, TC); charPos.x += .01 * Size; 1766 | Effect += drawChar( CH_B, charPos, charSize, TC); charPos.x += .01 * Size; 1767 | Effect += drawChar( CH_SLSH, charPos, charSize, TC); charPos.x += .01 * Size; 1768 | Effect += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1769 | Effect += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1770 | Effect += drawChar( CH_F, charPos, charSize, TC); charPos.x += .01 * Size; 1771 | Effect += drawChar( CH_SLSH, charPos, charSize, TC); charPos.x += .01 * Size; 1772 | Effect += drawChar( CH_G, charPos, charSize, TC); charPos.x += .01 * Size; 1773 | Effect += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1774 | Effect += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1775 | Effect += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1776 | Effect += drawChar( CH_N, charPos, charSize, TC); 1777 | //Disable Or Set TAA/MSAA/AA/DLSS 1778 | charPos = float2( 0.009, 0.9025); 1779 | SetAA += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1780 | SetAA += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1781 | SetAA += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1782 | SetAA += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1783 | SetAA += drawChar( CH_B, charPos, charSize, TC); charPos.x += .01 * Size; 1784 | SetAA += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1785 | SetAA += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1786 | SetAA += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1787 | SetAA += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1788 | SetAA += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1789 | SetAA += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1790 | SetAA += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1791 | SetAA += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1792 | SetAA += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1793 | SetAA += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1794 | SetAA += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1795 | SetAA += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1796 | SetAA += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1797 | SetAA += drawChar( CH_SLSH, charPos, charSize, TC); charPos.x += .01 * Size; 1798 | SetAA += drawChar( CH_M, charPos, charSize, TC); charPos.x += .01 * Size; 1799 | SetAA += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1800 | SetAA += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1801 | SetAA += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1802 | SetAA += drawChar( CH_SLSH, charPos, charSize, TC); charPos.x += .01 * Size; 1803 | SetAA += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1804 | SetAA += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1805 | SetAA += drawChar( CH_SLSH, charPos, charSize, TC); charPos.x += .01 * Size; 1806 | SetAA += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1807 | SetAA += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1808 | SetAA += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1809 | SetAA += drawChar( CH_S, charPos, charSize, TC); 1810 | //Set Weapon Profile 1811 | charPos = float2( 0.009, 0.885); 1812 | SetWP += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1813 | SetWP += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1814 | SetWP += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1815 | SetWP += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1816 | SetWP += drawChar( CH_W, charPos, charSize, TC); charPos.x += .01 * Size; 1817 | SetWP += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1818 | SetWP += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1819 | SetWP += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1820 | SetWP += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1821 | SetWP += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1822 | SetWP += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1823 | SetWP += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1824 | SetWP += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1825 | SetWP += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1826 | SetWP += drawChar( CH_F, charPos, charSize, TC); charPos.x += .01 * Size; 1827 | SetWP += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1828 | SetWP += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1829 | SetWP += drawChar( CH_E, charPos, charSize, TC); 1830 | //Set FoV 1831 | charPos = float2( 0.009, 0.8675); 1832 | SetFoV += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1833 | SetFoV += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1834 | SetFoV += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1835 | SetFoV += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1836 | SetFoV += drawChar( CH_F, charPos, charSize, TC); charPos.x += .01 * Size; 1837 | SetFoV += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1838 | SetFoV += drawChar( CH_V, charPos, charSize, TC); 1839 | //Read Help 1840 | charPos = float2( 0.894, 0.9725); 1841 | Read_Help += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1842 | Read_Help += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1843 | Read_Help += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1844 | Read_Help += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1845 | Read_Help += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1846 | Read_Help += drawChar( CH_H, charPos, charSize, TC); charPos.x += .01 * Size; 1847 | Read_Help += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1848 | Read_Help += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1849 | Read_Help += drawChar( CH_P, charPos, charSize, TC); 1850 | //New Start 1851 | charPos = float2( 0.009, 0.018); 1852 | // No Profile 1853 | NoPro += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1854 | NoPro += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1855 | NoPro += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1856 | NoPro += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1857 | NoPro += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1858 | NoPro += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1859 | NoPro += drawChar( CH_F, charPos, charSize, TC); charPos.x += .01 * Size; 1860 | NoPro += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1861 | NoPro += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1862 | NoPro += drawChar( CH_E, charPos, charSize, TC); charPos.x = 0.009; 1863 | //Not Compatible 1864 | NotCom += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1865 | NotCom += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1866 | NotCom += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1867 | NotCom += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1868 | NotCom += drawChar( CH_C, charPos, charSize, TC); charPos.x += .01 * Size; 1869 | NotCom += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1870 | NotCom += drawChar( CH_P, charPos, charSize, TC); charPos.x += .01 * Size; 1871 | NotCom += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1872 | NotCom += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1873 | NotCom += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1874 | NotCom += drawChar( CH_B, charPos, charSize, TC); charPos.x += .01 * Size; 1875 | NotCom += drawChar( CH_L, charPos, charSize, TC); charPos.x += .01 * Size; 1876 | NotCom += drawChar( CH_E, charPos, charSize, TC); charPos.x = 0.009; 1877 | //Needs Fix/Mod 1878 | Mod += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1879 | Mod += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1880 | Mod += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1881 | Mod += drawChar( CH_D, charPos, charSize, TC); charPos.x += .01 * Size; 1882 | Mod += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1883 | Mod += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1884 | Mod += drawChar( CH_F, charPos, charSize, TC); charPos.x += .01 * Size; 1885 | Mod += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1886 | Mod += drawChar( CH_X, charPos, charSize, TC); charPos.x += .01 * Size; 1887 | Mod += drawChar( CH_SLSH, charPos, charSize, TC); charPos.x += .01 * Size; 1888 | Mod += drawChar( CH_M, charPos, charSize, TC); charPos.x += .01 * Size; 1889 | Mod += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1890 | Mod += drawChar( CH_D, charPos, charSize, TC); charPos.x = 0.009; 1891 | //Overwatch.fxh Missing 1892 | State += drawChar( CH_O, charPos, charSize, TC); charPos.x += .01 * Size; 1893 | State += drawChar( CH_V, charPos, charSize, TC); charPos.x += .01 * Size; 1894 | State += drawChar( CH_E, charPos, charSize, TC); charPos.x += .01 * Size; 1895 | State += drawChar( CH_R, charPos, charSize, TC); charPos.x += .01 * Size; 1896 | State += drawChar( CH_W, charPos, charSize, TC); charPos.x += .01 * Size; 1897 | State += drawChar( CH_A, charPos, charSize, TC); charPos.x += .01 * Size; 1898 | State += drawChar( CH_T, charPos, charSize, TC); charPos.x += .01 * Size; 1899 | State += drawChar( CH_C, charPos, charSize, TC); charPos.x += .01 * Size; 1900 | State += drawChar( CH_H, charPos, charSize, TC); charPos.x += .01 * Size; 1901 | State += drawChar( CH_FSTP, charPos, charSize, TC); charPos.x += .01 * Size; 1902 | State += drawChar( CH_F, charPos, charSize, TC); charPos.x += .01 * Size; 1903 | State += drawChar( CH_X, charPos, charSize, TC); charPos.x += .01 * Size; 1904 | State += drawChar( CH_H, charPos, charSize, TC); charPos.x += .01 * Size; 1905 | State += drawChar( CH_BLNK, charPos, charSize, TC); charPos.x += .01 * Size; 1906 | State += drawChar( CH_M, charPos, charSize, TC); charPos.x += .01 * Size; 1907 | State += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1908 | State += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1909 | State += drawChar( CH_S, charPos, charSize, TC); charPos.x += .01 * Size; 1910 | State += drawChar( CH_I, charPos, charSize, TC); charPos.x += .01 * Size; 1911 | State += drawChar( CH_N, charPos, charSize, TC); charPos.x += .01 * Size; 1912 | State += drawChar( CH_G, charPos, charSize, TC); 1913 | //New Size 1914 | float D3D_Size_A = 1.375,D3D_Size_B = 0.75; 1915 | float2 charSize_A = float2(.00875, .0125) * D3D_Size_A, charSize_B = float2(.00875, .0125) * D3D_Size_B; 1916 | //New Start Pos 1917 | charPos = float2( 0.862, 0.018); 1918 | //Depth3D.Info Logo/Website 1919 | Depth3D += drawChar( CH_D, charPos, charSize_A, TC); charPos.x += .01 * D3D_Size_A; 1920 | Depth3D += drawChar( CH_E, charPos, charSize_A, TC); charPos.x += .01 * D3D_Size_A; 1921 | Depth3D += drawChar( CH_P, charPos, charSize_A, TC); charPos.x += .01 * D3D_Size_A; 1922 | Depth3D += drawChar( CH_T, charPos, charSize_A, TC); charPos.x += .01 * D3D_Size_A; 1923 | Depth3D += drawChar( CH_H, charPos, charSize_A, TC); charPos.x += .01 * D3D_Size_A; 1924 | Depth3D += drawChar( CH_3, charPos, charSize_A, TC); charPos.x += .01 * D3D_Size_A; 1925 | Depth3D += drawChar( CH_D, charPos, charSize_A, TC); charPos.x += 0.008 * D3D_Size_A; 1926 | Depth3D += drawChar( CH_FSTP, charPos, charSize_A, TC); charPos.x += 0.01 * D3D_Size_A; 1927 | charPos = float2( 0.963, 0.018); 1928 | Depth3D += drawChar( CH_I, charPos, charSize_B, TC); charPos.x += .01 * D3D_Size_B; 1929 | Depth3D += drawChar( CH_N, charPos, charSize_B, TC); charPos.x += .01 * D3D_Size_B; 1930 | Depth3D += drawChar( CH_F, charPos, charSize_B, TC); charPos.x += .01 * D3D_Size_B; 1931 | Depth3D += drawChar( CH_O, charPos, charSize_B, TC); 1932 | 1933 | //Text Information 1934 | if(DSW) 1935 | Need = Needs; 1936 | if(RHW) 1937 | Help = Read_Help; 1938 | if(NDW) 1939 | Net = Work; 1940 | if(PEW) 1941 | Post = Effect; 1942 | if(WPW) 1943 | Set = SetWP; 1944 | if(DAA) 1945 | AA = SetAA; 1946 | if(FOV) 1947 | FoV = SetFoV; 1948 | if(EDW) 1949 | Emu = Supported; 1950 | //Blinking Text Warnings 1951 | if(NPW) 1952 | No = NoPro * BT; 1953 | if(NCW) 1954 | Not = NotCom * BT; 1955 | if(NFM) 1956 | Fix = Mod * BT; 1957 | if(OSW) 1958 | Over = State * BT; 1959 | //Website 1960 | return Depth3D+Help+Post+No+Not+Net+Fix+Need+Over+AA+Set+FoV+Emu+ET ? (1-texcoord.y*50.0+48.85)*texcoord.y-0.500: Color; 1961 | } 1962 | else 1963 | return Color; 1964 | } 1965 | ///////////////////////////////////////////////////////////////////ReShade.fxh////////////////////////////////////////////////////////////////////// 1966 | void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD) 1967 | {// Vertex shader generating a triangle covering the entire screen 1968 | texcoord.x = (id == 2) ? 2.0 : 0.0; 1969 | texcoord.y = (id == 1) ? 2.0 : 0.0; 1970 | position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 1971 | } 1972 | 1973 | technique SuperDepth3D_WoWvx 1974 | < ui_tooltip = "Suggestion : You Can Enable 'Performance Mode Checkbox,' in the lower bottom right of the ReShade's Main UI.\n" 1975 | "Do this once you set your 3D settings of course."; > 1976 | { 1977 | #if D_Frame || DFW 1978 | pass Delay_Frame 1979 | { 1980 | VertexShader = PostProcessVS; 1981 | PixelShader = DelayFrame; 1982 | RenderTarget = texDF; 1983 | } 1984 | pass Current_Frame 1985 | { 1986 | VertexShader = PostProcessVS; 1987 | PixelShader = CurrentFrame; 1988 | RenderTarget = texCF; 1989 | } 1990 | #else 1991 | pass AverageLuminance 1992 | { 1993 | VertexShader = PostProcessVS; 1994 | PixelShader = Average_Luminance; 1995 | RenderTarget = texLumWoWvx; 1996 | } 1997 | #endif 1998 | pass DepthBuffer 1999 | { 2000 | VertexShader = PostProcessVS; 2001 | PixelShader = DepthMap; 2002 | RenderTarget = texDMWoWvx; 2003 | } 2004 | pass Modzbuffer 2005 | { 2006 | VertexShader = PostProcessVS; 2007 | PixelShader = Mod_Z; 2008 | RenderTarget0 = texzBufferWoWvx_P; 2009 | RenderTarget1 = texzBufferWoWvx_L; 2010 | } 2011 | pass StereoOut 2012 | { 2013 | VertexShader = PostProcessVS; 2014 | PixelShader = Out; 2015 | } 2016 | #if D_Frame || DFW 2017 | pass AverageLuminance 2018 | { 2019 | VertexShader = PostProcessVS; 2020 | PixelShader = Average_Luminance; 2021 | RenderTarget = texLumWoWvx; 2022 | } 2023 | #endif 2024 | } 2025 | -------------------------------------------------------------------------------- /Other Shaders/VirtualNose.fx: -------------------------------------------------------------------------------- 1 | ////----------------// 2 | ///**Virtual Nose**/// 3 | //----------------//// 4 | 5 | 6 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 7 | //* VR Virtual Nose for reducing nausia AKA VR Sickness *// 8 | //* For Reshade 3.0+ *// 9 | //* --------------------------------- *// 10 | //* This work is licensed under a Creative Commons Attribution 3.0 Unported License. *// 11 | //* So you are free to share, modify and adapt it for your needs, and even use it for commercial use. *// 12 | //* I would also love to hear about a project you are using it with. *// 13 | //* https://creativecommons.org/licenses/by/3.0/us/ *// 14 | //* *// 15 | //* Jose Negrete AKA BlueSkyDefender *// 16 | //* *// 17 | //* http://reshade.me/forum/shader-presentation/2128-sidebyside-3d-depth-map-based-stereoscopic-shader *// 18 | //* --------------------------------- *// 19 | //* *// 20 | //* *// 21 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | uniform float BlurAdjust < 24 | ui_type = "drag"; 25 | ui_min = 0; ui_max = 1; 26 | ui_label = "Edge Blur Adjust"; 27 | ui_tooltip = "Use this to adjust Nose Blur.\n" 28 | "Default is 0.5."; 29 | ui_category = "Virtual Nose"; 30 | > = 0.5; 31 | 32 | uniform float Transparency < 33 | ui_type = "drag"; 34 | ui_min = 0; ui_max = 1; 35 | ui_label = "Nose Transparency"; 36 | ui_tooltip = "Use this to adjust transparency.\n" 37 | "Default is One."; 38 | ui_category = "Virtual Nose"; 39 | > = 1.0; 40 | 41 | uniform int Ambiance < 42 | ui_type = "combo"; 43 | ui_items = "Off\0On Shade\0On Color\0"; 44 | ui_label = "Nose Ambiance"; 45 | ui_tooltip = "Use this to allow ambiance to affect the nose.\n" 46 | "Default is Off."; 47 | ui_category = "Virtual Nose"; 48 | > = 0; 49 | 50 | uniform int Human_Skin_Color < 51 | #if Compatibility 52 | ui_type = "drag"; 53 | #else 54 | ui_type = "slider"; 55 | #endif 56 | ui_min = -4; ui_max = 4; 57 | ui_label = "Pick Base Skin Color"; 58 | ui_tooltip = "This option allows you to pick your skin color and turns on the Virtual Nose.\n" 59 | "Default is Zero, Off."; 60 | ui_category = "Virtual Nose"; 61 | > = 0; 62 | 63 | uniform float separate < 64 | #if Compatibility 65 | ui_type = "drag"; 66 | #else 67 | ui_type = "slider"; 68 | #endif 69 | ui_min = 0; ui_max = 0.25; 70 | ui_label = "Separate Nose"; 71 | ui_tooltip = "Use this to split the Nose apart.\n" 72 | "Default is 0.0."; 73 | ui_category = "Virtual Nose"; 74 | > = 0.0; 75 | 76 | uniform float3 NoseWH < 77 | #if Compatibility 78 | ui_type = "drag"; 79 | #else 80 | ui_type = "slider"; 81 | #endif 82 | ui_min = 0; ui_max = 1.0; 83 | ui_label = "Adjust Nose"; 84 | ui_tooltip = "Adjust the Width and Height of the Virtual Nose.\n" 85 | "Default is float3(0.625,0.375,0.125)."; 86 | ui_category = "Virtual Nose"; 87 | > = float3(0.625,0.375,0.125); 88 | 89 | //Human Skin Color// 90 | float3 HSC() 91 | { 92 | float3 HSC; 93 | if(Human_Skin_Color == -4) 94 | HSC = float3(247,217,214); 95 | else if(Human_Skin_Color == -3) 96 | HSC = float3(240,186,173); 97 | else if(Human_Skin_Color == -2) 98 | HSC = float3(212,128,107); 99 | else if(Human_Skin_Color == -1) 100 | HSC = float3(230,178,148); 101 | else if(Human_Skin_Color == 0) 102 | HSC = float3(255,255,255); 103 | else if(Human_Skin_Color == 1) 104 | HSC = float3(235,179,133); 105 | else if(Human_Skin_Color == 2) 106 | HSC = float3(195,116,77); 107 | else if(Human_Skin_Color == 3) 108 | HSC = float3(69,42,29); 109 | else if(Human_Skin_Color == 4) 110 | HSC = float3(34,21,15); 111 | return HSC; 112 | } 113 | /////////////////////////////////////////////D3D Starts Here///////////////////////////////////////////////////////////////// 114 | #define pix float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT) 115 | #define TextureSize float2(BUFFER_WIDTH, BUFFER_HEIGHT) 116 | #define HumanColor float3( HSC().x/255, HSC().y/255, HSC().z/255)//RGB Conversion 0-1 range 117 | #define NWidth lerp(-10,5,saturate(NoseWH.x)) 118 | #define NHight lerp(-5,5,saturate(NoseWH.y)) 119 | #define NSize lerp(-10,10,saturate(NoseWH.z)) 120 | #define B_A lerp(1,11,saturate(BlurAdjust)) 121 | texture BackBufferTex : COLOR; 122 | 123 | sampler BackBuffer 124 | { 125 | Texture = BackBufferTex; 126 | }; 127 | 128 | texture texShade { Width = 256*0.5; Height = 256*0.5; Format = RGBA8; MipLevels = 8;}; //Sample at 256x256*0.5 and a mip bias of 8 should be 1x1 129 | 130 | sampler ShadeSampler 131 | { 132 | Texture = texShade; 133 | MipLODBias = 8.0f; //Luminance adapted luminance value from 1x1 Texture Mip lvl of 8 134 | MinFilter = LINEAR; 135 | MagFilter = LINEAR; 136 | MipFilter = LINEAR; 137 | }; 138 | 139 | texture texNMR { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; MipLevels = 3;}; 140 | 141 | sampler NMRSampler 142 | { 143 | Texture = texNMR; 144 | MinFilter = LINEAR; 145 | MagFilter = LINEAR; 146 | MipFilter = LINEAR; 147 | }; 148 | 149 | texture texNML { Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; MipLevels = 3;}; 150 | 151 | sampler NMLSampler 152 | { 153 | Texture = texNML; 154 | MinFilter = LINEAR; 155 | MagFilter = LINEAR; 156 | MipFilter = LINEAR; 157 | }; 158 | 159 | float4 AbianceBlur(float2 texcoord : TEXCOORD0) 160 | { //unneeded array I was having fun 161 | float2 XYoffset[4] = { float2( 0, 1 ), float2( 0,-1 ), float2( 1, 0 ), float2(-1, 0) }; 162 | float4 Blur; 163 | Blur += tex2D(ShadeSampler,texcoord + XYoffset[0] * 5 * pix); 164 | Blur += tex2D(ShadeSampler,texcoord + XYoffset[1] * 5 * pix); 165 | Blur += tex2D(ShadeSampler,texcoord + XYoffset[2] * 5 * pix); 166 | Blur += tex2D(ShadeSampler,texcoord + XYoffset[3] * 5 * pix); 167 | Blur /= 4; 168 | return Blur; 169 | } 170 | float4 NoseCreation(float2 texcoord : TEXCOORD0) 171 | { 172 | texcoord.x -= 0.5*TextureSize.x*pix.x; 173 | texcoord.y -= 0.5*TextureSize.y*pix.y; 174 | //Nose Height 175 | texcoord.y += (-2.5+NHight) * 25.0f * pix.y; 176 | //Nose Size 177 | texcoord *= 1 + (5-NSize) * 0.05f; //unneeded extra math....... I got lazy 178 | //Nose Width 179 | texcoord.x *= 1 + (-NWidth) * 0.10f; 180 | //Strange Bug if I remove the -0 it loses postion???? 181 | float2 XY_A = float2(0 - texcoord.x * 5.0f, 0.75f - texcoord.y);//Bridge 182 | float dist_A = distance(XY_A.x,texcoord.x)+distance(XY_A.y,texcoord.y); 183 | 184 | float2 XY_B = float2(texcoord.x * 5.395f, 2.0f - texcoord.y * 4.165f);//Nostro 185 | float dist_B = XY_B.x * XY_B.x + XY_B.y * XY_B.y; 186 | 187 | texcoord.x *= 0.9625; 188 | float2 XY_C = float2(0 - texcoord.x * 5.0f, 0.75f -texcoord.y);//Bridge 189 | float dist_C = distance(XY_C.x,texcoord.x)+distance(XY_C.y,texcoord.y); 190 | //float2 MXY_B = texcoord * JJ; 191 | float2 XY_D = float2(texcoord.x * 5.395f, 2.0f - texcoord.y * 4.165f);//Nostro 192 | float dist_D = XY_D.x * XY_D.x + XY_D.y * XY_D.y; 193 | 194 | return float4(dist_A,dist_B,dist_C,dist_D); 195 | } 196 | 197 | float4 NoseColor(float2 texcoord : TEXCOORD0) 198 | { 199 | texcoord.x -= 0.5*TextureSize.x*pix.x; 200 | texcoord.y -= 0.5*TextureSize.y*pix.y; 201 | float4 Nose = smoothstep(0,1,(-texcoord.y * (-texcoord.x * 500.0f) * texcoord.y) * texcoord.x + 0.5f); 202 | Nose *= float4(HumanColor, 1); // Nose Color 203 | float DB = 8;//Dither Bit 204 | float noise = frac(sin(dot(texcoord, float2(12.9898, 78.233))) * 43758.5453); 205 | float dither_shift = (1.0 / (pow(2,DB) - 1.0)); 206 | float dither_shift_half = (dither_shift * 0.5); 207 | dither_shift = dither_shift * noise - dither_shift_half; 208 | Nose.rgb += -dither_shift; 209 | Nose.rgb += dither_shift; 210 | Nose.rgb += -dither_shift; 211 | return Nose; 212 | } 213 | 214 | float4 NoseMaskRight(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 215 | { 216 | texcoord.x -= separate; 217 | float4 Out = tex2D(BackBuffer,float2(texcoord.x + separate,texcoord.y)).rgba; 218 | float NC_A = NoseCreation(texcoord).x, NC_B = NoseCreation(texcoord).y, NC_C = NoseCreation(texcoord).z, NC_D = NoseCreation(texcoord).w, M; 219 | 220 | if(NC_A < 1 || NC_B < 1) 221 | { 222 | if(Ambiance == 0) 223 | Out.rgb = NoseColor(texcoord).rgb; 224 | else if(Ambiance == 1) 225 | Out.rgb = NoseColor(texcoord).rgb * dot(AbianceBlur(texcoord).rgb, float3(0.299, 0.587, 0.114)); 226 | else if(Ambiance == 2) 227 | Out.rgb = NoseColor(texcoord).rgb * AbianceBlur(texcoord).rgb; 228 | } 229 | 230 | if(NC_C < 1 || NC_D < 1) 231 | M = 1; 232 | else 233 | M = 0; 234 | 235 | return float4(Out.rgb,texcoord.x < 0.5 ? 0 : M); 236 | } 237 | 238 | float4 NoseMaskLeft(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 239 | { 240 | texcoord.x += separate; 241 | float4 Out = tex2D(BackBuffer,float2(texcoord.x - separate,texcoord.y)).rgba; 242 | float NC_A = NoseCreation(texcoord).x, NC_B = NoseCreation(texcoord).y, NC_C = NoseCreation(texcoord).z, NC_D = NoseCreation(texcoord).w, M; 243 | 244 | if(NC_A < 1 || NC_B < 1) 245 | { 246 | if(Ambiance == 0) 247 | Out.rgb = NoseColor(texcoord).rgb; 248 | else if(Ambiance == 1) 249 | Out.rgb = NoseColor(texcoord).rgb * dot(AbianceBlur(texcoord).rgb, float3(0.299, 0.587, 0.114)); 250 | else if(Ambiance == 2) 251 | Out.rgb = NoseColor(texcoord).rgb * AbianceBlur(texcoord).rgb; 252 | } 253 | 254 | if(NC_C < 1 || NC_D < 1) 255 | M = 1; 256 | else 257 | M = 0; 258 | 259 | return float4(Out.rgb,texcoord.x < 0.5 ? M : 0); 260 | } 261 | 262 | float4 MergeNose(float2 TC,int BB) 263 | { 264 | return TC.x < 0.5 ? tex2Dlod(NMLSampler,float4(TC,0,BB)) : tex2Dlod(NMRSampler,float4(TC,0,BB)); 265 | } 266 | float4 VNose(float2 texcoord : TEXCOORD0) 267 | { 268 | int Blur_Boost = floor(B_A * 0.5); 269 | float BA = B_A * 2.0f; 270 | float4 Blur, Out = tex2D(BackBuffer,texcoord);; 271 | if(Human_Skin_Color < 0 || Human_Skin_Color > 0) 272 | { 273 | Blur += MergeNose(texcoord + float2( 1, 0) * BA * pix,Blur_Boost); 274 | Blur += MergeNose(texcoord + float2(-1, 0) * BA * pix,Blur_Boost); 275 | Blur += MergeNose(texcoord + float2( 1, 0) * (BA * 0.75) * pix,Blur_Boost); 276 | Blur += MergeNose(texcoord + float2(-1, 0) * (BA * 0.75) * pix,Blur_Boost); 277 | Blur += MergeNose(texcoord + float2( 1, 0) * (BA * 0.50) * pix,Blur_Boost); 278 | Blur += MergeNose(texcoord + float2(-1, 0) * (BA * 0.50) * pix,Blur_Boost); 279 | Blur += MergeNose(texcoord + float2( 1, 0) * (BA * 0.25) * pix,Blur_Boost); 280 | Blur += MergeNose(texcoord + float2(-1, 0) * (BA * 0.25) * pix,Blur_Boost); 281 | Blur /= 8; 282 | float NM = MergeNose(texcoord,0).w; 283 | //Dumb AA 284 | NM += MergeNose(texcoord + float2(-pix.x, 0),0).w; 285 | NM += MergeNose(texcoord + float2( pix.x, 0),0).w; 286 | NM += MergeNose(texcoord + float2( 0, pix.y),0).w; 287 | NM += MergeNose(texcoord + float2( 0,-pix.y),0).w; 288 | 289 | Out = lerp(tex2D(BackBuffer,texcoord), Blur, NM / 5); 290 | } 291 | 292 | return lerp(Out,tex2D(BackBuffer,texcoord),1-Transparency); 293 | } 294 | 295 | float4 VRLeft(float2 texcoord : TEXCOORD0) 296 | { 297 | return tex2D(BackBuffer,float2(texcoord.x*0.5,texcoord.y)); 298 | } 299 | 300 | float4 Shade(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 301 | { 302 | float2 XYoffset[4] = { float2( 0, 1 ), float2( 0,-1 ), float2( 1, 0 ), float2(-1, 0) }; 303 | float4 Blur; 304 | Blur += VRLeft(texcoord + XYoffset[0] * 10 * pix); 305 | Blur += VRLeft(texcoord + XYoffset[1] * 10 * pix); 306 | Blur += VRLeft(texcoord + XYoffset[2] * 10 * pix); 307 | Blur += VRLeft(texcoord + XYoffset[3] * 10 * pix); 308 | Blur /= 4; 309 | return Blur; 310 | } 311 | ////////////////////////////////////////////////////////Logo///////////////////////////////////////////////////////////////////////// 312 | uniform float timer < source = "timer"; >; 313 | 314 | float4 Out(float4 position : SV_Position, float2 texcoord : TEXCOORD) : SV_Target 315 | { 316 | float PosX = 0.5*BUFFER_WIDTH*pix.x,PosY = 0.5*BUFFER_HEIGHT*pix.y; 317 | float4 Color = VNose(texcoord),Done,Website,D,E,P,T,H,Three,DD,Dot,I,N,F,O; 318 | 319 | if(timer <= 10000) 320 | { 321 | //DEPTH 322 | //D 323 | float PosXD = -0.035+PosX, offsetD = 0.001; 324 | float4 OneD = all( abs(float2( texcoord.x -PosXD, texcoord.y-PosY)) < float2(0.0025,0.009)); 325 | float4 TwoD = all( abs(float2( texcoord.x -PosXD-offsetD, texcoord.y-PosY)) < float2(0.0025,0.007)); 326 | D = OneD-TwoD; 327 | 328 | //E 329 | float PosXE = -0.028+PosX, offsetE = 0.0005; 330 | float4 OneE = all( abs(float2( texcoord.x -PosXE, texcoord.y-PosY)) < float2(0.003,0.009)); 331 | float4 TwoE = all( abs(float2( texcoord.x -PosXE-offsetE, texcoord.y-PosY)) < float2(0.0025,0.007)); 332 | float4 ThreeE = all( abs(float2( texcoord.x -PosXE, texcoord.y-PosY)) < float2(0.003,0.001)); 333 | E = (OneE-TwoE)+ThreeE; 334 | 335 | //P 336 | float PosXP = -0.0215+PosX, PosYP = -0.0025+PosY, offsetP = 0.001, offsetP1 = 0.002; 337 | float4 OneP = all( abs(float2( texcoord.x -PosXP, texcoord.y-PosYP)) < float2(0.0025,0.009*0.682)); 338 | float4 TwoP = all( abs(float2( texcoord.x -PosXP-offsetP, texcoord.y-PosYP)) < float2(0.0025,0.007*0.682)); 339 | float4 ThreeP = all( abs(float2( texcoord.x -PosXP+offsetP1, texcoord.y-PosY)) < float2(0.0005,0.009)); 340 | P = (OneP-TwoP) + ThreeP; 341 | 342 | //T 343 | float PosXT = -0.014+PosX, PosYT = -0.008+PosY; 344 | float4 OneT = all( abs(float2( texcoord.x -PosXT, texcoord.y-PosYT)) < float2(0.003,0.001)); 345 | float4 TwoT = all( abs(float2( texcoord.x -PosXT, texcoord.y-PosY)) < float2(0.000625,0.009)); 346 | T = OneT+TwoT; 347 | 348 | //H 349 | float PosXH = -0.0071+PosX; 350 | float4 OneH = all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.002,0.001)); 351 | float4 TwoH = all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.002,0.009)); 352 | float4 ThreeH = all( abs(float2( texcoord.x -PosXH, texcoord.y-PosY)) < float2(0.003,0.009)); 353 | H = (OneH-TwoH)+ThreeH; 354 | 355 | //Three 356 | float offsetFive = 0.001, PosX3 = -0.001+PosX; 357 | float4 OneThree = all( abs(float2( texcoord.x -PosX3, texcoord.y-PosY)) < float2(0.002,0.009)); 358 | float4 TwoThree = all( abs(float2( texcoord.x -PosX3 - offsetFive, texcoord.y-PosY)) < float2(0.003,0.007)); 359 | float4 ThreeThree = all( abs(float2( texcoord.x -PosX3, texcoord.y-PosY)) < float2(0.002,0.001)); 360 | Three = (OneThree-TwoThree)+ThreeThree; 361 | 362 | //DD 363 | float PosXDD = 0.006+PosX, offsetDD = 0.001; 364 | float4 OneDD = all( abs(float2( texcoord.x -PosXDD, texcoord.y-PosY)) < float2(0.0025,0.009)); 365 | float4 TwoDD = all( abs(float2( texcoord.x -PosXDD-offsetDD, texcoord.y-PosY)) < float2(0.0025,0.007)); 366 | DD = OneDD-TwoDD; 367 | 368 | //Dot 369 | float PosXDot = 0.011+PosX, PosYDot = 0.008+PosY; 370 | float4 OneDot = all( abs(float2( texcoord.x -PosXDot, texcoord.y-PosYDot)) < float2(0.00075,0.0015)); 371 | Dot = OneDot; 372 | 373 | //INFO 374 | //I 375 | float PosXI = 0.0155+PosX, PosYI = 0.004+PosY, PosYII = 0.008+PosY; 376 | float4 OneI = all( abs(float2( texcoord.x - PosXI, texcoord.y - PosY)) < float2(0.003,0.001)); 377 | float4 TwoI = all( abs(float2( texcoord.x - PosXI, texcoord.y - PosYI)) < float2(0.000625,0.005)); 378 | float4 ThreeI = all( abs(float2( texcoord.x - PosXI, texcoord.y - PosYII)) < float2(0.003,0.001)); 379 | I = OneI+TwoI+ThreeI; 380 | 381 | //N 382 | float PosXN = 0.0225+PosX, PosYN = 0.005+PosY,offsetN = -0.001; 383 | float4 OneN = all( abs(float2( texcoord.x - PosXN, texcoord.y - PosYN)) < float2(0.002,0.004)); 384 | float4 TwoN = all( abs(float2( texcoord.x - PosXN, texcoord.y - PosYN - offsetN)) < float2(0.003,0.005)); 385 | N = OneN-TwoN; 386 | 387 | //F 388 | float PosXF = 0.029+PosX, PosYF = 0.004+PosY, offsetF = 0.0005, offsetF1 = 0.001; 389 | float4 OneF = all( abs(float2( texcoord.x -PosXF-offsetF, texcoord.y-PosYF-offsetF1)) < float2(0.002,0.004)); 390 | float4 TwoF = all( abs(float2( texcoord.x -PosXF, texcoord.y-PosYF)) < float2(0.0025,0.005)); 391 | float4 ThreeF = all( abs(float2( texcoord.x -PosXF, texcoord.y-PosYF)) < float2(0.0015,0.00075)); 392 | F = (OneF-TwoF)+ThreeF; 393 | 394 | //O 395 | float PosXO = 0.035+PosX, PosYO = 0.004+PosY; 396 | float4 OneO = all( abs(float2( texcoord.x -PosXO, texcoord.y-PosYO)) < float2(0.003,0.005)); 397 | float4 TwoO = all( abs(float2( texcoord.x -PosXO, texcoord.y-PosYO)) < float2(0.002,0.003)); 398 | O = OneO-TwoO; 399 | } 400 | 401 | Website = D+E+P+T+H+Three+DD+Dot+I+N+F+O ? float4(1.0,1.0,1.0,1) : Color; 402 | 403 | if(timer >= 10000) 404 | { 405 | Done = Color; 406 | } 407 | else 408 | { 409 | Done = Website; 410 | } 411 | 412 | return Done; 413 | } 414 | 415 | ///////////////////////////////////////////////////////////ReShade.fxh///////////////////////////////////////////////////////////// 416 | 417 | // Vertex shader generating a triangle covering the entire screen 418 | void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD) 419 | { 420 | texcoord.x = (id == 2) ? 2.0 : 0.0; 421 | texcoord.y = (id == 1) ? 2.0 : 0.0; 422 | position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 423 | } 424 | 425 | //*Rendering passes*// 426 | technique Virtual_Nose 427 | { 428 | pass Ambiance_Shading 429 | { 430 | VertexShader = PostProcessVS; 431 | PixelShader = Shade; 432 | RenderTarget = texShade; 433 | } 434 | pass Nose_Mask_Right 435 | { 436 | VertexShader = PostProcessVS; 437 | PixelShader = NoseMaskRight; 438 | RenderTarget = texNMR; 439 | } 440 | pass Nose_Mask_Left 441 | { 442 | VertexShader = PostProcessVS; 443 | PixelShader = NoseMaskLeft; 444 | RenderTarget = texNML; 445 | } 446 | pass PBD 447 | { 448 | VertexShader = PostProcessVS; 449 | PixelShader = Out; 450 | } 451 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### **Post-Process shaders for ReShade** 2 | ### Highlighted Shaders for ReShade 3 | **SuperDepth3D**
4 | This shader allows for depth map-based 3D, similar to what NVIDIA offers with Compatibility Mode 3D and what TriDef does with Power 3D. SuperDepth3D provides much more control and support for different devices. 5 | 6 | ### Shader Assistant 7 | **Overwatch.fxh**
8 | Overwatch is a companion tool designed to enhance your experience with SuperDepth3D by automatically setting depth and 3D configurations in many games. It simplifies setup so you can spend less time tweaking and more time enjoying immersive gameplay. 9 | 10 | Honestly, this is where your donations make a real difference. They help me improve and expand Overwatch, making it smarter and compatible with more titles. Less hassle, more fun for everyone. 11 | 12 | ### Depth3D VR 13 | **Companion App**
14 | 15 | **This Software is now Deprecated.** 16 | 17 | This Free VR App, is a basic way to view my stereoscopic shaders on your OpenXR supported HMD.
18 | 19 | Installer Name: Depth3DXRCompanionApp_v1.9.7.exe
20 | Installer Size: 61.5 MB
21 | [Depth3D VR Companion App 1.9.7 Mega Download](https://mega.nz/file/yIoyHDjZ#1AN73XlZ7vBvnMz4xUligmM3zWYT-AVpKxa6-neVelM)
22 | Uninstaller: Yes
23 | Supported OS: Windows 8.1, or 10.
24 | Requirements: OpenXR | GPU supporting DX11+ | .NET Framework 4.0
25 | Recommended System Specs are what is needed to run the game and then some.
26 | Resolution & AR: 720p - 4K & 16:9 / 24:9
27 | SHA1: 6BCE6A4397C9BE283D860B9DAD6181FE12178EBF
28 | 29 | No support for Laptops with Hybrid systems. Though there are workarounds as users noted. 30 | 31 | ### Game Compatibility 32 | **Game Compatibility Information** 33 | 34 | https://www.pcgamingwiki.com/wiki/ReShade#Compatibility_list 35 | At this link look for Depth Map Compatibility. 36 | This should work for Both AMD/Nividia GPUs. 37 | 38 | ### Contact & Donation Links 39 | 40 | **Want to leave me a message?:** BlueSkyDefender
41 | Also my steam page https://steamcommunity.com/id/BlueSkyDefender
42 | 43 | **Want to leave me a message or talk to me?:** BlueSkyDefender
44 | Discord Server https://discord.gg/W2f7YhX
45 | 46 | **Want to donate?:** 47 | If you enjoyed these shaders and like to donate you can do so at https://www.buymeacoffee.com/BlueSkyDefender 48 | -------------------------------------------------------------------------------- /Shaders/AXAA.fxh: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | //* AXAA: Adaptive approXimate Anti-Aliasing 3 | //* Jae-Ho Nah, Sunho Ki, Yeongkyu Lim, Jinhong Park, and Chulho Shin 4 | //* LG Electronics 5 | //* 6 | //* FXAA: Fast approXimate anti-aliasing 7 | //* Timothy Lottes 8 | //* NVIDIA Corporation 9 | //* 10 | //* https://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf 11 | //* https://nahjaeho.github.io/papers/SIG2016/SIG2016_AXAA.pdf 12 | //* 13 | //* ---------------------------------------------------------------------------------- 14 | //* File: es3-kepler\FXAA\assets\shaders/FXAA_Default.frag 15 | //* SDK Version: v3.00 16 | //* Email: gameworks@nvidia.com 17 | //* Site: http://developer.nvidia.com/ 18 | //* 19 | //* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. 20 | //* 21 | //* Redistribution and use in source and binary forms, with or without 22 | //* modification, are permitted provided that the following conditions 23 | //* are met: 24 | //* * Redistributions of source code must retain the above copyright 25 | //* notice, this list of conditions and the following disclaimer. 26 | //* * Redistributions in binary form must reproduce the above copyright 27 | //* notice, this list of conditions and the following disclaimer in the 28 | //* documentation and/or other materials provided with the distribution. 29 | //* * Neither the name of NVIDIA CORPORATION nor the names of its 30 | //* contributors may be used to endorse or promote products derived 31 | //* from this software without specific prior written permission. 32 | //* 33 | //* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 34 | //* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 35 | //* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 36 | //* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 37 | //* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 38 | //* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 39 | //* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 40 | //* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 41 | //* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | //* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 43 | //* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | //* 45 | //* ---------------------------------------------------------------------------------- 46 | //* 47 | //* Port/Modified to ReShadeFX by Jose Negrete AKA BlueSkyDefender - Depth3D.info 48 | //* 49 | //* Notes: 50 | //* ---------------------------------------------------------------------------------- 51 | //* Since there where no example shaders I had to follow the white paper from SIGGRAPH 52 | //* 2016 Talking about AXAA. I also had to port FXAA aswell to ReShadeFX. I didn't check 53 | //* if ReShade already had a working FXAA. But,I am sure there already is one. Finding 54 | //* the licence was harder than porting the shader. 55 | //* 56 | //* - God what a pain 57 | //* 58 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 59 | #if __RENDERER__ >= 0x10000 && __RENDERER__ < 0x20000 //This was added due to not compiling on AMD OpenGL 60 | #define OpenGL_Switch 1 61 | #else 62 | #define OpenGL_Switch 0 63 | #endif 64 | //////////////////////////////////////////////////////////Defines/////////////////////////////////////////////////////////////////// 65 | #define Pix float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT) 66 | //#define FXAA_EDGE_THRESHOLD (1.0/8.0) // Replaced with AXAA early Return 67 | //#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0) // Replaced with AXAA early Return 68 | #define FXAA_SEARCH_STEPS 32 69 | #define FXAA_SEARCH_ACCELERATION 1 70 | #define FXAA_SEARCH_THRESHOLD (1.0/4.0) 71 | #define FXAA_SUBPIX 1 72 | #define FXAA_SUBPIX_FASTER 0 73 | #define FXAA_SUBPIX_CAP (3.0/4.0) 74 | #define FXAA_SUBPIX_TRIM (1.0/4.0) 75 | #define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM)) 76 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 77 | float4 FxaaTexOff(sampler tex, float2 pos, int2 off) 78 | { 79 | #if OpenGL_Switch 80 | float2 texelSize = Pix; 81 | float2 uv = pos + float2(off) * texelSize; 82 | return tex2Dlod(tex, float4(uv, 0, 0)); 83 | #else 84 | return tex2Dlod(tex, float4(pos.xy,0,0), off); 85 | #endif 86 | } 87 | 88 | float FxaaLuma(float3 rgb) 89 | { 90 | return rgb.y * (0.587 / 0.299) + rgb.x; 91 | } 92 | 93 | float3 FxaaFilterReturn(float3 rgb) 94 | { 95 | return rgb; 96 | } 97 | 98 | float4 FxaaTexGrad(sampler tex, float2 pos, float2 grad) 99 | { 100 | return tex2Dgrad(tex, pos.xy, grad, grad); 101 | } 102 | 103 | float3 FxaaLerp3(float3 a, float3 b, float amountOfA) 104 | { 105 | return (float3(-amountOfA,0,0) * b) + 106 | ((a * float3(amountOfA,0,0)) + b); 107 | } 108 | 109 | float4 FxaaTexLod(sampler tex, float2 pos) 110 | { 111 | return tex2Dlod(tex, float4(pos.xy, 0.0,0)); 112 | } 113 | 114 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 115 | 116 | float4 AXAA(sampler tex,float2 texcoord) 117 | { 118 | //SEARCH MAP 119 | float3 rgbN = FxaaTexOff(tex, texcoord, int2( 0,-1)).xyz; 120 | float3 rgbW = FxaaTexOff(tex, texcoord, int2(-1, 0)).xyz; 121 | float3 rgbM = FxaaTexOff(tex, texcoord, int2( 0, 0)).xyz; 122 | float3 rgbE = FxaaTexOff(tex, texcoord, int2( 1, 0)).xyz; 123 | float3 rgbS = FxaaTexOff(tex, texcoord, int2( 0, 1)).xyz; 124 | float lumaN = FxaaLuma(rgbN); 125 | float lumaW = FxaaLuma(rgbW); 126 | float lumaM = FxaaLuma(rgbM); 127 | float lumaE = FxaaLuma(rgbE); 128 | float lumaS = FxaaLuma(rgbS); 129 | float rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE))); 130 | float rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE))); 131 | float range = rangeMax - rangeMin; 132 | 133 | float rangeMid = 0.5 * (rangeMin + rangeMax); 134 | float alpha = 0.1 * (rangeMax - rangeMin); // Alpha is 10% of the lum range 135 | 136 | // Check if current pix is in the rangeMid ± alpha and EXIT 137 | if (abs(lumaM - rangeMid) <= alpha) 138 | return float4(FxaaFilterReturn(rgbM), 1.0f); 139 | 140 | /* // FXAA old way of doing it 141 | if (range < max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD)) 142 | { 143 | return float4(FxaaFilterReturn(rgbM), 1.0f); 144 | } 145 | */ 146 | float3 rgbL = rgbN + rgbW + rgbM + rgbE + rgbS; 147 | 148 | //COMPUTE LOWPASS 149 | #if FXAA_SUBPIX != 0 150 | float lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25; 151 | float rangeL = abs(lumaL - lumaM); 152 | #endif 153 | #if FXAA_SUBPIX == 1 154 | float blendL = max(0.0, 155 | (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE; 156 | blendL = min(FXAA_SUBPIX_CAP, blendL); 157 | #endif 158 | 159 | //CHOOSE VERTICAL OR HORIZONTAL SEARCH 160 | float3 rgbNW = FxaaTexOff(tex, texcoord, int2(-1,-1)).xyz; 161 | float3 rgbNE = FxaaTexOff(tex, texcoord, int2( 1,-1)).xyz; 162 | float3 rgbSW = FxaaTexOff(tex, texcoord, int2(-1, 1)).xyz; 163 | float3 rgbSE = FxaaTexOff(tex, texcoord, int2( 1, 1)).xyz; 164 | #if (FXAA_SUBPIX_FASTER == 0) && (FXAA_SUBPIX > 0) 165 | rgbL += (rgbNW + rgbNE + rgbSW + rgbSE); 166 | rgbL *= float3(1.0 / 9.0,0,0); 167 | #endif 168 | float lumaNW = FxaaLuma(rgbNW); 169 | float lumaNE = FxaaLuma(rgbNE); 170 | float lumaSW = FxaaLuma(rgbSW); 171 | float lumaSE = FxaaLuma(rgbSE); 172 | float edgeVert = 173 | abs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) + 174 | abs((0.50 * lumaW) + (-1.0 * lumaM) + (0.50 * lumaE)) + 175 | abs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE)); 176 | float edgeHorz = 177 | abs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) + 178 | abs((0.50 * lumaN) + (-1.0 * lumaM) + (0.50 * lumaS)) + 179 | abs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE)); 180 | bool horzSpan = edgeHorz >= edgeVert; 181 | float lengthSign = horzSpan ? -Pix.y : -Pix.x; 182 | if (!horzSpan) 183 | lumaN = lumaW; 184 | if (!horzSpan) 185 | lumaS = lumaE; 186 | float gradientN = abs(lumaN - lumaM); 187 | float gradientS = abs(lumaS - lumaM); 188 | lumaN = (lumaN + lumaM) * 0.5; 189 | lumaS = (lumaS + lumaM) * 0.5; 190 | // Compute dmin and dmax 191 | float minLuma = min(min(lumaN, lumaS), min(lumaW, lumaE)); 192 | float maxLuma = max(max(lumaN, lumaS), max(lumaW, lumaE)); 193 | float dmin = abs(lumaM - minLuma); 194 | float dmax = abs(lumaM - maxLuma); 195 | 196 | // Determine search iterations based on contrast 197 | int searchIterations = FXAA_SEARCH_STEPS; // Default maximum search I don't think I did this correct. But, it looks good. -_(o _ o)_- 198 | bool IterationsA = max(dmin, dmax) <= 0.1;//only 1 iteration 199 | bool IterationsB = min(dmin, dmax) > 0.1; //only 2+ iteration 200 | bool IterationsC = min(dmin, dmax) > 0.3; //only 3+ iteration 201 | 202 | if (IterationsA) 203 | searchIterations = 1; 204 | if (IterationsB) 205 | searchIterations = 2; 206 | if (IterationsC) 207 | searchIterations = 3; 208 | 209 | // Contrast Conservation for Thin Lines 210 | if ((gradientN > 0.3) && (gradientS > 0.3)) 211 | { 212 | lengthSign = 0.0; // Prevents bilinear filtering 213 | } 214 | 215 | // CHOOSE SIDE OF PIXEL WHERE GRADIENT IS HIGHEST 216 | bool pairN = gradientN >= gradientS; 217 | if (!pairN) 218 | lumaN = lumaS; 219 | if (!pairN) 220 | gradientN = gradientS; 221 | if (!pairN) 222 | lengthSign *= -1.0; 223 | 224 | float2 posN; 225 | posN.x = texcoord.x + (horzSpan ? 0.0 : lengthSign * 0.5); 226 | posN.y = texcoord.y + (horzSpan ? lengthSign * 0.5 : 0.0); 227 | 228 | // CHOOSE SEARCH LIMITING VALUES 229 | gradientN *= FXAA_SEARCH_THRESHOLD; 230 | 231 | // SEARCH IN BOTH DIRECTIONS UNTIL FIND LUMA PAIR AVERAGE IS OUT OF RANGE 232 | float2 posP = posN; 233 | float2 offNP = horzSpan ? 234 | float2(Pix.x, 0.0) : 235 | float2(0.0f, Pix.y); 236 | float lumaEndN = lumaN; 237 | float lumaEndP = lumaN; 238 | bool doneN = false; 239 | bool doneP = false; 240 | 241 | #if FXAA_SEARCH_ACCELERATION == 1 242 | posN += offNP * float2(-1.0, -1.0); 243 | posP += offNP * float2(1.0, 1.0); 244 | #endif 245 | 246 | for (int i = 0; i < searchIterations; i++) // Apply adaptive search range 247 | { 248 | #if FXAA_SEARCH_ACCELERATION == 1 249 | if (!doneN) 250 | lumaEndN = FxaaLuma(FxaaTexLod(tex, posN.xy).xyz); 251 | if (!doneP) 252 | lumaEndP = FxaaLuma(FxaaTexLod(tex, posP.xy).xyz); 253 | #endif 254 | doneN = doneN || (abs(lumaEndN - lumaN) >= gradientN); 255 | doneP = doneP || (abs(lumaEndP - lumaN) >= gradientN); 256 | if (doneN && doneP) 257 | break; 258 | if (!doneN) 259 | posN -= offNP; 260 | if (!doneP) 261 | posP += offNP; 262 | } 263 | 264 | // HANDLE IF CENTER IS ON POSITIVE OR NEGATIVE SIDE 265 | float dstN = horzSpan ? texcoord.x - posN.x : texcoord.y - posN.y; 266 | float dstP = horzSpan ? posP.x - texcoord.x : posP.y - texcoord.y; 267 | bool directionN = dstN < dstP; 268 | lumaEndN = directionN ? lumaEndN : lumaEndP; 269 | 270 | // CHECK IF PIXEL IS IN SECTION OF SPAN WHICH GETS NO FILTERING 271 | if (((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0)) 272 | lengthSign = 0.0; 273 | 274 | float spanLength = (dstP + dstN); 275 | dstN = directionN ? dstN : dstP; 276 | float subPixelOffset = (0.5 + (dstN * (-1.0 / spanLength))) * lengthSign; 277 | float3 rgbF = FxaaTexLod(tex, float2( 278 | texcoord.x + (horzSpan ? 0.0 : subPixelOffset), 279 | texcoord.y + (horzSpan ? subPixelOffset : 0.0))).xyz; 280 | 281 | return float4(FxaaFilterReturn(FxaaLerp3(rgbL, rgbF, blendL)), 1.0f); 282 | } -------------------------------------------------------------------------------- /Textures/dummy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSkyDefender/Depth3D/64de86bbd870a880b0f5730032d8bedace3340fa/Textures/dummy -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | title: [Depth3D] 2 | description: [

] 3 | theme: jekyll-theme-slate 4 | show_downloads: true 5 | --------------------------------------------------------------------------------