Commits

davep committed 5c08e1d

MAINT-1223 Fix for alpha updates not triggering LoD updates.

Comments (0)

Files changed (4)

indra/newview/lldrawable.cpp

 
 	if (getVOVolume())
 	{
-		/*if (isActive())
-		{
-			if (isRoot())
-			{
-				mQuietCount = 0;
-			}
-			else
-			{
-				getParent()->mQuietCount = 0;
-			}
-		}*/
-				
 		gPipeline.markRebuild(this, LLDrawable::REBUILD_MATERIAL, TRUE);
 	}
 }

indra/newview/llface.cpp

 
 void LLFace::dirtyTexture()
 {
-	gPipeline.markTextured(getDrawable());
+	LLDrawable* drawablep = getDrawable();
+
+	if (mVObjp.notNull() && mVObjp->getVolume() && 
+		mTexture.notNull() && mTexture->getComponents() == 4)
+	{ //dirty texture on an alpha object should be treated as an LoD update
+		LLVOVolume* vobj = drawablep->getVOVolume();
+		if (vobj)
+		{
+			vobj->mLODChanged = TRUE;
+		}
+		gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME, FALSE);
+	}		
+			
+	gPipeline.markTextured(drawablep);
 }
 
 void LLFace::switchTexture(LLViewerTexture* new_texture)

indra/newview/llvovolume.cpp

 	}
 	else if (color != tep->getColor())
 	{
-		if (color.mV[3] != tep->getColor().mV[3])
+		F32 old_alpha = tep->getColor().mV[3];
+		if (color.mV[3] != old_alpha)
 		{
 			gPipeline.markTextured(mDrawable);
 		}
 			// These should only happen on updates which are not the initial update.
 			mDrawable->setState(LLDrawable::REBUILD_COLOR);
 			dirtyMesh();
+
+			if (old_alpha >= 1.f || color.mV[3] <= 0.f)
+			{ //treat this alpha change as an LoD update since render batches will need to get rebuilt
+				mLODChanged = TRUE;
+				gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE);
+			}
 		}
 	}
 

indra/newview/llvovolume.h

 	U8 mTexAnimMode;
 private:
 	friend class LLDrawable;
-	
+	friend class LLFace;
+
 	BOOL		mFaceMappingChanged;
 	LLFrameTimer mTextureUpdateTimer;
 	S32			mLOD;