summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolmaterials.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolmaterials.cpp')
-rw-r--r--indra/newview/lldrawpoolmaterials.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp
index c0e4ed38c1..a098230d91 100644
--- a/indra/newview/lldrawpoolmaterials.cpp
+++ b/indra/newview/lldrawpoolmaterials.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file lldrawpool.cpp
* @brief LLDrawPoolMaterials class implementation
* @author Jonathan "Geenz" Goodman
@@ -6,21 +6,21 @@
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2013, 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.
- *
+ *
* 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.
- *
+ *
* 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
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -36,18 +36,18 @@
LLDrawPoolMaterials::LLDrawPoolMaterials()
: LLRenderPass(LLDrawPool::POOL_MATERIALS)
{
-
+
}
void LLDrawPoolMaterials::prerender()
{
- mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT);
+ mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT);
}
S32 LLDrawPoolMaterials::getNumDeferredPasses()
{
// 12 render passes times 2 (one for each rigged and non rigged)
- return 12*2;
+ return 12*2;
}
void LLDrawPoolMaterials::beginDeferredPass(S32 pass)
@@ -56,34 +56,34 @@ void LLDrawPoolMaterials::beginDeferredPass(S32 pass)
bool rigged = false;
if (pass >= 12)
- {
+ {
rigged = true;
pass -= 12;
}
- U32 shader_idx[] =
- {
- 0, //LLRenderPass::PASS_MATERIAL,
- //1, //LLRenderPass::PASS_MATERIAL_ALPHA,
- 2, //LLRenderPass::PASS_MATERIAL_ALPHA_MASK,
- 3, //LLRenderPass::PASS_MATERIAL_ALPHA_GLOW,
- 4, //LLRenderPass::PASS_SPECMAP,
- //5, //LLRenderPass::PASS_SPECMAP_BLEND,
- 6, //LLRenderPass::PASS_SPECMAP_MASK,
- 7, //LLRenderPass::PASS_SPECMAP_GLOW,
- 8, //LLRenderPass::PASS_NORMMAP,
- //9, //LLRenderPass::PASS_NORMMAP_BLEND,
- 10, //LLRenderPass::PASS_NORMMAP_MASK,
- 11, //LLRenderPass::PASS_NORMMAP_GLOW,
- 12, //LLRenderPass::PASS_NORMSPEC,
- //13, //LLRenderPass::PASS_NORMSPEC_BLEND,
- 14, //LLRenderPass::PASS_NORMSPEC_MASK,
- 15, //LLRenderPass::PASS_NORMSPEC_GLOW,
- };
-
+ U32 shader_idx[] =
+ {
+ 0, //LLRenderPass::PASS_MATERIAL,
+ //1, //LLRenderPass::PASS_MATERIAL_ALPHA,
+ 2, //LLRenderPass::PASS_MATERIAL_ALPHA_MASK,
+ 3, //LLRenderPass::PASS_MATERIAL_ALPHA_GLOW,
+ 4, //LLRenderPass::PASS_SPECMAP,
+ //5, //LLRenderPass::PASS_SPECMAP_BLEND,
+ 6, //LLRenderPass::PASS_SPECMAP_MASK,
+ 7, //LLRenderPass::PASS_SPECMAP_GLOW,
+ 8, //LLRenderPass::PASS_NORMMAP,
+ //9, //LLRenderPass::PASS_NORMMAP_BLEND,
+ 10, //LLRenderPass::PASS_NORMMAP_MASK,
+ 11, //LLRenderPass::PASS_NORMMAP_GLOW,
+ 12, //LLRenderPass::PASS_NORMSPEC,
+ //13, //LLRenderPass::PASS_NORMSPEC_BLEND,
+ 14, //LLRenderPass::PASS_NORMSPEC_MASK,
+ 15, //LLRenderPass::PASS_NORMSPEC_GLOW,
+ };
+
U32 idx = shader_idx[pass];
-
+
mShader = &(gDeferredMaterialProgram[idx]);
-
+
if (rigged)
{
llassert(mShader->mRiggedVariant != nullptr);
@@ -95,35 +95,35 @@ void LLDrawPoolMaterials::beginDeferredPass(S32 pass)
void LLDrawPoolMaterials::endDeferredPass(S32 pass)
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_MATERIAL;
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_MATERIAL;
- mShader->unbind();
+ mShader->unbind();
- LLRenderPass::endRenderPass(pass);
+ LLRenderPass::endRenderPass(pass);
}
void LLDrawPoolMaterials::renderDeferred(S32 pass)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_MATERIAL;
- static const U32 type_list[] =
- {
- LLRenderPass::PASS_MATERIAL,
- //LLRenderPass::PASS_MATERIAL_ALPHA,
- LLRenderPass::PASS_MATERIAL_ALPHA_MASK,
- LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE,
- LLRenderPass::PASS_SPECMAP,
- //LLRenderPass::PASS_SPECMAP_BLEND,
- LLRenderPass::PASS_SPECMAP_MASK,
- LLRenderPass::PASS_SPECMAP_EMISSIVE,
- LLRenderPass::PASS_NORMMAP,
- //LLRenderPass::PASS_NORMMAP_BLEND,
- LLRenderPass::PASS_NORMMAP_MASK,
- LLRenderPass::PASS_NORMMAP_EMISSIVE,
- LLRenderPass::PASS_NORMSPEC,
- //LLRenderPass::PASS_NORMSPEC_BLEND,
- LLRenderPass::PASS_NORMSPEC_MASK,
- LLRenderPass::PASS_NORMSPEC_EMISSIVE,
- };
+ static const U32 type_list[] =
+ {
+ LLRenderPass::PASS_MATERIAL,
+ //LLRenderPass::PASS_MATERIAL_ALPHA,
+ LLRenderPass::PASS_MATERIAL_ALPHA_MASK,
+ LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE,
+ LLRenderPass::PASS_SPECMAP,
+ //LLRenderPass::PASS_SPECMAP_BLEND,
+ LLRenderPass::PASS_SPECMAP_MASK,
+ LLRenderPass::PASS_SPECMAP_EMISSIVE,
+ LLRenderPass::PASS_NORMMAP,
+ //LLRenderPass::PASS_NORMMAP_BLEND,
+ LLRenderPass::PASS_NORMMAP_MASK,
+ LLRenderPass::PASS_NORMMAP_EMISSIVE,
+ LLRenderPass::PASS_NORMSPEC,
+ //LLRenderPass::PASS_NORMSPEC_BLEND,
+ LLRenderPass::PASS_NORMSPEC_MASK,
+ LLRenderPass::PASS_NORMSPEC_EMISSIVE,
+ };
bool rigged = false;
if (pass >= 12)
@@ -132,17 +132,17 @@ void LLDrawPoolMaterials::renderDeferred(S32 pass)
pass -= 12;
}
- llassert(pass < sizeof(type_list)/sizeof(U32));
+ llassert(pass < sizeof(type_list)/sizeof(U32));
- U32 type = type_list[pass];
+ U32 type = type_list[pass];
if (rigged)
{
type += 1;
}
- LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
- LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type);
-
+ LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
+ LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type);
+
F32 lastIntensity = 0.f;
F32 lastFullbright = 0.f;
F32 lastMinimumAlpha = 0.f;
@@ -185,11 +185,11 @@ void LLDrawPoolMaterials::renderDeferred(S32 pass)
LLVOAvatar* lastAvatar = nullptr;
- for (LLCullResult::drawinfo_iterator i = begin; i != end; )
- {
+ for (LLCullResult::drawinfo_iterator i = begin; i != end; )
+ {
LL_PROFILE_ZONE_NAMED_CATEGORY_MATERIAL("materials draw loop");
- LLDrawInfo& params = **i;
-
+ LLDrawInfo& params = **i;
+
LLCullResult::increment_iterator(i, end);
if (specular > -1 && params.mSpecColor != lastSpecular)
@@ -203,7 +203,7 @@ void LLDrawPoolMaterials::renderDeferred(S32 pass)
lastIntensity = params.mEnvIntensity;
glUniform1f(intensity, lastIntensity);
}
-
+
if (minAlpha > -1 && lastMinimumAlpha != params.mAlphaMaskCutoff)
{
lastMinimumAlpha = params.mAlphaMaskCutoff;
@@ -295,5 +295,5 @@ void LLDrawPoolMaterials::renderDeferred(S32 pass)
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
}
- }
+ }
}