NORSPEC-258 and NORSPEC-226 make tex picker close refresh build tool UI correctly and fix issues with transition from no-bumps to normal maps
parent
7fcbb7c177
commit
96f7f6d01b
|
|
@ -171,6 +171,8 @@ BOOL LLPanelFace::postBuild()
|
|||
mTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectTexture, this, _2) );
|
||||
mTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
|
||||
mTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1));
|
||||
mTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) );
|
||||
|
||||
mTextureCtrl->setFollowsTop();
|
||||
mTextureCtrl->setFollowsLeft();
|
||||
mTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
|
||||
|
|
@ -184,6 +186,8 @@ BOOL LLPanelFace::postBuild()
|
|||
mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitSpecularTexture, this, _2) );
|
||||
mShinyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelSpecularTexture, this, _2) );
|
||||
mShinyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectSpecularTexture, this, _2) );
|
||||
mShinyTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) );
|
||||
|
||||
mShinyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
|
||||
mShinyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1));
|
||||
mShinyTextureCtrl->setFollowsTop();
|
||||
|
|
@ -200,6 +204,8 @@ BOOL LLPanelFace::postBuild()
|
|||
mBumpyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitNormalTexture, this, _2) );
|
||||
mBumpyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelNormalTexture, this, _2) );
|
||||
mBumpyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectNormalTexture, this, _2) );
|
||||
mBumpyTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) );
|
||||
|
||||
mBumpyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
|
||||
mBumpyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1));
|
||||
mBumpyTextureCtrl->setFollowsTop();
|
||||
|
|
@ -832,7 +838,7 @@ void LLPanelFace::updateUI()
|
|||
|
||||
updateAlphaControls();
|
||||
|
||||
if(texture_ctrl && !texture_ctrl->isPickerShown())
|
||||
if(texture_ctrl)
|
||||
{
|
||||
if (identical_diffuse)
|
||||
{
|
||||
|
|
@ -892,7 +898,7 @@ void LLPanelFace::updateUI()
|
|||
}
|
||||
}
|
||||
|
||||
if (bumpytexture_ctrl && !bumpytexture_ctrl->isPickerShown())
|
||||
if (bumpytexture_ctrl)
|
||||
{
|
||||
if (identical_norm && (bumpy == BUMPY_TEXTURE))
|
||||
{
|
||||
|
|
@ -1796,6 +1802,12 @@ void LLPanelFace::onSelectTexture(const LLSD& data)
|
|||
LLSelectedTEMaterial::setDiffuseAlphaMode(this, getCurrentDiffuseAlphaMode());
|
||||
}
|
||||
|
||||
void LLPanelFace::onCloseTexturePicker(const LLSD& data)
|
||||
{
|
||||
LL_DEBUGS("Materials") << data << LL_ENDL;
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void LLPanelFace::onCommitSpecularTexture( const LLSD& data )
|
||||
{
|
||||
LL_DEBUGS("Materials") << data << LL_ENDL;
|
||||
|
|
@ -1805,7 +1817,7 @@ void LLPanelFace::onCommitSpecularTexture( const LLSD& data )
|
|||
void LLPanelFace::onCommitNormalTexture( const LLSD& data )
|
||||
{
|
||||
LL_DEBUGS("Materials") << data << LL_ENDL;
|
||||
sendBump(getCurrentNormalMap().isNull() ? 0 : BUMPY_TEXTURE);
|
||||
sendBump(BUMPY_TEXTURE);
|
||||
}
|
||||
|
||||
void LLPanelFace::onCancelSpecularTexture(const LLSD& data)
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ protected:
|
|||
void onCancelColor(const LLSD& data);
|
||||
void onSelectColor(const LLSD& data);
|
||||
|
||||
void onCloseTexturePicker(const LLSD& data);
|
||||
|
||||
// Make UI reflect state of currently selected material (refresh)
|
||||
// and UI mode (e.g. editing normal map v diffuse map)
|
||||
//
|
||||
|
|
@ -298,7 +300,7 @@ private:
|
|||
if (tep)
|
||||
{
|
||||
material_ptr = tep->getMaterialParams();
|
||||
if (!material_ptr.isNull() && !tep->getMaterialID().isNull())
|
||||
if (!material_ptr.isNull())
|
||||
{
|
||||
ret = (material_ptr->*(MaterialGetFunc))();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1040,6 +1040,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
|
|||
mDragCallback(NULL),
|
||||
mDropCallback(NULL),
|
||||
mOnCancelCallback(NULL),
|
||||
mOnCloseCallback(NULL),
|
||||
mOnSelectCallback(NULL),
|
||||
mBorderColor( p.border_color() ),
|
||||
mAllowNoTexture( FALSE ),
|
||||
|
|
@ -1296,6 +1297,10 @@ void LLTextureCtrl::onFloaterClose()
|
|||
|
||||
if (floaterp)
|
||||
{
|
||||
if (mOnCloseCallback)
|
||||
{
|
||||
mOnCloseCallback(this,LLSD());
|
||||
}
|
||||
floaterp->setOwner(NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ public:
|
|||
void setDropCallback(drag_n_drop_callback cb) { mDropCallback = cb; }
|
||||
|
||||
void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; }
|
||||
|
||||
void setOnCloseCallback(commit_callback_t cb) { mOnCloseCallback = cb; }
|
||||
void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; }
|
||||
|
||||
/*
|
||||
|
|
@ -199,6 +199,7 @@ private:
|
|||
drag_n_drop_callback mDropCallback;
|
||||
commit_callback_t mOnCancelCallback;
|
||||
commit_callback_t mOnSelectCallback;
|
||||
commit_callback_t mOnCloseCallback;
|
||||
texture_selected_callback mOnTextureSelectedCallback;
|
||||
LLPointer<LLViewerFetchedTexture> mTexturep;
|
||||
LLUIColor mBorderColor;
|
||||
|
|
|
|||
|
|
@ -4389,17 +4389,7 @@ S32 LLViewerObject::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID
|
|||
<< ", material " << pMaterialID
|
||||
<< LL_ENDL;
|
||||
retval = LLPrimitive::setTEMaterialID(te, pMaterialID);
|
||||
if (retval)
|
||||
{
|
||||
// Kitty would like to know if this is necessary?
|
||||
// Since we should get a setTEMaterialParams that does it anyway?
|
||||
//
|
||||
setChanged(TEXTURE);
|
||||
if (mDrawable.notNull())
|
||||
{
|
||||
gPipeline.markTextured(mDrawable);
|
||||
}
|
||||
}
|
||||
refreshMaterials();
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
|
@ -4414,23 +4404,28 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri
|
|||
return 0;
|
||||
}
|
||||
|
||||
retval = LLPrimitive::setTEMaterialParams(te, pMaterialParams);
|
||||
LL_DEBUGS("Material") << "Changing material params for te " << (S32)te
|
||||
<< ", object " << mID
|
||||
<< " (" << retval << ")"
|
||||
<< LL_ENDL;
|
||||
setTENormalMap(te, (pMaterialParams) ? pMaterialParams->getNormalID() : LLUUID::null);
|
||||
setTESpecularMap(te, (pMaterialParams) ? pMaterialParams->getSpecularID() : LLUUID::null);
|
||||
|
||||
setChanged(TEXTURE);
|
||||
if (mDrawable.notNull())
|
||||
{
|
||||
gPipeline.markTextured(mDrawable);
|
||||
}
|
||||
retval = LLPrimitive::setTEMaterialParams(te, pMaterialParams);
|
||||
LL_DEBUGS("Material") << "Changing material params for te " << (S32)te
|
||||
<< ", object " << mID
|
||||
<< " (" << retval << ")"
|
||||
<< LL_ENDL;
|
||||
setTENormalMap(te, (pMaterialParams) ? pMaterialParams->getNormalID() : LLUUID::null);
|
||||
setTESpecularMap(te, (pMaterialParams) ? pMaterialParams->getSpecularID() : LLUUID::null);
|
||||
|
||||
refreshMaterials();
|
||||
return retval;
|
||||
}
|
||||
|
||||
void LLViewerObject::refreshMaterials()
|
||||
{
|
||||
setChanged(ALL_CHANGED);
|
||||
if (mDrawable.notNull())
|
||||
{
|
||||
gPipeline.markTextured(mDrawable);
|
||||
gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL);
|
||||
dirtySpatialGroup(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
S32 LLViewerObject::setTEScale(const U8 te, const F32 s, const F32 t)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -324,6 +324,12 @@ public:
|
|||
/*virtual*/ S32 setTEGlow(const U8 te, const F32 glow);
|
||||
/*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID);
|
||||
/*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams);
|
||||
|
||||
// Used by Materials update functions to properly kick off rebuilds
|
||||
// of VBs etc when materials updates require changes.
|
||||
//
|
||||
void refreshMaterials();
|
||||
|
||||
/*virtual*/ BOOL setMaterial(const U8 material);
|
||||
virtual void setTEImage(const U8 te, LLViewerTexture *imagep); // Not derived from LLPrimitive
|
||||
virtual void changeTEImage(S32 index, LLViewerTexture* new_image) ;
|
||||
|
|
|
|||
|
|
@ -2002,10 +2002,11 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
|
|||
{
|
||||
LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallbackTE, getID(), _1, _2, _3));
|
||||
|
||||
setChanged(TEXTURE);
|
||||
setChanged(ALL_CHANGED);
|
||||
if (!mDrawable.isNull())
|
||||
{
|
||||
gPipeline.markTextured(mDrawable);
|
||||
gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL);
|
||||
}
|
||||
mFaceMappingChanged = TRUE;
|
||||
}
|
||||
|
|
@ -2018,10 +2019,11 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa
|
|||
LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterialParams) ? pMaterialParams->asLLSD() : LLSD("null")) << " res " << res
|
||||
<< ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" )
|
||||
<< LL_ENDL;
|
||||
setChanged(TEXTURE);
|
||||
setChanged(ALL_CHANGED);
|
||||
if (!mDrawable.isNull())
|
||||
{
|
||||
gPipeline.markTextured(mDrawable);
|
||||
gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL);
|
||||
}
|
||||
mFaceMappingChanged = TRUE;
|
||||
return TEM_CHANGE_TEXTURE;
|
||||
|
|
@ -4114,8 +4116,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
|||
LLMaterial* mat = facep->getTextureEntry()->getMaterialParams().get();
|
||||
LLMaterialID mat_id = facep->getTextureEntry()->getMaterialID();
|
||||
|
||||
mat = mat_id.isNull() ? NULL : mat;
|
||||
|
||||
bool batchable = false;
|
||||
|
||||
U32 shader_mask = 0xFFFFFFFF; //no shader
|
||||
|
|
@ -4546,7 +4546,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
}
|
||||
|
||||
LLMaterial* mat = te->getMaterialParams().get();
|
||||
mat = te->getMaterialID().isNull() ? NULL : mat;
|
||||
|
||||
if (mat && LLPipeline::sRenderDeferred)
|
||||
{
|
||||
|
|
@ -4766,7 +4765,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
if (gPipeline.canUseWindLightShadersOnObjects()
|
||||
&& LLPipeline::sRenderBump)
|
||||
{
|
||||
if (LLPipeline::sRenderDeferred && te->getMaterialParams().notNull() && !te->getMaterialID().isNull())
|
||||
if (LLPipeline::sRenderDeferred && te->getMaterialParams().notNull())
|
||||
{
|
||||
LLMaterial* mat = te->getMaterialParams().get();
|
||||
if (mat->getNormalID().notNull())
|
||||
|
|
@ -5343,8 +5342,6 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
|
|||
|
||||
LLMaterial* mat = te->getMaterialParams().get();
|
||||
|
||||
mat = te->getMaterialID().isNull() ? NULL : mat;
|
||||
|
||||
bool can_be_shiny = true;
|
||||
if (mat)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1724,10 +1724,10 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
|
|||
{
|
||||
return LLDrawPool::POOL_ALPHA;
|
||||
}
|
||||
else if ((te->getBumpmap() || te->getShiny()) && te->getMaterialID().isNull())
|
||||
else if ((te->getBumpmap() || te->getShiny()) && !te->getMaterialParams().isNull())
|
||||
{
|
||||
return LLDrawPool::POOL_BUMP;
|
||||
} else if (!te->getMaterialID().isNull() && !alpha)
|
||||
} else if (!te->getMaterialParams().isNull() && !alpha)
|
||||
{
|
||||
return LLDrawPool::POOL_MATERIALS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue