summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llrender/llrendernavprim.cpp9
-rw-r--r--indra/newview/llviewerdisplay.cpp47
-rw-r--r--indra/newview/pipeline.cpp34
3 files changed, 51 insertions, 39 deletions
diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp
index c80ad3e180..3b217b426f 100644
--- a/indra/llrender/llrendernavprim.cpp
+++ b/indra/llrender/llrendernavprim.cpp
@@ -30,6 +30,7 @@
#include "llerror.h"
#include "llglheaders.h"
#include "llvertexbuffer.h"
+#include "llglslshader.h"
//=============================================================================
LLRenderNavPrim gRenderNav;
@@ -58,16 +59,16 @@ void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const L
LLColor4 colorA( color );
colorA*=1.5f;
gGL.color4fv( colorA.mV );
-
+ LLGLSLShader::sNoFixedFunction = false;
gGL.begin(LLRender::TRIANGLES);
{
gGL.vertex3fv( a.mV );
gGL.vertex3fv( b.mV );
gGL.vertex3fv( c.mV );
}
- gGL.end();
-
+ gGL.end();
gGL.flush();
+ LLGLSLShader::sNoFixedFunction = true;
}
//=============================================================================
void LLRenderNavPrim::renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt )
@@ -75,7 +76,9 @@ 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 );
+ LLGLSLShader::sNoFixedFunction = true;
}
//=============================================================================
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index cb40af7061..b33d8904fc 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -77,6 +77,7 @@
#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llpostprocess.h"
+#include "llpathinglib.h"
extern LLPointer<LLViewerTexture> gStartTexture;
@@ -880,7 +881,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderGeom");
-
+ bool exclusiveDraw = false;
if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot())
&& !gRestoreGL)
{
@@ -893,9 +894,51 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
else
{
- gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE);
+ //Render any navmesh geometry
+ if ( LLPathingLib::getInstance() )
+ {
+ //prep#
+ if ( LLPathingLib::getInstance()->getRenderNavMeshState() )
+ {
+ glClearColor(0,0,0,0);
+ glEnable(GL_TEXTURE_2D);
+ glShadeModel(GL_SMOOTH);
+ glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
+ glClearDepth(1.0f);
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_LEQUAL);
+ GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
+ glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
+
+ LLPathingLib::getInstance()->renderNavMesh();
+ exclusiveDraw = true;
+ }
+
+ if ( LLPathingLib::getInstance()->getRenderShapeState() )
+ {
+ glClearColor(0,0,0,0);
+ glEnable(GL_TEXTURE_2D);
+ glShadeModel(GL_SMOOTH);
+ glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
+ glClearDepth(1.0f);
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_LEQUAL);
+ 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;
+ }
+ }
}
+ if ( !exclusiveDraw )
+ {
+ gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE);
+ }
+
gGL.setColorMask(true, true);
//store this frame's modelview matrix for use
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 7613c0f14e..7511208ae5 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -104,7 +104,6 @@
#include "lltoolpie.h"
#include "llcurl.h"
#include "llnotifications.h"
-#include "llpathinglib.h"
#ifdef _DEBUG
// Debug indices is disabled for now for debug performance - djs 4/24/02
@@ -3763,40 +3762,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
}
LLAppViewer::instance()->pingMainloopTimeout("Pipeline:ForceVBO");
- //Render navmesh geometry
- {
- if ( LLPathingLib::getInstance() )
- {
- //prep#
- glClearColor(0,0,0,0);
- glEnable(GL_TEXTURE_2D); // Enable Texture Mapping
- glShadeModel(GL_SMOOTH); // Enable Smooth Shading
- glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
- glClearDepth(1.0f); // Depth Buffer Setup
- glEnable(GL_DEPTH_TEST); // Enables Depth Testing
- glDepthFunc(GL_LEQUAL);
- GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
- glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
- bool exclusiveDraw = false;
- if ( LLPathingLib::getInstance()->getRenderNavMeshState() )
- {
- LLPathingLib::getInstance()->renderNavMesh();
- exclusiveDraw = true;
- }
- if ( LLPathingLib::getInstance()->getRenderShapeState() )
- {
- LLGLSUIDefault texture_state;
- LLGLDepthTest gls_depth(GL_TRUE);
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- LLPathingLib::getInstance()->renderNavMeshShapesVBO();
- exclusiveDraw = true;
- }
-
- if ( exclusiveDraw ) { return; }
- }
- }
-
// Initialize lots of GL state to "safe" values
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();