Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9591 from blaahaj/sonic-epsilon
VertexShaderGen: Sonic epsilon hack for OpenGL ES
  • Loading branch information
JMC47 committed Apr 2, 2021
2 parents a2fa9aa + f339bc6 commit 5513d5f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/Core/VideoCommon/VertexShaderGen.cpp
Expand Up @@ -498,6 +498,12 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho
"o.clipDist1 = clipDist1;\n");
}
}
else
{
// Same depth adjustment for Sonic. Without depth clamping, it unfortunately
// affects non-clipping uses of depth too.
out.Write("o.pos.z = o.pos.z * (1.0 - 1e-7);\n");
}

// Write the true depth value. If the game uses depth textures, then the pixel shader will
// override it with the correct values if not then early z culling will improve speed.
Expand Down

0 comments on commit 5513d5f

Please sign in to comment.