summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rwxr-xr-xindra/newview/pipeline.cpp188
1 files changed, 110 insertions, 78 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index f49395da34..4445539ac2 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -111,6 +111,8 @@
#include "llpathinglib.h"
#include "llfloaterpathfindingconsole.h"
#include "llfloaterpathfindingcharacters.h"
+#include "llfloatertools.h"
+#include "llpanelface.h"
#include "llpathfindingpathtool.h"
#ifdef _DEBUG
@@ -255,6 +257,17 @@ LLFastTimer::DeclareTimer FTM_RENDER_DEFERRED("Deferred Shading");
static LLFastTimer::DeclareTimer FTM_STATESORT_DRAWABLE("Sort Drawables");
static LLFastTimer::DeclareTimer FTM_STATESORT_POSTSORT("Post Sort");
+static LLStaticHashedString sTint("tint");
+static LLStaticHashedString sAmbiance("ambiance");
+static LLStaticHashedString sAlphaScale("alpha_scale");
+static LLStaticHashedString sNormMat("norm_mat");
+static LLStaticHashedString sOffset("offset");
+static LLStaticHashedString sScreenRes("screenRes");
+static LLStaticHashedString sDelta("delta");
+static LLStaticHashedString sDistFactor("dist_factor");
+static LLStaticHashedString sKern("kern");
+static LLStaticHashedString sKernScale("kern_scale");
+
//----------------------------------------
std::string gPoolNames[] =
{
@@ -1402,9 +1415,15 @@ void LLPipeline::createLUTBuffers()
}
}
- LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_R16F, 1, &mLightFunc);
+ U32 pix_format = GL_R16F;
+#if LL_DARWIN
+ // Need to work around limited precision with 10.6.8 and older drivers
+ //
+ pix_format = GL_R32F;
+#endif
+ LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, pix_format, 1, &mLightFunc);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc);
- LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_R16F, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false);
+ LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false);
//LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_UNSIGNED_BYTE, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, ls, false);
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR);
@@ -2691,14 +2710,14 @@ void LLPipeline::downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& d
{
shader = &gDownsampleDepthRectProgram;
shader->bind();
- shader->uniform2f("delta", 1.f, 1.f);
+ shader->uniform2f(sDelta, 1.f, 1.f);
shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, source.getWidth(), source.getHeight());
}
else
{
shader = &gDownsampleDepthProgram;
shader->bind();
- shader->uniform2f("delta", 1.f/source.getWidth(), 1.f/source.getHeight());
+ shader->uniform2f(sDelta, 1.f/source.getWidth(), 1.f/source.getHeight());
shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, 1.f, 1.f);
}
@@ -3073,7 +3092,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera)
llassert(vobj); // trying to catch a bad assumption
if (vobj) // this test may not be needed, see above
{
- const LLVOAvatar* av = vobj->asAvatar();
+ LLVOAvatar* av = vobj->asAvatar();
if (av && av->isImpostor())
{
return;
@@ -3959,7 +3978,7 @@ void LLPipeline::postSort(LLCamera& camera)
{
mSelectedFaces.clear();
- LLPipeline::setRenderHighlightTextureChannel(LLSelectMgr::getInstance()->getTextureChannel());
+ LLPipeline::setRenderHighlightTextureChannel(gFloaterTools->getPanelFace()->getTextureChannelToEdit());
// Draw face highlights for selected faces.
if (LLSelectMgr::getInstance()->getTEMode())
@@ -4903,9 +4922,9 @@ void LLPipeline::renderDebug()
if (LLGLSLShader::sNoFixedFunction)
{
gPathfindingProgram.bind();
- gPathfindingProgram.uniform1f("tint", 1.f);
- gPathfindingProgram.uniform1f("ambiance", 1.f);
- gPathfindingProgram.uniform1f("alpha_scale", 1.f);
+ gPathfindingProgram.uniform1f(sTint, 1.f);
+ gPathfindingProgram.uniform1f(sAmbiance, 1.f);
+ gPathfindingProgram.uniform1f(sAlphaScale, 1.f);
}
//Requried character physics capsule render parameters
@@ -4922,7 +4941,7 @@ void LLPipeline::renderDebug()
llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
gGL.setColorMask(true, false);
LLGLEnable blend(GL_BLEND);
- gPathfindingProgram.uniform1f("alpha_scale", 0.90f);
+ gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
gPathfindingProgram.bind();
}
@@ -4949,9 +4968,9 @@ void LLPipeline::renderDebug()
{
gPathfindingProgram.bind();
- gPathfindingProgram.uniform1f("tint", 1.f);
- gPathfindingProgram.uniform1f("ambiance", ambiance);
- gPathfindingProgram.uniform1f("alpha_scale", 1.f);
+ gPathfindingProgram.uniform1f(sTint, 1.f);
+ gPathfindingProgram.uniform1f(sAmbiance, ambiance);
+ gPathfindingProgram.uniform1f(sAlphaScale, 1.f);
}
if ( !pathfindingConsole->isRenderWorld() )
@@ -4975,7 +4994,7 @@ void LLPipeline::renderDebug()
if ( pathfindingConsole->isRenderWorld() )
{
LLGLEnable blend(GL_BLEND);
- gPathfindingProgram.uniform1f("alpha_scale", 0.66f);
+ gPathfindingProgram.uniform1f(sAlphaScale, 0.66f);
llPathingLibInstance->renderNavMesh();
}
else
@@ -4987,8 +5006,8 @@ void LLPipeline::renderDebug()
if (LLGLSLShader::sNoFixedFunction)
{
gPathfindingNoNormalsProgram.bind();
- gPathfindingNoNormalsProgram.uniform1f("tint", 1.f);
- gPathfindingNoNormalsProgram.uniform1f("alpha_scale", 1.f);
+ gPathfindingNoNormalsProgram.uniform1f(sTint, 1.f);
+ gPathfindingNoNormalsProgram.uniform1f(sAlphaScale, 1.f);
llPathingLibInstance->renderNavMeshEdges();
gPathfindingProgram.bind();
}
@@ -5028,7 +5047,7 @@ void LLPipeline::renderDebug()
gGL.setColorMask(true, false);
//render the bookends
LLGLEnable blend(GL_BLEND);
- gPathfindingProgram.uniform1f("alpha_scale", 0.90f);
+ gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
gPathfindingProgram.bind();
@@ -5046,7 +5065,7 @@ void LLPipeline::renderDebug()
if (LLGLSLShader::sNoFixedFunction)
{
LLGLEnable blend(GL_BLEND);
- gPathfindingProgram.uniform1f("alpha_scale", 0.90f);
+ gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
llPathingLibInstance->renderSimpleShapes( gGL, gAgent.getRegion()->getWaterHeight() );
}
else
@@ -5094,7 +5113,7 @@ void LLPipeline::renderDebug()
LLGLEnable blend(GL_BLEND);
{
- gPathfindingProgram.uniform1f("ambiance", ambiance);
+ gPathfindingProgram.uniform1f(sAmbiance, ambiance);
{ //draw solid overlay
LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_LEQUAL);
@@ -5109,8 +5128,8 @@ void LLPipeline::renderDebug()
if (pathfindingConsole->isRenderXRay())
{
- gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
- gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
+ gPathfindingProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint"));
+ gPathfindingProgram.uniform1f(sAlphaScale, gSavedSettings.getF32("PathfindingXRayOpacity"));
LLGLEnable blend(GL_BLEND);
LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
@@ -5118,13 +5137,13 @@ void LLPipeline::renderDebug()
if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
{ //draw hidden wireframe as darker and less opaque
- gPathfindingProgram.uniform1f("ambiance", 1.f);
+ gPathfindingProgram.uniform1f(sAmbiance, 1.f);
llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
}
else
{
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- gPathfindingProgram.uniform1f("ambiance", ambiance);
+ gPathfindingProgram.uniform1f(sAmbiance, ambiance);
llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
@@ -5132,9 +5151,9 @@ void LLPipeline::renderDebug()
{ //draw visible wireframe as brighter, thicker and more opaque
glPolygonOffset(offset, offset);
- gPathfindingProgram.uniform1f("ambiance", 1.f);
- gPathfindingProgram.uniform1f("tint", 1.f);
- gPathfindingProgram.uniform1f("alpha_scale", 1.f);
+ gPathfindingProgram.uniform1f(sAmbiance, 1.f);
+ gPathfindingProgram.uniform1f(sTint, 1.f);
+ gPathfindingProgram.uniform1f(sAlphaScale, 1.f);
glLineWidth(gSavedSettings.getF32("PathfindingLineWidth"));
LLGLDisable blendOut(GL_BLEND);
@@ -5166,19 +5185,19 @@ void LLPipeline::renderDebug()
glLineWidth(2.0f);
LLGLEnable cull(GL_CULL_FACE);
- gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
- gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
+ gPathfindingProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint"));
+ gPathfindingProgram.uniform1f(sAlphaScale, gSavedSettings.getF32("PathfindingXRayOpacity"));
if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
{ //draw hidden wireframe as darker and less opaque
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
- gPathfindingProgram.uniform1f("ambiance", 1.f);
+ gPathfindingProgram.uniform1f(sAmbiance, 1.f);
llPathingLibInstance->renderNavMesh();
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
}
else
{
- gPathfindingProgram.uniform1f("ambiance", ambiance);
+ gPathfindingProgram.uniform1f(sAmbiance, ambiance);
llPathingLibInstance->renderNavMesh();
}
@@ -5186,8 +5205,8 @@ void LLPipeline::renderDebug()
if (LLGLSLShader::sNoFixedFunction)
{
gPathfindingNoNormalsProgram.bind();
- gPathfindingNoNormalsProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
- gPathfindingNoNormalsProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
+ gPathfindingNoNormalsProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint"));
+ gPathfindingNoNormalsProgram.uniform1f(sAlphaScale, gSavedSettings.getF32("PathfindingXRayOpacity"));
llPathingLibInstance->renderNavMeshEdges();
gPathfindingProgram.bind();
}
@@ -6297,13 +6316,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
F32 x = (3.f * (1.f + light->getLightFalloff())); // why this magic? probably trying to match a historic behavior.
float linatten = x / (light_radius); // % of brightness at radius
- if (LLPipeline::sRenderDeferred)
- {
- /*light_color.mV[0] = powf(light_color.mV[0], 2.2f);
- light_color.mV[1] = powf(light_color.mV[1], 2.2f);
- light_color.mV[2] = powf(light_color.mV[2], 2.2f);*/
- }
-
mHWLightColors[cur_light] = light_color;
LLLightState* light_state = gGL.getLight(cur_light);
@@ -6362,6 +6374,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
light->setDiffuse(LLColor4::black);
light->setAmbient(LLColor4::black);
light->setSpecular(LLColor4::black);
+ light->setQuadraticAttenuation(1.f);
+ light->setLinearAttenuation(1.f);
}
if (gAgentAvatarp &&
gAgentAvatarp->mSpecialRenderMode == 3)
@@ -7685,7 +7699,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
else
{
//focus on alt-zoom target
- focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal());
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region)
+ {
+ focus_point = LLVector3(gAgentCamera.getFocusGlobal()-region->getOriginGlobal());
+ }
}
}
@@ -8306,13 +8324,6 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
shader.uniform2f(LLShaderMgr::DEFERRED_PROJ_SHADOW_RES, mShadow[4].getWidth(), mShadow[4].getHeight());
shader.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff);
shader.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff);
-
-
- if (shader.getUniformLocation("norm_mat") >= 0)
- {
- glh::matrix4f norm_mat = glh_get_current_modelview().inverse().transpose();
- shader.uniformMatrix4fv("norm_mat", 1, FALSE, norm_mat.m);
- }
}
LLColor3 pow3f(LLColor3 v, F32 f)
@@ -8433,9 +8444,8 @@ void LLPipeline::renderDeferredLighting()
}
}
- gDeferredSunProgram.uniform3fv("offset", slice, offset);
- gDeferredSunProgram.uniform2f("screenRes", mDeferredLight.getWidth(), mDeferredLight.getHeight());
-
+ gDeferredSunProgram.uniform3fv(sOffset, slice, offset);
+
{
LLGLDisable blend(GL_BLEND);
LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS);
@@ -8478,10 +8488,10 @@ void LLPipeline::renderDeferredLighting()
x += 1.f;
}
- gDeferredBlurLightProgram.uniform2f("delta", 1.f, 0.f);
- gDeferredBlurLightProgram.uniform1f("dist_factor", dist_factor);
- gDeferredBlurLightProgram.uniform3fv("kern", kern_length, gauss[0].mV);
- gDeferredBlurLightProgram.uniform1f("kern_scale", blur_size * (kern_length/2.f - 0.5f));
+ gDeferredBlurLightProgram.uniform2f(sDelta, 1.f, 0.f);
+ gDeferredBlurLightProgram.uniform1f(sDistFactor, dist_factor);
+ gDeferredBlurLightProgram.uniform3fv(sKern, kern_length, gauss[0].mV);
+ gDeferredBlurLightProgram.uniform1f(sKernScale, blur_size * (kern_length/2.f - 0.5f));
{
LLGLDisable blend(GL_BLEND);
@@ -8498,7 +8508,7 @@ void LLPipeline::renderDeferredLighting()
mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
mDeferredLight.bindTarget();
- gDeferredBlurLightProgram.uniform2f("delta", 0.f, 1.f);
+ gDeferredBlurLightProgram.uniform2f(sDelta, 0.f, 1.f);
{
LLGLDisable blend(GL_BLEND);
@@ -8665,7 +8675,7 @@ void LLPipeline::renderDeferredLighting()
LLFastTimer ftm(FTM_LOCAL_LIGHTS);
gDeferredLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c);
- gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
+ gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, 1.f/s);
gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f);
gGL.syncMatrices();
@@ -8686,7 +8696,7 @@ void LLPipeline::renderDeferredLighting()
glh::vec3f tc(c);
mat.mult_matrix_vec(tc);
- fullscreen_lights.push_back(LLVector4(tc.v[0], tc.v[1], tc.v[2], s));
+ fullscreen_lights.push_back(LLVector4(tc.v[0], tc.v[1], tc.v[2], 1.f/s));
light_colors.push_back(LLVector4(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f));
}
}
@@ -8742,10 +8752,6 @@ void LLPipeline::renderDeferredLighting()
vert[2].set(3,1,0);
{
- bindDeferredShader(gDeferredMultiLightProgram);
-
- mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-
LLGLDepthTest depth(GL_FALSE);
//full screen blit
@@ -8757,7 +8763,7 @@ void LLPipeline::renderDeferredLighting()
U32 count = 0;
- const U32 max_count = 8;
+ const U32 max_count = LL_DEFERRED_MULTI_LIGHT_COUNT;
LLVector4 light[max_count];
LLVector4 col[max_count];
@@ -8775,22 +8781,25 @@ void LLPipeline::renderDeferredLighting()
col[count].mV[1] = powf(col[count].mV[1], 2.2f);
col[count].mV[2] = powf(col[count].mV[2], 2.2f);*/
- far_z = llmin(light[count].mV[2]-light[count].mV[3], far_z);
+ far_z = llmin(light[count].mV[2]-1.f/light[count].mV[3], far_z);
//col[count] = pow4fsrgb(col[count], 2.2f);
count++;
if (count == max_count || fullscreen_lights.empty())
{
- gDeferredMultiLightProgram.uniform1i(LLShaderMgr::MULTI_LIGHT_COUNT, count);
- gDeferredMultiLightProgram.uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*) light);
- gDeferredMultiLightProgram.uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col);
- gDeferredMultiLightProgram.uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z);
+ U32 idx = count-1;
+ bindDeferredShader(gDeferredMultiLightProgram[idx]);
+ gDeferredMultiLightProgram[idx].uniform1i(LLShaderMgr::MULTI_LIGHT_COUNT, count);
+ gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*) light);
+ gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col);
+ gDeferredMultiLightProgram[idx].uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z);
far_z = 0.f;
count = 0;
+ mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
}
}
- unbindDeferredShader(gDeferredMultiLightProgram);
+ unbindDeferredShader(gDeferredMultiLightProgram[0]);
bindDeferredShader(gDeferredMultiSpotLightProgram);
@@ -9199,12 +9208,13 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
water_clip = 1;
}
+ S32 occlusion = LLPipeline::sUseOcclusion;
+ LLPipeline::sUseOcclusion = 0;
+
if (!LLViewerCamera::getInstance()->cameraUnderWater())
{ //generate planar reflection map
//disable occlusion culling for reflection map for now
- S32 occlusion = LLPipeline::sUseOcclusion;
- LLPipeline::sUseOcclusion = 0;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
glClearColor(0,0,0,0);
mWaterRef.bindTarget();
@@ -9308,7 +9318,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
gGL.popMatrix();
mWaterRef.flush();
glh_set_current_modelview(current);
- LLPipeline::sUseOcclusion = occlusion;
}
camera.setOrigin(camera_in.getOrigin());
@@ -9364,6 +9373,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
LLPipeline::sUnderWaterRender = FALSE;
mWaterDis.flush();
}
+
+ LLPipeline::sUseOcclusion = occlusion;
last_update = LLDrawPoolWater::sNeedsReflectionUpdate && LLDrawPoolWater::sNeedsDistortionUpdate;
LLPipeline::sReflectionRender = FALSE;
@@ -10678,11 +10689,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
assertInitialized();
- bool muted = avatar->isVisuallyMuted();
+ bool visually_muted = avatar->isVisuallyMuted();
pushRenderTypeMask();
- if (muted)
+ if (visually_muted)
{
andRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES);
}
@@ -10826,6 +10837,13 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
avatar->mImpostor.bindTarget();
}
+ F32 old_alpha = LLDrawPoolAvatar::sMinimumAlpha;
+
+ if (visually_muted)
+ { //disable alpha masking for muted avatars (get whole skin silhouette)
+ LLDrawPoolAvatar::sMinimumAlpha = 0.f;
+ }
+
if (LLPipeline::sRenderDeferred)
{
avatar->mImpostor.clear();
@@ -10840,6 +10858,8 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
renderGeom(camera);
}
+ LLDrawPoolAvatar::sMinimumAlpha = old_alpha;
+
{ //create alpha mask based on depth buffer (grey out if muted)
LLFastTimer t(FTM_IMPOSTOR_BACKGROUND);
if (LLPipeline::sRenderDeferred)
@@ -10850,9 +10870,10 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
LLGLDisable blend(GL_BLEND);
- if (muted)
+ if (visually_muted)
{
gGL.setColorMask(true, true);
+
}
else
{
@@ -10871,14 +10892,24 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
gGL.pushMatrix();
gGL.loadIdentity();
- static const F32 clip_plane = 0.99999f;
+ static const F32 clip_plane = 0.999f;
if (LLGLSLShader::sNoFixedFunction)
{
- gUIProgram.bind();
+ gDebugProgram.bind();
+ }
+
+
+ if (LLMuteList::getInstance()->isMuted(avatar->getID()))
+ { //grey muted avatar
+ gGL.diffuseColor4ub(64,64,64,255);
+ }
+ else
+ { // Visually muted avatar
+ gGL.diffuseColor4fv( avatar->getMutedAVColor().mV );
}
- gGL.color4ub(64,64,64,255);
+ {
gGL.begin(LLRender::QUADS);
gGL.vertex3f(-1, -1, clip_plane);
gGL.vertex3f(1, -1, clip_plane);
@@ -10886,10 +10917,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
gGL.vertex3f(-1, 1, clip_plane);
gGL.end();
gGL.flush();
+ }
if (LLGLSLShader::sNoFixedFunction)
{
- gUIProgram.unbind();
+ gDebugProgram.unbind();
}
gGL.popMatrix();