diff options
author | callum_linden <none@none> | 2013-05-16 12:06:29 -0700 |
---|---|---|
committer | callum_linden <none@none> | 2013-05-16 12:06:29 -0700 |
commit | 68c6ad909c4878f5627fa485efaa735c2ea13587 (patch) | |
tree | 1abb1dd9a3f22952a9e06d45cb05bee4e004fe46 | |
parent | b3df764bd3c461df49f0f2289b66c87a76e71d34 (diff) | |
parent | 666896ac4efa0575c82cd58c9fe041f354ccbbfc (diff) |
Merge
-rwxr-xr-x | indra/llprimitive/lltextureentry.cpp | 21 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 15 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl | 42 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl | 42 | ||||
-rwxr-xr-x | indra/newview/llface.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llmaterialmgr.h | 2 | ||||
-rwxr-xr-x | indra/newview/llpanelface.cpp | 24 | ||||
-rwxr-xr-x | indra/newview/llselectmgr.cpp | 79 | ||||
-rwxr-xr-x | indra/newview/llselectmgr.h | 8 | ||||
-rwxr-xr-x | indra/newview/lltexturectrl.cpp | 10 | ||||
-rwxr-xr-x | indra/newview/llviewerobject.cpp | 17 | ||||
-rwxr-xr-x | indra/newview/llviewershadermgr.cpp | 25 | ||||
-rwxr-xr-x | indra/newview/llviewershadermgr.h | 3 | ||||
-rwxr-xr-x | indra/newview/llvovolume.cpp | 8 | ||||
-rwxr-xr-x | indra/newview/pipeline.cpp | 85 | ||||
-rwxr-xr-x | indra/newview/pipeline.h | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_tools_texture.xml | 8 |
17 files changed, 337 insertions, 63 deletions
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index ca57f1edbd..597f078490 100755 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -539,21 +539,28 @@ S32 LLTextureEntry::setGlow(F32 glow) S32 LLTextureEntry::setMaterialID(const LLMaterialID& pMaterialID) { - if (mMaterialID != pMaterialID) + if ( (mMaterialID != pMaterialID) || (mMaterialUpdatePending && !mSelected) ) { - mMaterialID = pMaterialID; - - } - if (mMaterialID.isNull()) + if (mSelected) { - setMaterialParams(NULL); + mMaterialUpdatePending = true; + mMaterialID = pMaterialID; + return TEM_CHANGE_NONE; } + + mMaterialUpdatePending = false; + mMaterialID = pMaterialID; return TEM_CHANGE_TEXTURE; } + return TEM_CHANGE_NONE; +} S32 LLTextureEntry::setMaterialParams(const LLMaterialPtr pMaterialParams) { - + if (mSelected) + { + mMaterialUpdatePending = true; + } mMaterial = pMaterialParams; return TEM_CHANGE_TEXTURE; } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b82da4c5ab..e9b36ee5b1 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2873,17 +2873,6 @@ <key>Value</key> <string>5b53359e-59dd-d8a2-04c3-9e65134da47a</string> </map> - <key>DefaultBlankSpecularTexture</key> - <map> - <key>Comment</key> - <string>Texture used as 'Blank' in texture picker for specular maps. (UUID texture reference)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string>cd35472f-71fa-9b9c-8e73-a2c324f5751a</string> - </map> <key>DefaultFemaleAvatar</key> <map> <key>Comment</key> @@ -2915,7 +2904,7 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>2d9dd1d8-9d57-3cfb-f965-f7613e702d8e</string> + <string>85f28839-7a1c-b4e3-d71d-967792970a7b</string> </map> <key>DefaultObjectSpecularTexture</key> <map> @@ -2926,7 +2915,7 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>e0491381-964c-0d68-1caa-91ab2f4c6d6a</string> + <string>87e0e8f7-8729-1ea8-cfc9-8915773009db</string> </map> <key>DefaultObjectTexture</key> <map> diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl new file mode 100644 index 0000000000..947c2b0065 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl @@ -0,0 +1,42 @@ +/** + * @file highlightV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; +ATTRIBUTE vec2 texcoord2; + +VARYING vec2 vary_texcoord0; + +void main() +{ + //transform vertex + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord1,0,1)).xy; +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl new file mode 100644 index 0000000000..c5d102b739 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl @@ -0,0 +1,42 @@ +/** + * @file highlightV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; +ATTRIBUTE vec2 texcoord2; + +VARYING vec2 vary_texcoord0; + +void main() +{ + //transform vertex + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord2,0,1)).xy; +} + diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 007ad1f8d9..eb78d42c35 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -582,7 +582,9 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) } else { - mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); + // cheaters sometimes prosper... + // + mVertexBuffer->setBuffer(mVertexBuffer->getTypeMask()); mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); } diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 922b16f1cf..b5ba8ab680 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -96,7 +96,7 @@ protected: const struct LLMaterialMgr::TEMaterialPair& rhs) { return (lhs.materialID < rhs.materialID) ? TRUE : - (lhs.te < rhs.te) ? TRUE : FALSE; + (lhs.te < rhs.te) ? TRUE : FALSE; } typedef std::map<TEMaterialPair, get_callback_te_t*> get_callback_te_map_t; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index c71ec62bcd..1d99e9d162 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -158,7 +158,6 @@ BOOL LLPanelFace::postBuild() if(mShinyTextureCtrl) { mShinyTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectSpecularTexture" ))); - mShinyTextureCtrl->setBlankImageAssetID(LLUUID( gSavedSettings.getString( "DefaultBlankSpecularTexture" ))); mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitSpecularTexture, this, _2) ); mShinyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelSpecularTexture, this, _2) ); mShinyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectSpecularTexture, this, _2) ); @@ -1220,7 +1219,7 @@ void LLPanelFace::updateUI() { F32 get(LLViewerObject* object, S32 face) { - F32 s = 1.f, t = 1.f; + F32 s = 0.f, t = 0.f; LLMaterial* mat = object->getTE(face)->getMaterialParams().get(); if (mat) @@ -1242,7 +1241,7 @@ void LLPanelFace::updateUI() { F32 get(LLViewerObject* object, S32 face) { - F32 s = 1.f, t = 1.f; + F32 s = 0.f, t = 0.f; LLMaterial* mat = object->getTE(face)->getMaterialParams().get(); if (mat) @@ -1665,6 +1664,18 @@ void LLPanelFace::updateUI() getChild<LLColorSwatchCtrl>("shinycolorswatch")->set(material->getSpecularLightColor(),TRUE); } + // Update sel manager as to which channel we're editing so it can reflect the correct overlay UI + // NORSPEC-103 + LLRender::eTexIndex channel_to_edit = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? (LLRender::eTexIndex)combobox_mattype->getCurrentIndex() : LLRender::DIFFUSE_MAP; + + if ( ((channel_to_edit == LLRender::NORMAL_MAP) && material->getNormalID().isNull()) + ||((channel_to_edit == LLRender::SPECULAR_MAP) && material->getSpecularID().isNull())) + { + channel_to_edit = LLRender::DIFFUSE_MAP; + } + + LLSelectMgr::getInstance()->setTextureChannel(channel_to_edit); + // Bumpy (normal) texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); texture_ctrl->setImageAssetID(material->getNormalID()); @@ -1689,7 +1700,10 @@ void LLPanelFace::updateUI() } updateBumpyControls(!material->getNormalID().isNull(), true); } - + else + { + LLSelectMgr::getInstance()->setTextureChannel(LLRender::DIFFUSE_MAP); + } } // Set variable values for numeric expressions @@ -1875,7 +1889,7 @@ void LLPanelFace::updateMaterial() } LL_DEBUGS("Materials") << "Updating material: " << material->asLLSD() << LL_ENDL; - + LLSelectMgr::getInstance()->selectionSetMaterial( material ); } else diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 3f60b5f642..e42d29f7e3 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -188,6 +188,7 @@ LLSelectMgr::LLSelectMgr() mDebugSelectMgr(LLCachedControl<bool>(gSavedSettings, "DebugSelectMgr", FALSE)) { mTEMode = FALSE; + mTextureChannel = LLRender::DIFFUSE_MAP; mLastCameraPos.clearVec(); sHighlightThickness = gSavedSettings.getF32("SelectionHighlightThickness"); @@ -236,6 +237,8 @@ void LLSelectMgr::clearSelections() mHighlightedObjects->deleteAllNodes(); mRectSelectedObjects.clear(); mGridObjects.deleteAllNodes(); + + LLPipeline::setRenderHighlightTextureChannel(LLRender::DIFFUSE_MAP); } void LLSelectMgr::update() @@ -844,6 +847,10 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab // check to see if object is already in list LLSelectNode *nodep = mSelectedObjects->findNode(objectp); + // Reset (in anticipation of being set to an appropriate value by panel refresh, if they're up) + // + setTextureChannel(LLRender::DIFFUSE_MAP); + // if not in list, add it if (!nodep) { @@ -2052,7 +2059,7 @@ void LLSelectMgr::selectionRemoveMaterial() { LL_DEBUGS("Materials") << "Removing material from object " << object->getID() << " face " << face << LL_ENDL; LLMaterialMgr::getInstance()->remove(object->getID(),face); - object->setTEMaterialID(face,LLMaterialID::null); + object->setTEMaterialParams(face, NULL); } return true; } @@ -4467,7 +4474,8 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type) struct f : public LLSelectedNodeFunctor { EActionType mActionType; - f(EActionType a) : mActionType(a) {} + LLSelectMgr* mManager; + f(EActionType a, LLSelectMgr* p) : mActionType(a), mManager(p) {} virtual bool apply(LLSelectNode* selectNode) { LLViewerObject* object = selectNode->getObject(); @@ -4514,10 +4522,10 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type) } selectNode->mSavedScale = object->getScale(); - selectNode->saveTextureScaleRatios(); + selectNode->saveTextureScaleRatios(mManager->mTextureChannel); return true; } - } func(action_type); + } func(action_type, this); getSelection()->applyToNodes(&func); mSavedSelectionBBox = getBBoxOfSelection(); @@ -5828,23 +5836,72 @@ void LLSelectNode::saveTextures(const uuid_vec_t& textures) } } -void LLSelectNode::saveTextureScaleRatios() +void LLSelectNode::saveTextureScaleRatios(LLRender::eTexIndex index_to_query) { mTextureScaleRatios.clear(); if (mObject.notNull()) { + + LLVector3 scale = mObject->getScale(); + for (U8 i = 0; i < mObject->getNumTEs(); i++) { - F32 s,t; + F32 s = 1.0f; + F32 t = 1.0f; + + LLVector3 v; + const LLTextureEntry* tep = mObject->getTE(i); - tep->getScale(&s,&t); - U32 s_axis = 0; - U32 t_axis = 0; + if (!tep) + continue; + + LLMaterialPtr mat = tep->getMaterialParams(); + U32 s_axis = VX; + U32 t_axis = VY; LLPrimitive::getTESTAxes(i, &s_axis, &t_axis); - LLVector3 v; - LLVector3 scale = mObject->getScale(); + switch(index_to_query) + { + case LLRender::DIFFUSE_MAP: + { + tep->getScale(&s,&t); + } + break; + + case LLRender::NORMAL_MAP: + { + if (mat) + { + mat->getNormalRepeat(s, t); + } + else + { + tep->getScale(&s,&t); + } + + } + break; + + case LLRender::SPECULAR_MAP: + { + if (mat) + { + mat->getSpecularRepeat(s, t); + } + else + { + tep->getScale(&s,&t); + } + } + break; + + default: + // should never be. + // + llassert_always(false); + break; + } if (tep->getTexGen() == LLTextureEntry::TEX_GEN_PLANAR) { diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 1991b5581b..f9b97cebdd 100755 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -147,7 +147,7 @@ public: // *NOTE: invalidate stored textures and colors when # faces change void saveColors(); void saveTextures(const uuid_vec_t& textures); - void saveTextureScaleRatios(); + void saveTextureScaleRatios(LLRender::eTexIndex index_to_query); BOOL allowOperationOnNode(PermissionBit op, U64 group_proxy_power) const; @@ -514,6 +514,11 @@ public: void saveSelectedObjectColors(); void saveSelectedObjectTextures(); + // Sets which texture channel to query for scale and rot of display + // and depends on UI state of LLPanelFace when editing + void setTextureChannel(LLRender::eTexIndex texIndex) { mTextureChannel = texIndex; } + LLRender::eTexIndex getTextureChannel() { return mTextureChannel; } + void selectionUpdatePhysics(BOOL use_physics); void selectionUpdateTemporary(BOOL is_temporary); void selectionUpdatePhantom(BOOL is_ghost); @@ -777,6 +782,7 @@ private: EGridMode mGridMode; BOOL mTEMode; // render te + LLRender::eTexIndex mTextureChannel; // diff, norm, or spec, depending on UI editing mode LLVector3d mSelectionCenterGlobal; LLBBox mSelectionBBox; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 5be342e3d0..9badba4143 100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -165,7 +165,6 @@ protected: LLUUID mImageAssetID; // Currently selected texture LLUIImagePtr mFallbackImage; // What to show if currently selected texture is null. - LLUUID mWhiteImageAssetID; LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory. LLUUID mOriginalImageAssetID; @@ -208,8 +207,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( : LLFloater(LLSD()), mOwner( owner ), mImageAssetID( owner->getImageAssetID() ), - mFallbackImage( fallback_image ), - mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ), + mFallbackImage( fallback_image ), mOriginalImageAssetID(owner->getImageAssetID()), mLabel(label), mTentativeLabel(NULL), @@ -1056,6 +1054,12 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mDefaultImageName(p.default_image_name), mFallbackImage(p.fallback_image) { + + // Default of defaults is white image for diff tex + // + LLUUID whiteImage( gSavedSettings.getString( "UIImgWhiteUUID" ) ); + setBlankImageAssetID( whiteImage ); + setAllowNoTexture(p.allow_no_texture); setCanApplyImmediately(p.can_apply_immediately); mCommitOnSelection = !p.no_commit_on_selection; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f8bc6ef4d3..4e233d479a 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4393,15 +4393,18 @@ S32 LLViewerObject::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID << ", material " << pMaterialID << LL_ENDL; retval = LLPrimitive::setTEMaterialID(te, pMaterialID); - } - // Kitty would like to know if this is necessary? - // Since we should get a setTEMaterialParams that does it anyway? - // - setChanged(TEXTURE); - if (mDrawable.notNull()) + if (retval) { - gPipeline.markTextured(mDrawable); + // 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); + } } + } return retval; } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index fce06b9e13..022ddb69ce 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -143,6 +143,9 @@ LLGLSLShader gUnderWaterProgram; //interface shaders LLGLSLShader gHighlightProgram; +LLGLSLShader gHighlightNormalProgram; +LLGLSLShader gHighlightSpecularProgram; + LLGLSLShader gPathfindingProgram; LLGLSLShader gPathfindingNoNormalsProgram; @@ -752,6 +755,8 @@ void LLViewerShaderMgr::unloadShaders() gAvatarEyeballProgram.unload(); gAvatarPickProgram.unload(); gHighlightProgram.unload(); + gHighlightNormalProgram.unload(); + gHighlightSpecularProgram.unload(); gWLSkyProgram.unload(); gWLCloudProgram.unload(); @@ -2705,6 +2710,26 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { + gHighlightNormalProgram.mName = "Highlight Normals Shader"; + gHighlightNormalProgram.mShaderFiles.clear(); + gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER_ARB)); + gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gHighlightNormalProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gHighlightNormalProgram.createShader(NULL, NULL); + } + + if (success) + { + gHighlightSpecularProgram.mName = "Highlight Spec Shader"; + gHighlightSpecularProgram.mShaderFiles.clear(); + gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER_ARB)); + gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gHighlightSpecularProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gHighlightSpecularProgram.createShader(NULL, NULL); + } + + if (success) + { gUIProgram.mName = "UI Shader"; gUIProgram.mShaderFiles.clear(); gUIProgram.mShaderFiles.push_back(make_pair("interface/uiV.glsl", GL_VERTEX_SHADER_ARB)); diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 5ef5d2234c..a24427a7bb 100755 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -301,6 +301,9 @@ extern LLGLSLShader gGlowExtractProgram; //interface shaders extern LLGLSLShader gHighlightProgram; +extern LLGLSLShader gHighlightNormalProgram; +extern LLGLSLShader gHighlightSpecularProgram; + extern LLGLSLShader gPathfindingProgram; extern LLGLSLShader gPathfindingNoNormalsProgram; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 52d05c8030..a9b540507f 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1991,15 +1991,17 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) << LL_ENDL; LL_DEBUGS("MaterialTEs") << " " << pMaterialID.asString() << LL_ENDL; - // Use TE-specific version of boost CB hook-up to avoid cross-contaminatin' - LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, _3)); + if (res) + { + LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, _3)); setChanged(TEXTURE); if (!mDrawable.isNull()) { gPipeline.markTextured(mDrawable); } mFaceMappingChanged = TRUE; - return TEM_CHANGE_TEXTURE; + } + return res; } S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f4b445c2eb..bcbd752550 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -354,6 +354,7 @@ BOOL LLPipeline::sRenderParticleBeacons = FALSE; BOOL LLPipeline::sRenderSoundBeacons = FALSE; BOOL LLPipeline::sRenderBeacons = FALSE; BOOL LLPipeline::sRenderHighlight = TRUE; +LLRender::eTexIndex LLPipeline::sRenderHighlightTextureChannel = LLRender::DIFFUSE_MAP; BOOL LLPipeline::sForceOldBakedUpload = FALSE; S32 LLPipeline::sUseOcclusion = 0; BOOL LLPipeline::sDelayVBUpdate = TRUE; @@ -3843,7 +3844,9 @@ void LLPipeline::postSort(LLCamera& camera) if (!sShadowRender) { mSelectedFaces.clear(); - + + LLPipeline::setRenderHighlightTextureChannel(LLSelectMgr::getInstance()->getTextureChannel()); + // Draw face highlights for selected faces. if (LLSelectMgr::getInstance()->getTEMode()) { @@ -4066,13 +4069,14 @@ void LLPipeline::renderHighlights() gGL.diffuseColor4f(1,1,1,0.5f); } - if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED)) + if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && !mFaceSelectImagep) + { + mFaceSelectImagep = LLViewerTextureManager::getFetchedTexture(IMG_FACE_SELECT); + } + + if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::DIFFUSE_MAP)) { // Make sure the selection image gets downloaded and decoded - if (!mFaceSelectImagep) - { - mFaceSelectImagep = LLViewerTextureManager::getFetchedTexture(IMG_FACE_SELECT); - } mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA); U32 count = mSelectedFaces.size(); @@ -4088,7 +4092,7 @@ void LLPipeline::renderHighlights() facep->renderSelected(mFaceSelectImagep, color); } } - + if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED)) { // Paint 'em red! @@ -4110,6 +4114,67 @@ void LLPipeline::renderHighlights() { gHighlightProgram.unbind(); } + + + if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::NORMAL_MAP)) + { + color.setVec(1.0f, 0.5f, 0.5f, 0.5f); + if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) + { + gHighlightNormalProgram.bind(); + gGL.diffuseColor4f(1,1,1,0.5f); + } + + mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA); + + U32 count = mSelectedFaces.size(); + for (U32 i = 0; i < count; i++) + { + LLFace *facep = mSelectedFaces[i]; + if (!facep || facep->getDrawable()->isDead()) + { + llerrs << "Bad face on selection" << llendl; + return; + } + + facep->renderSelected(mFaceSelectImagep, color); + } + + if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) + { + gHighlightNormalProgram.unbind(); + } + } + + if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::SPECULAR_MAP)) + { + color.setVec(0.0f, 0.3f, 1.0f, 0.8f); + if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) + { + gHighlightSpecularProgram.bind(); + gGL.diffuseColor4f(1,1,1,0.5f); + } + + mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA); + + U32 count = mSelectedFaces.size(); + for (U32 i = 0; i < count; i++) + { + LLFace *facep = mSelectedFaces[i]; + if (!facep || facep->getDrawable()->isDead()) + { + llerrs << "Bad face on selection" << llendl; + return; + } + + facep->renderSelected(mFaceSelectImagep, color); + } + + if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) + { + gHighlightSpecularProgram.unbind(); + } + } } //debug use @@ -6727,6 +6792,12 @@ BOOL LLPipeline::getRenderHighlights(void*) return sRenderHighlight; } +// static +void LLPipeline::setRenderHighlightTextureChannel(LLRender::eTexIndex channel) +{ + sRenderHighlightTextureChannel = channel; +} + LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector3& start, const LLVector3& end, BOOL pick_transparent, S32* face_hit, diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 9b7d1d642c..4aee8f14d6 100755 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -394,6 +394,7 @@ public: static void setRenderHighlights(BOOL val); static void toggleRenderHighlights(void* data); static BOOL getRenderHighlights(void* data); + static void setRenderHighlightTextureChannel(LLRender::eTexIndex channel); // sets which UV setup to display in highlight overlay static void updateRenderBump(); static void updateRenderDeferred(); @@ -401,6 +402,8 @@ public: static void throttleNewMemoryAllocation(BOOL disable); + + void addDebugBlip(const LLVector3& position, const LLColor4& color); void hidePermanentObjects( std::vector<U32>& restoreList ); @@ -847,6 +850,10 @@ public: static BOOL sRenderBeacons; static BOOL sRenderHighlight; + // Determines which set of UVs to use in highlight display + // + static LLRender::eTexIndex sRenderHighlightTextureChannel; + //debug use static U32 sCurRenderPoolType ; diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index 5be3ca9d9f..626115bd5d 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -644,8 +644,8 @@ layout="topleft" label_width="205" left="10" - max_val="180" - min_val="-180" + max_val="9999" + min_val="-9999" name="bumpyRot" width="265" /> @@ -707,8 +707,8 @@ layout="topleft" label_width="205" left="10" - max_val="180" - min_val="-180" + max_val="9999" + min_val="-9999" name="shinyRot" width="265" /> |