diff options
author | Graham Linden <graham@lindenlab.com> | 2019-01-30 12:34:20 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-01-30 12:34:20 -0800 |
commit | 08440def112395487d57a9d6e719c7700d7134b5 (patch) | |
tree | 94167b6f71edb1aba9ab384fedace93ee4819584 /indra/newview/lldrawpoolwater.cpp | |
parent | bd25688867d824a3c21ffce93d689bb30e4ba803 (diff) |
WIP for 10374 (reduce number of shaders linking against deferredUtil).
Prepare for using ifdef to conditionally engage using gl_FragDepth in water shaders
(because GL requires that writing to gl_FragDepth on any path means you need to
write a depth value on every path).
Diffstat (limited to 'indra/newview/lldrawpoolwater.cpp')
-rw-r--r-- | indra/newview/lldrawpoolwater.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 9820720fb9..514ce41d5a 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -716,11 +716,18 @@ void LLDrawPoolWater::shade() for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); iter != mDrawFace.end(); iter++) { LLFace *face = *iter; - gGL.getTexUnit(diffTex)->bind(face->getTexture()); - face->renderIndexed(); + if (face) + { + LLVOWater* water = (LLVOWater*) face->getViewerObject(); + gGL.getTexUnit(diffTex)->bind(face->getTexture()); + + bool edge = water && water->getIsEdgePatch(); + shader->uniform1i(LLShaderMgr::WATER_EDGE_FACTOR, edge ? 1 : 0); + face->renderIndexed(); + } } } - + shader->disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); shader->disableTexture(LLShaderMgr::WATER_SCREENTEX); shader->disableTexture(LLShaderMgr::BUMP_MAP); |