From 358e458a93b7c71da7351c144761d492c75e5a6e Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Tue, 5 Jan 2016 01:24:54 +0100 Subject: [PATCH] VertexShaderManager: Add an epsilon hack to the perspective projection. --- Source/Core/VideoCommon/VertexShaderManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 20b41e194c..a73421e0c5 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -432,10 +432,9 @@ void VertexShaderManager::SetConstants() g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f; - // donkopunchstania suggested the GC GPU might round differently - // He had thus changed this to -(1 + epsilon) to fix clipping issues. - // I (neobrain) don't think his conjecture is true and thus reverted his change. - g_fProjectionMatrix[14] = -1.0f; + + // Hack to fix depth clipping precision issues (such as Sonic Adventure UI) + g_fProjectionMatrix[14] = -(1.0f + FLT_EPSILON); g_fProjectionMatrix[15] = 0.0f; // Heuristic to detect if a GameCube game is in 16:9 anamorphic widescreen mode.