diff options
| -rw-r--r-- | indra/llrender/llgl.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llpanelface.cpp | 129 | 
3 files changed, 77 insertions, 56 deletions
| diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 8431744892..088ba95b75 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -760,12 +760,13 @@ bool LLGLManager::initGL()  	{ //using multisample textures on ATI results in black screen for some reason  		mHasTextureMultisample = FALSE;  	} -#endif +  	if (mIsIntel && mGLVersion <= 3.f)  	{ //never try to use framebuffer objects on older intel drivers (crashy)  		mHasFramebufferObject = FALSE;  	} +#endif  	if (mHasFramebufferObject)  	{ diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ef8df305e3..69f10cd4df 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -182,6 +182,7 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass)  		break;  	case 4:  		beginDeferredRiggedBump(); +		break;  	default:  		beginDeferredRiggedMaterial(pass-5);  		break; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 67ef072508..1a3f4832fd 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1569,19 +1569,30 @@ void LLPanelFace::getState()  				LLMaterialID get(LLViewerObject* object, S32 te_index)  				{  					LLMaterialID material_id; -					 +  					return object->getTE(te_index)->getMaterialID();  				}  			} func; -			identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, mMaterialID ); -			llinfos << "Material ID returned: '" -				<< mMaterialID.asString() << "', isNull? " -				<< (mMaterialID.isNull()?"TRUE":"FALSE") << llendl; + +			LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->getSelection(); +			LLSelectNode* node = sel->getFirstNode(); +			if (node) +			{	 +				int selected_te = node->getLastSelectedTE(); +				if (selected_te >= 0) +				{ +					mMaterialID = node->getObject()->getTE(selected_te)->getMaterialID(); +				} +			} + +			llinfos << "Material ID returned: '" << mMaterialID.asString() << "', isNull? " << (mMaterialID.isNull()?"TRUE":"FALSE") << llendl; +  			if (!mMaterialID.isNull() && editable)  			{  				llinfos << "Requesting material ID " << mMaterialID.asString() << llendl; -				LLMaterialMgr::getInstance()->get(objectp->getRegion()->getRegionID(),mMaterialID,boost::bind(&LLPanelFace::onMaterialLoaded, this, _1, _2)); +				LLMaterialMgr::getInstance()->get(objectp->getRegion()->getRegionID(),mMaterialID,boost::bind(&LLPanelFace::onMaterialLoaded, this, _1, _2));		  			} +  		}  		// Set variable values for numeric expressions @@ -1774,14 +1785,38 @@ void LLPanelFace::updateMaterial()  			mMaterial = LLMaterialPtr(new LLMaterial());  		} -		mMaterial->setDiffuseAlphaMode(getChild<LLComboBox>("combobox alphamode")->getCurrentIndex()); -		mMaterial->setAlphaMaskCutoff((U8)(getChild<LLUICtrl>("maskcutoff")->getValue().asInteger())); +		LLMaterialPtr material_to_set = mMaterial; + +		// If we're editing a single face and not the entire material for an object, +		// we need to clone the material so that our changes to the material's settings +		// don't automatically propagate to the non-selected faces +		// NORSPEC-92 +		// +		LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->getSelection(); +		LLSelectNode* node = sel->getFirstNode(); +		if (node) +		{ +			if (node->getTESelectMask() != TE_SELECT_MASK_ALL) +			{ +				llinfos << "Cloning material to apply to subselection." << llendl; +				material_to_set = new LLMaterial(mMaterial->asLLSD()); +			} +			else +			{ +				llinfos << "Apply material change to whole selection." << llendl; +			} +		} + +		llassert(!material_to_set.isNull()); + +		material_to_set->setDiffuseAlphaMode(getChild<LLComboBox>("combobox alphamode")->getCurrentIndex()); +		material_to_set->setAlphaMaskCutoff((U8)(getChild<LLUICtrl>("maskcutoff")->getValue().asInteger()));  		LLUUID norm_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID();  		if (!norm_map_id.isNull())  		{  			LL_DEBUGS("Materials") << "Setting bumpy texture, bumpiness = " << bumpiness  << LL_ENDL; -			mMaterial->setNormalID(norm_map_id); +			material_to_set->setNormalID(norm_map_id);  			F32 bumpy_scale_u = getChild<LLUICtrl>("bumpyScaleU")->getValue().asReal();  			F32 bumpy_scale_v = getChild<LLUICtrl>("bumpyScaleV")->getValue().asReal(); @@ -1792,18 +1827,18 @@ void LLPanelFace::updateMaterial()  				bumpy_scale_v *= 0.5f;  			} -			mMaterial->setNormalOffset(getChild<LLUICtrl>("bumpyOffsetU")->getValue().asReal(), +			material_to_set->setNormalOffset(getChild<LLUICtrl>("bumpyOffsetU")->getValue().asReal(),  							getChild<LLUICtrl>("bumpyOffsetV")->getValue().asReal()); -			mMaterial->setNormalRepeat(bumpy_scale_u, bumpy_scale_v); -			mMaterial->setNormalRotation(getChild<LLUICtrl>("bumpyRot")->getValue().asReal()*DEG_TO_RAD); +			material_to_set->setNormalRepeat(bumpy_scale_u, bumpy_scale_v); +			material_to_set->setNormalRotation(getChild<LLUICtrl>("bumpyRot")->getValue().asReal()*DEG_TO_RAD);  		}  		else  		{  			LL_DEBUGS("Materials") << "Removing bumpy texture, bumpiness = " << bumpiness  << LL_ENDL; -			mMaterial->setNormalID(LLUUID()); -			mMaterial->setNormalOffset(0.0f,0.0f); -			mMaterial->setNormalRepeat(1.0f,1.0f); -			mMaterial->setNormalRotation(0.0f); +			material_to_set->setNormalID(LLUUID()); +			material_to_set->setNormalOffset(0.0f,0.0f); +			material_to_set->setNormalRepeat(1.0f,1.0f); +			material_to_set->setNormalRotation(0.0f);  		}  		LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID(); @@ -1811,8 +1846,8 @@ void LLPanelFace::updateMaterial()  		if (!spec_map_id.isNull())  		{  			LL_DEBUGS("Materials") << "Setting shiny texture, shininess = " << shininess  << LL_ENDL; -			mMaterial->setSpecularID(spec_map_id); -			mMaterial->setSpecularOffset(getChild<LLUICtrl>("shinyOffsetU")->getValue().asReal(), +			material_to_set->setSpecularID(spec_map_id); +			material_to_set->setSpecularOffset(getChild<LLUICtrl>("shinyOffsetU")->getValue().asReal(),  							getChild<LLUICtrl>("shinyOffsetV")->getValue().asReal());  			F32 shiny_scale_u = getChild<LLUICtrl>("shinyScaleU")->getValue().asReal(); @@ -1824,48 +1859,32 @@ void LLPanelFace::updateMaterial()  				shiny_scale_v *= 0.5f;  			} -			mMaterial->setSpecularRepeat(shiny_scale_u, shiny_scale_v); -			mMaterial->setSpecularRotation(getChild<LLUICtrl>("shinyRot")->getValue().asReal()*DEG_TO_RAD); +			material_to_set->setSpecularRepeat(shiny_scale_u, shiny_scale_v); +			material_to_set->setSpecularRotation(getChild<LLUICtrl>("shinyRot")->getValue().asReal()*DEG_TO_RAD);  			//override shininess to 0.2f if this is a new material  			if (!new_material)  			{ -				mMaterial->setSpecularLightColor(getChild<LLColorSwatchCtrl>("shinycolorswatch")->get()); -				mMaterial->setSpecularLightExponent(getChild<LLUICtrl>("glossiness")->getValue().asInteger()); -				mMaterial->setEnvironmentIntensity(getChild<LLUICtrl>("environment")->getValue().asInteger()); +				material_to_set->setSpecularLightColor(getChild<LLColorSwatchCtrl>("shinycolorswatch")->get()); +				material_to_set->setSpecularLightExponent(getChild<LLUICtrl>("glossiness")->getValue().asInteger()); +				material_to_set->setEnvironmentIntensity(getChild<LLUICtrl>("environment")->getValue().asInteger());  			}  		}  		else  		{  			LL_DEBUGS("Materials") << "Removing shiny texture, shininess = " << shininess << LL_ENDL; -			mMaterial->setSpecularID(LLUUID()); -			mMaterial->setSpecularOffset(0.0f,0.0f); -			mMaterial->setSpecularRepeat(1.0f,1.0f); -			mMaterial->setSpecularRotation(0.0f); -			mMaterial->setSpecularLightColor(LLMaterial::DEFAULT_SPECULAR_LIGHT_COLOR); -			mMaterial->setSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT); -			mMaterial->setEnvironmentIntensity(0); +			material_to_set->setSpecularID(LLUUID()); +			material_to_set->setSpecularOffset(0.0f,0.0f); +			material_to_set->setSpecularRepeat(1.0f,1.0f); +			material_to_set->setSpecularRotation(0.0f); +			material_to_set->setSpecularLightColor(LLMaterial::DEFAULT_SPECULAR_LIGHT_COLOR); +			material_to_set->setSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT); +			material_to_set->setEnvironmentIntensity(0);  		} -		LL_DEBUGS("Materials") << "Updating material: " << mMaterial->asLLSD() << LL_ENDL; -         -        LLMaterialPtr material_to_set = mMaterial; -         -        // If we're editing a single face and not the entire material for an object, -        // we need to clone the material so that our changes to the material's settings -        // don't automatically propagate to the non-selected faces -        // NORSPEC-92 -        // -        LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->getSelection(); -        LLSelectNode* node = sel->getFirstNode(); -        if (node) -        { -            if (node->getTESelectMask() != TE_SELECT_MASK_ALL) -            { -                material_to_set = new LLMaterial(*mMaterial); -            } -        } -        LLSelectMgr::getInstance()->selectionSetMaterial( material_to_set ); +		LL_DEBUGS("Materials") << "Updating material: " << material_to_set->asLLSD() << LL_ENDL; +        +      LLSelectMgr::getInstance()->selectionSetMaterial( material_to_set );  	}  	else  	{ @@ -1934,11 +1953,11 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata)  	U32 materials_media = combo_matmedia->getCurrentIndex();  	U32 material_type = combo_mattype->getCurrentIndex();  	bool show_media = (materials_media == MATMEDIA_MEDIA) && combo_matmedia->getEnabled(); -	bool show_texture = (!show_media) && (material_type == MATTYPE_DIFFUSE) && combo_matmedia->getEnabled(); +	bool show_texture = (show_media || ((material_type == MATTYPE_DIFFUSE) && combo_matmedia->getEnabled()));  	bool show_bumpiness = (!show_media) && (material_type == MATTYPE_NORMAL) && combo_matmedia->getEnabled();  	bool show_shininess = (!show_media) && (material_type == MATTYPE_SPECULAR) && combo_matmedia->getEnabled();  	self->getChildView("combobox mattype")->setVisible(!show_media); -	self->getChildView("rptctrl")->setVisible(!show_media); +	self->getChildView("rptctrl")->setVisible(show_texture);  	// Media controls  	self->getChildView("media_info")->setVisible(show_media); @@ -1947,12 +1966,12 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata)  	self->getChildView("button align")->setVisible(show_media);  	// Diffuse texture controls -	self->getChildView("texture control")->setVisible(show_texture); -	self->getChildView("label alphamode")->setVisible(show_texture); -	self->getChildView("combobox alphamode")->setVisible(show_texture); +	self->getChildView("texture control")->setVisible(show_texture && !show_media); +	self->getChildView("label alphamode")->setVisible(show_texture && !show_media); +	self->getChildView("combobox alphamode")->setVisible(show_texture && !show_media);  	self->getChildView("label maskcutoff")->setVisible(false);  	self->getChildView("maskcutoff")->setVisible(false); -	if (show_texture) +	if (show_texture && !show_media)  	{  		updateAlphaControls(ctrl, userdata);  	} | 
