1
0
forked from 0ad/0ad

Removes useless transparent pass before the water for lowest settings since the water is opaque there.

This was SVN commit r24756.
This commit is contained in:
Vladislav Belov 2021-01-21 22:38:11 +00:00
parent 1a218ec4fd
commit 065b03a3db

View File

@ -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
{