summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llrender/llrendernavprim.cpp38
-rw-r--r--indra/llrender/llrendernavprim.h4
-rw-r--r--indra/newview/llviewerdisplay.cpp15
3 files changed, 34 insertions, 23 deletions
diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp
index 11e60548e2..9a114609d2 100644
--- a/indra/llrender/llrendernavprim.cpp
+++ b/indra/llrender/llrendernavprim.cpp
@@ -35,7 +35,7 @@
//=============================================================================
LLRenderNavPrim gRenderNav;
//=============================================================================
-void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& end, int color ) const
+void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& end, int color,bool overlayMode ) const
{
LLGLSLShader::sNoFixedFunction = false;
LLColor4 colorA( color );
@@ -54,13 +54,20 @@ void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& en
glLineWidth(1.0f);
}
//=============================================================================
-void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ) const
+void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color,bool overlayMode ) const
{
- glLineWidth(1.5f);
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ glLineWidth(1.5f);
+ if ( overlayMode )
+ {
+ glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+ }
+ else
+ {
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ }
LLGLDisable cull(GL_CULL_FACE);
LLColor4 colorA( color );
- colorA*=1.5f;
+ colorA*=1.25f;
gGL.color4fv( colorA.mV );
LLGLSLShader::sNoFixedFunction = false;
gGL.begin(LLRender::TRIANGLES);
@@ -71,17 +78,30 @@ void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const L
}
gGL.end();
gGL.flush();
+ glLineWidth(1.0f);
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
LLGLSLShader::sNoFixedFunction = true;
}
//=============================================================================
void LLRenderNavPrim::renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt )
{
glLineWidth(1.5f);
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- LLGLDisable cull(GL_CULL_FACE);
LLGLSLShader::sNoFixedFunction = false;
- pVBO->setBuffer( LLVertexBuffer::MAP_VERTEX );
- pVBO->drawArrays( LLRender::TRIANGLES, 0, vertCnt );
+
+ LLGLEnable depth(GL_DEPTH_TEST);
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ LLGLEnable cull( GL_CULL_FACE );
+
+ //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 );
+ //static GLubyte red[]= { 255.0f, 0.0f, 0.0f, 255.0f };
+ //glColor4ubv( red );
+ //pass 2 outlined
+ //pVBO->drawArrays( LLRender::TRIANGLES, 0, vertCnt );
LLGLSLShader::sNoFixedFunction = true;
+ glLineWidth(1.0f);
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
}
//=============================================================================
diff --git a/indra/llrender/llrendernavprim.h b/indra/llrender/llrendernavprim.h
index cd57fd2223..a30a14551d 100644
--- a/indra/llrender/llrendernavprim.h
+++ b/indra/llrender/llrendernavprim.h
@@ -40,9 +40,9 @@ class LLRenderNavPrim
{
public:
//Draw a line
- void renderSegment( const LLVector3& start, const LLVector3& end, int color ) const;
+ void renderSegment( const LLVector3& start, const LLVector3& end, int color,bool overlayMode ) const;
//Draw simple tri
- void renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ) const;
+ void renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color,bool overlayMode ) const;
//Draw the contents of vertex buffer
void renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt );
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 2b2dd5ef7c..85896c74dd 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -915,24 +915,15 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
//Navmesh
if ( LLPathingLib::getInstance()->getRenderNavMeshState() )
{
- glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
-
+ glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glEnable(GL_DEPTH_TEST);
- gGL.setSceneBlendType( LLRender::BT_ALPHA );
gGL.setAmbientLightColor( LLColor4::white );
- LLPathingLib::getInstance()->renderNavMesh();
+ LLPathingLib::getInstance()->renderNavMesh( allowRenderables );
exclusiveDraw = true;
}
//physics/exclusion shapes
if ( LLPathingLib::getInstance()->getRenderShapeState() )
- {
- glEnable(GL_DEPTH_TEST);
- gGL.setSceneBlendType( LLRender::BT_REPLACE );
- GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
- glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
- LLGLSUIDefault texture_state;
- LLGLDepthTest gls_depth(GL_TRUE);
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ {
LLPathingLib::getInstance()->renderNavMeshShapesVBO();
exclusiveDraw = true;
}