summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2012-04-02 13:11:17 -0400
committerprep <prep@lindenlab.com>2012-04-02 13:11:17 -0400
commit931b99f24218176f981ad8c375981fbdb17b4dca (patch)
treee60b723ef29fa3195ee1cb94c15366d3ccc102e2 /indra
parentdfa1fb6a16e499e1012e69e3c3ec13931b3bf21a (diff)
Path 409: Fix for hud attachments messing up rendering of navmesh display.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/pipeline.cpp115
1 files changed, 59 insertions, 56 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 3d4cf6afd9..d196361b88 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4315,71 +4315,76 @@ void LLPipeline::renderDebug()
assertInitialized();
- if (LLGLSLShader::sNoFixedFunction)
+ bool hud_only = hasRenderType(LLPipeline::RENDER_TYPE_HUD);
+
+ if (!hud_only )
{
- gUIProgram.bind();
- }
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gUIProgram.bind();
+ }
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gPipeline.disableLights();
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ gPipeline.disableLights();
- //Render any navmesh geometry
- LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();
- if ( llPathingLibInstance != NULL )
- {
- LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
- if (!pathfindingConsoleHandle.isDead())
+ //Render any navmesh geometry
+ LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();
+ if ( llPathingLibInstance != NULL )
{
- LLFloaterPathfindingConsole *pathfindingConsole = pathfindingConsoleHandle.get();
- //NavMesh
- if ( pathfindingConsole->isRenderNavMesh() )
- {
- glLineWidth(2.0f);
- LLGLEnable cull(GL_CULL_FACE);
- LLGLEnable blend(GL_BLEND);
- if ( pathfindingConsole->isRenderWorld() )
+ LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
+ if (!pathfindingConsoleHandle.isDead())
+ {
+ LLFloaterPathfindingConsole *pathfindingConsole = pathfindingConsoleHandle.get();
+ //NavMesh
+ if ( pathfindingConsole->isRenderNavMesh() )
+ {
+ glLineWidth(2.0f);
+ LLGLEnable cull(GL_CULL_FACE);
+ LLGLEnable blend(GL_BLEND);
+ if ( pathfindingConsole->isRenderWorld() )
+ {
+ glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+ }
+ else
+ {
+ const LLColor4 &clearColor = pathfindingConsole->mNavMeshColors.mNavMeshClear;
+ glClearColor(clearColor.mV[0],clearColor.mV[1],clearColor.mV[2],0);
+ glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ }
+ int materialIndex = pathfindingConsole->getHeatMapType();
+ llPathingLibInstance->renderNavMesh( materialIndex );
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ glLineWidth(1.0f);
+ gGL.flush();
+ }
+ //physics/exclusion shapes
+ if ( pathfindingConsole->isRenderAnyShapes() )
{
+ LLGLEnable blend(GL_BLEND);
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ llPathingLibInstance->renderNavMeshShapesVBO( pathfindingConsole->getRenderShapeFlags() );
+ gGL.flush();
+ LLGLDisable blendOut(GL_BLEND);
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
- }
- else
- {
- const LLColor4 &clearColor = pathfindingConsole->mNavMeshColors.mNavMeshClear;
- glClearColor(clearColor.mV[0],clearColor.mV[1],clearColor.mV[2],0);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ llPathingLibInstance->renderNavMeshShapesVBO( pathfindingConsole->getRenderShapeFlags() );
+ gGL.flush();
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ }
+ //User designated path
+ if ( pathfindingConsole->isRenderPath() )
+ {
+ LLGLEnable blend(GL_BLEND);
+ llPathingLibInstance->renderPath();
}
- int materialIndex = pathfindingConsole->getHeatMapType();
- llPathingLibInstance->renderNavMesh( materialIndex );
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- glLineWidth(1.0f);
- gGL.flush();
- }
- //physics/exclusion shapes
- if ( pathfindingConsole->isRenderAnyShapes() )
- {
- LLGLEnable blend(GL_BLEND);
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- llPathingLibInstance->renderNavMeshShapesVBO( pathfindingConsole->getRenderShapeFlags() );
- gGL.flush();
- LLGLDisable blendOut(GL_BLEND);
- glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
- llPathingLibInstance->renderNavMeshShapesVBO( pathfindingConsole->getRenderShapeFlags() );
- gGL.flush();
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- }
- //User designated path
- if ( pathfindingConsole->isRenderPath() )
- {
- LLGLEnable blend(GL_BLEND);
- llPathingLibInstance->renderPath();
}
}
- }
- gGL.flush();
- if (LLGLSLShader::sNoFixedFunction)
- {
- gUIProgram.unbind();
+ gGL.flush();
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gUIProgram.unbind();
+ }
}
gGL.color4f(1,1,1,1);
@@ -4388,9 +4393,7 @@ void LLPipeline::renderDebug()
gGL.loadMatrix(gGLModelView);
gGL.setColorMask(true, false);
- bool hud_only = hasRenderType(LLPipeline::RENDER_TYPE_HUD);
-
if (!hud_only && !mDebugBlips.empty())
{ //render debug blips
if (LLGLSLShader::sNoFixedFunction)