From 065b03a3db9bc1d062af0ebe7cd6016deb196828 Mon Sep 17 00:00:00 2001 From: vladislavbelov Date: Thu, 21 Jan 2021 22:38:11 +0000 Subject: [PATCH] Removes useless transparent pass before the water for lowest settings since the water is opaque there. This was SVN commit r24756. --- source/renderer/Renderer.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 7f5f75fe87..01d55dad6a 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -1350,16 +1350,28 @@ void CRenderer::RenderSubmissions(const CBoundingBoxAligned& waterScissor) // render water if (m_WaterManager->m_RenderWater && g_Game && waterScissor.GetVolume() > 0) { - // render transparent stuff, but only the solid parts that can occlude block water - RenderTransparentModels(context, cullGroup, TRANSPARENT_OPAQUE, false); - ogl_WarnIfError(); + if (m_WaterManager->WillRenderFancyWater()) + { + // Render transparent stuff, but only the solid parts that can occlude block water. + RenderTransparentModels(context, cullGroup, TRANSPARENT_OPAQUE, false); + ogl_WarnIfError(); - m->terrainRenderer.RenderWater(context, cullGroup, &m->shadow); - ogl_WarnIfError(); + m->terrainRenderer.RenderWater(context, cullGroup, &m->shadow); + ogl_WarnIfError(); - // render transparent stuff again, but only the blended parts that overlap water - RenderTransparentModels(context, cullGroup, TRANSPARENT_BLEND, false); - ogl_WarnIfError(); + // Render transparent stuff again, but only the blended parts that overlap water. + RenderTransparentModels(context, cullGroup, TRANSPARENT_BLEND, false); + ogl_WarnIfError(); + } + else + { + m->terrainRenderer.RenderWater(context, cullGroup, &m->shadow); + ogl_WarnIfError(); + + // Render transparent stuff, so it can overlap models/terrain. + RenderTransparentModels(context, cullGroup, TRANSPARENT, false); + ogl_WarnIfError(); + } } else {