summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolwater.cpp
diff options
context:
space:
mode:
authorDavid Parks <davep@lindenlab.com>2009-09-22 11:11:45 +0000
committerDavid Parks <davep@lindenlab.com>2009-09-22 11:11:45 +0000
commit536e38ad51b89808f26d8e3cd107fe093862d22a (patch)
tree230159ae9e319f5c419f1a643177b2bbb17d52c5 /indra/newview/lldrawpoolwater.cpp
parent760adead96e62cab8f9cdacc6469773a87dfbc1a (diff)
Merging render-pipeline-6-qa-2 into viewer-2
Self reviewed.
Diffstat (limited to 'indra/newview/lldrawpoolwater.cpp')
-rw-r--r--indra/newview/lldrawpoolwater.cpp52
1 files changed, 39 insertions, 13 deletions
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index fd4dc123d5..f56359afc3 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -136,6 +136,19 @@ void LLDrawPoolWater::endPostDeferredPass(S32 pass)
deferred_render = FALSE;
}
+//===============================
+//DEFERRED IMPLEMENTATION
+//===============================
+void LLDrawPoolWater::renderDeferred(S32 pass)
+{
+ LLFastTimer t(FTM_RENDER_WATER);
+ deferred_render = TRUE;
+ shade();
+ deferred_render = FALSE;
+}
+
+//=========================================
+
void LLDrawPoolWater::render(S32 pass)
{
LLFastTimer ftm(FTM_RENDER_WATER);
@@ -337,7 +350,10 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
void LLDrawPoolWater::shade()
{
- gGL.setColorMask(true, true);
+ if (!deferred_render)
+ {
+ gGL.setColorMask(true, true);
+ }
LLVOSky *voskyp = gSky.mVOSkyp;
@@ -400,6 +416,15 @@ void LLDrawPoolWater::shade()
shader = &gWaterProgram;
}
+ if (deferred_render)
+ {
+ gPipeline.bindDeferredShader(*shader);
+ }
+ else
+ {
+ shader->bind();
+ }
+
sTime = (F32)LLFrameTimer::getElapsedSeconds()*0.5f;
S32 reftex = shader->enableTexture(LLViewerShaderMgr::WATER_REFTEX);
@@ -435,15 +460,6 @@ void LLDrawPoolWater::shade()
S32 screentex = shader->enableTexture(LLViewerShaderMgr::WATER_SCREENTEX);
- if (deferred_render)
- {
- gPipeline.bindDeferredShader(*shader);
- }
- else
- {
- shader->bind();
- }
-
if (screentex > -1)
{
shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
@@ -547,8 +563,15 @@ void LLDrawPoolWater::shade()
{ //smash background faces to far clip plane
if (water->getIsEdgePatch())
{
- LLGLClampToFarClip far_clip(glh_get_current_projection());
- face->renderIndexed();
+ if (deferred_render)
+ {
+ face->renderIndexed();
+ }
+ else
+ {
+ LLGLClampToFarClip far_clip(glh_get_current_projection());
+ face->renderIndexed();
+ }
}
else
{
@@ -577,7 +600,10 @@ void LLDrawPoolWater::shade()
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
- gGL.setColorMask(true, false);
+ if (!deferred_render)
+ {
+ gGL.setColorMask(true, false);
+ }
}