summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-06-05 11:10:32 -0500
committerDave Parks <davep@lindenlab.com>2013-06-05 11:10:32 -0500
commitda294b79c052ff503b66a3383693beb8a3dc2173 (patch)
tree2fc1fedcf3cf2436779c3954822e0ee824466bac /indra
parent3c2920297e261a4df429037c08eba3f10b16e8c7 (diff)
NORSPEC-236 Fix for rigged attachments with materials not rendering under water when advanced lighting is enabled.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/lldrawpoolavatar.cpp40
-rwxr-xr-xindra/newview/llviewershadermgr.cpp1
2 files changed, 39 insertions, 2 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index fa9e6f949f..075299386e 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -62,6 +62,7 @@ S32 LLDrawPoolAvatar::sDiffuseChannel = 0;
static bool is_deferred_render = false;
+static bool is_post_deferred_render = false;
extern BOOL gUseGLPick;
@@ -377,7 +378,9 @@ void LLDrawPoolAvatar::renderPostDeferred(S32 pass)
p -= 2;
}
+ is_post_deferred_render = true;
render(p);
+ is_post_deferred_render = false;
}
@@ -1273,6 +1276,22 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
else
{
renderRiggedSimple(avatarp);
+
+ if (LLPipeline::sRenderDeferred)
+ { //render "simple" materials
+ renderRigged(avatarp, RIGGED_MATERIAL);
+ renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_MASK);
+ renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_EMISSIVE);
+ renderRigged(avatarp, RIGGED_NORMMAP);
+ renderRigged(avatarp, RIGGED_NORMMAP_MASK);
+ renderRigged(avatarp, RIGGED_NORMMAP_EMISSIVE);
+ renderRigged(avatarp, RIGGED_SPECMAP);
+ renderRigged(avatarp, RIGGED_SPECMAP_MASK);
+ renderRigged(avatarp, RIGGED_SPECMAP_EMISSIVE);
+ renderRigged(avatarp, RIGGED_NORMSPEC);
+ renderRigged(avatarp, RIGGED_NORMSPEC_MASK);
+ renderRigged(avatarp, RIGGED_NORMSPEC_EMISSIVE);
+ }
}
return;
}
@@ -1311,6 +1330,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
if (pass == 5)
{
renderRiggedShinySimple(avatarp);
+
return;
}
@@ -1325,6 +1345,24 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
if (pass == 7)
{
renderRiggedAlpha(avatarp);
+
+ if (LLPipeline::sRenderDeferred && !is_post_deferred_render)
+ { //render transparent materials under water
+ LLGLEnable blend(GL_BLEND);
+
+ gGL.setColorMask(true, true);
+ gGL.blendFunc(LLRender::BF_SOURCE_ALPHA,
+ LLRender::BF_ONE_MINUS_SOURCE_ALPHA,
+ LLRender::BF_ZERO,
+ LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
+
+ renderRigged(avatarp, RIGGED_MATERIAL_ALPHA);
+ renderRigged(avatarp, RIGGED_SPECMAP_BLEND);
+ renderRigged(avatarp, RIGGED_NORMMAP_BLEND);
+ renderRigged(avatarp, RIGGED_NORMSPEC_BLEND);
+
+ gGL.setColorMask(true, false);
+ }
return;
}
@@ -1334,7 +1372,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
return;
}
- if (LLPipeline::sRenderDeferred)
+ if (LLPipeline::sRenderDeferred && is_post_deferred_render)
{
S32 p = 0;
switch (pass)
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 9284fb1587..9e2a0d74db 100755
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -2581,7 +2581,6 @@ BOOL LLViewerShaderMgr::loadShadersObject()
gSkinnedObjectSimpleWaterProgram.mFeatures.hasWaterFog = true;
gSkinnedObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
gSkinnedObjectSimpleWaterProgram.mFeatures.hasObjectSkinning = true;
- gSkinnedObjectSimpleWaterProgram.mFeatures.hasAlphaMask = true;
gSkinnedObjectSimpleWaterProgram.mFeatures.disableTextureIndex = true;
gSkinnedObjectSimpleWaterProgram.mShaderFiles.clear();
gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB));