summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-04-03 17:52:32 -0500
committerDave Parks <davep@lindenlab.com>2012-04-03 17:52:32 -0500
commit5c68a69af0249728cef2b1e58683c03ecf462e95 (patch)
tree981998289124bfb2f8dfdc663e7a81173087c3bb /indra/newview/pipeline.cpp
parent6bf304ec06c2717fc513e010f113996460d3be62 (diff)
Cleanup -- use falcon's default colors -- fix bug where screen remains blank after closing pathfinding console
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp308
1 files changed, 154 insertions, 154 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index cd6b1b02fa..5f0a47f11d 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4319,19 +4319,6 @@ void LLPipeline::renderDebug()
if (!hud_only )
{
- if (LLGLSLShader::sNoFixedFunction)
- {
- gPathfindingProgram.bind();
-
- gPathfindingProgram.uniform1f("tint", 1.f);
- gPathfindingProgram.uniform1f("ambiance", 1.f);
- gPathfindingProgram.uniform1f("alpha_scale", 1.f);
- }
-
-
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gPipeline.disableLights();
-
//Render any navmesh geometry
LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();
if ( llPathingLibInstance != NULL )
@@ -4341,184 +4328,197 @@ void LLPipeline::renderDebug()
{
LLFloaterPathfindingConsole *pathfindingConsole = pathfindingConsoleHandle.get();
- if ( pathfindingConsole->isRenderWorld() )
- {
- glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
- }
- else
+ if (pathfindingConsole->isShown())
{
- const LLColor4 &clearColor = pathfindingConsole->mNavMeshColors.mNavMeshClear;
- gGL.setColorMask(true, true);
- glClearColor(clearColor.mV[0],clearColor.mV[1],clearColor.mV[2],0);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- gGL.setColorMask(true, false);
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- }
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gPathfindingProgram.bind();
+
+ gPathfindingProgram.uniform1f("tint", 1.f);
+ gPathfindingProgram.uniform1f("ambiance", 1.f);
+ gPathfindingProgram.uniform1f("alpha_scale", 1.f);
+ }
- //NavMesh
- if ( pathfindingConsole->isRenderNavMesh() )
- { gGL.flush();
- glLineWidth(2.0f);
- LLGLEnable cull(GL_CULL_FACE);
- LLGLDisable blend(GL_BLEND);
-
- int materialIndex = pathfindingConsole->getHeatMapType();
- llPathingLibInstance->renderNavMesh( materialIndex );
- gGL.flush();
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- glLineWidth(1.0f);
- gGL.flush();
- }
- //User designated path
- if ( pathfindingConsole->isRenderPath() )
- {
- LLGLEnable blend(GL_BLEND);
- llPathingLibInstance->renderPath();
- }
- //physics/exclusion shapes
- if ( pathfindingConsole->isRenderAnyShapes() )
- {
- U32 render_order[] = {
- 1 << LLPathingLib::LLST_ObstacleObjects,
- 1 << LLPathingLib::LLST_WalkableObjects,
- 1 << LLPathingLib::LLST_ExclusionPhantoms,
- 1 << LLPathingLib::LLST_MaterialPhantoms,
- };
-
- U32 flags = pathfindingConsole->getRenderShapeFlags();
-
- for (U32 i = 0; i < 4; i++)
+ if ( pathfindingConsole->isRenderWorld() )
+ {
+ glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+ }
+ else
{
- if (!(flags & render_order[i]))
- {
- continue;
- }
+ const LLColor4 &clearColor = pathfindingConsole->mNavMeshColors.mNavMeshClear;
+ gGL.setColorMask(true, true);
+ glClearColor(clearColor.mV[0],clearColor.mV[1],clearColor.mV[2],0);
+ glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ gGL.setColorMask(true, false);
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ }
+ //NavMesh
+ if ( pathfindingConsole->isRenderNavMesh() )
+ { gGL.flush();
+ glLineWidth(2.0f);
+ LLGLEnable cull(GL_CULL_FACE);
+ LLGLDisable blend(GL_BLEND);
+
+ int materialIndex = pathfindingConsole->getHeatMapType();
+ llPathingLibInstance->renderNavMesh( materialIndex );
gGL.flush();
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ glLineWidth(1.0f);
+ gGL.flush();
+ }
+ //User designated path
+ if ( pathfindingConsole->isRenderPath() )
+ {
+ LLGLEnable blend(GL_BLEND);
+ llPathingLibInstance->renderPath();
+ }
+ //physics/exclusion shapes
+ if ( pathfindingConsole->isRenderAnyShapes() )
+ {
+ U32 render_order[] = {
+ 1 << LLPathingLib::LLST_ObstacleObjects,
+ 1 << LLPathingLib::LLST_WalkableObjects,
+ 1 << LLPathingLib::LLST_ExclusionPhantoms,
+ 1 << LLPathingLib::LLST_MaterialPhantoms,
+ };
+
+ U32 flags = pathfindingConsole->getRenderShapeFlags();
+
+ for (U32 i = 0; i < 4; i++)
+ {
+ if (!(flags & render_order[i]))
+ {
+ continue;
+ }
+
+ //turn off backface culling for volumes so they are visible when camera is inside volume
+ LLGLDisable cull(i >= 2 ? GL_CULL_FACE : 0);
+
+ gGL.flush();
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- //get rid of some z-fighting
- LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(1.0f, 1.0f);
+ //get rid of some z-fighting
+ LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
+ glPolygonOffset(1.0f, 1.0f);
- //render to depth first to avoid blending artifacts
- gGL.setColorMask(false, false);
- llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
- gGL.setColorMask(true, false);
+ //render to depth first to avoid blending artifacts
+ gGL.setColorMask(false, false);
+ llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
+ gGL.setColorMask(true, false);
- //get rid of some z-fighting
- glPolygonOffset(0.f, 0.f);
+ //get rid of some z-fighting
+ glPolygonOffset(0.f, 0.f);
- LLGLEnable blend(GL_BLEND);
+ LLGLEnable blend(GL_BLEND);
- {
- F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance");
+ {
+ F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance");
- gPathfindingProgram.uniform1f("ambiance", ambiance);
+ gPathfindingProgram.uniform1f("ambiance", ambiance);
- { //draw solid overlay
- LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_LEQUAL);
- llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
- gGL.flush();
- }
+ { //draw solid overlay
+ LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_LEQUAL);
+ llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
+ gGL.flush();
+ }
- LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE);
- glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+ LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE);
+ glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
- F32 offset = gSavedSettings.getF32("PathfindingLineOffset");
+ F32 offset = gSavedSettings.getF32("PathfindingLineOffset");
- if (pathfindingConsole->isRenderXRay())
- {
- gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
- gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
- LLGLEnable blend(GL_BLEND);
- LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
+ if (pathfindingConsole->isRenderXRay())
+ {
+ gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
+ gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
+ LLGLEnable blend(GL_BLEND);
+ LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
- glPolygonOffset(offset, -offset);
+ glPolygonOffset(offset, -offset);
- if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
- { //draw hidden wireframe as darker and less opaque
- gPathfindingProgram.uniform1f("ambiance", 1.f);
- llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
+ if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
+ { //draw hidden wireframe as darker and less opaque
+ gPathfindingProgram.uniform1f("ambiance", 1.f);
+ llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
+ }
+ else
+ {
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ gPathfindingProgram.uniform1f("ambiance", ambiance);
+ llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ }
}
- else
- {
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- gPathfindingProgram.uniform1f("ambiance", ambiance);
+
+ { //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);
+
+ glLineWidth(gSavedSettings.getF32("PathfindingLineWidth"));
+ LLGLDisable blendOut(GL_BLEND);
llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ gGL.flush();
+ glLineWidth(1.f);
}
- }
-
- { //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);
-
- glLineWidth(gSavedSettings.getF32("PathfindingLineWidth"));
- LLGLDisable blendOut(GL_BLEND);
- llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
- gGL.flush();
- glLineWidth(1.f);
- }
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ }
}
}
- }
- glPolygonOffset(0.f, 0.f);
+ glPolygonOffset(0.f, 0.f);
- if ( pathfindingConsole->isRenderNavMesh() && pathfindingConsole->isRenderXRay() )
- { //render navmesh xray
- F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance");
+ if ( pathfindingConsole->isRenderNavMesh() && pathfindingConsole->isRenderXRay() )
+ { //render navmesh xray
+ F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance");
- LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE);
- LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
- glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
-
- F32 offset = gSavedSettings.getF32("PathfindingLineOffset");
- glPolygonOffset(offset, -offset);
+ LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE);
+ LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
+
+ F32 offset = gSavedSettings.getF32("PathfindingLineOffset");
+ glPolygonOffset(offset, -offset);
- LLGLEnable blend(GL_BLEND);
- LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
- gGL.flush();
- glLineWidth(2.0f);
- LLGLEnable cull(GL_CULL_FACE);
+ LLGLEnable blend(GL_BLEND);
+ LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
+ gGL.flush();
+ glLineWidth(2.0f);
+ LLGLEnable cull(GL_CULL_FACE);
- int materialIndex = pathfindingConsole->getHeatMapType();
+ int materialIndex = pathfindingConsole->getHeatMapType();
- gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
- gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
+ gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
+ gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
- if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
- { //draw hidden wireframe as darker and less opaque
- gPathfindingProgram.uniform1f("ambiance", 1.f);
- llPathingLibInstance->renderNavMesh( materialIndex );
+ if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
+ { //draw hidden wireframe as darker and less opaque
+ glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+ gPathfindingProgram.uniform1f("ambiance", 1.f);
+ llPathingLibInstance->renderNavMesh( materialIndex );
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ }
+ else
+ {
+ gPathfindingProgram.uniform1f("ambiance", ambiance);
+ llPathingLibInstance->renderNavMesh( materialIndex );
+ }
+
+ gGL.flush();
+ glLineWidth(1.0f);
}
- else
+
+ glPolygonOffset(0.f, 0.f);
+
+ gGL.flush();
+ if (LLGLSLShader::sNoFixedFunction)
{
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- gPathfindingProgram.uniform1f("ambiance", ambiance);
- llPathingLibInstance->renderNavMesh( materialIndex );
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ gPathfindingProgram.unbind();
}
- llPathingLibInstance->renderNavMesh( materialIndex );
- gGL.flush();
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- glLineWidth(1.0f);
- gGL.flush();
}
-
- glPolygonOffset(0.f, 0.f);
}
}
- gGL.flush();
- if (LLGLSLShader::sNoFixedFunction)
- {
- gPathfindingProgram.unbind();
- }
}
gGL.color4f(1,1,1,1);