From 41e095deb8f40de24c26ef10dda03951566e03c6 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Wed, 7 Mar 2012 17:48:17 -0500
Subject: [PATCH] Path-287: VB bug fixes. Cleaned up rendering prims. Navmesh
 shape rendering fixes. Code cleanup

---
 indra/llrender/llrendernavprim.cpp | 16 +---------------
 indra/newview/pipeline.cpp         | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp
index b697946a1d0..ebc453a32ce 100644
--- a/indra/llrender/llrendernavprim.cpp
+++ b/indra/llrender/llrendernavprim.cpp
@@ -38,7 +38,6 @@ LLRenderNavPrim gRenderNav;
 void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& end, int color, bool overlayMode  ) const
 {	
 	LLColor4 colorA( color );	
-	//glLineWidth(1.5f);	
 	gGL.color3fv( colorA.mV );
 
 	gGL.begin(LLRender::LINES);
@@ -47,7 +46,6 @@ void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& en
 		gGL.vertex3fv( end.mV );
 	}
 	gGL.end();	
-	//glLineWidth(1.0f);	
 }
 //=============================================================================
 void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color, bool overlayMode ) const
@@ -65,21 +63,9 @@ void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const L
 }
 //=============================================================================
 void LLRenderNavPrim::renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt )
-{
-	LLGLEnable blend( GL_BLEND ); 
-	LLGLEnable cull( GL_CULL_FACE );		
-	glLineWidth(1.5f);	
-	bool ff = LLGLSLShader::sNoFixedFunction;
-	LLGLSLShader::sNoFixedFunction = false;
-	//pass 1 filled
+{	
 	pVBO->setBuffer( LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL );
 	pVBO->drawArrays( LLRender::TRIANGLES, 0, vertCnt );	
-	glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );		
-	//pass 2 outlined
-	pVBO->drawArrays( LLRender::TRIANGLES, 0, vertCnt );	
-	LLGLSLShader::sNoFixedFunction = ff;
-	glLineWidth(1.0f);		
-	glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );	
 }
 //=============================================================================
 void LLRenderNavPrim::renderStar( const LLVector3& center, const float scale, int color ) const
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 90681514355..95482638435 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4334,8 +4334,8 @@ void LLPipeline::renderDebug()
 		gUIProgram.bind();
 	}
 
-	gGL.setSceneBlendType(LLRender::BT_ALPHA);
-	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+
+	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);	
 	gPipeline.disableLights();
 
 	//Render any navmesh geometry	
@@ -4368,8 +4368,16 @@ void LLPipeline::renderDebug()
 			}
 			//physics/exclusion shapes
 			if ( pathfindingConsole->isRenderAnyShapes() )
-			{						
-				llPathingLibInstance->renderNavMeshShapesVBO( pathfindingConsole->getRenderShapeFlags() );
+			{					
+				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() )
-- 
GitLab