summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-12-02 21:34:01 -0600
committerDave Parks <davep@lindenlab.com>2010-12-02 21:34:01 -0600
commit98802a1ef99b7e5fb586dc259118fd58dc34631a (patch)
tree51e183db55f7c3dfbc60bcc4ab09e700d8f7f51a /indra/newview/pipeline.cpp
parent0be7fcf2a95a6d885bbef583966757d12fc9d18c (diff)
parent680328dd78e1d31a2f8836919a0f6140a76af5f4 (diff)
Merge
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp188
1 files changed, 5 insertions, 183 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index e3f397e291..31200675fc 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -132,8 +132,6 @@ static S32 sDelayedVBOEnable = 0;
BOOL gAvatarBacklight = FALSE;
-BOOL gRenderForSelect = FALSE;
-
BOOL gDebugPipeline = FALSE;
LLPipeline gPipeline;
const LLMatrix4* gGLLastMatrix = NULL;
@@ -744,7 +742,11 @@ void LLPipeline::updateRenderDeferred()
gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE) &&
!gUseWireframe;
- sRenderDeferred = deferred;
+ sRenderDeferred = deferred;
+ if (deferred)
+ { //must render glow when rendering deferred since post effect pass is needed to present any lighting at all
+ sRenderGlow = TRUE;
+ }
}
void LLPipeline::releaseGLBuffers()
@@ -837,7 +839,6 @@ void LLPipeline::createGLBuffers()
allocateScreenBuffer(resX,resY);
mScreenWidth = 0;
mScreenHeight = 0;
-
}
if (sRenderDeferred)
@@ -4245,185 +4246,6 @@ void LLPipeline::renderDebug()
gPipeline.renderPhysicsDisplay();
}
-void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects, BOOL render_transparent, const LLRect& screen_rect)
-{
- assertInitialized();
-
- gGL.setColorMask(true, false);
- gPipeline.resetDrawOrders();
-
- LLViewerCamera* camera = LLViewerCamera::getInstance();
- for (std::set<LLViewerObject*>::iterator iter = objects.begin(); iter != objects.end(); ++iter)
- {
- stateSort((*iter)->mDrawable, *camera);
- }
-
- LLMemType mt(LLMemType::MTYPE_PIPELINE_RENDER_SELECT);
-
-
-
- glMatrixMode(GL_MODELVIEW);
-
- LLGLSDefault gls_default;
- LLGLSObjectSelect gls_object_select;
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE);
- disableLights();
-
- LLVertexBuffer::unbind();
-
- //for each drawpool
- LLGLState::checkStates();
- LLGLState::checkTextureChannels();
- LLGLState::checkClientArrays();
- U32 last_type = 0;
-
- // If we don't do this, we crash something on changing graphics settings
- // from Medium -> Low, because we unload all the shaders and the
- // draw pools aren't aware. I don't know if this has to be a separate
- // loop before actual rendering. JC
- for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
- {
- LLDrawPool *poolp = *iter;
- if (poolp->isFacePool() && hasRenderType(poolp->getType()))
- {
- poolp->prerender();
- }
- }
- for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter)
- {
- LLDrawPool *poolp = *iter;
- if (poolp->isFacePool() && hasRenderType(poolp->getType()))
- {
- LLFacePool* face_pool = (LLFacePool*) poolp;
- face_pool->renderForSelect();
- LLVertexBuffer::unbind();
- gGLLastMatrix = NULL;
- glLoadMatrixd(gGLModelView);
-
- if (poolp->getType() != last_type)
- {
- last_type = poolp->getType();
- LLGLState::checkStates();
- LLGLState::checkTextureChannels();
- LLGLState::checkClientArrays();
- }
- }
- }
-
- LLGLEnable alpha_test(GL_ALPHA_TEST);
- if (render_transparent)
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.f);
- }
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.2f);
- }
-
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_VERT_COLOR);
- gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA);
-
- U32 prim_mask = LLVertexBuffer::MAP_VERTEX |
- LLVertexBuffer::MAP_TEXCOORD0;
-
- for (std::set<LLViewerObject*>::iterator i = objects.begin(); i != objects.end(); ++i)
- {
- LLViewerObject* vobj = *i;
- LLDrawable* drawable = vobj->mDrawable;
- if (vobj->isDead() ||
- vobj->isHUDAttachment() ||
- (LLSelectMgr::getInstance()->mHideSelectedObjects && vobj->isSelected()) ||
- drawable->isDead() ||
- !hasRenderType(drawable->getRenderType()))
- {
- continue;
- }
-
- for (S32 j = 0; j < drawable->getNumFaces(); ++j)
- {
- LLFace* facep = drawable->getFace(j);
- if (!facep->getPool())
- {
- facep->renderForSelect(prim_mask);
- }
- }
- }
-
- // pick HUD objects
- if (isAgentAvatarValid() && sShowHUDAttachments)
- {
- glh::matrix4f save_proj(glh_get_current_projection());
- glh::matrix4f save_model(glh_get_current_modelview());
-
- setup_hud_matrices(screen_rect);
- for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
- iter != gAgentAvatarp->mAttachmentPoints.end(); )
- {
- LLVOAvatar::attachment_map_t::iterator curiter = iter++;
- LLViewerJointAttachment* attachment = curiter->second;
- if (attachment->getIsHUDAttachment())
- {
- for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
- attachment_iter != attachment->mAttachedObjects.end();
- ++attachment_iter)
- {
- if (LLViewerObject* attached_object = (*attachment_iter))
- {
- LLDrawable* drawable = attached_object->mDrawable;
- if (drawable->isDead())
- {
- continue;
- }
-
- for (S32 j = 0; j < drawable->getNumFaces(); ++j)
- {
- LLFace* facep = drawable->getFace(j);
- if (!facep->getPool())
- {
- facep->renderForSelect(prim_mask);
- }
- }
-
- //render child faces
- LLViewerObject::const_child_list_t& child_list = attached_object->getChildren();
- for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
- iter != child_list.end(); iter++)
- {
- LLViewerObject* child = *iter;
- LLDrawable* child_drawable = child->mDrawable;
- for (S32 l = 0; l < child_drawable->getNumFaces(); ++l)
- {
- LLFace* facep = child_drawable->getFace(l);
- if (!facep->getPool())
- {
- facep->renderForSelect(prim_mask);
- }
- }
- }
- }
- }
- }
- }
-
- glMatrixMode(GL_PROJECTION);
- glLoadMatrixf(save_proj.m);
- glh_set_current_projection(save_proj);
-
- glMatrixMode(GL_MODELVIEW);
- glLoadMatrixf(save_model.m);
- glh_set_current_modelview(save_model);
-
-
- }
-
- gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
-
- LLVertexBuffer::unbind();
-
- gGL.setColorMask(true, true);
-}
-
void LLPipeline::rebuildPools()
{
LLMemType mt(LLMemType::MTYPE_PIPELINE_REBUILD_POOLS);