summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-03-07 10:19:16 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-03-07 10:19:16 -0800
commit94dbe51a5c6fa09989f9e71ee8d84a7207b8acc5 (patch)
treead129da68df6ed23ab4359287e1fbeb21a8464f8 /indra
parenta0c626fe411336871505c2c414143ae4b2f73259 (diff)
parente02d8cdc9875c14084447a5156799eeca030ea73 (diff)
Pull and merge from ssh://hg@bitbucket.org/stinson_linden/viewer-development-havokai.
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llrendernavprim.cpp29
-rw-r--r--indra/newview/llviewerdisplay.cpp100
-rw-r--r--indra/newview/pipeline.cpp50
3 files changed, 82 insertions, 97 deletions
diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp
index 47cc996043..b697946a1d 100644
--- a/indra/llrender/llrendernavprim.cpp
+++ b/indra/llrender/llrendernavprim.cpp
@@ -37,11 +37,8 @@ LLRenderNavPrim gRenderNav;
//=============================================================================
void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& end, int color, bool overlayMode ) const
{
- bool ff = LLGLSLShader::sNoFixedFunction;
- LLGLSLShader::sNoFixedFunction = false;
- LLGLEnable smooth(GL_LINE_SMOOTH);
LLColor4 colorA( color );
- glLineWidth(1.5f);
+ //glLineWidth(1.5f);
gGL.color3fv( colorA.mV );
gGL.begin(LLRender::LINES);
@@ -50,30 +47,14 @@ void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& en
gGL.vertex3fv( end.mV );
}
gGL.end();
-
- gGL.flush();
- LLGLSLShader::sNoFixedFunction = ff;
- LLGLDisable smoothout(GL_LINE_SMOOTH);
- glLineWidth(1.0f);
+ //glLineWidth(1.0f);
}
//=============================================================================
void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color, bool overlayMode ) const
{
- glLineWidth(1.5f);
- if ( overlayMode )
- {
- glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
- }
- else
- {
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- }
- LLGLEnable cull(GL_CULL_FACE);
LLColor4 colorA( color );
colorA*=1.25f;
gGL.color4fv( colorA.mV );
- bool ff = LLGLSLShader::sNoFixedFunction;
- LLGLSLShader::sNoFixedFunction = false;
gGL.begin(LLRender::TRIANGLES);
{
gGL.vertex3fv( a.mV );
@@ -81,10 +62,6 @@ void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const L
gGL.vertex3fv( c.mV );
}
gGL.end();
- gGL.flush();
- glLineWidth(1.0f);
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- LLGLSLShader::sNoFixedFunction = ff;
}
//=============================================================================
void LLRenderNavPrim::renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt )
@@ -98,13 +75,11 @@ void LLRenderNavPrim::renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt )
pVBO->setBuffer( LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL );
pVBO->drawArrays( LLRender::TRIANGLES, 0, vertCnt );
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
- LLGLEnable smooth( GL_LINE_SMOOTH );
//pass 2 outlined
pVBO->drawArrays( LLRender::TRIANGLES, 0, vertCnt );
LLGLSLShader::sNoFixedFunction = ff;
glLineWidth(1.0f);
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- LLGLDisable smoothout( GL_LINE_SMOOTH );
}
//=============================================================================
void LLRenderNavPrim::renderStar( const LLVector3& center, const float scale, int color ) const
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 001c23278d..d7ef038e4e 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -113,7 +113,6 @@ void render_hud_attachments();
void render_ui_3d();
void render_ui_2d();
void render_disconnected_background();
-void render_navmesh( bool& allowRenderables, bool& exclusiveNavDraw );
void display_startup()
{
@@ -719,7 +718,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLAppViewer::instance()->pingMainloopTimeout("Display:Imagery");
gPipeline.generateWaterReflection(*LLViewerCamera::getInstance());
gPipeline.generateHighlight(*LLViewerCamera::getInstance());
- gPipeline.renderPhysicsDisplay();
+ gPipeline.renderPhysicsDisplay();
}
LLGLState::checkStates();
@@ -860,6 +859,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
stop_glerror();
+
if (to_texture)
{
gGL.setColorMask(true, true);
@@ -884,37 +884,33 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gGL.setColorMask(true, false);
}
- LLAppViewer::instance()->pingMainloopTimeout("Display:RenderGeom");
- bool exclusiveNavDraw = false;
- bool allowRenderables = false;
- if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot())
- && !gRestoreGL)
- {
- LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
- LLMemType mt_rg(LLMemType::MTYPE_DISPLAY_RENDER_GEOM);
- gGL.setColorMask(true, false);
- if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
- {
- gPipeline.renderGeomDeferred(*LLViewerCamera::getInstance());
- }
-
- render_navmesh( allowRenderables, exclusiveNavDraw );
-
- if ( !exclusiveNavDraw || allowRenderables )
- {
- gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE);
- }
-
- gGL.setColorMask(true, true);
-
- //store this frame's modelview matrix for use
- //when rendering next frame's occlusion queries
- for (U32 i = 0; i < 16; i++)
- {
- gGLLastModelView[i] = gGLModelView[i];
- gGLLastProjection[i] = gGLProjection[i];
- }
- stop_glerror();
+ if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot())
+ && !gRestoreGL)
+ {
+ LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
+ LLMemType mt_rg(LLMemType::MTYPE_DISPLAY_RENDER_GEOM);
+ gGL.setColorMask(true, false);
+
+
+ if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
+ {
+ gPipeline.renderGeomDeferred(*LLViewerCamera::getInstance());
+ }
+ else
+ {
+ gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE);
+ }
+
+ gGL.setColorMask(true, true);
+
+ //store this frame's modelview matrix for use
+ //when rendering next frame's occlusion queries
+ for (U32 i = 0; i < 16; i++)
+ {
+ gGLLastModelView[i] = gGLModelView[i];
+ gGLLastProjection[i] = gGLProjection[i];
+ }
+ stop_glerror();
}
for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++)
@@ -956,6 +952,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
}
+
if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender )
{
gPipeline.renderDeferredLighting();
@@ -992,42 +989,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLAppViewer::instance()->pingMainloopTimeout("Display:Done");
}
-void render_navmesh( bool& allowRenderables, bool& exclusiveNavDraw )
-{
- //Render any navmesh geometry
- LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();
- if ( llPathingLibInstance != NULL )
- {
- LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
- if (!pathfindingConsoleHandle.isDead())
- {
- LLFloaterPathfindingConsole *pathfindingConsole = pathfindingConsoleHandle.get();
- //Determine if we can should overlay the navmesh ontop of the scenes typical renderables
- allowRenderables = pathfindingConsole->isRenderWorld();
-
- //NavMesh
- if ( pathfindingConsole->isRenderNavMesh() )
- {
- glClearColor(0,0,0,0);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- LLGLDisable lighting(GL_LIGHTING);
- llPathingLibInstance->renderNavMesh();
- exclusiveNavDraw = true;
- }
- //physics/exclusion shapes
- if ( pathfindingConsole->isRenderAnyShapes() )
- {
- llPathingLibInstance->renderNavMeshShapesVBO( pathfindingConsole->getRenderShapeFlags() );
- exclusiveNavDraw = true;
- }
- //User designated path
- if ( pathfindingConsole->isRenderPath() )
- {
- llPathingLibInstance->renderPath();
- }
- }
- }
-}
void render_hud_attachments()
{
LLMemType mt_ra(LLMemType::MTYPE_DISPLAY_RENDER_ATTACHMENTS);
@@ -1266,7 +1227,6 @@ void render_ui(F32 zoom_factor, int subfield)
{
render_disconnected_background();
}
-
render_ui_2d();
LLGLState::checkStates();
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 70cf09caca..87e21c1f05 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -105,6 +105,7 @@
#include "llcurl.h"
#include "llnotifications.h"
#include "LLPathingLib.h"
+#include "llfloaterpathfindingconsole.h"
#ifdef _DEBUG
// Debug indices is disabled for now for debug performance - djs 4/24/02
@@ -4327,6 +4328,55 @@ void LLPipeline::renderDebug()
LLMemType mt(LLMemType::MTYPE_PIPELINE);
assertInitialized();
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gUIProgram.bind();
+ }
+ //Render any navmesh geometry
+ LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();
+ if ( llPathingLibInstance != NULL )
+ {
+ LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
+ if (!pathfindingConsoleHandle.isDead())
+ {
+ LLFloaterPathfindingConsole *pathfindingConsole = pathfindingConsoleHandle.get();
+ //NavMesh
+ if ( pathfindingConsole->isRenderNavMesh() )
+ {
+ glLineWidth(1.5f);
+ LLGLEnable cull(GL_CULL_FACE);
+ if ( pathfindingConsole->isRenderWorld() )
+ {
+ glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+ }
+ else
+ {
+ glClearColor(0,0,0,0);
+ glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ }
+ llPathingLibInstance->renderNavMesh();
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+ glLineWidth(1.0f);
+ gGL.flush();
+ }
+ //physics/exclusion shapes
+ if ( pathfindingConsole->isRenderAnyShapes() )
+ {
+ llPathingLibInstance->renderNavMeshShapesVBO( pathfindingConsole->getRenderShapeFlags() );
+ }
+ //User designated path
+ if ( pathfindingConsole->isRenderPath() )
+ {
+ llPathingLibInstance->renderPath();
+ }
+ }
+ }
+ gGL.flush();
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gUIProgram.unbind();
+ }
gGL.color4f(1,1,1,1);