From dc5eaad82ced8eb9a3164168ddca1851abfb6c26 Mon Sep 17 00:00:00 2001 From: omegadox Date: Thu, 23 Oct 2008 19:01:00 +0000 Subject: [PATCH] ZTP bloom fix and MP1 and 2 skybox fix, I commented out sonic's hacks and just added comments about them. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@945 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_VideoOGL/Src/VertexShaderManager.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp index 584727ec6a..d13c0d1365 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp @@ -424,7 +424,11 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs) abs((int)(2 * rawViewport[0])) * MValueX, abs((int)(2 * rawViewport[1])) * MValueY); } - glDepthRange(-(0.0f - (rawViewport[5]-rawViewport[2])/-16777215.0f), rawViewport[5]/16777215.0f); + // Metroid Prime 1 & 2 likes this + glDepthRange(-(0.0f - (rawViewport[5]-rawViewport[2])/16777215.0f), rawViewport[5]/16777215.0f); + + // FZero stage likes this (a sonic hack) + // glDepthRange(-(0.0f - (rawViewport[5]-rawViewport[2])/-16777215.0f), rawViewport[5]/16777215.0f); } if (bProjectionChanged) { @@ -444,7 +448,10 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs) g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[10] = rawProjection[4]; + // Working bloom in ZTP g_fProjectionMatrix[11] = -(0.0f - rawProjection[5]); // Yes, it's important that it's done this way. + // Working projection in PSO + // g_fProjectionMatrix[11] = -(1.0f - rawProjection[5]); g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f; @@ -465,7 +472,10 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs) g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[10] = rawProjection[4]; - g_fProjectionMatrix[11] = -(0.0f - rawProjection[5]); // Yes, it's important that it's done this way. + // Working bloom in ZTP + g_fProjectionMatrix[11] = -(-1.0f - rawProjection[5]); // Yes, it's important that it's done this way. + // Working projection in PSO + // g_fProjectionMatrix[11] = -(0.0f - rawProjection[5]); g_fProjectionMatrix[12] = 0; g_fProjectionMatrix[13] = 0;