diff options
author | prep <prep@lindenlab.com> | 2011-12-14 16:07:47 -0500 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2011-12-14 16:07:47 -0500 |
commit | 7f8aebf78bddf0d15180700162da1728cb5a2bbf (patch) | |
tree | 9b0ad2556f8222e5f221f7912b86fafa49019cc5 /indra/newview | |
parent | 35b6450d10b826a6bbb60e9dc00e8eaafa8b0d26 (diff) |
Moved navmesh rendering invocation into viewerdisplay.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewerdisplay.cpp | 47 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 34 |
2 files changed, 45 insertions, 36 deletions
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();
|