diff options
author | Dave Parks <davep@lindenlab.com> | 2012-04-03 17:16:57 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2012-04-03 17:16:57 -0500 |
commit | 6bf304ec06c2717fc513e010f113996460d3be62 (patch) | |
tree | fc80817fb00449dced67fd075a80b5d0c2b22e53 /indra/newview | |
parent | 6b64ea6779a6d35bb6c9f94e354f5635ee633366 (diff) |
Make navmesh show up in xray view.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/pipeline.cpp | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a02c39e728..cd6b1b02fa 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4466,8 +4466,52 @@ void LLPipeline::renderDebug() glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); } } - } - + } + + glPolygonOffset(0.f, 0.f); + + 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 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(); + + 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 ); + } + else + { + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + gPathfindingProgram.uniform1f("ambiance", ambiance); + llPathingLibInstance->renderNavMesh( materialIndex ); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } + llPathingLibInstance->renderNavMesh( materialIndex ); + gGL.flush(); + glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); + glLineWidth(1.0f); + gGL.flush(); + } + + glPolygonOffset(0.f, 0.f); } } gGL.flush(); |