From b81aadae1b5026195103a5ae20404daf858ded0c Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Tue, 13 Jun 2023 15:36:51 -0500 Subject: SL-19835 Fix for inaccurate water fog on transparent objects when camera is above water. --- indra/newview/lldrawpoolalpha.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 6aa2316589..060129d275 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -243,11 +243,13 @@ void LLDrawPoolAlpha::forwardRender(bool rigged) //enable writing to alpha for emissive effects gGL.setColorMask(true, true); - bool write_depth = rigged || + bool write_depth = rigged || LLDrawPoolWater::sSkipScreenCopy // we want depth written so that rendered alpha will // contribute to the alpha mask used for impostors - || LLPipeline::sImpostorRenderAlphaDepthPass; + || LLPipeline::sImpostorRenderAlphaDepthPass + || getType() == LLDrawPoolAlpha::POOL_ALPHA_PRE_WATER; // needed for accurate water fog + LLGLDepthTest depth(GL_TRUE, write_depth ? GL_TRUE : GL_FALSE); -- cgit v1.2.3