From 6bf304ec06c2717fc513e010f113996460d3be62 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 3 Apr 2012 17:16:57 -0500 Subject: Make navmesh show up in xray view. --- indra/newview/pipeline.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'indra/newview') 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(); -- cgit v1.2.3