summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-05-23 10:42:32 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-05-23 10:42:32 -0700
commit9ef98bece29b6740e4f779ab6a3534b5b1e7f974 (patch)
tree55211701d33b55ac9c449b6ffb1059850d032cc0 /indra/newview
parent74a84738ed8779e345f34b95f029862b3c9ccf6e (diff)
NORSPEC-193 NORSPEC-161 make legacy shiny a batch breaker when materials are in play
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llpanelface.cpp11
-rwxr-xr-xindra/newview/llspatialpartition.h1
-rwxr-xr-xindra/newview/llvovolume.cpp6
3 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 49750c8c19..33c77ed98f 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -1799,9 +1799,12 @@ void LLPanelFace::updateMaterial()
bool is_default_blend_mode = mIsAlpha ? (alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
: (alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
+ LLUUID norm_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID();
+ LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID();
+
if ( !is_default_blend_mode
- || (bumpiness == BUMPY_TEXTURE)
- || (shininess == SHINY_TEXTURE))
+ || !norm_map_id.isNull()
+ || !spec_map_id.isNull())
{
// This should match getState()
struct f1 : public LLSelectedTEGetFunctor<LLMaterialPtr>
@@ -1822,7 +1825,7 @@ void LLPanelFace::updateMaterial()
material->setDiffuseAlphaMode(getChild<LLComboBox>("combobox alphamode")->getCurrentIndex());
material->setAlphaMaskCutoff((U8)(getChild<LLUICtrl>("maskcutoff")->getValue().asInteger()));
- LLUUID norm_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID();
+
if (!norm_map_id.isNull() && (bumpiness == BUMPY_TEXTURE))
{
LL_DEBUGS("Materials") << "Setting bumpy texture, bumpiness = " << bumpiness << LL_ENDL;
@@ -1852,7 +1855,7 @@ void LLPanelFace::updateMaterial()
material->setNormalRotation(0.0f);
}
- LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID();
+
if (!spec_map_id.isNull() && (shininess == SHINY_TEXTURE))
{
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index bf32440848..8d3e8499da 100755
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -112,6 +112,7 @@ public:
U32 mOffset;
BOOL mFullbright;
U8 mBump;
+ U8 mShiny;
BOOL mParticle;
F32 mPartSize;
F32 mVSize;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index ca7849fdad..24275c57e0 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4102,6 +4102,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0;
+ U8 shiny = facep->getTextureEntry()->getShiny();
+
LLViewerTexture* tex = facep->getTexture();
U8 index = facep->getTextureIndex();
@@ -4162,6 +4164,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
draw_vec[idx]->mTextureMatrix == tex_mat &&
draw_vec[idx]->mModelMatrix == model_mat &&
draw_vec[idx]->mMaterial == mat &&
+ (!mat || (draw_vec[idx]->mShiny == shiny)) && // need to break batches when a material is shared, but legacy shiny is different
draw_vec[idx]->mShaderMask == shader_mask)
{
draw_vec[idx]->mCount += facep->getIndicesCount();
@@ -4191,7 +4194,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
draw_info->mTextureMatrix = tex_mat;
draw_info->mModelMatrix = model_mat;
- U8 shiny = facep->getTextureEntry()->getShiny();
+ draw_info->mShiny = shiny;
+
float alpha[4] =
{
0.00f,