Skip to content

Commit

Permalink
Update for 3D shaders and added Profile for game.
Browse files Browse the repository at this point in the history
SuperDepth3D & VR+ Update

+This update fixes bugs what where effecting the Range Boost option.

+Also added a new template for Check Weapon Hand for the game mouthwashing

Overwatch Update

Profile added:

+Mouthwashing
  • Loading branch information
BlueSkyDefender committed Dec 6, 2024
1 parent 3910ab8 commit 68999e0
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 51 deletions.
87 changes: 85 additions & 2 deletions Shaders/Overwatch.fxh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////----------------------------------------//
///SuperDepth3D Overwatch Automation Header///
//----------------------------------------////
#define OVERWATCH "Overwatch v4.0.7\n"
#define OVERWATCH "Overwatch v4.0.8\n"
//---------------------------------------OVERWATCH---------------------------------------//
// If you are reading this stop. Go away and never look back. From this point on if you //
// still think it's is worth looking at this..... Then no one can save you or your soul. //
Expand Down Expand Up @@ -32139,6 +32139,88 @@ static const int Not_Compatible_Warning_D = 0; //Not Compatible Warning
//#define DAA 1
//#define FOV 1
//#define ARW 1
#elif (App == 0x1A0C7975 ) //Mouthwashing
#define DS_Z 2 // Set View Mode
#define DA_W 1 // Set Linerzation
#define DB_X 1 // Flip
#define DA_X 0.025 // ZPD
//#define DF_Y 0.025 // Seperation
#define DA_Y 237.5 // Near Plane Adjustment
//#define DA_Z 0.0005 // Linerzation Offset
#define DS_Y 2 // Linerzation Offset Effects only distance if true
#define DB_Z 0.025 // Auto Depth Protection
#define DE_X 2 // ZPD Boundary
#define DE_Y 0.75 // Set ZPD Boundary Level Zero
#define DE_Z 0.40 // Speed that Boundary is Enforced
//#define AFD 1 // Alternate Frame Detection - May be phased out
//#define DG_W -0.25 // Shift Boundary Out of screen 0.5 and or In screen -0.5
#define OIL 3 //Set How many Levels We use for RE_Fix 0 | 1 | 2 | 3
#define OIF float4(0.625,0.50,0.4375,0.25) //Fix enables if Value is > 0.0
#define DI_W float4(0.25,0.75,1.5,5.0)
#define CWH 7 //ZPD Weapon Hand Consideration For Masking 0 is Off | 1 Is Full | 2 Half Right screen Mask And Not to be used with Weapon Profiles.
#define WBA 2.0 //ZPD Weapon Boundary Alt Adjust power for CWH
//#define FTM 4 // Fast Trigger Mode If this enabled then Level 1 and > switches instantly.
#define WND 0.50 //Weapon Near Pushes depth in and adjust perspective to match.
#define DG_Z 0.05 // Min Weapon Hands That are apart of world with Auto and Trim
//#define DS_X float3(0.025,0,1) // Min Weapon bit only triggers when a OIL Level is set and set here on .y
#define DE_W 0.50 // Auto
#define DI_Z 0.05 // Trim
#define DF_W float4(1.0,0.0005,0.01,0.001)// Edge & Scale
//#define DAA_W 2 //Warp/Halo Masking Type
//#define EDU 1 //Elevate Detectors Up effects ZPD
//#define TMD 1
//#define ASA 2 //Auto Depth Scaling

#define BMT 1 // ZPD and World Scale Balance // I need to phase this out.
#define DF_Z 1.0 // Set the Balance
//#define DAO 1 // Turn On or Off De-Artifact Options For now DAO if set to 1 it's also applys to Hoz
#define DL_Y -1.0 // De-Artifact Only works on some View Modes and causes performance degredation
#define DL_Z 0.75 // Compat Power
//#define DJ_X 0.0625 // Range Smoothing

//#define LBM 1 //Letter Box Masking With size Adust for Top and Bottom and 2 is Left and Right
//#define DI_X 0.8835

//#define LBC 1 //Letter Box Correction Offsets With X & Y
//#define LBR 1
//#define LBE 1
//#define DH_Z 0.0
//#define DH_W -0.256
//#define DH_Y 1.320

#define WSM 6 // Weapon Setting Mode
#define DB_W 25 // Weapon Profile

//#define DF_X float2(0.1,0.15) // ZPD Weapon Boundarys Level 1 and Level 2
//#define DJ_W 0.1 // Weapon Depth Limit Location 1
//#define DS_W 0.5 // Weapon Depth Limit Location 2


//#define FPS 2 // FPS Focus Settings
//#define DK_X 2 //Trigger Type
//#define DK_Y 0 //Eye Selection
//#define WRP 3 //Weapon Reduction Power
//#define DK_Z 1 //World Reduction Power
//#define DK_W 5 //Set Shift Speed
//#define WZD 1 //Weapon Zoom Detection


//Smooth Mode
//#define SMS 1 //SM Separation Limit - Do Not use any more
#define DL_X 0.75 //SM Tune Limit
//#define DL_W 0.5 //SM Perspective Limit - Do Not use any more
#define DM_X 6 //SM HQ Tune Power - Will be made global
//#define DM_Y 1 //SM HQ VRS Limit
//#define HQT 1 //SM HQ Trigger
//#define FMM 1 //Filter Mode - Need to add this back in the new shader.
//#define NDW 1
#define PEW 1
//#define NFM 1
//#define DSW 1
//#define DRS 1
//#define DAA 1
//#define FOV 1
#define ARW 1
#else
#define NPW 1 //No Profile
#endif
Expand Down Expand Up @@ -32216,6 +32298,7 @@ static const int Not_Compatible_Warning_D = 0; //Not Compatible Warning
#define RHW 1
#define NFM 1
#define DSW 1
#define ARW 1
*/
//Menu Detection Templates - Needs a Specail Shader to adjust
/*
Expand Down Expand Up @@ -33642,7 +33725,7 @@ float4 Weapon_Profiles(float WP ,float4 Weapon_Adjust)
if (WP == 24)
Weapon_Adjust = float4(0.0,0.0,0.0,0.0); //WP 22 | Game
if (WP == 25)
Weapon_Adjust = float4(0.0,0.0,0.0,0.0); //WP 23 | Game
Weapon_Adjust = float4(0.875,0.5,0.0,0.0); //WP 23 | Mouthwashing
if (WP == 26)
Weapon_Adjust = float4(4.0,25.0,0.0,0.05); //WP 24 | S.T.A.L.K.E.R: 2
if (WP == 27)
Expand Down
58 changes: 33 additions & 25 deletions Shaders/SuperDepth3D.fx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////----------------//
///**SuperDepth3D**///
//----------------////
#define SD3D "SuperDepth3D v4.3.8\n"
#define SD3D "SuperDepth3D v4.3.9\n"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//* Depth Map Based 3D post-process shader
//* For Reshade 3.0+
Expand Down Expand Up @@ -428,7 +428,6 @@ uniform int SuperDepth3D <
ui_type = "radio";
>;
//uniform float TEST < ui_type = "slider"; ui_min = 0.0; ui_max = 1.0; > = 0.00;

//Divergence & Convergence//
uniform float Divergence <
ui_type = "slider";
Expand Down Expand Up @@ -2683,41 +2682,40 @@ uniform int Extra_Information <
if(Adjust_Size_XY.x != 0 && Starting_Resolution.x != 0)
texcoord.x = texcoord.x / Adjust_Size_XY.x;
#endif
// Retrieve depth from the buffer
float zBuffer = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x;
//Conversions to linear space.....
float zBuffer = tex2Dlod(DepthBuffer, float4(texcoord,0,0)).x;

// Set RangeBoost based on Range_Boost value
float RangeBoost = (Range_Boost == 3) ? 2.0 :
(Range_Boost == 4) ? 3.0 :
(Range_Boost == 5) ? 4.0 : 1.5;

//define near/far values with adjustments
float Far = 1.0;
float Near_A = 0.125 / DMA();
float Near_B = 0.125 / (DMA() * RangeBoost);

// Prepare zBuffer storage and constant values for linear conversions
float2 Store_zBuffer = float2(zBuffer, 1.0 - zBuffer);
float4 C = float4(Far / Near_A, 1.0 - Far / Near_A, Far / Near_B, 1.0 - Far / Near_B);

// Adjust Z based on Offset
float2 Z = (Offset < 0) ? min(1.0, zBuffer * (1.0 + abs(Offset))) : Store_zBuffer;
if (Offset != 0)
Z = (Offset < 0) ? float2(Z.x, 1.0 - Z.y)
: min(1.0, float2(Z.x * (1.0 + Offset), Z.y / (1.0 - Offset)));

// Choose constants based on Range_Boost setting
float2 C_Switch = (Range_Boost >= 2) ? C.zw : C.xy;
float2 Two_Ch_zBuffer, Store_zBuffer = float2( zBuffer, 1.0 - zBuffer );
float4 C = float4( Far / Near_A, 1.0 - Far / Near_A, Far / Near_B, 1.0 - Far / Near_B);
float2 Z = Offset < 0 ? min( 1.0, zBuffer * ( 1.0 + abs(Offset) ) ) : Store_zBuffer;
//May add this later need to check emulators.
//if (Range_Boost == 2)
// Store_zBuffer = Z;

if(Offset > 0 || Offset < 0)
Z = Offset < 0 ? float2( Z.x, 1.0 - Z.y ) : min( 1.0, float2( Z.x * (1.0 + Offset) , Z.y / (1.0 - Offset) ) );

// Calculate Two_Ch_zBuffer based on Depth_Map setting
float2 Two_Ch_zBuffer;
if (Depth_Map == 0) // Normal mode
Two_Ch_zBuffer = rcp(Z.x * C_Switch.y + C_Switch.x);
else // Reverse mode
Two_Ch_zBuffer = rcp(Z.y * C_Switch.y + C_Switch.x);
float2 C_Switch = Range_Boost >= 2 ? C.zw : C.xy;
if (Depth_Map == 0) //DM0 Normal
Two_Ch_zBuffer = rcp(float2(Z.x,Store_zBuffer.x) * float2(C_Switch.y,C.y) + float2(C_Switch.x,C.x));//MAD - RCP
else if (Depth_Map == 1) //DM1 Reverse
Two_Ch_zBuffer = rcp(float2(Z.y,Store_zBuffer.y) * float2(C_Switch.y,C.y) + float2(C_Switch.x,C.x));//MAD - RCP

// Apply final zBuffer adjustments based on Range_Boost
zBuffer = Range_Boost ? lerp(Two_Ch_zBuffer.y, Two_Ch_zBuffer.x, saturate(Two_Ch_zBuffer.y)) : Two_Ch_zBuffer.x;
if(Range_Boost)
zBuffer = lerp(Two_Ch_zBuffer.y,Two_Ch_zBuffer.x,saturate(Two_Ch_zBuffer.y));
else
zBuffer = Two_Ch_zBuffer.x;

#if ALM == 1
return smoothstep(0,1,zBuffer);
Expand Down Expand Up @@ -3041,6 +3039,13 @@ uniform int Extra_Information <
STTT_Switch = 0.4;
}

if(CWH == 7)
{
STT_Switch = 0.1875;
SF_Switch = 0.75;
//ST_Switch = 0.325;
STTT_Switch = 0.4;
}

// Conditions for Shape_One
bool Shape_One_C1 = (Shape_TC.x / Shape_TC.y * SO_Switch) > 1;
Expand All @@ -3067,6 +3072,9 @@ uniform int Extra_Information <
if(CWH == 2 || CWH == 4 && CWH != 5)
Shape_Out = Shape_TC.x < 0.5 ? 1 : Shape_Out;

if(CWH == 7)
Shape_Out = Shape_TC.x < 0.125 || Shape_TC.x > 0.875 || Shape_TC.y < 0.7 ? 1 : Shape_Out;

return Shape_Out;
}

Expand Down
57 changes: 33 additions & 24 deletions Shaders/SuperDepth3D_VR+.fx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////--------------------//
///**SuperDepth3D_VR+**///
//--------------------////
#define SD3DVR "SuperDepth3D_VR+ v4.3.5\n"
#define SD3DVR "SuperDepth3D_VR+ v4.3.6\n"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//* Depth Map Based 3D post-process shader
//* For Reshade 4.4+ I think...
Expand Down Expand Up @@ -2491,41 +2491,40 @@ uniform int Extra_Information <
if(Adjust_Size_XY.x != 0 && Starting_Resolution.x != 0)
texcoord.x = texcoord.x / Adjust_Size_XY.x;
#endif
// Retrieve depth from the buffer
float zBuffer = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x;
//Conversions to linear space.....
float zBuffer = tex2Dlod(DepthBuffer, float4(texcoord,0,0)).x;

// Set RangeBoost based on Range_Boost value
float RangeBoost = (Range_Boost == 3) ? 2.0 :
(Range_Boost == 4) ? 3.0 :
(Range_Boost == 5) ? 4.0 : 1.5;

//define near/far values with adjustments
float Far = 1.0;
float Near_A = 0.125 / DMA();
float Near_B = 0.125 / (DMA() * RangeBoost);

// Prepare zBuffer storage and constant values for linear conversions
float2 Store_zBuffer = float2(zBuffer, 1.0 - zBuffer);
float4 C = float4(Far / Near_A, 1.0 - Far / Near_A, Far / Near_B, 1.0 - Far / Near_B);

// Adjust Z based on Offset
float2 Z = (Offset < 0) ? min(1.0, zBuffer * (1.0 + abs(Offset))) : Store_zBuffer;
if (Offset != 0)
Z = (Offset < 0) ? float2(Z.x, 1.0 - Z.y)
: min(1.0, float2(Z.x * (1.0 + Offset), Z.y / (1.0 - Offset)));

// Choose constants based on Range_Boost setting
float2 C_Switch = (Range_Boost >= 2) ? C.zw : C.xy;
float2 Two_Ch_zBuffer, Store_zBuffer = float2( zBuffer, 1.0 - zBuffer );
float4 C = float4( Far / Near_A, 1.0 - Far / Near_A, Far / Near_B, 1.0 - Far / Near_B);
float2 Z = Offset < 0 ? min( 1.0, zBuffer * ( 1.0 + abs(Offset) ) ) : Store_zBuffer;
//May add this later need to check emulators.
//if (Range_Boost == 2)
// Store_zBuffer = Z;

if(Offset > 0 || Offset < 0)
Z = Offset < 0 ? float2( Z.x, 1.0 - Z.y ) : min( 1.0, float2( Z.x * (1.0 + Offset) , Z.y / (1.0 - Offset) ) );

// Calculate Two_Ch_zBuffer based on Depth_Map setting
float2 Two_Ch_zBuffer;
if (Depth_Map == 0) // Normal mode
Two_Ch_zBuffer = rcp(Z.x * C_Switch.y + C_Switch.x);
else // Reverse mode
Two_Ch_zBuffer = rcp(Z.y * C_Switch.y + C_Switch.x);
float2 C_Switch = Range_Boost >= 2 ? C.zw : C.xy;
if (Depth_Map == 0) //DM0 Normal
Two_Ch_zBuffer = rcp(float2(Z.x,Store_zBuffer.x) * float2(C_Switch.y,C.y) + float2(C_Switch.x,C.x));//MAD - RCP
else if (Depth_Map == 1) //DM1 Reverse
Two_Ch_zBuffer = rcp(float2(Z.y,Store_zBuffer.y) * float2(C_Switch.y,C.y) + float2(C_Switch.x,C.x));//MAD - RCP

// Apply final zBuffer adjustments based on Range_Boost
zBuffer = Range_Boost ? lerp(Two_Ch_zBuffer.y, Two_Ch_zBuffer.x, saturate(Two_Ch_zBuffer.y)) : Two_Ch_zBuffer.x;
if(Range_Boost)
zBuffer = lerp(Two_Ch_zBuffer.y,Two_Ch_zBuffer.x,saturate(Two_Ch_zBuffer.y));
else
zBuffer = Two_Ch_zBuffer.x;

#if ALM == 1
return smoothstep(0,1,zBuffer);
Expand Down Expand Up @@ -2835,6 +2834,13 @@ uniform int Extra_Information <
STTT_Switch = 0.4;
}

if(CWH == 7)
{
STT_Switch = 0.1875;
SF_Switch = 0.75;
//ST_Switch = 0.325;
STTT_Switch = 0.4;
}

// Conditions for Shape_One
bool Shape_One_C1 = (Shape_TC.x / Shape_TC.y * SO_Switch) > 1;
Expand All @@ -2861,6 +2867,9 @@ uniform int Extra_Information <
if(CWH == 2 || CWH == 4 && CWH != 5)
Shape_Out = Shape_TC.x < 0.5 ? 1 : Shape_Out;

if(CWH == 7)
Shape_Out = Shape_TC.x < 0.125 || Shape_TC.x > 0.875 || Shape_TC.y < 0.7 ? 1 : Shape_Out;

return Shape_Out;
}

Expand Down

0 comments on commit 68999e0

Please sign in to comment.