Index: ps/trunk/source/gui/CGUI.cpp =================================================================== --- ps/trunk/source/gui/CGUI.cpp +++ ps/trunk/source/gui/CGUI.cpp @@ -327,10 +327,6 @@ void CGUI::Draw() { - // Clear the depth buffer, so the GUI is - // drawn on top of everything else - glClear(GL_DEPTH_BUFFER_BIT); - using Arena = Allocators::DynamicArena<128 * KiB>; using ObjectListAllocator = ProxyAllocator; Arena arena; Index: ps/trunk/source/gui/ObjectTypes/CChart.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CChart.cpp +++ ps/trunk/source/gui/ObjectTypes/CChart.cpp @@ -131,10 +131,6 @@ const float width = rect.GetWidth(); const float height = rect.GetHeight(); - // Disable depth updates to prevent apparent z-fighting-related issues - // with some drivers causing units to get drawn behind the texture. - glDepthMask(0); - // Setup the render state CMatrix3D transform = GetDefaultGuiMatrix(); CShaderDefines lineDefines; @@ -173,9 +169,6 @@ tech->EndPass(); - // Reset depth mask - glDepthMask(1); - for (size_t i = 0; i < m_TextPositions.size(); ++i) DrawText(i, CGUIColor(1.f, 1.f, 1.f, 1.f), m_TextPositions[i], bz + 0.5f); } Index: ps/trunk/source/gui/ObjectTypes/CMiniMap.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CMiniMap.cpp +++ ps/trunk/source/gui/ObjectTypes/CMiniMap.cpp @@ -430,9 +430,6 @@ const float unitScale = (cmpRangeManager->GetLosCircular() ? 1.f : m_MapScale/2.f); CLOSTexture& losTexture = g_Game->GetView()->GetLOSTexture(); - // Disable depth updates to prevent apparent z-fighting-related issues - // with some drivers causing units to get drawn behind the texture. - glDepthMask(0); CShaderProgramPtr shader; CShaderTechniquePtr tech; @@ -634,9 +631,6 @@ DrawViewRect(unitMatrix); PROFILE_END("minimap units"); - - // Reset depth mask - glDepthMask(1); } void CMiniMap::CreateTextures() Index: ps/trunk/source/ps/GameSetup/GameSetup.cpp =================================================================== --- ps/trunk/source/ps/GameSetup/GameSetup.cpp +++ ps/trunk/source/ps/GameSetup/GameSetup.cpp @@ -254,7 +254,13 @@ ogl_WarnIfError(); if (g_DoRenderGui) + { + // All GUI elements are drawn in Z order to render semi-transparent + // objects correctly. + glDisable(GL_DEPTH_TEST); g_GUI->Draw(); + glEnable(GL_DEPTH_TEST); + } ogl_WarnIfError();