summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-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,