summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolwater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolwater.cpp')
-rwxr-xr-xindra/newview/lldrawpoolwater.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 0d79631182..32a9365aba 100755
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -522,14 +522,21 @@ void LLDrawPoolWater::shade()
F32 eyedepth = LLViewerCamera::getInstance()->getOrigin().mV[2] - gAgent.getRegion()->getWaterHeight();
+ if (eyedepth < 0.f && LLPipeline::sWaterReflections)
+ {
if (deferred_render)
{
- shader = &gDeferredWaterProgram;
+ shader = &gDeferredUnderWaterProgram;
}
- else if (eyedepth < 0.f && LLPipeline::sWaterReflections)
+ else
{
shader = &gUnderWaterProgram;
}
+ }
+ else if (deferred_render)
+ {
+ shader = &gDeferredWaterProgram;
+ }
else
{
shader = &gWaterProgram;
@@ -597,9 +604,15 @@ void LLDrawPoolWater::shade()
shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
}
+ F32 screenRes[] =
+ {
+ 1.f/gGLViewport[2],
+ 1.f/gGLViewport[3]
+ };
+ shader->uniform2fv(LLShaderMgr::DEFERRED_SCREEN_RES, 1, screenRes);
stop_glerror();
- S32 diffTex = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+ S32 diffTex = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP);
stop_glerror();
light_dir.normVec();