summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolsimple.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolsimple.cpp')
-rw-r--r--indra/newview/lldrawpoolsimple.cpp77
1 files changed, 39 insertions, 38 deletions
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index 1fdf87f6d2..2e83167851 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -2,31 +2,25 @@
* @file lldrawpoolsimple.cpp
* @brief LLDrawPoolSimple class implementation
*
- * $LicenseInfo:firstyear=2002&license=viewergpl$
- *
- * Copyright (c) 2002-2009, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -35,7 +29,6 @@
#include "lldrawpoolsimple.h"
#include "llviewercamera.h"
-#include "llagent.h"
#include "lldrawable.h"
#include "llface.h"
#include "llsky.h"
@@ -48,11 +41,18 @@
static LLGLSLShader* simple_shader = NULL;
static LLGLSLShader* fullbright_shader = NULL;
+static LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE_DEFERRED("Deferred Simple");
+static LLFastTimer::DeclareTimer FTM_RENDER_GRASS_DEFERRED("Deferred Grass");
+
void LLDrawPoolGlow::render(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_GLOW);
+ LLFastTimer t(FTM_RENDER_GLOW);
LLGLEnable blend(GL_BLEND);
LLGLDisable test(GL_ALPHA_TEST);
+ gGL.flush();
+ /// Get rid of z-fighting with non-glow pass.
+ LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
+ glPolygonOffset(-1.0f, -1.0f);
gGL.setSceneBlendType(LLRender::BT_ADD);
U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT);
@@ -98,7 +98,7 @@ void LLDrawPoolSimple::prerender()
void LLDrawPoolSimple::beginRenderPass(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
+ LLFastTimer t(FTM_RENDER_SIMPLE);
if (LLPipeline::sUnderWaterRender)
{
@@ -125,7 +125,7 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass)
void LLDrawPoolSimple::endRenderPass(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
+ LLFastTimer t(FTM_RENDER_SIMPLE);
LLRenderPass::endRenderPass(pass);
if (mVertexShaderLevel > 0){
@@ -140,12 +140,13 @@ void LLDrawPoolSimple::render(S32 pass)
LLGLDisable alpha_test(GL_ALPHA_TEST);
{ //render simple
- LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
+ LLFastTimer t(FTM_RENDER_SIMPLE);
gPipeline.enableLightsDynamic();
renderTexture(LLRenderPass::PASS_SIMPLE, getVertexDataMask());
if (LLPipeline::sRenderDeferred)
- {
+ { //if deferred rendering is enabled, bump faces aren't registered as simple
+ //render bump faces here as simple so bump faces will appear under water
renderTexture(LLRenderPass::PASS_BUMP, getVertexDataMask());
}
}
@@ -157,13 +158,13 @@ void LLDrawPoolSimple::render(S32 pass)
void LLDrawPoolSimple::beginDeferredPass(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
+ LLFastTimer t(FTM_RENDER_SIMPLE_DEFERRED);
gDeferredDiffuseProgram.bind();
}
void LLDrawPoolSimple::endDeferredPass(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
+ LLFastTimer t(FTM_RENDER_SIMPLE_DEFERRED);
LLRenderPass::endRenderPass(pass);
gDeferredDiffuseProgram.unbind();
@@ -175,7 +176,7 @@ void LLDrawPoolSimple::renderDeferred(S32 pass)
LLGLDisable alpha_test(GL_ALPHA_TEST);
{ //render simple
- LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
+ LLFastTimer t(FTM_RENDER_SIMPLE_DEFERRED);
renderTexture(LLRenderPass::PASS_SIMPLE, getVertexDataMask());
}
}
@@ -195,7 +196,7 @@ void LLDrawPoolGrass::prerender()
void LLDrawPoolGrass::beginRenderPass(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
+ LLFastTimer t(FTM_RENDER_GRASS);
if (LLPipeline::sUnderWaterRender)
{
@@ -222,7 +223,7 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass)
void LLDrawPoolGrass::endRenderPass(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
+ LLFastTimer t(FTM_RENDER_GRASS);
LLRenderPass::endRenderPass(pass);
if (mVertexShaderLevel > 0)
@@ -237,7 +238,7 @@ void LLDrawPoolGrass::render(S32 pass)
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
+ LLFastTimer t(FTM_RENDER_GRASS);
LLGLEnable test(GL_ALPHA_TEST);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
//render grass
@@ -259,10 +260,10 @@ void LLDrawPoolGrass::endDeferredPass(S32 pass)
void LLDrawPoolGrass::renderDeferred(S32 pass)
{
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
+ gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f);
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
+ LLFastTimer t(FTM_RENDER_GRASS_DEFERRED);
gDeferredTreeProgram.bind();
LLGLEnable test(GL_ALPHA_TEST);
//render grass
@@ -286,7 +287,7 @@ void LLDrawPoolFullbright::prerender()
void LLDrawPoolFullbright::beginRenderPass(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
+ LLFastTimer t(FTM_RENDER_FULLBRIGHT);
if (LLPipeline::sUnderWaterRender)
{
@@ -300,7 +301,7 @@ void LLDrawPoolFullbright::beginRenderPass(S32 pass)
void LLDrawPoolFullbright::endRenderPass(S32 pass)
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
+ LLFastTimer t(FTM_RENDER_FULLBRIGHT);
LLRenderPass::endRenderPass(pass);
if (mVertexShaderLevel > 0)
@@ -311,7 +312,7 @@ void LLDrawPoolFullbright::endRenderPass(S32 pass)
void LLDrawPoolFullbright::render(S32 pass)
{ //render fullbright
- LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
+ LLFastTimer t(FTM_RENDER_FULLBRIGHT);
if (mVertexShaderLevel > 0)
{
fullbright_shader->bind();