From 3e80fa3dbc943de9b784fedc202ba38cf238f46d Mon Sep 17 00:00:00 2001 From: David Parks <davep@lindenlab.com> Date: Mon, 2 Nov 2009 19:55:37 +0000 Subject: Sync up with render-pipeline-7 ignore-dead-branch --- indra/cmake/00-Common.cmake | 5 +- indra/cmake/LLPrimitive.cmake | 22 +- indra/llcommon/llassettype.cpp | 1 + indra/llcommon/llassettype.h | 6 +- indra/llcommon/llthread.cpp | 2 +- indra/llcommon/stdenums.h | 3 +- indra/llinventory/llinventorytype.cpp | 7 +- indra/llinventory/llinventorytype.h | 3 +- indra/llmath/llvolume.cpp | 350 ++++++++++- indra/llmath/llvolume.h | 22 +- indra/llmath/llvolumemgr.cpp | 2 +- indra/llmath/m4math.cpp | 11 + indra/llmath/m4math.h | 1 + indra/llmath/v2math.cpp | 15 + indra/llmath/v2math.h | 3 + indra/llmessage/llassetstorage.cpp | 2 +- indra/llmessage/lltransfermanager.cpp | 2 +- indra/llmessage/lltransfersourceasset.cpp | 2 + indra/llprimitive/CMakeLists.txt | 4 + indra/llprimitive/llprimitive.cpp | 15 +- indra/llprimitive/llprimitive.h | 2 +- indra/llvfs/llvfile.cpp | 2 +- indra/llvfs/llvfs.cpp | 3 + indra/newview/CMakeLists.txt | 10 + indra/newview/app_settings/settings.xml | 14 +- .../shaders/class2/deferred/multiSpotLightF.glsl | 2 +- .../shaders/class2/deferred/sunLightF.glsl | 4 +- indra/newview/licenses-win32.txt | 69 +++ indra/newview/llassetuploadresponders.cpp | 661 +++++++++++++++++---- indra/newview/llassetuploadresponders.h | 51 +- indra/newview/lldrawable.h | 6 +- indra/newview/lldrawpoolbump.cpp | 12 + indra/newview/lldrawpoolbump.h | 2 +- indra/newview/llface.cpp | 2 +- indra/newview/llfilepicker.cpp | 5 + indra/newview/llfilepicker.h | 3 + indra/newview/llfloaterinventory.cpp | 3 + indra/newview/llhudtext.cpp | 12 + indra/newview/llhudtext.h | 1 + indra/newview/llinventorybridge.cpp | 94 ++- indra/newview/llinventorybridge.h | 35 +- indra/newview/llpanelgroupnotices.cpp | 1 + indra/newview/llselectmgr.cpp | 80 ++- indra/newview/llselectmgr.h | 1 + indra/newview/llspatialpartition.cpp | 1 - indra/newview/llspatialpartition.h | 1 + indra/newview/lltexturectrl.cpp | 6 +- indra/newview/lltooldraganddrop.cpp | 11 + indra/newview/llviewerdisplay.cpp | 8 +- indra/newview/llviewerfloaterreg.cpp | 4 +- indra/newview/llviewermenu.cpp | 2 +- indra/newview/llviewermenufile.cpp | 330 +++++++--- indra/newview/llviewermenufile.h | 77 ++- indra/newview/llviewermessage.cpp | 1 + indra/newview/llviewerregion.cpp | 2 + indra/newview/llviewertexteditor.cpp | 1 + indra/newview/llviewertexture.cpp | 2 +- indra/newview/llviewerwindow.cpp | 134 ----- indra/newview/llvovolume.cpp | 183 +++++- indra/newview/llvovolume.h | 9 + indra/newview/pipeline.cpp | 241 +++++++- indra/newview/pipeline.h | 33 + indra/newview/skins/default/textures/textures.xml | 2 + .../newview/skins/default/xui/en/floater_about.xml | 3 + .../skins/default/xui/en/floater_inventory.xml | 10 + .../newview/skins/default/xui/en/floater_tools.xml | 3 + indra/newview/skins/default/xui/en/menu_viewer.xml | 4 +- .../newview/skins/default/xui/en/notifications.xml | 25 +- indra/newview/skins/default/xui/en/strings.xml | 1 + indra/newview/viewer_manifest.py | 6 + install.xml | 166 ++++++ 71 files changed, 2351 insertions(+), 468 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 173e650961..3bd10ea9ee 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -49,11 +49,12 @@ if (WINDOWS) add_definitions( /DLL_WINDOWS=1 + /DDOM_DYNAMIC /DUNICODE /D_UNICODE /GS /TP - /W3 + /W2 /c /Zc:forScope /nologo @@ -195,7 +196,7 @@ endif (DARWIN) if (LINUX OR DARWIN) - set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-non-virtual-dtor -Woverloaded-virtual") + set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-non-virtual-dtor") if (NOT GCC_DISABLE_FATAL_WARNINGS) set(GCC_WARNINGS "${GCC_WARNINGS} -Werror") diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index d397b78f1c..9f8d99a0bf 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -1,7 +1,27 @@ # -*- cmake -*- +# these should be moved to their own cmake file +include(Prebuilt) +use_prebuilt_binary(colladadom) +use_prebuilt_binary(pcre) +use_prebuilt_binary(libxml) + set(LLPRIMITIVE_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llprimitive ) -set(LLPRIMITIVE_LIBRARIES llprimitive) +if (WINDOWS) + set(LLPRIMITIVE_LIBRARIES + llprimitive + libcollada14dom21 + ) +else (WINDOWS) + set(LLPRIMITIVE_LIBRARIES + llprimitive + collada14dom + xml2 + pcrecpp + pcre + ) +endif (WINDOWS) + diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index 0b016b81fb..d57494b444 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -107,6 +107,7 @@ LLAssetDictionary::LLAssetDictionary() addEntry(LLAssetType::AT_LINK, new AssetEntry("LINK", "link", "symbolic link", "Link", DAD_LINK, FALSE, TRUE)); addEntry(LLAssetType::AT_LINK_FOLDER, new AssetEntry("FOLDER_LINK", "link_f", "symbolic folder link", "New Folder", DAD_LINK, FALSE, TRUE)); + addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", "Meshes", DAD_MESH, FALSE, TRUE)); for (S32 ensemble_num = S32(LLAssetType::AT_FOLDER_ENSEMBLE_START); ensemble_num <= S32(LLAssetType::AT_FOLDER_ENSEMBLE_END); diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index 5e51188541..a1154d16e3 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -147,9 +147,11 @@ public: AT_MY_OUTFITS = 48, // Folder that holds your outfits. + + AT_MESH = 49, + // Mesh data in our proprietary SLM format - - AT_COUNT = 49, + AT_COUNT = 50, // +*********************************************************+ // | TO ADD AN ELEMENT TO THIS ENUM: | // +*********************************************************+ diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 920d8c0977..e3906bc86e 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -75,7 +75,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap // Run the user supplied function threadp->run(); - llinfos << "LLThread::staticRun() Exiting: " << threadp->mName << llendl; + //llinfos << "LLThread::staticRun() Exiting: " << threadp->mName << llendl; // We're done with the run function, this thread is done executing now. threadp->mStatus = STOPPED; diff --git a/indra/llcommon/stdenums.h b/indra/llcommon/stdenums.h index 1a5678dde1..6eead924da 100644 --- a/indra/llcommon/stdenums.h +++ b/indra/llcommon/stdenums.h @@ -55,7 +55,8 @@ enum EDragAndDropType DAD_ANIMATION = 12, DAD_GESTURE = 13, DAD_LINK = 14, - DAD_COUNT = 15, // number of types in this enum + DAD_MESH = 15, + DAD_COUNT = 16, // number of types in this enum }; // Reasons for drags to be denied. diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index a445466b26..ae3cb2697b 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -96,7 +96,9 @@ LLInventoryDictionary::LLInventoryDictionary() addEntry(LLInventoryType::IT_WEARABLE, new InventoryEntry("wearable", "wearable", 2, LLAssetType::AT_CLOTHING, LLAssetType::AT_BODYPART)); addEntry(LLInventoryType::IT_ANIMATION, new InventoryEntry("animation", "animation", 1, LLAssetType::AT_ANIMATION)); addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE)); - addEntry(LLInventoryType::IT_FAVORITE, new InventoryEntry("favorite", "favorite", 1, LLAssetType::AT_FAVORITE)); + addEntry(LLInventoryType::IT_FAVORITE, new InventoryEntry("favorite", "favorite", 1, LLAssetType::AT_FAVORITE)); + addEntry(LLInventoryType::IT_MESH, new InventoryEntry("mesh", "mesh", 1, LLAssetType::AT_MESH)); + } @@ -132,7 +134,7 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_NONE, // AT_LINK LLInventoryType::IT_NONE, // AT_LINK_FOLDER - + LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE @@ -157,6 +159,7 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_CATEGORY, // AT_CURRENT_OUTFIT LLInventoryType::IT_CATEGORY, // AT_OUTFIT LLInventoryType::IT_CATEGORY, // AT_MY_OUTFITS + LLInventoryType::IT_MESH, // AT_MESH }; // static diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index 14b28bfe4b..0d580d3000 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -68,7 +68,8 @@ public: IT_ANIMATION = 19, IT_GESTURE = 20, IT_FAVORITE = 21, - IT_COUNT = 22, + IT_MESH = 22, + IT_COUNT = 23, IT_NONE = -1 }; diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index b8ef92f9a9..afa82ed399 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -46,6 +46,9 @@ #include "lldarray.h" #include "llvolume.h" #include "llstl.h" +#include "llsdserialize.h" +#include "zlib/zlib.h" + #define DEBUG_SILHOUETTE_BINORMALS 0 #define DEBUG_SILHOUETTE_NORMALS 0 // TomY: Use this to display normals using the silhouette @@ -1688,7 +1691,7 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mGenerateSingleFace = generate_single_face; generate(); - if (mParams.getSculptID().isNull()) + if (mParams.getSculptID().isNull() && params.getSculptType() == LL_SCULPT_TYPE_NONE) { createVolumeFaces(); } @@ -1839,6 +1842,295 @@ BOOL LLVolume::generate() return FALSE; } +bool LLVolumeFace::VertexData::operator<(const LLVolumeFace::VertexData& rhs)const +{ + const U8* l = (const U8*) this; + const U8* r = (const U8*) &rhs; + + for (U32 i = 0; i < sizeof(VertexData); ++i) + { + if (l[i] != r[i]) + { + return r[i] < l[i]; + } + } + + return false; +} + +bool LLVolumeFace::VertexData::operator==(const LLVolumeFace::VertexData& rhs)const +{ + const U8* l = (const U8*) this; + const U8* r = (const U8*) &rhs; + + for (U32 i = 0; i < sizeof(VertexData); ++i) + { + if (l[i] != r[i]) + { + return false; + } + } + + return true; +} + + +BOOL LLVolume::createVolumeFacesFromFile(const std::string& file_name) +{ + std::ifstream is; + + is.open(file_name.c_str(), std::ifstream::in | std::ifstream::binary); + + BOOL success = createVolumeFacesFromStream(is); + + is.close(); + + return success; +} + +BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) +{ + mSculptLevel = -1; // default is an error occured + + LLSD header; + { + if (!LLSDSerialize::deserialize(header, is, 1024*1024*1024)) + { + llwarns << "not a valid mesh asset!" << llendl; + return FALSE; + } + } + + std::string nm[] = + { + "impostor", + "low_lod", + "medium_lod", + "high_lod" + }; + + S32 lod = llclamp((S32) mDetail, 0, 3); + + while (lod < 4 && header[nm[lod]]["offset"].asInteger() == -1) + { + ++lod; + } + + if (lod >= 4) + { + llwarns << "Couldn't load model for given lod" << llendl; + return FALSE; + } + + is.seekg(header[nm[lod]]["offset"].asInteger(), std::ios_base::cur); + + + U8* result = NULL; + U32 cur_size = 0; + + { + //input stream is now pointing at a zlib compressed block of LLSD + //decompress block + z_stream strm; + + const U32 CHUNK = 65536; + + S32 size = header[nm[lod]]["size"].asInteger(); + U8 *in = new U8[size]; + is.read((char*) in, size); + + U8 out[CHUNK]; + + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = size; + strm.next_in = in; + + S32 ret = inflateInit(&strm); + + if (ret != Z_OK) + { + llerrs << "WTF?" << llendl; + } + + do + { + strm.avail_out = CHUNK; + strm.next_out = out; + ret = inflate(&strm, Z_NO_FLUSH); + if (ret == Z_STREAM_ERROR) + { + inflateEnd(&strm); + free(result); + delete [] in; + return FALSE; + } + + switch (ret) + { + case Z_NEED_DICT: + ret = Z_DATA_ERROR; + case Z_DATA_ERROR: + case Z_MEM_ERROR: + inflateEnd(&strm); + free(result); + delete [] in; + return FALSE; + break; + } + + U32 have = CHUNK-strm.avail_out; + + result = (U8*) realloc(result, cur_size + have); + memcpy(result+cur_size, out, have); + cur_size += have; + + } while (strm.avail_out == 0); + + inflateEnd(&strm); + delete [] in; + + if (ret != Z_STREAM_END) + { + free(result); + return FALSE; + } + } + + //result now points to the decompressed LLSD block + + LLSD mdl; + + { + std::string res_str((char*) result, cur_size); + std::istringstream istr(res_str); + + if (!LLSDSerialize::deserialize(mdl, istr, cur_size)) + { + llwarns << "not a valid mesh asset!" << llendl; + return FALSE; + } + } + + + free(result); + + + { + U32 face_count = mdl.size(); + + mVolumeFaces.resize(face_count); + + for (U32 i = 0; i < face_count; ++i) + { + LLSD::Binary pos = mdl[i]["Position"]; + LLSD::Binary norm = mdl[i]["Normal"]; + LLSD::Binary tc = mdl[i]["TexCoord0"]; + LLSD::Binary idx = mdl[i]["TriangleList"]; + + LLVolumeFace& face = mVolumeFaces[i]; + + face.mHasBinormals = FALSE; + + //copy out indices + face.mIndices.resize(idx.size()/2); + if (idx.empty()) + { //why is there an empty index list? + continue; + } + + U16* indices = (U16*) &(idx[0]); + for (U32 j = 0; j < idx.size()/2; ++j) + { + face.mIndices[j] = indices[j]; + } + + //copy out vertices + U32 num_verts = pos.size()/(3*2); + face.mVertices.resize(num_verts); + + LLVector3 min_pos; + LLVector3 max_pos; + LLVector2 min_tc; + LLVector2 max_tc; + + min_pos.setValue(mdl[i]["PositionDomain"]["Min"]); + max_pos.setValue(mdl[i]["PositionDomain"]["Max"]); + min_tc.setValue(mdl[i]["TexCoord0Domain"]["Min"]); + max_tc.setValue(mdl[i]["TexCoord0Domain"]["Max"]); + + F32 scale = llclamp((F32) mdl[i]["Scale"].asReal(), 1.f, 10.f); + + LLVector3 pos_range = max_pos - min_pos; + LLVector2 tc_range = max_tc - min_tc; + + LLVector3& min = face.mExtents[0]; + LLVector3& max = face.mExtents[1]; + + min = max = LLVector3(0,0,0); + + for (U32 j = 0; j < num_verts; ++j) + { + U16* v = (U16*) &(pos[j*3*2]); + + face.mVertices[j].mPosition.setVec( + (F32) v[0] / 65535.f * pos_range.mV[0] + min_pos.mV[0], + (F32) v[1] / 65535.f * pos_range.mV[1] + min_pos.mV[1], + (F32) v[2] / 65535.f * pos_range.mV[2] + min_pos.mV[2]); + + face.mVertices[j].mPosition *= scale; + + if (j == 0) + { + min = max = face.mVertices[j].mPosition; + } + else + { + update_min_max(min,max,face.mVertices[j].mPosition); + } + + U16* n = (U16*) &(norm[j*3*2]); + + face.mVertices[j].mNormal.setVec( + (F32) n[0] / 65535.f * 2.f - 1.f, + (F32) n[1] / 65535.f * 2.f - 1.f, + (F32) n[2] / 65535.f * 2.f - 1.f); + + U16* t = (U16*) &(tc[j*2*2]); + + face.mVertices[j].mTexCoord.setVec( + (F32) t[0] / 65535.f * tc_range.mV[0] + min_tc.mV[0], + (F32) t[1] / 65535.f * tc_range.mV[1] + min_tc.mV[1]); + } + + } + } + + mSculptLevel = 0; // success! + return TRUE; +} + +void LLVolume::copyVolumeFaces(LLVolume* volume) +{ + mVolumeFaces = volume->mVolumeFaces; + mSculptLevel = 0; +} + +S32 const LL_SCULPT_MESH_MAX_FACES = 8; + +S32 LLVolume::getNumFaces() const +{ + U8 sculpt_type = (mParams.getSculptType() & LL_SCULPT_TYPE_MASK); + + if (sculpt_type == LL_SCULPT_TYPE_MESH) + { + return LL_SCULPT_MESH_MAX_FACES; + } + + return (S32)mProfilep->mFaces.size(); +} + void LLVolume::createVolumeFaces() { @@ -1864,6 +2156,11 @@ void LLVolume::createVolumeFaces() LLProfile::Face& face = mProfilep->mFaces[i]; vf.mBeginS = face.mIndex; vf.mNumS = face.mCount; + if (vf.mNumS < 0) + { + llerrs << "Volume face corruption detected." << llendl; + } + vf.mBeginT = 0; vf.mNumT= getPath().mPath.size(); vf.mID = i; @@ -1907,6 +2204,10 @@ void LLVolume::createVolumeFaces() if (face.mFlat && vf.mNumS > 2) { //flat inner faces have to copy vert normals vf.mNumS = vf.mNumS*2; + if (vf.mNumS < 0) + { + llerrs << "Volume face corruption detected." << llendl; + } } } else @@ -2309,7 +2610,6 @@ bool LLVolumeParams::operator<(const LLVolumeParams ¶ms) const return mSculptID < params.mSculptID; } - return mSculptType < params.mSculptType; @@ -3379,22 +3679,29 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices, S32 face_mask) { LLMemType m1(LLMemType::MTYPE_VOLUME); - + vertices.clear(); normals.clear(); segments.clear(); + if (mParams.getSculptType() == LL_SCULPT_TYPE_MESH) + { + return; + } + S32 cur_index = 0; //for each face for (face_list_t::iterator iter = mVolumeFaces.begin(); iter != mVolumeFaces.end(); ++iter) { - const LLVolumeFace& face = *iter; + LLVolumeFace& face = *iter; - if (!(face_mask & (0x1 << cur_index++))) + if (!(face_mask & (0x1 << cur_index++)) || + face.mIndices.empty() || face.mEdge.empty()) { continue; } + if (face.mTypeMask & (LLVolumeFace::CAP_MASK)) { } @@ -3594,6 +3901,8 @@ S32 LLVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, F32 closest_t = 2.f; // must be larger than 1 + end_face = llmin(end_face, getNumVolumeFaces()-1); + for (S32 i = start_face; i <= end_face; i++) { const LLVolumeFace &face = getVolumeFace((U32)i); @@ -4103,11 +4412,28 @@ BOOL LLVolumeParams::exportLegacyStream(std::ostream& output_stream) const return TRUE; } +LLSD LLVolumeParams::sculptAsLLSD() const +{ + LLSD sd = LLSD(); + sd["id"] = getSculptID(); + sd["type"] = getSculptType(); + + return sd; +} + +bool LLVolumeParams::sculptFromLLSD(LLSD& sd) +{ + setSculptID(sd["id"].asUUID(), (U8)sd["type"].asInteger()); + return true; +} + LLSD LLVolumeParams::asLLSD() const { LLSD sd = LLSD(); sd["path"] = mPathParams; sd["profile"] = mProfileParams; + sd["sculpt"] = sculptAsLLSD(); + return sd; } @@ -4115,6 +4441,8 @@ bool LLVolumeParams::fromLLSD(LLSD& sd) { mPathParams.fromLLSD(sd["path"]); mProfileParams.fromLLSD(sd["profile"]); + sculptFromLLSD(sd["sculpt"]); + return true; } @@ -4157,6 +4485,12 @@ const F32 MIN_CONCAVE_PATH_WEDGE = 0.111111f; // 1/9 unity // for collison purposes BOOL LLVolumeParams::isConvex() const { + if (!getSculptID().isNull()) + { + // can't determine, be safe and say no: + return FALSE; + } + F32 path_length = mPathParams.getEnd() - mPathParams.getBegin(); F32 hollow = mProfileParams.getHollow(); @@ -5011,7 +5345,11 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) if (!partial_build) { mIndices.resize(num_indices); - mEdge.resize(num_indices); + + if (volume->getParams().getSculptType() != LL_SCULPT_TYPE_MESH) + { + mEdge.resize(num_indices); + } } else { diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 871b334452..9f595ccbc4 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -186,6 +186,9 @@ const U8 LL_SCULPT_TYPE_CYLINDER = 4; const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE | LL_SCULPT_TYPE_CYLINDER; +// need to change this (these) names +const U8 LL_SCULPT_TYPE_MESH = 5; + const U8 LL_SCULPT_FLAG_INVERT = 64; const U8 LL_SCULPT_FLAG_MIRROR = 128; @@ -575,6 +578,9 @@ public: BOOL importLegacyStream(std::istream& input_stream); BOOL exportLegacyStream(std::ostream& output_stream) const; + LLSD sculptAsLLSD() const; + bool sculptFromLLSD(LLSD& sd); + LLSD asLLSD() const; operator LLSD() const { return asLLSD(); } bool fromLLSD(LLSD& sd); @@ -634,7 +640,6 @@ public: const F32& getSkew() const { return mPathParams.getSkew(); } const LLUUID& getSculptID() const { return mSculptID; } const U8& getSculptType() const { return mSculptType; } - BOOL isConvex() const; // 'begin' and 'end' should be in range [0, 1] (they will be clamped) @@ -798,7 +803,7 @@ public: BOOL create(LLVolume* volume, BOOL partial_build = FALSE); void createBinormals(); - + class VertexData { public: @@ -806,6 +811,9 @@ public: LLVector3 mNormal; LLVector3 mBinormal; LLVector2 mTexCoord; + + bool operator<(const VertexData& rhs) const; + bool operator==(const VertexData& rhs) const; }; enum @@ -851,8 +859,7 @@ class LLVolume : public LLRefCount { friend class LLVolumeLODGroup; -private: - LLVolume(const LLVolume&); // Don't implement +protected: ~LLVolume(); // use unref public: @@ -874,7 +881,7 @@ public: U8 getProfileType() const { return mParams.getProfileParams().getCurveType(); } U8 getPathType() const { return mParams.getPathParams().getCurveType(); } - S32 getNumFaces() const { return (S32)mProfilep->mFaces.size(); } + S32 getNumFaces() const; S32 getNumVolumeFaces() const { return mVolumeFaces.size(); } F32 getDetail() const { return mDetail; } const LLVolumeParams& getParams() const { return mParams; } @@ -946,6 +953,8 @@ public: LLVector3 mLODScaleBias; // vector for biasing LOD based on scale void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level); + void copyVolumeFaces(LLVolume* volume); + private: void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type); F32 sculptGetSurfaceArea(); @@ -956,6 +965,9 @@ private: protected: BOOL generate(); void createVolumeFaces(); +public: + virtual BOOL createVolumeFacesFromFile(const std::string& file_name); + virtual BOOL createVolumeFacesFromStream(std::istream& is); protected: BOOL mUnique; diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index 53641fceab..61c5a0adc9 100644 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -320,7 +320,7 @@ BOOL LLVolumeLODGroup::derefLOD(LLVolume *volumep) { llassert_always(mLODRefs[i] > 0); mLODRefs[i]--; -#if 1 // SJB: Possible opt: keep other lods around +#if 0 // SJB: Possible opt: keep other lods around if (!mLODRefs[i]) { mVolumeLODs[i] = NULL; diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index d8e7b4aaf9..7c7f60154d 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -428,6 +428,17 @@ const LLMatrix4& LLMatrix4::initRotTrans(const LLQuaternion &q, const LLVector return (*this); } +const LLMatrix4& LLMatrix4::initScale(const LLVector3 &scale) +{ + setIdentity(); + + mMatrix[VX][VX] = scale.mV[VX]; + mMatrix[VY][VY] = scale.mV[VY]; + mMatrix[VZ][VZ] = scale.mV[VZ]; + + return (*this); +} + const LLMatrix4& LLMatrix4::initAll(const LLVector3 &scale, const LLQuaternion &q, const LLVector3 &pos) { F32 sx, sy, sz; diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h index e74b7afe9b..de981b7646 100644 --- a/indra/llmath/m4math.h +++ b/indra/llmath/m4math.h @@ -159,6 +159,7 @@ public: const LLMatrix4& initRotTrans(const F32 roll, const F32 pitch, const F32 yaw, const LLVector4 &pos); // Rotation from Euler + translation const LLMatrix4& initRotTrans(const LLQuaternion &q, const LLVector4 &pos); // Set with Quaternion and position + const LLMatrix4& initScale(const LLVector3 &scale); // Set all const LLMatrix4& initAll(const LLVector3 &scale, const LLQuaternion &q, const LLVector3 &pos); diff --git a/indra/llmath/v2math.cpp b/indra/llmath/v2math.cpp index 555e1f92bb..220336e0c2 100644 --- a/indra/llmath/v2math.cpp +++ b/indra/llmath/v2math.cpp @@ -115,3 +115,18 @@ LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u) a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u, a.mV[VY] + (b.mV[VY] - a.mV[VY]) * u ); } + +LLSD LLVector2::getValue() const +{ + LLSD ret; + ret[0] = mV[0]; + ret[1] = mV[1]; + return ret; +} + +void LLVector2::setValue(LLSD& sd) +{ + mV[0] = (F32) sd[0].asReal(); + mV[1] = (F32) sd[1].asReal(); +} + diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index 9fef8851cc..f9f1c024f2 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -66,6 +66,9 @@ class LLVector2 void set(const LLVector2 &vec); // Sets LLVector2 to vec void set(const F32 *vec); // Sets LLVector2 to vec + LLSD getValue() const; + void setValue(LLSD& sd); + void setVec(F32 x, F32 y); // deprecated void setVec(const LLVector2 &vec); // deprecated void setVec(const F32 *vec); // deprecated diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index b3087bcc3f..eeb903de6a 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -502,7 +502,7 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at tpvf.setAsset(uuid, atype); tpvf.setCallback(downloadCompleteCallback, req); - llinfos << "Starting transfer for " << uuid << llendl; + //llinfos << "Starting transfer for " << uuid << llendl; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET); ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f)); } diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index d67911e8e2..72662bb782 100644 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -344,7 +344,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) } } - llinfos << "Receiving " << transfer_id << ", size " << size << " bytes" << llendl; + //llinfos << "Receiving " << transfer_id << ", size " << size << " bytes" << llendl; ttp->setSize(size); ttp->setGotInfo(TRUE); diff --git a/indra/llmessage/lltransfersourceasset.cpp b/indra/llmessage/lltransfersourceasset.cpp index 5a1cd95ffc..f255a2cf7e 100644 --- a/indra/llmessage/lltransfersourceasset.cpp +++ b/indra/llmessage/lltransfersourceasset.cpp @@ -271,6 +271,7 @@ bool is_asset_fetch_by_id_allowed(LLAssetType::EType type) case LLAssetType::AT_ANIMATION: case LLAssetType::AT_GESTURE: case LLAssetType::AT_FAVORITE: + case LLAssetType::AT_MESH: rv = true; break; default: @@ -296,6 +297,7 @@ bool is_asset_id_knowable(LLAssetType::EType type) case LLAssetType::AT_FAVORITE: case LLAssetType::AT_LINK: case LLAssetType::AT_LINK_FOLDER: + case LLAssetType::AT_MESH: rv = true; break; default: diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index d130513637..f9392a2b75 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -13,11 +13,14 @@ include_directories( ${LLMATH_INCLUDE_DIRS} ${LLMESSAGE_INCLUDE_DIRS} ${LLXML_INCLUDE_DIRS} + ${LIBS_PREBUILT_DIR}/include/collada + ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) set(llprimitive_SOURCE_FILES llmaterialtable.cpp llmediaentry.cpp + llmodel.cpp llprimitive.cpp llprimtexturelist.cpp lltextureanim.cpp @@ -33,6 +36,7 @@ set(llprimitive_HEADER_FILES legacy_object_types.h llmaterialtable.h llmediaentry.h + llmodel.h llprimitive.h llprimtexturelist.h lltextureanim.h diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index b102254b62..2675a27c08 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -744,18 +744,11 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai return TRUE; } - U32 old_face_mask = mVolumep->mFaceMask; - // build the new object sVolumeManager->unrefVolume(mVolumep); mVolumep = volumep; - - U32 new_face_mask = mVolumep->mFaceMask; - if (old_face_mask != new_face_mask) - { - setNumTEs(mVolumep->getNumFaces()); - } - + setNumTEs(mVolumep->getNumFaces()); + return TRUE; } @@ -898,7 +891,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const U8 packed_buffer[MAX_TE_BUFFER]; U8 *cur_ptr = packed_buffer; - S32 last_face_index = getNumTEs() - 1; + S32 last_face_index = llmin((U32) getNumTEs(), MAX_TES) - 1; if (last_face_index > -1) { @@ -1179,7 +1172,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) return retval; } - face_count = getNumTEs(); + face_count = llmin((U32) getNumTEs(), MAX_TES); U32 i; cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)image_data, 16, face_count, MVT_LLUUID); diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 4f828186cb..4db7aa7261 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -328,7 +328,7 @@ public: const LLVolume *getVolumeConst() const { return mVolumep; } // HACK for Windoze confusion about ostream operator in LLVolume LLVolume *getVolume() const { return mVolumep; } virtual BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); - + // Modify texture entry properties inline BOOL validTE(const U8 te_num) const; LLTextureEntry* getTE(const U8 te_num) const; diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index 5fdf41188d..e0e282d7af 100644 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -428,7 +428,7 @@ bool LLVFile::isLocked(EVFSLock lock) void LLVFile::waitForLock(EVFSLock lock) { - LLFastTimer t(FTM_VFILE_WAIT); + //LLFastTimer t(FTM_VFILE_WAIT); // spin until the lock clears while (isLocked(lock)) { diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp index 9ce1e75d06..ddb76fb2ba 100644 --- a/indra/llvfs/llvfs.cpp +++ b/indra/llvfs/llvfs.cpp @@ -2041,6 +2041,9 @@ std::string get_extension(LLAssetType::EType type) case LLAssetType::AT_ANIMATION: extension = ".lla"; break; + case LLAssetType::AT_MESH: + extension = ".slm"; + break; default: // Just use the asset server filename extension in most cases extension += "."; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 26170d1713..3cee6394e0 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -36,6 +36,7 @@ include(UI) include(UnixInstall) include(LLKDU) include(ViewerMiscLibs) +include(GLOD) if (WINDOWS) include(CopyWinLibs) @@ -44,6 +45,7 @@ endif (WINDOWS) include_directories( ${DBUSGLIB_INCLUDE_DIRS} ${ELFIO_INCLUDE_DIR} + ${GLOD_INCLUDE_DIR} ${LLAUDIO_INCLUDE_DIRS} ${LLCHARACTER_INCLUDE_DIRS} ${LLCOMMON_INCLUDE_DIRS} @@ -61,6 +63,8 @@ include_directories( ${LLXUIXML_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS}/lscript_compile + ${LIBS_PREBUILT_DIR}/include/collada + ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) set(viewer_SOURCE_FILES @@ -175,6 +179,7 @@ set(viewer_SOURCE_FILES llfloatermediasettings.cpp llfloaterhud.cpp llfloaterimagepreview.cpp + llfloaterimportcollada.cpp llfloaterinspect.cpp llfloaterinventory.cpp llfloaterjoystick.cpp @@ -183,6 +188,7 @@ set(viewer_SOURCE_FILES llfloaterlandholdings.cpp llfloatermap.cpp llfloatermemleak.cpp + llfloatermodelpreview.cpp llfloaternamedesc.cpp llfloaternotificationsconsole.cpp llfloateropenobject.cpp @@ -647,6 +653,7 @@ set(viewer_HEADER_FILES llfloatermediasettings.h llfloaterhud.h llfloaterimagepreview.h + llfloaterimportcollada.h llfloaterinspect.h llfloaterinventory.h llfloaterjoystick.h @@ -655,6 +662,7 @@ set(viewer_HEADER_FILES llfloaterlandholdings.h llfloatermap.h llfloatermemleak.h + llfloatermodelpreview.h llfloaternamedesc.h llfloaternotificationsconsole.h llfloateropenobject.h @@ -1139,6 +1147,7 @@ if (WINDOWS) ${DXGUID_LIBRARY} fmodvc kernel32 + libboost_system odbc32 odbccp32 ole32 @@ -1405,6 +1414,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${DBUSGLIB_LIBRARIES} ${OPENGL_LIBRARIES} ${FMODWRAPPER_LIBRARY} + ${GLOD_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL_LIBRARY} ${SMARTHEAP_LIBRARY} diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7e368b0c9c..073ea766fe 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7252,7 +7252,19 @@ <key>Value</key> <integer>0</integer> </map> - <key>SafeMode</key> + <key>MeshThreadCount</key> + <map> + <key>Comment</key> + <string>Number of threads to use for loading meshes.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>8</integer> + </map> + + <key>SafeMode</key> <map> <key>Comment</key> <string>Reset preferences, run in safe mode.</string> diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 651959413c..45884d5732 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -137,7 +137,7 @@ void main() } //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, proj_ambient_lod); + vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, proj_lod); amb_da += (da*da*0.5+0.5)*proj_ambiance; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index a0026edcd2..4333cc64a7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -224,11 +224,11 @@ void main() //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.1).x; + gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8).x; //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.1).x; + gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8).x; //gl_FragColor.rgb = pos.xyz; //gl_FragColor.b = shadow; diff --git a/indra/newview/licenses-win32.txt b/indra/newview/licenses-win32.txt index 7e6d4b4561..8736626907 100644 --- a/indra/newview/licenses-win32.txt +++ b/indra/newview/licenses-win32.txt @@ -769,3 +769,72 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +============= +GLOD license +============= +The GLOD Open-Source License Version 1.0 June 16, 2004 + +Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns +Hopkins University and David Luebke, Brenden Schubert, University of +Virginia. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, is permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer and + request. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer and + request in the documentation and/or other materials provided with + the distribution. + +3. The name "GLOD" must not be used to endorse or promote products + derived from this software without prior written permission. + +4. Redistributions of any modified version of this source, whether in + source or binary form , must include a form of the following + acknowledgment: "This product is derived from the GLOD library, + which is available from http://www.cs.jhu.edu/~graphics/GLOD." + +5. Redistributions of any modified version of this source in binary + form must provide, free of charge, access to the modified version + of the code. + +6. This license shall be governed by and construed and enforced in + accordance with the laws of the State of Maryland, without + reference to its conflicts of law provisions. The exclusive + jurisdiction and venue for all legal actions relating to this + license shall be in courts of competent subject matter jurisdiction + located in the State of Maryland. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, GLOD IS PROVIDED +UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES +THAT GLOD IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR +PURPOSE OR NON-INFRINGING. ALL WARRANTIES ARE DISCLAIMED AND THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE CODE IS WITH +YOU. SHOULD ANY CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE +COPYRIGHT HOLDER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY +NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY +CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY CODE IS +AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL +THE COPYRIGHT HOLDER OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY +SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES FOR LOSS OF +PROFITS, REVENUE, OR FOR LOSS OF INFORMATION OR ANY OTHER LOSS. + +YOU EXPRESSLY AGREE TO FOREVER INDEMNIFY, DEFEND AND HOLD HARMLESS THE +COPYRIGHT HOLDERS AND CONTRIBUTORS OF GLOD AGAINST ALL CLAIMS, +DEMANDS, SUITS OR OTHER ACTIONS ARISING DIRECTLY OR INDIRECTLY FROM +YOUR ACCEPTANCE AND USE OF GLOD. + +Although NOT REQUIRED, we would appreciate it if active users of GLOD +put a link on their web site to the GLOD web site when possible. + + diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index cd3963050f..cb03379b23 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -64,6 +64,7 @@ #include "llfocusmgr.h" #include "llscrolllistctrl.h" #include "llsdserialize.h" +#include "llsdutil.h" #include "llvfs.h" // When uploading multiple files, don't display any of them when uploading more than this number. @@ -71,6 +72,120 @@ static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; void dialog_refresh_all(); +void on_new_single_inventory_upload_complete( + LLAssetType::EType asset_type, + LLInventoryType::EType inventory_type, + const std::string inventory_type_string, + const LLUUID& item_folder_id, + const std::string& item_name, + const std::string& item_description, + const LLSD& server_response, + S32 upload_price) +{ + if ( upload_price > 0 ) + { + // this upload costed us L$, update our balance + // and display something saying that it cost L$ + LLStatusBar::sendMoneyBalanceRequest(); + + LLSD args; + args["AMOUNT"] = llformat("%d", upload_price); + LLNotifications::instance().add("UploadPayment", args); + } + + // Actually add the upload to viewer inventory + llinfos << "Adding " << server_response["new_inventory_item"].asUUID() + << " " << server_response["new_asset"].asUUID() + << " to inventory." << llendl; + + if( item_folder_id.notNull() ) + { + U32 everyone_perms = PERM_NONE; + U32 group_perms = PERM_NONE; + U32 next_owner_perms = PERM_ALL; + if( server_response.has("new_next_owner_mask") ) + { + // The server provided creation perms so use them. + // Do not assume we got the perms we asked for in + // since the server may not have granted them all. + everyone_perms = server_response["new_everyone_mask"].asInteger(); + group_perms = server_response["new_group_mask"].asInteger(); + next_owner_perms = server_response["new_next_owner_mask"].asInteger(); + } + else + { + // The server doesn't provide creation perms + // so use old assumption-based perms. + if( inventory_type_string != "snapshot") + { + next_owner_perms = PERM_MOVE | PERM_TRANSFER; + } + } + + LLPermissions new_perms; + new_perms.init( + gAgent.getID(), + gAgent.getID(), + LLUUID::null, + LLUUID::null); + + new_perms.initMasks( + PERM_ALL, + PERM_ALL, + everyone_perms, + group_perms, + next_owner_perms); + + S32 creation_date_now = time_corrected(); + LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem( + server_response["new_inventory_item"].asUUID(), + item_folder_id, + new_perms, + server_response["new_asset"].asUUID(), + asset_type, + inventory_type, + item_name, + item_description, + LLSaleInfo::DEFAULT, + LLInventoryItem::II_FLAGS_NONE, + creation_date_now); + + gInventory.updateItem(item); + gInventory.notifyObservers(); + + // Show the preview panel for textures and sounds to let + // user know that the image (or snapshot) arrived intact. + LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); + if ( view ) + { + LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); + + view->getPanel()->setSelection( + server_response["new_inventory_item"].asUUID(), + TAKE_FOCUS_NO); + + if( + (LLAssetType::AT_TEXTURE == asset_type || + LLAssetType::AT_SOUND == asset_type) && + (LLFilePicker::instance().getFileCount() <= + FILE_COUNT_DISPLAY_THRESHOLD) ) + { + view->getPanel()->openSelected(); + } + + // restore keyboard focus + gFocusMgr.setKeyboardFocus(focus); + } + } + else + { + llwarns << "Can't find a folder to put it in" << llendl; + } + + // remove the "Uploading..." message + LLUploadDialog::modalUploadFinished(); +} + LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data, const LLUUID& vfile_id, LLAssetType::EType asset_type) @@ -88,9 +203,10 @@ LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data, } } -LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data, - const std::string& file_name, - LLAssetType::EType asset_type) +LLAssetUploadResponder::LLAssetUploadResponder( + const LLSD &post_data, + const std::string& file_name, + LLAssetType::EType asset_type) : LLHTTPClient::Responder(), mPostData(post_data), mFileName(file_name), @@ -196,15 +312,19 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content) { } -LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type) -: LLAssetUploadResponder(post_data, vfile_id, asset_type) +LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( + const LLSD& post_data, + const LLUUID& vfile_id, + LLAssetType::EType asset_type) + : LLAssetUploadResponder(post_data, vfile_id, asset_type) { } -LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, const std::string& file_name, LLAssetType::EType asset_type) -: LLAssetUploadResponder(post_data, file_name, asset_type) +LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( + const LLSD& post_data, + const std::string& file_name, + LLAssetType::EType asset_type) + : LLAssetUploadResponder(post_data, file_name, asset_type) { } @@ -219,96 +339,31 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString()); LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString()); - S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + S32 expected_upload_cost = 0; // Update L$ and ownership credit information // since it probably changed on the server if (asset_type == LLAssetType::AT_TEXTURE || asset_type == LLAssetType::AT_SOUND || - asset_type == LLAssetType::AT_ANIMATION) + asset_type == LLAssetType::AT_ANIMATION || + asset_type == LLAssetType::AT_MESH) { - LLStatusBar::sendMoneyBalanceRequest(); - - LLSD args; - args["AMOUNT"] = llformat("%d", expected_upload_cost); - LLNotifications::instance().add("UploadPayment", args); + expected_upload_cost = + LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); } - // Actually add the upload to viewer inventory - llinfos << "Adding " << content["new_inventory_item"].asUUID() << " " - << content["new_asset"].asUUID() << " to inventory." << llendl; - if(mPostData["folder_id"].asUUID().notNull()) - { - //std::ostringstream out; - //LLSDXMLFormatter *formatter = new LLSDXMLFormatter; - //formatter->format(mPostData, out, LLSDFormatter::OPTIONS_PRETTY); - //llinfos << "Post Data: " << out.str() << llendl; - - U32 everyone_perms = PERM_NONE; - U32 group_perms = PERM_NONE; - U32 next_owner_perms = PERM_ALL; - if(content.has("new_next_owner_mask")) - { - // This is a new sim that provides creation perms so use them. - // Do not assume we got the perms we asked for in mPostData - // since the sim may not have granted them all. - everyone_perms = content["new_everyone_mask"].asInteger(); - group_perms = content["new_group_mask"].asInteger(); - next_owner_perms = content["new_next_owner_mask"].asInteger(); - } - else - { - // This old sim doesn't provide creation perms so use old assumption-based perms. - if(mPostData["inventory_type"].asString() != "snapshot") - { - next_owner_perms = PERM_MOVE | PERM_TRANSFER; - } - } - LLPermissions new_perms; - new_perms.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); - new_perms.initMasks(PERM_ALL, PERM_ALL, everyone_perms, group_perms, next_owner_perms); - S32 creation_date_now = time_corrected(); - LLPointer<LLViewerInventoryItem> item - = new LLViewerInventoryItem(content["new_inventory_item"].asUUID(), - mPostData["folder_id"].asUUID(), - new_perms, - content["new_asset"].asUUID(), - asset_type, - inventory_type, - mPostData["name"].asString(), - mPostData["description"].asString(), - LLSaleInfo::DEFAULT, - LLInventoryItem::II_FLAGS_NONE, - creation_date_now); - gInventory.updateItem(item); - gInventory.notifyObservers(); - - // Show the preview panel for textures and sounds to let - // user know that the image (or snapshot) arrived intact. - LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); - if(view) - { - LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); + on_new_single_inventory_upload_complete( + asset_type, + inventory_type, + mPostData["asset_type"].asString(), + mPostData["folder_id"].asUUID(), + mPostData["name"], + mPostData["description"], + content, + expected_upload_cost); - view->getPanel()->setSelection(content["new_inventory_item"].asUUID(), TAKE_FOCUS_NO); - if((LLAssetType::AT_TEXTURE == asset_type || LLAssetType::AT_SOUND == asset_type) - && LLFilePicker::instance().getFileCount() <= FILE_COUNT_DISPLAY_THRESHOLD) - { - view->getPanel()->openSelected(); - } - //LLFloaterInventory::dumpSelectionInformation((void*)view); - // restore keyboard focus - gFocusMgr.setKeyboardFocus(focus); - } - } - else - { - llwarns << "Can't find a folder to put it in" << llendl; - } + // continue uploading for bulk uploads - // remove the "Uploading..." message - LLUploadDialog::modalUploadFinished(); - // *FIX: This is a pretty big hack. What this does is check the // file picker if there are any more pending uploads. If so, // upload that file. @@ -325,18 +380,39 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) // Continuing the horrible hack above, we need to extract the originally requested permissions data, if any, // and use them for each next file to be uploaded. Note the requested perms are not the same as the - // granted ones found in the given "content" structure but can still be found in mPostData. -MG - U32 everyone_perms = mPostData.has("everyone_mask") ? mPostData.get("everyone_mask" ).asInteger() : PERM_NONE; - U32 group_perms = mPostData.has("group_mask") ? mPostData.get("group_mask" ).asInteger() : PERM_NONE; - U32 next_owner_perms = mPostData.has("next_owner_mask") ? mPostData.get("next_owner_mask").asInteger() : PERM_NONE; + U32 everyone_perms = + content.has("everyone_mask") ? + content["everyone_mask"].asInteger() : + PERM_NONE; + + U32 group_perms = + content.has("group_mask") ? + content["group_mask"].asInteger() : + PERM_NONE; + + U32 next_owner_perms = + content.has("next_owner_mask") ? + content["next_owner_mask"].asInteger() : + PERM_NONE; + std::string display_name = LLStringUtil::null; LLAssetStorage::LLStoreAssetCallback callback = NULL; void *userdata = NULL; - upload_new_resource(next_file, asset_name, asset_name, - 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE, - next_owner_perms, group_perms, - everyone_perms, display_name, - callback, expected_upload_cost, userdata); + + upload_new_resource( + next_file, + asset_name, + asset_name, + 0, + LLAssetType::AT_NONE, + LLInventoryType::IT_NONE, + next_owner_perms, + group_perms, + everyone_perms, + display_name, + callback, + LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), + userdata); } } @@ -383,17 +459,19 @@ void LLSendTexLayerResponder::uploadComplete(const LLSD& content) } -LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder(const LLSD& post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type) -: LLAssetUploadResponder(post_data, vfile_id, asset_type) +LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder( + const LLSD& post_data, + const LLUUID& vfile_id, + LLAssetType::EType asset_type) + : LLAssetUploadResponder(post_data, vfile_id, asset_type) { } -LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder(const LLSD& post_data, - const std::string& file_name, - LLAssetType::EType asset_type) -: LLAssetUploadResponder(post_data, file_name, asset_type) +LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder( + const LLSD& post_data, + const std::string& file_name, + LLAssetType::EType asset_type) + : LLAssetUploadResponder(post_data, file_name, asset_type) { } @@ -576,3 +654,374 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) break; } } + + +///////////////////////////////////////////////////// +// LLNewAgentInventoryVariablePriceResponder::Impl // +///////////////////////////////////////////////////// +class LLNewAgentInventoryVariablePriceResponder::Impl +{ +public: + Impl( + const LLUUID& vfile_id, + const LLSD& inventory_data) : + mVFileID(vfile_id), + mInventoryData(inventory_data) + { + } + + Impl( + const std::string& file_name, + const LLSD& inventory_data) : + mFileName(file_name), + mInventoryData(inventory_data) + { + } + + std::string getFilenameOrIDString() const + { + return (mFileName.empty() ? mVFileID.asString() : mFileName); + } + + LLUUID getVFileID() const + { + return mVFileID; + } + + std::string getFilename() const + { + return mFileName; + } + + LLAssetType::EType getAssetType() const + { + return LLAssetType::lookup( + mInventoryData["asset_type"].asString()); + } + + LLInventoryType::EType getInventoryType() const + { + return LLInventoryType::lookup( + mInventoryData["inventory_type"].asString()); + } + + std::string getInventoryTypeString() const + { + return mInventoryData["inventory_type"].asString(); + } + + LLUUID getFolderID() const + { + return mInventoryData["folder_id"].asUUID(); + } + + std::string getItemName() const + { + return mInventoryData["name"].asString(); + } + + std::string getItemDescription() const + { + return mInventoryData["description"].asString(); + } + + void displayCannotUploadReason(const std::string& reason) + { + LLSD args; + args["FILE"] = getFilenameOrIDString(); + args["REASON"] = reason; + + + LLNotifications::instance().add("CannotUploadReason", args); + LLUploadDialog::modalUploadFinished(); + } + + void onApplicationLevelError(const std::string& error_identifier) + { + // TODO*: Pull these user visible strings from an xml file + // to be localized + static const std::string _INSUFFICIENT_FUNDS = + "NewAgentInventory_InsufficientLindenDollarBalance"; + + + if ( _INSUFFICIENT_FUNDS == error_identifier ) + { + displayCannotUploadReason("You do not have a sufficient L$ balance to complete this upload."); + } + else + { + displayCannotUploadReason("Unknown Error"); + + } + } + + void onTransportError() + { + displayCannotUploadReason( + "The server is experiencing unexpected difficulties."); + } + + void onTransportError(const std::string& error_identifier) + { + // TODO*: Pull these user visible strings from an xml file + // to be localized + + static const std::string _SERVER_ERROR_AFTER_CHARGE = + "NewAgentInventory_ServerErrorAfterCharge"; + + if ( _SERVER_ERROR_AFTER_CHARGE == error_identifier ) + { + displayCannotUploadReason( + "The server is experiencing unexpected difficulties. You may have been charged for the upload."); + } + else + { + displayCannotUploadReason( + "The server is experiencing unexpected difficulties."); + } + + } + + bool uploadConfirmationCallback( + const LLSD& notification, + const LLSD& response, + boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder> responder) + { + S32 option; + std::string confirmation_url; + + option = LLNotification::getSelectedOption( + notification, + response); + + confirmation_url = + notification["payload"]["confirmation_url"].asString(); + + // Yay! We are confirming or cancelling our upload + LLSD body; + + body["confirm_upload"] = false; + + switch(option) + { + case 0: + { + body["confirm_upload"] = true; + body["expected_upload_price"] = + notification["payload"]["expected_upload_price"]; + } + break; + case 1: + default: + break; + } + + LLHTTPClient::post(confirmation_url, body, responder); + + return false; + } + +private: + std::string mFileName; + + LLSD mInventoryData; + LLUUID mVFileID; +}; + +/////////////////////////////////////////////// +// LLNewAgentInventoryVariablePriceResponder // +/////////////////////////////////////////////// +LLNewAgentInventoryVariablePriceResponder::LLNewAgentInventoryVariablePriceResponder( + const LLUUID& vfile_id, + const LLSD& inventory_info) +{ + mImpl = new Impl( + vfile_id, + inventory_info); +} + +LLNewAgentInventoryVariablePriceResponder::LLNewAgentInventoryVariablePriceResponder( + const std::string& file_name, + const LLSD& inventory_info) +{ + mImpl = new Impl( + file_name, + inventory_info); +} + +LLNewAgentInventoryVariablePriceResponder::~LLNewAgentInventoryVariablePriceResponder() +{ + delete mImpl; +} + +void LLNewAgentInventoryVariablePriceResponder::errorWithContent( + U32 statusNum, + const std::string& reason, + const LLSD& content) +{ + llinfos << "LLNewAgentInventoryVariablePrice::error " << statusNum + << " reason: " << reason << llendl; + + if ( content.has("error") ) + { + static const std::string _ERROR = "error"; + static const std::string _IDENTIFIER = "identifier"; + + mImpl->onTransportError(content[_ERROR][_IDENTIFIER].asString()); + } + else + { + mImpl->onTransportError(); + } +} + +void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) +{ + // Parse out application level errors and the appropriate + // responses for them + static const std::string _ERROR = "error"; + static const std::string _IDENTIFIER = "identifier"; + static const std::string _STATE = "state"; + + static const std::string _COMPLETE = "complete"; + static const std::string _COST_ANALYSIS = "cost_analysis"; + static const std::string _NEEDS_CONFIRMATION = "needs_confirmation"; + static const std::string _CANCEL = "cancel"; + + static const std::string _RESOURCE_COST = "resource_cost"; + static const std::string _UPLOAD_PRICE = "upload_price"; + + static const std::string _ANALYZER = "analyzer"; + static const std::string _RSVP = "rsvp"; + + // Check for application level errors + if ( content.has(_ERROR) ) + { + onApplicationLevelError(content[_ERROR][_IDENTIFIER].asString()); + return; + } + + std::string state = content[_STATE]; + LLAssetType::EType asset_type = mImpl->getAssetType(); + + if ( _COST_ANALYSIS == state ) + { + std::string analyzer_url = content[_ANALYZER]; + + if ( mImpl->getFilename().empty() ) + { + // we have no filename, use virtual file ID instead + LLHTTPClient::postFile( + analyzer_url, + mImpl->getVFileID(), + asset_type, + this); + } + else + { + LLHTTPClient::postFile( + analyzer_url, + mImpl->getFilename(), + this); + } + } + else if ( _COMPLETE == state ) + { + // rename file in VFS with new asset id + if (mImpl->getFilename().empty()) + { + // rename the file in the VFS to the actual asset id + // llinfos << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << llendl; + gVFS->renameFile( + mImpl->getVFileID(), + asset_type, + content["new_asset"].asUUID(), + asset_type); + } + + on_new_single_inventory_upload_complete( + asset_type, + mImpl->getInventoryType(), + mImpl->getInventoryTypeString(), + mImpl->getFolderID(), + mImpl->getItemName(), + mImpl->getItemDescription(), + content, + content["upload_price"].asInteger()); + + // TODO* Add bulk (serial) uploading or add + // a super class of this that does so + } + else if ( _NEEDS_CONFIRMATION == state ) + { + showConfirmationDialog( + content[_UPLOAD_PRICE].asInteger(), + content[_RESOURCE_COST].asInteger(), + content[_RSVP].asString()); + } + else if ( _CANCEL == state ) + { + // cancelled, do nothing + } + else + { + onApplicationLevelError(""); + } +} + +void LLNewAgentInventoryVariablePriceResponder::onApplicationLevelError( + const std::string& error_identifier) +{ + mImpl->onApplicationLevelError(error_identifier); +} + +void LLNewAgentInventoryVariablePriceResponder::showConfirmationDialog( + S32 upload_price, + S32 resource_cost, + const std::string& confirmation_url) +{ + if ( 0 == upload_price ) + { + // don't show confirmation dialog for free uploads, I mean, + // they're free! + LLSD body; + body["confirm_upload"] = true; + body["expected_upload_price"] = upload_price; + + LLHTTPClient::post(confirmation_url, body, this); + } + else + { + LLSD substitutions; + LLSD payload; + + substitutions["PRICE"] = upload_price; + + payload["confirmation_url"] = confirmation_url; + payload["expected_upload_price"] = upload_price; + + // The creating of a new instrusive_ptr(this) + // creates a new boost::intrusive_ptr + // which is a copy of this. This code is required because + // 'this' is always of type Class* and not the intrusive_ptr, + // and thus, a reference to 'this' is not registered + // by using just plain 'this'. + + // Since LLNewAgentInventoryVariablePriceResponder is a + // reference counted class, it is possible (since the + // reference to a plain 'this' would be missed here) that, + // when using plain ol' 'this', that this object + // would be deleted before the callback is triggered + // and cause sadness. + LLNotifications::instance().add( + "UploadCostConfirmation", + substitutions, + payload, + boost::bind( + &LLNewAgentInventoryVariablePriceResponder::Impl::uploadConfirmationCallback, + mImpl, + _1, + _2, + boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder>(this))); + } +} diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index a08d70213c..adbf13519b 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -61,17 +61,58 @@ protected: std::string mFileName; }; + +// TODO*: Remove this once deprecated class LLNewAgentInventoryResponder : public LLAssetUploadResponder { public: - LLNewAgentInventoryResponder(const LLSD& post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type); - LLNewAgentInventoryResponder(const LLSD& post_data, const std::string& file_name, - LLAssetType::EType asset_type); + LLNewAgentInventoryResponder( + const LLSD& post_data, + const LLUUID& vfile_id, + LLAssetType::EType asset_type); + LLNewAgentInventoryResponder( + const LLSD& post_data, + const std::string& file_name, + LLAssetType::EType asset_type); virtual void uploadComplete(const LLSD& content); }; +// A base class which goes through and performs some default +// actions for variable price uploads. If more specific actions +// are needed (such as different confirmation messages, etc.) +// the functions onApplicationLevelError and showConfirmationDialog. +class LLNewAgentInventoryVariablePriceResponder : + public LLHTTPClient::Responder +{ +public: + LLNewAgentInventoryVariablePriceResponder( + const LLUUID& vfile_id, + const LLSD& inventory_info); + + LLNewAgentInventoryVariablePriceResponder( + const std::string& file_name, + const LLSD& inventory_info); + + virtual ~LLNewAgentInventoryVariablePriceResponder(); + + void errorWithContent( + U32 statusNum, + const std::string& reason, + const LLSD& content); + void result(const LLSD& content); + + virtual void onApplicationLevelError( + const std::string& error_identifier); + virtual void showConfirmationDialog( + S32 upload_price, + S32 resource_cost, + const std::string& confirmation_url); + +private: + class Impl; + Impl* mImpl; +}; + class LLBakedUploadData; class LLSendTexLayerResponder : public LLAssetUploadResponder { diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 5a10b688da..27c9ab319a 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -314,8 +314,10 @@ private: inline LLFace* LLDrawable::getFace(const S32 i) const { - llassert((U32)i < mFaces.size()); - llassert(mFaces[i]); + if ((U32) i >= mFaces.size()) + { + return NULL; + } return mFaces[i]; } diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index e087feeaec..e74b488be9 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -701,6 +701,18 @@ void LLDrawPoolBump::endBump() gGL.setSceneBlendType(LLRender::BT_ALPHA); } +S32 LLDrawPoolBump::getNumDeferredPasses() +{ + if (gSavedSettings.getBOOL("RenderObjectBump")) + { + return 1; + } + else + { + return 0; + } +} + void LLDrawPoolBump::beginDeferredPass(S32 pass) { if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index bf940cf1e4..2019f1df26 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -79,7 +79,7 @@ public: void renderBump(); void endBump(); - virtual S32 getNumDeferredPasses() { return 1; } + virtual S32 getNumDeferredPasses(); /*virtual*/ void beginDeferredPass(S32 pass); /*virtual*/ void endDeferredPass(S32 pass); /*virtual*/ void renderDeferred(S32 pass); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 4246cbc27f..e49ef8b969 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1040,7 +1040,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (full_rebuild) { mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex); - for (U16 i = 0; i < num_indices; i++) + for (S32 i = 0; i < num_indices; i++) { *indicesp++ = vf.mIndices[i] + index_offset; } diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 028e1cc098..e12db901bd 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -61,6 +61,7 @@ LLFilePicker LLFilePicker::sInstance; #define XML_FILTER L"XML files (*.xml)\0*.xml\0" #define SLOBJECT_FILTER L"Objects (*.slobject)\0*.slobject\0" #define RAW_FILTER L"RAW files (*.raw)\0*.raw\0" +#define MODEL_FILTER L"Model files (*.dae)\0*.dae\0" #endif // @@ -193,6 +194,10 @@ BOOL LLFilePicker::setupFilter(ELoadFilter filter) mOFN.lpstrFilter = RAW_FILTER \ L"\0"; break; + case FFLOAD_MODEL: + mOFN.lpstrFilter = MODEL_FILTER \ + L"\0"; + break; default: res = FALSE; break; diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index ab2455620f..7600922e9c 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -93,6 +93,7 @@ public: FFLOAD_XML = 6, FFLOAD_SLOBJECT = 7, FFLOAD_RAW = 8, + FFLOAD_MODEL = 9, }; enum ESaveFilter @@ -198,4 +199,6 @@ public: ~LLFilePicker(); }; +const std::string upload_pick(void* data); + #endif diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp index c890f9f122..364c79e3c1 100644 --- a/indra/newview/llfloaterinventory.cpp +++ b/indra/newview/llfloaterinventory.cpp @@ -1143,6 +1143,9 @@ const std::string& get_item_icon_name(LLAssetType::EType asset_type, case LLAssetType::AT_LINK_FOLDER: idx = LINKFOLDER_ICON_NAME; break; + case LLAssetType::AT_MESH: + idx = MESH_ICON_NAME; + break; default: break; } diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 55019f91f8..58637329d7 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -567,6 +567,18 @@ void LLHUDText::setStringUTF8(const std::string &wtext) setString(utf8str_to_wstring(wtext)); } +std::string LLHUDText::getString() +{ + std::ostringstream ostr; + for (U32 i = 0; i < mTextSegments.size(); ++i) + { + const std::string str = wstring_to_utf8str(mTextSegments[i].getText()); + ostr << str; + } + + return ostr.str(); +} + void LLHUDText::setString(const LLWString &wtext) { mTextSegments.clear(); diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index dc14a8c764..4787a15eaf 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -90,6 +90,7 @@ public: public: void setStringUTF8(const std::string &utf8string); + std::string getString(); void setString(const LLWString &wstring); void clearString(); void addLine(const std::string &text, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ca9ebf8dc1..028505456b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -154,7 +154,9 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Gesture", "inv_item_linkitem.tga", - "inv_item_linkfolder.tga" + "inv_item_linkfolder.tga", + + "inv_item_mesh.tga" }; @@ -891,6 +893,14 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, // Only should happen for broken links. new_listener = new LLLinkItemBridge(inventory, uuid); break; + case LLAssetType::AT_MESH: + if(!(inv_type == LLInventoryType::IT_MESH)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLMeshBridge(inventory, uuid); + break; + default: llinfos << "Unhandled asset type (llassetstorage.h): " << (S32)asset_type << llendl; @@ -2189,6 +2199,9 @@ LLUIImagePtr LLFolderBridge::getIcon(LLAssetType::EType preferred_type) { // we only have one folder image now return LLUI::getUIImage("Inv_FolderClosed"); + /*case LLAssetType::AT_MESH: + control = "inv_folder_mesh.tga"; + break;*/ } BOOL LLFolderBridge::renameItem(const std::string& new_name) @@ -2558,6 +2571,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_ANIMATION: case DAD_GESTURE: case DAD_LINK: + case DAD_MESH: accept = dragItemIntoFolder((LLInventoryItem*)cargo_data, drop); break; @@ -3457,6 +3471,7 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: + case DAD_MESH: { LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; const LLPermissions& perm = inv_item->getPermissions(); @@ -4713,6 +4728,65 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, delete on_remove_struct; } + +// +=================================================+ +// | LLMeshBridge | +// +=================================================+ + +LLUIImagePtr LLMeshBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE); +} + +void LLMeshBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + // open mesh + } +} + +void LLMeshBridge::previewItem() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + // preview mesh + } +} + + +void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLMeshBridge::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + } + + + hideContextEntries(menu, items, disabled_items); +} + + + LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type, const LLUUID& uuid,LLInventoryModel* model) { @@ -4761,6 +4835,12 @@ LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_ break; + case LLAssetType::AT_MESH: + action = new LLMeshBridgeAction(uuid,model); + break; + + + default: break; } @@ -4998,6 +5078,18 @@ void LLWearableBridgeAction::doIt() LLInvFVBridgeAction::doIt(); } +//virtual +void LLMeshBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + // do it + } + + LLInvFVBridgeAction::doIt(); +} + // +=================================================+ // | LLLinkItemBridge | // +=================================================+ diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 6b2a2d32de..95a5f97e7b 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -79,6 +79,8 @@ enum EInventoryIcon LINKITEM_ICON_NAME, LINKFOLDER_ICON_NAME, + + MESH_ICON_NAME, ICON_NAME_COUNT }; @@ -609,7 +611,6 @@ protected: static std::string sPrefix; }; - class LLLinkFolderBridge : public LLItemBridge { friend class LLInvFVBridge; @@ -630,6 +631,25 @@ protected: static std::string sPrefix; }; + + +class LLMeshBridge : public LLItemBridge +{ + friend class LLInvFVBridge; +public: + virtual LLUIImagePtr getIcon() const; + virtual void openItem(); + virtual void previewItem(); + virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + +protected: + LLMeshBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : + LLItemBridge(inventory, uuid) {} +}; + + + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInvFVBridgeAction (& its derived classes) // @@ -790,6 +810,19 @@ protected: }; +class LLMeshBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLMeshBridgeAction(){} +protected: + LLMeshBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + + void wear_inventory_item_on_avatar(LLInventoryItem* item); class LLViewerJointAttachment; diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 0ce85818dd..a824025723 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -157,6 +157,7 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, case DAD_ANIMATION: case DAD_GESTURE: case DAD_CALLINGCARD: + case DAD_MESH: { LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; if(gInventory.getItem(inv_item->getUUID()) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index a7f0ce16d3..a5e3a0492b 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -173,7 +173,6 @@ LLObjectSelection *get_null_object_selection() return sNullSelection; } - //----------------------------------------------------------------------------- // LLSelectMgr() //----------------------------------------------------------------------------- @@ -5301,6 +5300,78 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) return (mPermissions->allowOperationBy(op, proxy_agent_id, group_id)); } +void LLSelectNode::renderOneWireframe(const LLColor4& color) +{ + LLViewerObject* objectp = getObject(); + if (!objectp) + { + return; + } + + LLDrawable* drawable = objectp->mDrawable; + if(!drawable) + { + return; + } + + glMatrixMode(GL_MODELVIEW); + gGL.pushMatrix(); + + BOOL is_hud_object = objectp->isHUDAttachment(); + + if (!is_hud_object) + { + glLoadIdentity(); + glMultMatrixd(gGLModelView); + } + + if (drawable->isActive()) + { + glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix); + } + + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + + if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) + { + gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); + LLGLEnable fog(GL_FOG); + glFogi(GL_FOG_MODE, GL_LINEAR); + float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); + LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgent.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); + glFogf(GL_FOG_START, d); + glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); + glFogfv(GL_FOG_COLOR, fogCol.mV); + + LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + { + glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + for (S32 i = 0; i < drawable->getNumFaces(); ++i) + { + LLFace* face = drawable->getFace(i); + pushVerts(face, LLVertexBuffer::MAP_VERTEX); + } + } + } + + gGL.flush(); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + LLGLEnable offset(GL_POLYGON_OFFSET_LINE); + glPolygonOffset(3.f, 2.f); + glLineWidth(3.f); + for (S32 i = 0; i < drawable->getNumFaces(); ++i) + { + LLFace* face = drawable->getFace(i); + pushVerts(face, LLVertexBuffer::MAP_VERTEX); + } + glLineWidth(1.f); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + gGL.popMatrix(); +} + //----------------------------------------------------------------------------- // renderOneSilhouette() //----------------------------------------------------------------------------- @@ -5318,6 +5389,13 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) return; } + LLVOVolume* vobj = drawable->getVOVolume(); + if (vobj && vobj->isMesh()) + { + renderOneWireframe(color); + return; + } + if (!mSilhouetteExists) { return; diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 6e757ef976..b518765946 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -140,6 +140,7 @@ public: BOOL isTESelected(S32 te_index); S32 getLastSelectedTE(); S32 getTESelectMask() { return mTESelectMask; } + void renderOneWireframe(const LLColor4& color); void renderOneSilhouette(const LLColor4 &color); void setTransient(BOOL transient) { mTransient = transient; } BOOL isTransient() { return mTransient; } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 9f317803ce..9704fe71b7 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2294,7 +2294,6 @@ void pushVerts(LLFace* face, U32 mask) U16 offset = face->getIndicesStart(); buffer->drawRange(LLRender::TRIANGLES, start, end, count, offset); } - } void pushBufferVerts(LLVertexBuffer* buffer, U32 mask) diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 64c2a9acbc..1d9127639a 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -59,6 +59,7 @@ class LLTextureAtlasSlot; S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad); S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &radius_squared); +void pushVerts(LLFace* face, U32 mask); // get index buffer for binary encoded axis vertex buffer given a box at center being viewed by given camera U8* get_box_fan_indices(LLCamera* camera, const LLVector3& center); diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index b5aec1b80b..ae4ec75a1b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -289,7 +289,7 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop( { BOOL handled = FALSE; - if (cargo_type == DAD_TEXTURE) + if ((cargo_type == DAD_TEXTURE) || (cargo_type == DAD_MESH)) { LLInventoryItem *item = (LLInventoryItem *)cargo_data; @@ -1152,7 +1152,9 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, // returns true, then the cast was valid, and we can perform // the third test without problems. LLInventoryItem* item = (LLInventoryItem*)cargo_data; - if (getEnabled() && (cargo_type == DAD_TEXTURE) && allowDrop(item)) + if (getEnabled() && + ((cargo_type == DAD_TEXTURE) || (cargo_type == DAD_MESH)) && + allowDrop(item)) { if (drop) { diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 9a63f07a7e..643a81be1f 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -483,6 +483,16 @@ LLToolDragAndDrop::dragOrDrop3dImpl LLToolDragAndDrop::sDragAndDrop3d[DAD_COUNT] &LLToolDragAndDrop::dad3dNULL, // Dest: DT_OBJECT &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND }, + + +// Source: DAD_MESH + { + &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE + &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF + &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR + &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT + &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND + }, }; LLToolDragAndDrop::LLToolDragAndDrop() @@ -2007,6 +2017,7 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ case DAD_ANIMATION: case DAD_GESTURE: case DAD_CALLINGCARD: + case DAD_MESH: { LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; if(gInventory.getItem(inv_item->getUUID()) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index a6a72e9666..3b727e2861 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -869,12 +869,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } } - /// We copy the frame buffer straight into a texture here, - /// and then display it again with compositor effects. - /// Using render to texture would be faster/better, but I don't have a - /// grasp of their full display stack just yet. - // gPostProcess->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { gPipeline.renderDeferredLighting(); @@ -1097,7 +1091,7 @@ void render_ui(F32 zoom_factor, int subfield) { gPipeline.renderBloom(gSnapshot, zoom_factor, subfield); } - + render_hud_elements(); render_hud_attachments(); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index dace3f875f..7c5f5e8b2f 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -122,6 +122,8 @@ #include "llpreviewsound.h" #include "llpreviewtexture.h" #include "llsyswellwindow.h" +#include "llfloatermodelpreview.h" + // *NOTE: Please add files in alphabetical order to keep merges easy. @@ -236,7 +238,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAnimPreview>, "upload"); LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImagePreview>, "upload"); LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload"); - + LLFloaterReg::add("upload_model", "floater_model_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelPreview>, "upload"); LLFloaterReg::add("voice_call", "floater_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCall>); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index dc291d6c34..56f70e0f5d 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -268,7 +268,6 @@ LLMenuItemCallGL* gBusyMenu = NULL; // Local prototypes // File Menu -const char* upload_pick(void* data); void handle_compress_image(void*); @@ -557,6 +556,7 @@ void init_menus() gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost); + gMenuHolder->childSetLabelArg("Upload Model", "[COST]", upload_cost); gAFKMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Away", TRUE); gBusyMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Busy", TRUE); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index d3a9e1cef8..836ac79a87 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -39,6 +39,7 @@ #include "llfilepicker.h" #include "llfloaterreg.h" #include "llfloaterbuycurrency.h" +#include "llfloatermodelpreview.h" #include "llfloatersnapshot.h" #include "llinventorymodel.h" // gInventory #include "llresourcedata.h" @@ -62,6 +63,7 @@ #include "lleconomy.h" #include "llhttpclient.h" #include "llsdserialize.h" +#include "llsdutil.h" #include "llstring.h" #include "lltransactiontypes.h" #include "lluuid.h" @@ -101,6 +103,7 @@ static std::string XML_EXTENSIONS = "xml"; static std::string SLOBJECT_EXTENSIONS = "slobject"; #endif static std::string ALL_FILE_EXTENSIONS = "*.*"; +static std::string MODEL_EXTENSIONS = "dae"; std::string build_extensions_string(LLFilePicker::ELoadFilter filter) { @@ -115,6 +118,8 @@ std::string build_extensions_string(LLFilePicker::ELoadFilter filter) return ANIM_EXTENSIONS; case LLFilePicker::FFLOAD_SLOBJECT: return SLOBJECT_EXTENSIONS; + case LLFilePicker::FFLOAD_MODEL: + return MODEL_EXTENSIONS; #ifdef _CORY_TESTING case LLFilePicker::FFLOAD_GEOMETRY: return GEOMETRY_EXTENSIONS; @@ -258,6 +263,16 @@ class LLFileUploadImage : public view_listener_t } }; +class LLFileUploadModel : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterReg::showInstance("upload_model"); + + return TRUE; + } +}; + class LLFileUploadSound : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -319,10 +334,21 @@ class LLFileUploadBulk : public view_listener_t LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); void *userdata = NULL; - upload_new_resource(filename, asset_name, asset_name, 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE, - LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(), - display_name, - callback, expected_upload_cost, userdata); + + upload_new_resource( + filename, + asset_name, + asset_name, + 0, + LLAssetType::AT_NONE, + LLInventoryType::IT_NONE, + LLFloaterPerms::getNextOwnerPerms(), + LLFloaterPerms::getGroupPerms(), + LLFloaterPerms::getEveryonePerms(), + display_name, + callback, + expected_upload_cost, + userdata); // *NOTE: Ew, we don't iterate over the file list here, // we handle the next files in upload_done_callback() @@ -491,17 +517,20 @@ void handle_compress_image(void*) } } -void upload_new_resource(const std::string& src_filename, std::string name, - std::string desc, S32 compression_info, - LLAssetType::EType destination_folder_type, - LLInventoryType::EType inv_type, - U32 next_owner_perms, - U32 group_perms, - U32 everyone_perms, - const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - S32 expected_upload_cost, - void *userdata) +void upload_new_resource( + const std::string& src_filename, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + S32 expected_upload_cost, + void *userdata) { // Generate the temporary UUID. std::string filename = gDirUtilp->getTempFilename(); @@ -783,9 +812,21 @@ void upload_new_resource(const std::string& src_filename, std::string name, { t_disp_name = src_filename; } - upload_new_resource(tid, asset_type, name, desc, compression_info, // tid - destination_folder_type, inv_type, next_owner_perms, group_perms, everyone_perms, - display_name, callback, expected_upload_cost, userdata); + upload_new_resource( + tid, + asset_type, + name, + desc, + compression_info, // tid + destination_folder_type, + inv_type, + next_owner_perms, + group_perms, + everyone_perms, + display_name, + callback, + expected_upload_cost, + userdata); } else { @@ -801,7 +842,11 @@ void upload_new_resource(const std::string& src_filename, std::string name, } } -void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed) +void upload_done_callback( + const LLUUID& uuid, + void* user_data, + S32 result, + LLExtStat ext_status) // StoreAssetData callback (fixed) { LLResourceData* data = (LLResourceData*)user_data; S32 expected_upload_cost = data ? data->mExpectedUploadCost : 0; @@ -902,71 +947,134 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt std::string display_name = LLStringUtil::null; LLAssetStorage::LLStoreAssetCallback callback = NULL; void *userdata = NULL; - upload_new_resource(next_file, asset_name, asset_name, // file - 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE, - PERM_NONE, PERM_NONE, PERM_NONE, - display_name, - callback, - expected_upload_cost, // assuming next in a group of uploads is of roughly the same type, i.e. same upload cost - userdata); + upload_new_resource( + next_file, + asset_name, + asset_name, // file + 0, + LLAssetType::AT_NONE, + LLInventoryType::IT_NONE, + PERM_NONE, + PERM_NONE, + PERM_NONE, + display_name, + callback, + expected_upload_cost, // assuming next in a group of uploads is of roughly the same type, i.e. same upload cost + userdata); } } -void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type, - std::string name, - std::string desc, S32 compression_info, - LLAssetType::EType destination_folder_type, - LLInventoryType::EType inv_type, - U32 next_owner_perms, - U32 group_perms, - U32 everyone_perms, - const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - S32 expected_upload_cost, - void *userdata) +LLAssetID upload_new_resource_prep( + const LLTransactionID &tid, + LLAssetType::EType asset_type, + LLInventoryType::EType& inventory_type, + std::string& name, + const std::string& display_name, + std::string& description) { - if(gDisconnected) + if ( gDisconnected ) { - return ; + LLAssetID rv; + + rv.setNull(); + return rv; } LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); - if( LLAssetType::AT_SOUND == asset_type ) + if ( LLAssetType::AT_SOUND == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } - else - if( LLAssetType::AT_TEXTURE == asset_type ) + else if ( LLAssetType::AT_TEXTURE == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } - else - if( LLAssetType::AT_ANIMATION == asset_type) + else if ( LLAssetType::AT_ANIMATION == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } - if(LLInventoryType::IT_NONE == inv_type) + if ( LLInventoryType::IT_NONE == inventory_type ) { - inv_type = LLInventoryType::defaultForAssetType(asset_type); + inventory_type = LLInventoryType::defaultForAssetType(asset_type); } LLStringUtil::stripNonprintable(name); - LLStringUtil::stripNonprintable(desc); - if(name.empty()) + LLStringUtil::stripNonprintable(description); + + if ( name.empty() ) { name = "(No Name)"; } - if(desc.empty()) + if ( description.empty() ) { - desc = "(No Description)"; + description = "(No Description)"; } - + // At this point, we're ready for the upload. std::string upload_message = "Uploading...\n\n"; upload_message.append(display_name); LLUploadDialog::modalUploadDialog(upload_message); + return uuid; +} + +LLSD generate_new_resource_upload_capability_body( + LLAssetType::EType asset_type, + const std::string& name, + const std::string& desc, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms) +{ + LLSD body; + + body["folder_id"] = gInventory.findCategoryUUIDForType( + (destination_folder_type == LLAssetType::AT_NONE) ? + asset_type : + destination_folder_type); + + body["asset_type"] = LLAssetType::lookup(asset_type); + body["inventory_type"] = LLInventoryType::lookup(inv_type); + body["name"] = name; + body["description"] = desc; + body["next_owner_mask"] = LLSD::Integer(next_owner_perms); + body["group_mask"] = LLSD::Integer(group_perms); + body["everyone_mask"] = LLSD::Integer(everyone_perms); + + return body; +} + +void upload_new_resource( + const LLTransactionID &tid, + LLAssetType::EType asset_type, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + S32 expected_upload_cost, + void *userdata) +{ + LLAssetID uuid = + upload_new_resource_prep( + tid, + asset_type, + inv_type, + name, + display_name, + desc); + llinfos << "*** Uploading: " << llendl; llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl; llinfos << "UUID: " << uuid << llendl; @@ -975,26 +1083,32 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty llinfos << "Expected Upload Cost: " << expected_upload_cost << llendl; lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type) << llendl; lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; - std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory"); - if (!url.empty()) + + std::string url = gAgent.getRegion()->getCapability( + "NewFileAgentInventory"); + + if ( !url.empty() ) { llinfos << "New Agent Inventory via capability" << llendl; - LLSD body; - body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type); - body["asset_type"] = LLAssetType::lookup(asset_type); - body["inventory_type"] = LLInventoryType::lookup(inv_type); - body["name"] = name; - body["description"] = desc; - body["next_owner_mask"] = LLSD::Integer(next_owner_perms); - body["group_mask"] = LLSD::Integer(group_perms); - body["everyone_mask"] = LLSD::Integer(everyone_perms); - body["expected_upload_cost"] = LLSD::Integer(expected_upload_cost); - - //std::ostringstream llsdxml; - //LLSDSerialize::toPrettyXML(body, llsdxml); - //llinfos << "posting body to capability: " << llsdxml.str() << llendl; - LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type)); + LLSD body; + body = generate_new_resource_upload_capability_body( + asset_type, + name, + desc, + destination_folder_type, + inv_type, + next_owner_perms, + group_perms, + everyone_perms); + + LLHTTPClient::post( + url, + body, + new LLNewAgentInventoryResponder( + body, + uuid, + asset_type)); } else { @@ -1039,11 +1153,83 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty } } +BOOL upload_new_variable_cost_resource( + const LLTransactionID &tid, + LLAssetType::EType asset_type, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + void *userdata) +{ + LLAssetID uuid = + upload_new_resource_prep( + tid, + asset_type, + inv_type, + name, + display_name, + desc); + + llinfos << "*** Uploading: " << llendl; + llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl; + llinfos << "UUID: " << uuid << llendl; + llinfos << "Name: " << name << llendl; + llinfos << "Desc: " << desc << llendl; + lldebugs << "Folder: " + << gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type) << llendl; + lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; + + std::string url = gAgent.getRegion()->getCapability( + "NewFileAgentInventoryVariablePrice"); + + if ( !url.empty() ) + { + llinfos << "New Agent Inventory variable price upload" + << llendl; + + // Each of the two capabilities has similar data, so + // let's reuse that code + + LLSD body; + + body = generate_new_resource_upload_capability_body( + asset_type, + name, + desc, + destination_folder_type, + inv_type, + next_owner_perms, + group_perms, + everyone_perms); + + LLHTTPClient::post( + url, + body, + new LLNewAgentInventoryVariablePriceResponder( + uuid, + body)); + + return TRUE; + } + else + { + return FALSE; + } +} + void init_menu_file() { view_listener_t::addCommit(new LLFileUploadImage(), "File.UploadImage"); view_listener_t::addCommit(new LLFileUploadSound(), "File.UploadSound"); view_listener_t::addCommit(new LLFileUploadAnim(), "File.UploadAnim"); + view_listener_t::addCommit(new LLFileUploadModel(), "File.UploadModel"); view_listener_t::addCommit(new LLFileUploadBulk(), "File.UploadBulk"); view_listener_t::addCommit(new LLFileCloseWindow(), "File.CloseWindow"); view_listener_t::addCommit(new LLFileCloseAllWindows(), "File.CloseAllWindows"); diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index bf21292082..b51192b499 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -41,33 +41,56 @@ class LLTransactionID; void init_menu_file(); -void upload_new_resource(const std::string& src_filename, - std::string name, - std::string desc, - S32 compression_info, - LLAssetType::EType destination_folder_type, - LLInventoryType::EType inv_type, - U32 next_owner_perms, - U32 group_perms, - U32 everyone_perms, - const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - S32 expected_upload_cost, - void *userdata); +void upload_new_resource( + const std::string& src_filename, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + S32 expected_upload_cost, + void *userdata); + +void upload_new_resource( + const LLTransactionID &tid, + LLAssetType::EType type, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + S32 expected_upload_cost, + void *userdata); + +// TODO* : Move all uploads to use this new function +// since at some point, that upload path will be deprecated and no longer +// used + +// We make a new function here to ensure that previous code is not broken +BOOL upload_new_variable_cost_resource( + const LLTransactionID &tid, + LLAssetType::EType type, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + void *userdata); -void upload_new_resource(const LLTransactionID &tid, - LLAssetType::EType type, - std::string name, - std::string desc, - S32 compression_info, - LLAssetType::EType destination_folder_type, - LLInventoryType::EType inv_type, - U32 next_owner_perms, - U32 group_perms, - U32 everyone_perms, - const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - S32 expected_upload_cost, - void *userdata); #endif diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 791ec07349..f16465acba 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4530,6 +4530,7 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost)); gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost)); + gMenuHolder->childSetLabelArg("Upload Model", "[COST]", llformat("%d", upload_cost)); gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", llformat("%d", upload_cost)); gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", llformat("%d", upload_cost)); } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7ea55b49e8..986264ad34 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1437,6 +1437,8 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("MapLayer"); capabilityNames.append("MapLayerGod"); capabilityNames.append("NewFileAgentInventory"); + capabilityNames.append("NewFileAgentInventoryVariablePrice"); + capabilityNames.append("ObjectAdd"); capabilityNames.append("ParcelPropertiesUpdate"); capabilityNames.append("ParcelMediaURLFilterList"); capabilityNames.append("ParcelNavigateMedia"); diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 65994dfb30..ed8d820844 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -477,6 +477,7 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; //TODO need img_name case LLAssetType::AT_FAVORITE: img_name = "Inv_Landmark"; break; + case LLAssetType::AT_MESH: img_name = "inv_item_mesh.tga"; break; default: llassert(0); } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a0ab4cb1e6..32baa29afb 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -583,7 +583,7 @@ BOOL LLViewerTexture::createGLTexture(S32 discard_level, const LLImageRaw* image llassert_always(mGLTexturep.notNull()) ; BOOL ret = mGLTexturep->createGLTexture(discard_level, imageraw, usename) ; - + if(ret) { mFullWidth = mGLTexturep->getCurrentWidth() ; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5f95e9ccf1..72e40e3030 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3733,140 +3733,6 @@ void LLViewerWindow::playSnapshotAnimAndSound() BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) { return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, do_rebuild, type); - - // *TODO below code was broken in deferred pipeline - /* - if ((!raw) || preview_width < 10 || preview_height < 10) - { - return FALSE; - } - - if(gResizeScreenTexture) //the window is resizing - { - return FALSE ; - } - - setCursor(UI_CURSOR_WAIT); - - // Hide all the UI widgets first and draw a frame - BOOL prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI); - - if ( prev_draw_ui != show_ui) - { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); - } - - BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && LLPipeline::sShowHUDAttachments; - if (hide_hud) - { - LLPipeline::sShowHUDAttachments = FALSE; - } - - S32 render_name = gSavedSettings.getS32("RenderName"); - gSavedSettings.setS32("RenderName", 0); - LLVOAvatar::updateFreezeCounter(1) ; //pause avatar updating for one frame - - S32 w = preview_width ; - S32 h = preview_height ; - LLVector2 display_scale = mDisplayScale ; - mDisplayScale.setVec((F32)w / mWindowRect.getWidth(), (F32)h / mWindowRect.getHeight()) ; - LLRect window_rect = mWindowRect; - mWindowRect.set(0, h, w, 0); - - gDisplaySwapBuffers = FALSE; - gDepthDirty = TRUE; - glClearColor(0.f, 0.f, 0.f, 0.f); - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - setup3DRender(); - - LLFontGL::setFontDisplay(FALSE) ; - LLHUDText::setDisplayText(FALSE) ; - if (type == SNAPSHOT_TYPE_OBJECT_ID) - { - gObjectList.renderPickList(gViewerWindow->getVirtualWindowRect(), FALSE, FALSE); - } - else - { - display(do_rebuild, 1.0f, 0, TRUE); - render_ui(); - } - - S32 glformat, gltype, glpixel_length ; - if(SNAPSHOT_TYPE_DEPTH == type) - { - glpixel_length = 4 ; - glformat = GL_DEPTH_COMPONENT ; - gltype = GL_FLOAT ; - } - else - { - glpixel_length = 3 ; - glformat = GL_RGB ; - gltype = GL_UNSIGNED_BYTE ; - } - - raw->resize(w, h, glpixel_length); - glReadPixels(0, 0, w, h, glformat, gltype, raw->getData()); - - if(SNAPSHOT_TYPE_DEPTH == type) - { - LLViewerCamera* camerap = LLViewerCamera::getInstance(); - F32 depth_conversion_factor_1 = (camerap->getFar() + camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); - F32 depth_conversion_factor_2 = (camerap->getFar() - camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); - - //calculate the depth - for (S32 y = 0 ; y < h ; y++) - { - for(S32 x = 0 ; x < w ; x++) - { - S32 i = (w * y + x) << 2 ; - - F32 depth_float_i = *(F32*)(raw->getData() + i); - - F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float_i * depth_conversion_factor_2)); - U8 depth_byte = F32_to_U8(linear_depth_float, camerap->getNear(), camerap->getFar()); - *(raw->getData() + i + 0) = depth_byte; - *(raw->getData() + i + 1) = depth_byte; - *(raw->getData() + i + 2) = depth_byte; - *(raw->getData() + i + 3) = 255; - } - } - } - - LLFontGL::setFontDisplay(TRUE) ; - LLHUDText::setDisplayText(TRUE) ; - mDisplayScale.setVec(display_scale) ; - mWindowRect = window_rect; - setup3DRender(); - gDisplaySwapBuffers = FALSE; - gDepthDirty = TRUE; - - // POST SNAPSHOT - if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) - { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); - } - - if (hide_hud) - { - LLPipeline::sShowHUDAttachments = TRUE; - } - - setCursor(UI_CURSOR_ARROW); - - if (do_rebuild) - { - // If we had to do a rebuild, that means that the lists of drawables to be rendered - // was empty before we started. - // Need to reset these, otherwise we call state sort on it again when render gets called the next time - // and we stand a good chance of crashing on rebuild because the render drawable arrays have multiple copies of - // objects on them. - gPipeline.resetDrawOrders(); - } - - gSavedSettings.setS32("RenderName", render_name); - - return TRUE;*/ } // Saves the image from the screen to the specified filename and path. diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 583246c23e..ef3244b199 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -36,6 +36,8 @@ #include "llvovolume.h" +#include <sstream> + #include "llviewercontrol.h" #include "lldir.h" #include "llflexibleobject.h" @@ -61,6 +63,7 @@ #include "llsky.h" #include "llviewercamera.h" #include "llviewertexturelist.h" +#include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewertextureanim.h" #include "llworld.h" @@ -90,6 +93,12 @@ LLPointer<LLObjectMediaNavigateClient> LLVOVolume::sObjectMediaNavigateClient = static LLFastTimer::DeclareTimer FTM_GEN_TRIANGLES("Generate Triangles"); static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes"); +static LLFastTimer::DeclareTimer FTM_BUILD_MESH("Mesh"); +static LLFastTimer::DeclareTimer FTM_MESH_VFS("VFS"); +static LLFastTimer::DeclareTimer FTM_MESH_STREAM("Stream"); +static LLFastTimer::DeclareTimer FTM_MESH_FACES("Faces"); +static LLFastTimer::DeclareTimer FTM_VOLUME_TEXTURES("Volume Textures"); + LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLViewerObject(id, pcode, regionp), @@ -513,6 +522,7 @@ void LLVOVolume::updateTextures(LLAgent &agent) void LLVOVolume::updateTextures() { + LLFastTimer ftm(FTM_VOLUME_TEXTURES); // Update the pixel area of all faces if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SIMPLE)) @@ -599,36 +609,60 @@ void LLVOVolume::updateTextures() if (isSculpted()) { LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); - LLUUID id = sculpt_params->getSculptTexture(); - mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, TRUE, FALSE, LLViewerTexture::LOD_TEXTURE); - if (mSculptTexture.notNull()) - { - S32 lod = llmin(mLOD, 3); - F32 lodf = ((F32)(lod + 1.0f)/4.f); - F32 tex_size = lodf * MAX_SCULPT_REZ; - mSculptTexture->addTextureStats(2.f * tex_size * tex_size); - mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(), - (S32)LLViewerTexture::BOOST_SCULPTED)); - mSculptTexture->setForSculpt() ; - } - - S32 texture_discard = mSculptTexture->getDiscardLevel(); //try to match the texture - S32 current_discard = mSculptLevel; + LLUUID id = sculpt_params->getSculptTexture(); + U8 sculpt_type = sculpt_params->getSculptType(); - if (texture_discard >= 0 && //texture has some data available - (texture_discard < current_discard || //texture has more data than last rebuild - current_discard < 0)) //no previous rebuild + if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) + // mesh is a mesh { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE); - mSculptChanged = TRUE; + if (mSculptLevel == -2) + { + // get the asset please + gPipeline.loadMesh(this, id); + /*gAssetStorage->getAssetData(id, LLAssetType::AT_MESH, (LLGetAssetCallback)NULL, NULL, TRUE); + + if (gAssetStorage->hasLocalAsset(id, LLAssetType::AT_MESH)) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE); + mSculptChanged = TRUE; + }*/ + } } - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SCULPTED)) + else + // mesh is a sculptie + { + mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, TRUE, FALSE, LLViewerTexture::LOD_TEXTURE); + + if (mSculptTexture.notNull()) + { + S32 lod = llmin(mLOD, 3); + F32 lodf = ((F32)(lod + 1.0f)/4.f); + F32 tex_size = lodf * MAX_SCULPT_REZ; + mSculptTexture->addTextureStats(2.f * tex_size * tex_size); + mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(), + (S32)LLViewerTexture::BOOST_SCULPTED)); + mSculptTexture->setForSculpt() ; + } + + S32 texture_discard = mSculptTexture->getDiscardLevel(); //try to match the texture + S32 current_discard = mSculptLevel; + + if (texture_discard >= 0 && //texture has some data available + (texture_discard < current_discard || //texture has more data than last rebuild + current_discard < 0)) //no previous rebuild + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE); + mSculptChanged = TRUE; + } + + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SCULPTED)) { setDebugText(llformat("T%d C%d V%d\n%dx%d", texture_discard, current_discard, getVolume()->getSculptLevel(), mSculptTexture->getHeight(), mSculptTexture->getWidth())); } + } } if (getLightTextureID().notNull()) @@ -771,8 +805,10 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline) } -BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume) +BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool unique_volume) { + LLVolumeParams volume_params = params; + // Check if we need to change implementations bool is_flexible = (volume_params.getPathParams().getCurveType() == LL_PCODE_PATH_FLEXIBLE); if (is_flexible) @@ -811,21 +847,39 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail if (isSculpted()) { - mSculptTexture = LLViewerTextureManager::getFetchedTexture(volume_params.getSculptID(), TRUE, FALSE, LLViewerTexture::LOD_TEXTURE); - if (mSculptTexture.notNull()) + // if it's a mesh + if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) { - //ignore sculpt GL usage since bao fixed this in a separate branch - if (!gGLActive) + if (getVolume()->getNumVolumeFaces() == 0) { - gGLActive = TRUE; - sculpt(); - gGLActive = FALSE; + //mesh is not loaded, request pipeline load this mesh + LLUUID asset_id = volume_params.getSculptID(); + gPipeline.loadMesh(this, asset_id); } else { - sculpt(); + mSculptLevel = 1; + } + } + else // otherwise is sculptie + { + mSculptTexture = LLViewerTextureManager::getFetchedTexture(volume_params.getSculptID(), TRUE, FALSE, LLViewerTexture::LOD_TEXTURE); + + if (mSculptTexture.notNull()) + { + //ignore sculpt GL usage since bao fixed this in a separate branch + if (!gGLActive) + { + gGLActive = TRUE; + sculpt(); + gGLActive = FALSE; + } + else + { + sculpt(); + } + mSculptLevel = getVolume()->getSculptLevel(); } - mSculptLevel = getVolume()->getSculptLevel(); } } else @@ -838,6 +892,14 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail return FALSE; } + + +void LLVOVolume::notifyMeshLoaded() +{ + mSculptChanged = TRUE; + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY); +} + // sculpt replaces generate() for sculpted surfaces void LLVOVolume::sculpt() { @@ -1039,6 +1101,11 @@ void LLVOVolume::updateFaceFlags() for (S32 i = 0; i < getVolume()->getNumFaces(); i++) { LLFace *face = mDrawable->getFace(i); + if (!face) + { + return; + } + BOOL fullbright = getTE(i)->getFullbright(); face->clearState(LLFace::FULLBRIGHT | LLFace::HUD_RENDER | LLFace::LIGHT); @@ -1111,6 +1178,10 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global) for (S32 i = 0; i < getVolume()->getNumFaces(); i++) { LLFace *face = mDrawable->getFace(i); + if (!face) + { + continue; + } res &= face->genVolumeBBoxes(*getVolume(), i, mRelativeXform, mRelativeXformInvTrans, (mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global); @@ -2218,6 +2289,23 @@ BOOL LLVOVolume::isSculpted() const return FALSE; } +BOOL LLVOVolume::isMesh() const +{ + if (isSculpted()) + { + LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); + U8 sculpt_type = sculpt_params->getSculptType(); + + if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) + // mesh is a mesh + { + return TRUE; + } + } + + return FALSE; +} + BOOL LLVOVolume::hasLightTexture() const { if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) @@ -2423,6 +2511,30 @@ F32 LLVOVolume::getBinRadius() { F32 radius; + F32 scale = 1.f; + + if (isSculpted()) + { + LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLUUID id = sculpt_params->getSculptTexture(); + U8 sculpt_type = sculpt_params->getSculptType(); + + if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) + // mesh is a mesh + { + LLVolume* volume = getVolume(); + U32 vert_count = 0; + + for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) + { + const LLVolumeFace& face = volume->getVolumeFace(i); + vert_count += face.mVertices.size(); + } + + scale = 1.f/llmax(vert_count/1024.f, 1.f); + } + } + const LLVector3* ext = mDrawable->getSpatialExtents(); BOOL shrink_wrap = mDrawable->isAnimating(); @@ -2481,7 +2593,7 @@ F32 LLVOVolume::getBinRadius() radius = 8.f; } - return llclamp(radius, 0.5f, 256.f); + return llclamp(radius*scale, 0.5f, 256.f); } const LLVector3 LLVOVolume::getPivotPositionAgent() const @@ -3071,6 +3183,11 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) face->getGeometryVolume(*volume, face->getTEOffset(), vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex()); } + + if (!face) + { + llerrs << "WTF?" << llendl; + } } drawablep->clearState(LLDrawable::REBUILD_ALL); @@ -3354,7 +3471,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else { - if (LLPipeline::sRenderDeferred && te->getBumpmap()) + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) { registerFace(group, facep, LLRenderPass::PASS_BUMP); } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 250c3ed917..6aaf5b2fdd 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -182,6 +182,11 @@ public: /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); void sculpt(); + static void rebuildMeshAssetCallback(LLVFS *vfs, + const LLUUID& asset_uuid, + LLAssetType::EType type, + void* user_data, S32 status, LLExtStat ext_status); + void updateRelativeXform(); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); /*virtual*/ void updateFaceSize(S32 idx); @@ -227,6 +232,7 @@ public: U32 getVolumeInterfaceID() const; virtual BOOL isFlexible() const; virtual BOOL isSculpted() const; + virtual BOOL isMesh() const; virtual BOOL hasLightTexture() const; BOOL isVolumeGlobal() const; @@ -235,6 +241,7 @@ public: void updateObjectMediaData(const LLSD &media_data_duples); void mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, LLViewerMediaObserver::EMediaEvent event); + // Sync the given media data with the impl and the given te void syncMediaData(S32 te, const LLSD &media_data, bool merge, bool ignore_agent); @@ -247,6 +254,8 @@ public: bool hasMedia() const; + void notifyMeshLoaded(); + protected: S32 computeLODDetail(F32 distance, F32 radius); BOOL calcLOD(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b50e71bf48..7cf5cf75ad 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -342,6 +342,8 @@ LLPipeline::LLPipeline() : mGlowPool(NULL), mBumpPool(NULL), mWLSkyPool(NULL), + mMeshMutex(NULL), + mMeshThreadCount(0), mLightMask(0), mLightMovingMask(0), mLightingDetail(0) @@ -399,6 +401,7 @@ void LLPipeline::init() stop_glerror(); + mMeshMutex = new LLMutex(NULL); for (U32 i = 0; i < 2; ++i) { mSpotLightFade[i] = 1.f; @@ -473,6 +476,9 @@ void LLPipeline::cleanup() //delete mWLSkyPool; mWLSkyPool = NULL; + delete mMeshMutex; + mMeshMutex = NULL; + releaseGLBuffers(); mBloomImagep = NULL; @@ -1783,6 +1789,8 @@ void LLPipeline::rebuildPriorityGroups() assertInitialized(); + notifyLoadedMeshes(); + // Iterate through all drawables on the priority build queue, for (LLSpatialGroup::sg_list_t::iterator iter = mGroupQ1.begin(); iter != mGroupQ1.end(); ++iter) @@ -1793,6 +1801,7 @@ void LLPipeline::rebuildPriorityGroups() } mGroupQ1.clear(); + } void LLPipeline::rebuildGroups() @@ -3419,27 +3428,14 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); - renderHighlights(); - mHighlightFaces.clear(); - - renderDebug(); - - LLVertexBuffer::unbind(); - - if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) - { - // Render debugging beacons. - gObjectList.renderObjectBeacons(); - LLHUDObject::renderAll(); - gObjectList.resetObjectBeacons(); - } - if (occlude) { occlude = FALSE; gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); doOcclusion(camera); + gGLLastMatrix = NULL; + glLoadMatrixd(gGLModelView); } } @@ -5836,6 +5832,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + + if (LLRenderTarget::sUseFBO) + { //copy depth buffer from mScreen to framebuffer + LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), + 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } } @@ -6912,6 +6914,24 @@ void LLPipeline::renderDeferredLighting() mRenderTypeMask = render_mask; } + { + //render highlights, etc. + renderHighlights(); + mHighlightFaces.clear(); + + renderDebug(); + + LLVertexBuffer::unbind(); + + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + // Render debugging beacons. + gObjectList.renderObjectBeacons(); + LLHUDObject::renderAll(); + gObjectList.resetObjectBeacons(); + } + } + mScreen.flush(); } @@ -7241,18 +7261,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLGLDisable cull(GL_CULL_FACE); updateCull(camera, ref_result, 1); stateSort(camera, ref_result); - gGL.setColorMask(true, true); - mWaterRef.clear(); - gGL.setColorMask(true, false); - - } - else - { - gGL.setColorMask(true, true); - mWaterRef.clear(); - gGL.setColorMask(true, false); - } - + } + + gGL.setColorMask(true, true); + mWaterRef.clear(); + gGL.setColorMask(true, false); + ref_mask = mRenderTypeMask; mRenderTypeMask = mask; } @@ -7907,6 +7921,7 @@ void LLPipeline::generateHighlight(LLCamera& camera) mHighlight.flush(); gGL.setColorMask(true, false); + gViewerWindow->setup3DViewport(); } } @@ -8886,3 +8901,175 @@ LLCullResult::sg_list_t::iterator LLPipeline::endAlphaGroups() } +void LLPipeline::loadMesh(LLVOVolume* volume, LLUUID mesh_id) +{ + + { + LLMutexLock lock(mMeshMutex); + //add volume to list of loading meshes + mesh_load_map::iterator iter = mLoadingMeshes.find(mesh_id); + if (iter != mLoadingMeshes.end()) + { //request pending for this mesh, append volume id to list + iter->second.insert(volume->getID()); + return; + } + + //first request for this mesh + mLoadingMeshes[mesh_id].insert(volume->getID()); + } + + if (gAssetStorage->hasLocalAsset(mesh_id, LLAssetType::AT_MESH)) + { //already have asset, load desired LOD in background + mPendingMeshes.push_back(new LLMeshThread(mesh_id, volume->getVolume())); + } + else + { //fetch asset and load when done + gAssetStorage->getAssetData(mesh_id, LLAssetType::AT_MESH, + getMeshAssetCallback, volume->getVolume(), TRUE); + } + +} + +//static +void LLPipeline::getMeshAssetCallback(LLVFS *vfs, + const LLUUID& asset_uuid, + LLAssetType::EType type, + void* user_data, S32 status, LLExtStat ext_status) +{ + gPipeline.mPendingMeshes.push_back(new LLMeshThread(asset_uuid, (LLVolume*) user_data)); +} + + +LLPipeline::LLMeshThread::LLMeshThread(LLUUID mesh_id, LLVolume* target) +: LLThread("mesh_loading_thread") +{ + mMeshID = mesh_id; + mVolume = NULL; + mDetail = target->getDetail(); + mTargetVolume = target; +} + +LLPipeline::LLMeshThread::~LLMeshThread() +{ + +} + +void LLPipeline::LLMeshThread::run() +{ + if (!gAssetStorage || LLApp::instance()->isQuitting()) + { + return; + } + + char* buffer = NULL; + S32 size = 0; + + LLVFS* vfs = gAssetStorage->mVFS; + + { + LLVFile file(vfs, mMeshID, LLAssetType::AT_MESH, LLVFile::READ); + file.waitForLock(VFSLOCK_READ); + size = file.getSize(); + + if (size == 0) + { + gPipeline.meshLoaded(this); + return; + } + + buffer = new char[size]; + file.read((U8*)&buffer[0], size); + } + + { + std::string buffer_string(buffer, size); + std::istringstream buffer_stream(buffer_string); + + { + LLVolumeParams volume_params; + volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE); + mVolume = new LLVolume(volume_params, mDetail); + mVolume->createVolumeFacesFromStream(buffer_stream); + } + } + delete[] buffer; + + gPipeline.meshLoaded(this); +} + +void LLPipeline::meshLoaded(LLPipeline::LLMeshThread* mesh_thread) +{ + LLMutexLock lock(mMeshMutex); + mLoadedMeshes.push_back(mesh_thread); +} + +void LLPipeline::notifyLoadedMeshes() +{ //called from main thread + + U32 max_thread_count = llmax(gSavedSettings.getU32("MeshThreadCount"), (U32) 1); + while (mMeshThreadCount < max_thread_count && !mPendingMeshes.empty()) + { + LLMeshThread* mesh_thread = mPendingMeshes.front(); + mesh_thread->start(); + ++mMeshThreadCount; + mPendingMeshes.pop_front(); + } + + LLMutexLock lock(mMeshMutex); + std::list<LLMeshThread*> stopping_threads; + + for (std::list<LLMeshThread*>::iterator iter = mLoadedMeshes.begin(); iter != mLoadedMeshes.end(); ++iter) + { //for each mesh done loading + LLMeshThread* mesh = *iter; + + if (!mesh->isStopped()) + { //don't process a LLMeshThread until it's stopped + stopping_threads.push_back(mesh); + continue; + } + + //get list of objects waiting to be notified this mesh is loaded + mesh_load_map::iterator obj_iter = mLoadingMeshes.find(mesh->mMeshID); + + if (mesh->mVolume && obj_iter != mLoadingMeshes.end()) + { + //make sure target volume is still valid + BOOL valid = FALSE; + + for (std::set<LLUUID>::iterator vobj_iter = obj_iter->second.begin(); vobj_iter != obj_iter->second.end(); ++vobj_iter) + { + LLVOVolume* vobj = (LLVOVolume*) gObjectList.findObject(*vobj_iter); + + if (vobj) + { + if (vobj->getVolume() == mesh->mTargetVolume) + { + valid = TRUE; + } + } + } + + + if (valid) + { + mesh->mTargetVolume->copyVolumeFaces(mesh->mVolume); + for (std::set<LLUUID>::iterator vobj_iter = obj_iter->second.begin(); vobj_iter != obj_iter->second.end(); ++vobj_iter) + { + LLVOVolume* vobj = (LLVOVolume*) gObjectList.findObject(*vobj_iter); + if (vobj) + { + vobj->notifyMeshLoaded(); + } + } + } + + mLoadingMeshes.erase(mesh->mMeshID); + } + + delete mesh; + --mMeshThreadCount; + } + + mLoadedMeshes = stopping_threads; +} + diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index ce50a37405..bf654f88b1 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -278,6 +278,10 @@ public: LLCullResult::sg_list_t::iterator beginAlphaGroups(); LLCullResult::sg_list_t::iterator endAlphaGroups(); + + //mesh management functions + void loadMesh(LLVOVolume* volume, LLUUID mesh_id); + void addTrianglesDrawn(S32 count); BOOL hasRenderType(const U32 type) const { return (type && (mRenderTypeMask & (1<<type))) ? TRUE : FALSE; } BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } @@ -672,6 +676,35 @@ public: protected: std::vector<LLFace*> mSelectedFaces; + typedef std::map<LLUUID, std::set<LLUUID> > mesh_load_map; + mesh_load_map mLoadingMeshes; + + LLMutex* mMeshMutex; + + class LLMeshThread : public LLThread + { + public: + LLPointer<LLVolume> mVolume; + LLVolume* mTargetVolume; + LLUUID mMeshID; + F32 mDetail; + LLMeshThread(LLUUID mesh_id, LLVolume* target); + ~LLMeshThread(); + void run(); + }; + + static void getMeshAssetCallback(LLVFS *vfs, + const LLUUID& asset_uuid, + LLAssetType::EType type, + void* user_data, S32 status, LLExtStat ext_status); + + std::list<LLMeshThread*> mLoadedMeshes; + std::list<LLMeshThread*> mPendingMeshes; + U32 mMeshThreadCount; + + void meshLoaded(LLMeshThread* mesh_thread); + void notifyLoadedMeshes(); + LLPointer<LLViewerFetchedTexture> mFaceSelectImagep; LLPointer<LLViewerTexture> mBloomImagep; LLPointer<LLViewerTexture> mBloomImage2p; diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 01976c9a5c..26b0b39a68 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -568,6 +568,7 @@ <texture name="inv_folder_landmark.tga" /> <texture name="inv_folder_lostandfound.tga" /> <texture name="inv_folder_my_outfits.tga" /> + <texture name="inv_folder_mesh.tga"/> <texture name="inv_folder_notecard.tga" /> <texture name="inv_folder_object.tga" /> <texture name="inv_folder_outfit.tga" /> @@ -591,6 +592,7 @@ <texture name="inv_item_landmark_visited.tga" /> <texture name="inv_item_linkitem.tga" /> <texture name="inv_item_linkfolder.tga" /> + <texture name="inv_item_mesh.tga"/> <texture name="inv_item_notecard.tga" /> <texture name="inv_item_object.tga" /> <texture name="inv_item_object_multi.tga" /> diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 4d7433233a..09240a3e27 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -152,16 +152,19 @@ It is a rare mind indeed that can render the hitherto non-existent blindingly ob word_wrap="true"> 3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion APR Copyright (C) 2000-2004 The Apache Software Foundation + Collada DOM Copyright 2005 Sony Computer Entertainment Inc. cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se) DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org). GL Copyright (C) 1999-2004 Brian Paul. + GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia. Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) jpeglib Copyright (C) 1991-1998, Thomas G. Lane. ogg/vorbis Copyright (C) 2001, Xiphophorus OpenSSL Copyright (C) 1998-2002 The OpenSSL Project. + PCRE Copyright (c) 1997-2008 University of Cambridge SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) xmlrpc-epi Copyright (C) 2000 Epinions, Inc. diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index 0f06558dd1..6afeb4e82d 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -123,6 +123,16 @@ <menu_item_call.on_enable function="File.EnableUpload" /> </menu_item_call> + <menu_item_call + label="Model (L$[COST])..." + layout="topleft" + name="Upload Model"> + <menu_item_call.on_click + function="File.UploadModel" + parameter="" /> + <menu_item_call.on_enable + function="File.EnableUpload" /> + </menu_item_call> <menu_item_call label="Animation (L$[COST])..." layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 7829a4fa93..c15811f0e8 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1996,6 +1996,9 @@ label="Cylinder" name="Cylinder" value="Cylinder" /> + <combo_box.item + label="Mesh" + value="Mesh" /> </combo_box> </panel> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 284594426c..d90d1f0635 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2210,10 +2210,10 @@ name="Fast Alpha"> <menu_item_check.on_check function="CheckControl" - parameter="RenderDebugGL" /> + parameter="RenderFastAlpha" /> <menu_item_check.on_click function="ToggleControl" - parameter="RenderDebugGL" /> + parameter="RenderFastAlpha" /> </menu_item_check> <menu_item_check label="Animation Textures" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index d10bbe7569..6831e56f0b 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6540,7 +6540,7 @@ Attachment has been saved. Unable to find the help topic for this element. </notification> - <notification + <notification icon="alertmodal.tga" name="ObjectMediaFailure" type="alertmodal"> @@ -6551,6 +6551,29 @@ Server Error: Media update or get failed. yestext="OK"/> </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmClearTeleportHistory" + type="alertmodal"> +Are you sure you want to delete your teleport history? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="UploadCostConfirmation" + type="alertmodal"> +This upload will cost L$[PRICE], do you wish to continue with the upload? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Upload"/> + </notification> + <notification icon="alertmodal.tga" name="ConfirmClearTeleportHistory" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index bdcea05c73..36f4fb98ed 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1872,6 +1872,7 @@ this texture in your inventory <string name="InvFolder favorite">Favorites</string> <string name="InvFolder Current Outfit">Current Outfit</string> <string name="InvFolder My Outfits">My Outfits</string> + <string name="InvFolder Meshes">Meshes</string> <!-- are used for Friends and Friends/All folders in Inventory "Calling cards" folder. See EXT-694--> <string name="InvFolder Friends">Friends</string> diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 045990811b..db4b68e9d6 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -194,6 +194,12 @@ class WindowsManifest(ViewerManifest): # For using FMOD for sound... DJS self.path("fmod.dll") + # For automatic level of detail generation in mesh importer + self.path("glod.dll") + + # For reading collada files + self.path("libcollada14dom21.dll") + # For textures if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""): self.path("openjpeg.dll") diff --git a/install.xml b/install.xml index 44224664ca..24ade32095 100644 --- a/install.xml +++ b/install.xml @@ -43,6 +43,39 @@ </map> </map> </map> + <key>GLOD</key> + <map> + <key>copyright</key> + <string>Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia. All rights reserved.</string> + <key>description</key> + <string>Geometric Level of Detail for OpenGL</string> + <key>license</key> + <string>GLOD</string> + <key>packages</key> + <map> + <key>darwin</key> + <map> + <key>md5sum</key> + <string>ab78835bafcad3bb7223eaeecb5a6a4b</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/GLOD-1.0pre4-darwin-20090918.tar.bz2</uri> + </map> + <key>linux</key> + <map> + <key>md5sum</key> + <string>66ae292063b80f3a9fecb46dcd4fe5ec</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/GLOD-1.0pre4-linux-20091023.tar.bz2</uri> + </map> + <key>windows</key> + <map> + <key>md5sum</key> + <string>b97aa644a548310ca3c916518bb07b7e</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/GLOD-windows-20090915.tar.bz2</uri> + </map> + </map> + </map> <key>SDL</key> <map> <key>copyright</key> @@ -220,6 +253,39 @@ </map> </map> </map> + <key>colladadom</key> + <map> + <key>copyright</key> + <string>Copyright 2005 Sony Computer Entertainment Inc.</string> + <key>description</key> + <string>Library for processing collada file format</string> + <key>license</key> + <string>scea</string> + <key>packages</key> + <map> + <key>darwin</key> + <map> + <key>md5sum</key> + <string>786de8bfebb5df3a3b51a7832119f8d8</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-darwin-20090731.tar.bz2</uri> + </map> + <key>linux</key> + <map> + <key>md5sum</key> + <string>01d17182ecc6728edaa520b3c780d194</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-linux-20090921.tar.bz2</uri> + </map> + <key>windows</key> + <map> + <key>md5sum</key> + <string>fd3e5dade35c586ae13a320ab731df0d</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-windows-20090908.tar.bz2</uri> + </map> + </map> + </map> <key>curl</key> <map> <key>copyright</key> @@ -1186,6 +1252,32 @@ anguage Infrstructure (CLI) international standard</string> </map> </map> </map> + <key>pcre</key> + <map> + <key>copyright</key> + <string>Copyright (c) 1997-2008 University of Cambridge</string> + <key>description</key> + <string>Regular expression library</string> + <key>license</key> + <string>bsd</string> + <key>packages</key> + <map> + <key>darwin</key> + <map> + <key>md5sum</key> + <string>63e2dc55142b8b36521c1b0c9b6ed6bb</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/pcre-7.6-darwin-20090730.tar.bz2</uri> + </map> + <key>linux</key> + <map> + <key>md5sum</key> + <string>0886d0b1cdf104b6341df1832a8a7e09</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/pcre-7.6-linux-20090804.tar.bz2</uri> + </map> + </map> + </map> <key>quicktime</key> <map> <key>copyright</key> @@ -1400,6 +1492,75 @@ anguage Infrstructure (CLI) international standard</string> <key>url</key> <string>http://www.xfree86.org/4.4.0/LICENSE9.html#sgi</string> </map> + <key>GLOD</key> + <map> + <key>text</key> + <string>The GLOD Open-Source License Version 1.0 July 22, 2003 + +Copyright (C) 2003 Jonathan Cohen, Nat Duca, Johns Hopkins University +and David Luebke, Brenden Schubert, University of Virginia. All rights +reserved. + +Redistribution and use in source and binary forms, with or without +modification, is permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer and + request. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer and + request in the documentation and/or other materials provided with + the distribution. + +3. The name "GLOD" must not be used to endorse or promote products + derived from this software without prior written permission. + +4. Redistributions of any modified version of this source, whether in + source or binary form , must include a form of the following + acknowledgment: "This product is derived from the GLOD library, + which is available from http://www.cs.jhu.edu/~graphics/GLOD." + +5. Redistributions of any modified version of this source in binary + form must provide, free of charge, access to the modified version + of the code. + +6. This license shall be governed by and construed and enforced in + accordance with the laws of the State of Maryland, without + reference to its conflicts of law provisions. The exclusive + jurisdiction and venue for all legal actions relating to this + license shall be in courts of competent subject matter jurisdiction + located in the State of Maryland. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, GLOD IS PROVIDED +UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES +THAT GLOD IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR +PURPOSE OR NON-INFRINGING. ALL WARRANTIES ARE DISCLAIMED AND THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE CODE IS WITH +YOU. SHOULD ANY CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE +COPYRIGHT HOLDER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY +NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY +CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY CODE IS +AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL +THE COPYRIGHT HOLDER OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY +SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES FOR LOSS OF +PROFITS, REVENUE, OR FOR LOSS OF INFORMATION OR ANY OTHER LOSS. + +YOU EXPRESSLY AGREE TO FOREVER INDEMNIFY, DEFEND AND HOLD HARMLESS THE +COPYRIGHT HOLDERS AND CONTRIBUTORS OF GLOD AGAINST ALL CLAIMS, +DEMANDS, SUITS OR OTHER ACTIONS ARISING DIRECTLY OR INDIRECTLY FROM +YOUR ACCEPTANCE AND USE OF GLOD. + +Although NOT REQUIRED, we would appreciate it if active users of GLOD +put a link on their web site to the GLOD web site when possible. +</string> + <key>url</key> + <string>http://www.cs.jhu.edu/~graphics/GLOD/license/</string> + </map> <key>MSDTW</key> <map> <key>text</key> @@ -1725,6 +1886,11 @@ IMPORTANT NOTE: To the extent this software may be used to reproduce materials, EA0300 </string> </map> + <key>scea</key> + <map> + <key>url</key> + <string>http://research.scea.com/scea_shared_source_license.html</string> + </map> <key>sleepycat</key> <map> <key>url</key> -- cgit v1.2.3 From 63b9bd43ff41da01d549f630bd838caff0dffd97 Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Mon, 2 Nov 2009 14:56:46 -0800 Subject: Repairing things that didn't quite merge properly. --- indra/llprimitive/llprimitive.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index c30ef0350f..da1cfc2074 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -743,6 +743,8 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai setNumTEs(mVolumep->getNumFaces()); return TRUE; } + + U32 old_face_mask = mVolumep->mFaceMask; S32 face_bit = 0; S32 cur_mask = 0; -- cgit v1.2.3 From 9c3595465972ba4be916e871f6b0a62cc0c13d4a Mon Sep 17 00:00:00 2001 From: Jon Wolk <jwolk@lindenlab.com> Date: Tue, 3 Nov 2009 19:36:39 +0000 Subject: Changed variable price upload responders to reflect server changes. I hope this gets pulled into the hg repository --- indra/newview/llassetuploadresponders.cpp | 176 ++++++++++++++++++++---------- indra/newview/llassetuploadresponders.h | 3 +- indra/newview/llviewermenufile.cpp | 138 ++++++++++++++--------- indra/newview/llviewermenufile.h | 16 ++- 4 files changed, 212 insertions(+), 121 deletions(-) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index cb03379b23..680d1acd81 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -72,7 +72,7 @@ static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; void dialog_refresh_all(); -void on_new_single_inventory_upload_complete( +static void on_new_single_inventory_upload_complete( LLAssetType::EType asset_type, LLInventoryType::EType inventory_type, const std::string inventory_type_string, @@ -736,22 +736,103 @@ public: LLUploadDialog::modalUploadFinished(); } - void onApplicationLevelError(const std::string& error_identifier) + void onApplicationLevelError(const LLSD& error) { - // TODO*: Pull these user visible strings from an xml file - // to be localized + static const std::string _IDENTIFIER = "identifier"; + static const std::string _INSUFFICIENT_FUNDS = "NewAgentInventory_InsufficientLindenDollarBalance"; + static const std::string _MISSING_REQUIRED_PARAMETER = + "NewAgentInventory_MissingRequiredParamater"; + static const std::string _INVALID_REQUEST_BODY = + "NewAgentInventory_InvalidRequestBody"; + static const std::string _RESOURCE_COST_DIFFERS = + "NewAgentInventory_ResourceCostDiffers"; + + static const std::string _MISSING_PARAMETER = "missing_parameter"; + static const std::string _INVALID_PARAMETER = "invalid_parameter"; + static const std::string _MISSING_RESOURCE = "missing_resource"; + static const std::string _INVALID_RESOURCE = "invalid_resource"; + + // TODO* Add the other error_identifiers + std::string error_identifier = error[_IDENTIFIER].asString(); + // TODO*: Pull these user visible strings from an xml file + // to be localized if ( _INSUFFICIENT_FUNDS == error_identifier ) { displayCannotUploadReason("You do not have a sufficient L$ balance to complete this upload."); } + else if ( _MISSING_REQUIRED_PARAMETER == error_identifier ) + { + // Missing parameters + if (error.has(_MISSING_PARAMETER) ) + { + std::string message = + "Upload request was missing required parameter '[P]'"; + LLStringUtil::replaceString( + message, + "[P]", + error[_MISSING_PARAMETER].asString()); + + displayCannotUploadReason(message); + } + else + { + std::string message = + "Upload request was missing a required parameter"; + displayCannotUploadReason(message); + } + } + else if ( _INVALID_REQUEST_BODY == error_identifier ) + { + // Invalid request body, check to see if + // a particular parameter was invalid + if ( error.has(_INVALID_PARAMETER) ) + { + std::string message = "Upload parameter '[P]' is invalid."; + LLStringUtil::replaceString( + message, + "[P]", + error[_INVALID_PARAMETER].asString()); + + // See if the server also responds with what resource + // is missing. + if ( error.has(_MISSING_RESOURCE) ) + { + message += "\nMissing resource '[R]'."; + + LLStringUtil::replaceString( + message, + "[R]", + error[_MISSING_RESOURCE].asString()); + } + else if ( error.has(_INVALID_RESOURCE) ) + { + message += "\nInvalid resource '[R]'."; + + LLStringUtil::replaceString( + message, + "[R]", + error[_INVALID_RESOURCE].asString()); + } + + displayCannotUploadReason(message); + } + else + { + std::string message = "Upload request was malformed"; + displayCannotUploadReason(message); + } + } + else if ( _RESOURCE_COST_DIFFERS == error_identifier ) + { + displayCannotUploadReason("The resource cost associated with this upload is not consistent with the server."); + } else { displayCannotUploadReason("Unknown Error"); - } } @@ -761,14 +842,18 @@ public: "The server is experiencing unexpected difficulties."); } - void onTransportError(const std::string& error_identifier) + void onTransportError(const LLSD& error) { - // TODO*: Pull these user visible strings from an xml file - // to be localized + static const std::string _IDENTIFIER = "identifier"; static const std::string _SERVER_ERROR_AFTER_CHARGE = "NewAgentInventory_ServerErrorAfterCharge"; + std::string error_identifier = error[_IDENTIFIER].asString(); + + // TODO*: Pull the user visible strings from an xml file + // to be localized + if ( _SERVER_ERROR_AFTER_CHARGE == error_identifier ) { displayCannotUploadReason( @@ -779,7 +864,6 @@ public: displayCannotUploadReason( "The server is experiencing unexpected difficulties."); } - } bool uploadConfirmationCallback( @@ -798,17 +882,26 @@ public: notification["payload"]["confirmation_url"].asString(); // Yay! We are confirming or cancelling our upload - LLSD body; - - body["confirm_upload"] = false; - switch(option) { case 0: { - body["confirm_upload"] = true; - body["expected_upload_price"] = - notification["payload"]["expected_upload_price"]; + if ( getFilename().empty() ) + { + // we have no filename, use virtual file ID instead + LLHTTPClient::postFile( + confirmation_url, + getVFileID(), + getAssetType(), + responder); + } + else + { + LLHTTPClient::postFile( + confirmation_url, + getFilename(), + responder); + } } break; case 1: @@ -816,8 +909,6 @@ public: break; } - LLHTTPClient::post(confirmation_url, body, responder); - return false; } @@ -865,9 +956,8 @@ void LLNewAgentInventoryVariablePriceResponder::errorWithContent( if ( content.has("error") ) { static const std::string _ERROR = "error"; - static const std::string _IDENTIFIER = "identifier"; - mImpl->onTransportError(content[_ERROR][_IDENTIFIER].asString()); + mImpl->onTransportError(content[_ERROR]); } else { @@ -880,52 +970,25 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) // Parse out application level errors and the appropriate // responses for them static const std::string _ERROR = "error"; - static const std::string _IDENTIFIER = "identifier"; static const std::string _STATE = "state"; static const std::string _COMPLETE = "complete"; - static const std::string _COST_ANALYSIS = "cost_analysis"; - static const std::string _NEEDS_CONFIRMATION = "needs_confirmation"; - static const std::string _CANCEL = "cancel"; + static const std::string _CONFIRM_UPLOAD = "confirm_upload"; - static const std::string _RESOURCE_COST = "resource_cost"; static const std::string _UPLOAD_PRICE = "upload_price"; - - static const std::string _ANALYZER = "analyzer"; static const std::string _RSVP = "rsvp"; // Check for application level errors if ( content.has(_ERROR) ) { - onApplicationLevelError(content[_ERROR][_IDENTIFIER].asString()); + onApplicationLevelError(content[_ERROR]); return; } std::string state = content[_STATE]; LLAssetType::EType asset_type = mImpl->getAssetType(); - if ( _COST_ANALYSIS == state ) - { - std::string analyzer_url = content[_ANALYZER]; - - if ( mImpl->getFilename().empty() ) - { - // we have no filename, use virtual file ID instead - LLHTTPClient::postFile( - analyzer_url, - mImpl->getVFileID(), - asset_type, - this); - } - else - { - LLHTTPClient::postFile( - analyzer_url, - mImpl->getFilename(), - this); - } - } - else if ( _COMPLETE == state ) + if ( _COMPLETE == state ) { // rename file in VFS with new asset id if (mImpl->getFilename().empty()) @@ -952,17 +1015,12 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) // TODO* Add bulk (serial) uploading or add // a super class of this that does so } - else if ( _NEEDS_CONFIRMATION == state ) + else if ( _CONFIRM_UPLOAD == state ) { showConfirmationDialog( content[_UPLOAD_PRICE].asInteger(), - content[_RESOURCE_COST].asInteger(), content[_RSVP].asString()); } - else if ( _CANCEL == state ) - { - // cancelled, do nothing - } else { onApplicationLevelError(""); @@ -970,14 +1028,13 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) } void LLNewAgentInventoryVariablePriceResponder::onApplicationLevelError( - const std::string& error_identifier) + const LLSD& error) { - mImpl->onApplicationLevelError(error_identifier); + mImpl->onApplicationLevelError(error); } void LLNewAgentInventoryVariablePriceResponder::showConfirmationDialog( S32 upload_price, - S32 resource_cost, const std::string& confirmation_url) { if ( 0 == upload_price ) @@ -998,7 +1055,6 @@ void LLNewAgentInventoryVariablePriceResponder::showConfirmationDialog( substitutions["PRICE"] = upload_price; payload["confirmation_url"] = confirmation_url; - payload["expected_upload_price"] = upload_price; // The creating of a new instrusive_ptr(this) // creates a new boost::intrusive_ptr diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index adbf13519b..04636d4977 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -102,10 +102,9 @@ public: void result(const LLSD& content); virtual void onApplicationLevelError( - const std::string& error_identifier); + const LLSD& error); virtual void showConfirmationDialog( S32 upload_price, - S32 resource_cost, const std::string& confirmation_url); private: diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 836ac79a87..7b9494c02a 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -964,60 +964,24 @@ void upload_done_callback( } } -LLAssetID upload_new_resource_prep( - const LLTransactionID &tid, +static LLAssetID upload_new_resource_prep( + const LLTransactionID& tid, LLAssetType::EType asset_type, LLInventoryType::EType& inventory_type, std::string& name, const std::string& display_name, std::string& description) { - if ( gDisconnected ) - { - LLAssetID rv; + LLAssetID uuid = generate_asset_id_for_new_upload(tid); - rv.setNull(); - return rv; - } + increase_new_upload_stats(asset_type); - LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); - - if ( LLAssetType::AT_SOUND == asset_type ) - { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_SOUND_COUNT ); - } - else if ( LLAssetType::AT_TEXTURE == asset_type ) - { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); - } - else if ( LLAssetType::AT_ANIMATION == asset_type ) - { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_ANIM_COUNT ); - } - - if ( LLInventoryType::IT_NONE == inventory_type ) - { - inventory_type = LLInventoryType::defaultForAssetType(asset_type); - } - LLStringUtil::stripNonprintable(name); - LLStringUtil::stripNonprintable(description); - - if ( name.empty() ) - { - name = "(No Name)"; - } - if ( description.empty() ) - { - description = "(No Description)"; - } - - // At this point, we're ready for the upload. - std::string upload_message = "Uploading...\n\n"; - upload_message.append(display_name); - LLUploadDialog::modalUploadDialog(upload_message); + assign_defaults_and_show_upload_message( + asset_type, + inventory_type, + name, + display_name, + description); return uuid; } @@ -1146,27 +1110,27 @@ void upload_new_resource( { asset_callback = callback; } - gAssetStorage->storeAssetData(data->mAssetInfo.mTransactionID, data->mAssetInfo.mType, - asset_callback, - (void*)data, - FALSE); + gAssetStorage->storeAssetData( + data->mAssetInfo.mTransactionID, + data->mAssetInfo.mType, + asset_callback, + (void*)data, + FALSE); } } -BOOL upload_new_variable_cost_resource( +BOOL upload_new_variable_price_resource( const LLTransactionID &tid, LLAssetType::EType asset_type, std::string name, std::string desc, - S32 compression_info, LLAssetType::EType destination_folder_type, LLInventoryType::EType inv_type, U32 next_owner_perms, U32 group_perms, U32 everyone_perms, const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - void *userdata) + const LLSD& asset_resources) { LLAssetID uuid = upload_new_resource_prep( @@ -1209,6 +1173,8 @@ BOOL upload_new_variable_cost_resource( group_perms, everyone_perms); + body["asset_resources"] = asset_resources; + LLHTTPClient::post( url, body, @@ -1224,6 +1190,70 @@ BOOL upload_new_variable_cost_resource( } } +LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid) +{ + if ( gDisconnected ) + { + LLAssetID rv; + + rv.setNull(); + return rv; + } + + LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); + + return uuid; +} + +void increase_new_upload_stats(LLAssetType::EType asset_type) +{ + if ( LLAssetType::AT_SOUND == asset_type ) + { + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + } + else if ( LLAssetType::AT_TEXTURE == asset_type ) + { + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + } + else if ( LLAssetType::AT_ANIMATION == asset_type ) + { + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + } +} + +void assign_defaults_and_show_upload_message( + LLAssetType::EType asset_type, + LLInventoryType::EType& inventory_type, + std::string& name, + const std::string& display_name, + std::string& description) +{ + if ( LLInventoryType::IT_NONE == inventory_type ) + { + inventory_type = LLInventoryType::defaultForAssetType(asset_type); + } + LLStringUtil::stripNonprintable(name); + LLStringUtil::stripNonprintable(description); + + if ( name.empty() ) + { + name = "(No Name)"; + } + if ( description.empty() ) + { + description = "(No Description)"; + } + + // At this point, we're ready for the upload. + std::string upload_message = "Uploading...\n\n"; + upload_message.append(display_name); + LLUploadDialog::modalUploadDialog(upload_message); +} + + void init_menu_file() { view_listener_t::addCommit(new LLFileUploadImage(), "File.UploadImage"); diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index b51192b499..858fcd51de 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -77,20 +77,26 @@ void upload_new_resource( // used // We make a new function here to ensure that previous code is not broken -BOOL upload_new_variable_cost_resource( - const LLTransactionID &tid, +BOOL upload_new_variable_price_resource( + const LLTransactionID& tid, LLAssetType::EType type, std::string name, std::string desc, - S32 compression_info, LLAssetType::EType destination_folder_type, LLInventoryType::EType inv_type, U32 next_owner_perms, U32 group_perms, U32 everyone_perms, const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - void *userdata); + const LLSD& asset_resources); +LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid); +void increase_new_upload_stats(LLAssetType::EType asset_type); +void assign_defaults_and_show_upload_message( + LLAssetType::EType asset_type, + LLInventoryType::EType& inventory_type, + std::string& name, + const std::string& display_name, + std::string& description); #endif -- cgit v1.2.3 From e8eb8a86a69c7ba345dafbadb6aa72fc5bba090e Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Tue, 3 Nov 2009 17:22:01 -0800 Subject: Quick fix to get collada working. Will need to make collada and boost happier. --- install.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.xml b/install.xml index cb477701b7..2f22ba5c0d 100644 --- a/install.xml +++ b/install.xml @@ -280,9 +280,9 @@ <key>windows</key> <map> <key>md5sum</key> - <string>fd3e5dade35c586ae13a320ab731df0d</string> + <string>c239ce23ed3f0dbbe58a1ddba05aee0b</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-windows-20090908.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-windows-20091103.tar.bz2</uri> </map> </map> </map> -- cgit v1.2.3 From c3bb2669ce30681449f7fe68f0822878565c273f Mon Sep 17 00:00:00 2001 From: "palmer@sansome-guest-196.lindenlab.com" <palmer@sansome-guest-196.lindenlab.com> Date: Tue, 3 Nov 2009 17:43:47 -0800 Subject: fix to make build run on mac --- indra/cmake/00-Common.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index e7afe0ecba..5c0e639947 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -208,7 +208,7 @@ if (LINUX OR DARWIN) set(GCC_WARNINGS "${GCC_WARNINGS} -Werror") endif (NOT GCC_DISABLE_FATAL_WARNINGS) - set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual") + set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor") set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}") -- cgit v1.2.3 From 88292104d9a2332e6169f2add8f0b590bb22dbff Mon Sep 17 00:00:00 2001 From: David Parks <davep@lindenlab.com> Date: Wed, 4 Nov 2009 14:19:05 +0000 Subject: Fix for crash when loading some meshes. Added button to auto-fill LODs. --- indra/llmath/llvolume.cpp | 4 +++- indra/newview/pipeline.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index afa82ed399..ddd1b4b3db 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1690,9 +1690,11 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mGenerateSingleFace = generate_single_face; - generate(); + mLODScaleBias.setVec(1,1,1); + if (mParams.getSculptID().isNull() && params.getSculptType() == LL_SCULPT_TYPE_NONE) { + generate(); createVolumeFaces(); } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7cf5cf75ad..4fc94c08bc 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8988,6 +8988,7 @@ void LLPipeline::LLMeshThread::run() { LLVolumeParams volume_params; volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE); + volume_params.setSculptID(mMeshID, LL_SCULPT_TYPE_MESH); mVolume = new LLVolume(volume_params, mDetail); mVolume->createVolumeFacesFromStream(buffer_stream); } -- cgit v1.2.3 From 1c495c56c1011f4514d96b75cbcfb5a8256de78f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 5 Nov 2009 17:12:18 -0600 Subject: Fix for crash on teleport to mesh enabled region. Fix for flashing meshes on LOD switch. --- indra/llprimitive/llprimitive.cpp | 4 ++++ indra/newview/pipeline.cpp | 47 ++++++++++++++++++++++++++++++++++----- indra/newview/pipeline.h | 2 +- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index da1cfc2074..52265e7ad5 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -744,6 +744,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai return TRUE; } +#if 0 U32 old_face_mask = mVolumep->mFaceMask; S32 face_bit = 0; @@ -941,6 +942,9 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai setTE(te_num, *(old_tes.getTexture(face_mapping[face_bit]))); } } +#else + setNumTEs(mVolumep->getNumFaces()); +#endif return TRUE; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1a1d29ac32..4ac95fa939 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8902,33 +8902,68 @@ LLCullResult::sg_list_t::iterator LLPipeline::endAlphaGroups() } -void LLPipeline::loadMesh(LLVOVolume* volume, LLUUID mesh_id) +void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) { - { LLMutexLock lock(mMeshMutex); //add volume to list of loading meshes mesh_load_map::iterator iter = mLoadingMeshes.find(mesh_id); if (iter != mLoadingMeshes.end()) { //request pending for this mesh, append volume id to list - iter->second.insert(volume->getID()); + iter->second.insert(vobj->getID()); return; } //first request for this mesh - mLoadingMeshes[mesh_id].insert(volume->getID()); + mLoadingMeshes[mesh_id].insert(vobj->getID()); } if (gAssetStorage->hasLocalAsset(mesh_id, LLAssetType::AT_MESH)) { //already have asset, load desired LOD in background - mPendingMeshes.push_back(new LLMeshThread(mesh_id, volume->getVolume())); + mPendingMeshes.push_back(new LLMeshThread(mesh_id, vobj->getVolume())); } else { //fetch asset and load when done gAssetStorage->getAssetData(mesh_id, LLAssetType::AT_MESH, - getMeshAssetCallback, volume->getVolume(), TRUE); + getMeshAssetCallback, vobj->getVolume(), TRUE); } + //do a quick search to see if we can't display something while we wait for this mesh to load + LLVolume* volume = vobj->getVolume(); + + if (volume) + { + LLVolumeParams params = volume->getParams(); + + LLVolumeLODGroup* group = LLPrimitive::getVolumeManager()->getGroup(params); + + if (group) + { + //first see what the next lowest LOD available might be + for (S32 i = detail-1; i >= 0; --i) + { + LLVolume* lod = group->refLOD(i); + if (lod && lod->getNumVolumeFaces() > 0) + { + volume->copyVolumeFaces(lod); + group->derefLOD(lod); + return; + } + } + + //no lower LOD is a available, is a higher lod available? + for (S32 i = detail+1; i < 4; ++i) + { + LLVolume* lod = group->refLOD(i); + if (lod && lod->getNumVolumeFaces() > 0) + { + volume->copyVolumeFaces(lod); + group->derefLOD(lod); + return; + } + } + } + } } //static diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index bf654f88b1..3300f866e3 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -280,7 +280,7 @@ public: //mesh management functions - void loadMesh(LLVOVolume* volume, LLUUID mesh_id); + void loadMesh(LLVOVolume* volume, LLUUID mesh_id, S32 detail = 0); void addTrianglesDrawn(S32 count); BOOL hasRenderType(const U32 type) const { return (type && (mRenderTypeMask & (1<<type))) ? TRUE : FALSE; } -- cgit v1.2.3 From 10069e0e13e3214ba9320fdce915440b2e12f938 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 5 Nov 2009 19:58:10 -0600 Subject: Fix for prims all being 0 lod. Fix for dangling prim references. --- indra/llmath/llvolume.cpp | 3 ++- indra/llprimitive/llprimitive.cpp | 8 +++++++- indra/newview/llvovolume.cpp | 2 +- indra/newview/pipeline.cpp | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index ddd1b4b3db..33a8d33ce1 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1692,9 +1692,10 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mLODScaleBias.setVec(1,1,1); + generate(); + if (mParams.getSculptID().isNull() && params.getSculptType() == LL_SCULPT_TYPE_NONE) { - generate(); createVolumeFaces(); } } diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 52265e7ad5..340f60ed1a 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -744,7 +744,10 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai return TRUE; } -#if 0 +#if 0 + // #if 0'd out by davep + // this is a lot of cruft to set texture entry values that just stay the same for LOD switch + // or immediately get overridden by an object update message, also crashes occasionally U32 old_face_mask = mVolumep->mFaceMask; S32 face_bit = 0; @@ -943,6 +946,9 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai } } #else + // build the new object + sVolumeManager->unrefVolume(mVolumep); + mVolumep = volumep; setNumTEs(mVolumep->getNumFaces()); #endif return TRUE; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 78fd371087..7666009a62 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -919,7 +919,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool { //mesh is not loaded, request pipeline load this mesh LLUUID asset_id = volume_params.getSculptID(); - gPipeline.loadMesh(this, asset_id); + gPipeline.loadMesh(this, asset_id, detail); } else { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4ac95fa939..3554ceb7f0 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8949,6 +8949,7 @@ void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) group->derefLOD(lod); return; } + group->derefLOD(lod); } //no lower LOD is a available, is a higher lod available? @@ -8961,6 +8962,7 @@ void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) group->derefLOD(lod); return; } + group->derefLOD(lod); } } } -- cgit v1.2.3 From 4e420a36c67e611cd7d85652b43d9cd65315e563 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 7 Nov 2009 08:22:39 -0600 Subject: Fix for missing LOD spam. --- indra/llmath/llvolume.cpp | 21 +++++++++++++++------ indra/llprimitive/llprimitive.cpp | 3 ++- indra/newview/pipeline.cpp | 2 ++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 33a8d33ce1..c8ef911cc1 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1676,7 +1676,8 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mFaceMask = 0x0; mDetail = detail; mSculptLevel = -2; - + mLODScaleBias.setVec(1,1,1); + // set defaults if (mParams.getPathParams().getCurveType() == LL_PCODE_PATH_FLEXIBLE) { @@ -1690,8 +1691,6 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mGenerateSingleFace = generate_single_face; - mLODScaleBias.setVec(1,1,1); - generate(); if (mParams.getSculptID().isNull() && params.getSculptType() == LL_SCULPT_TYPE_NONE) @@ -1899,7 +1898,7 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) { if (!LLSDSerialize::deserialize(header, is, 1024*1024*1024)) { - llwarns << "not a valid mesh asset!" << llendl; + llwarns << "Mesh header parse error. Not a valid mesh asset!" << llendl; return FALSE; } } @@ -1921,8 +1920,18 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) if (lod >= 4) { - llwarns << "Couldn't load model for given lod" << llendl; - return FALSE; + lod = llclamp((S32) mDetail, 0, 3); + + while (lod >= 0 && header[nm[lod]]["offset"].asInteger() == -1) + { + --lod; + } + + if (lod < 0) + { + llwarns << "Mesh header missing LOD offsets. Not a valid mesh asset!" << llendl; + return FALSE; + } } is.seekg(header[nm[lod]]["offset"].asInteger(), std::ios_base::cur); diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 340f60ed1a..4c6d244f3c 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -948,7 +948,8 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai #else // build the new object sVolumeManager->unrefVolume(mVolumep); - mVolumep = volumep; + mVolumep = volumep; + setNumTEs(mVolumep->getNumFaces()); #endif return TRUE; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3554ceb7f0..f13bb73acf 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8949,6 +8949,7 @@ void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) group->derefLOD(lod); return; } + group->derefLOD(lod); } @@ -8962,6 +8963,7 @@ void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) group->derefLOD(lod); return; } + group->derefLOD(lod); } } -- cgit v1.2.3 From 7fa698252060a72be6b5ebc52f0ff01bcea6134c Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Mon, 9 Nov 2009 17:57:21 -0600 Subject: super importer stuff (gui, texture upload, etc.) --- indra/newview/llassetuploadresponders.cpp | 3 ++ indra/newview/llfilepicker.cpp | 23 ++++++++++++ indra/newview/llfilepicker.h | 1 + indra/newview/llviewerfloaterreg.cpp | 2 ++ indra/newview/llviewermenufile.cpp | 41 +++++++++++++++------- indra/newview/llviewermenufile.h | 2 +- .../skins/default/xui/en/floater_inventory.xml | 10 ++++++ 7 files changed, 69 insertions(+), 13 deletions(-) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 680d1acd81..2da40ba4b5 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -42,6 +42,7 @@ #include "llnotify.h" #include "llinventorymodel.h" #include "llfloaterinventory.h" +#include "llfloaterimportcollada.h" #include "llpermissionsflags.h" #include "llpreviewnotecard.h" #include "llpreviewscript.h" @@ -414,6 +415,8 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), userdata); } + + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], TRUE); } LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data, diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index e12db901bd..8dfb333530 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -55,6 +55,7 @@ LLFilePicker LLFilePicker::sInstance; #define SOUND_FILTER L"Sounds (*.wav)\0*.wav\0" #define IMAGE_FILTER L"Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)\0*.tga;*.bmp;*.jpg;*.jpeg;*.png\0" #define ANIM_FILTER L"Animations (*.bvh)\0*.bvh\0" +#define COLLADA_FILTER L"Scene (*.dae)\0*.dae\0" #ifdef _CORY_TESTING #define GEOMETRY_FILTER L"SL Geometry (*.slg)\0*.slg\0" #endif @@ -176,6 +177,10 @@ BOOL LLFilePicker::setupFilter(ELoadFilter filter) mOFN.lpstrFilter = ANIM_FILTER \ L"\0"; break; + case FFLOAD_COLLADA: + mOFN.lpstrFilter = COLLADA_FILTER \ + L"\0"; + break; #ifdef _CORY_TESTING case FFLOAD_GEOMETRY: mOFN.lpstrFilter = GEOMETRY_FILTER \ @@ -547,6 +552,15 @@ Boolean LLFilePicker::navOpenFilterProc(AEDesc *theItem, void *info, void *callB result = false; } } + else if (filter == FFLOAD_COLLADA) + { + if (fileInfo.filetype != 'DAE ' && + (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("dae"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) + ) + { + result = false; + } + } #ifdef _CORY_TESTING else if (filter == FFLOAD_GEOMETRY) { @@ -1093,6 +1107,12 @@ static std::string add_bvh_filter_to_gtkchooser(GtkWindow *picker) LLTrans::getString("animation_files") + " (*.bvh)"); } +static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker) +{ + return add_simple_pattern_filter_to_gtkchooser(picker, "*.dae", + LLTrans::getString("scene_files") + " (*.dae)"); +} + static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker) { GtkFileFilter *gfilter = gtk_file_filter_new(); @@ -1217,6 +1237,9 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter ) case FFLOAD_ANIM: filtername = add_bvh_filter_to_gtkchooser(picker); break; + case FFLOAD_COLLADA: + filtername = add_collada_filter_to_gtkchooser(picker); + break; case FFLOAD_IMAGE: filtername = add_imageload_filter_to_gtkchooser(picker); break; diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 7600922e9c..10736c7dd0 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -94,6 +94,7 @@ public: FFLOAD_SLOBJECT = 7, FFLOAD_RAW = 8, FFLOAD_MODEL = 9, + FFLOAD_COLLADA = 10, }; enum ESaveFilter diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 4ff1e6c703..f3bf6b70a3 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -73,6 +73,7 @@ #include "llimpanel.h" #include "llfloaterinspect.h" #include "llfloaterinventory.h" +#include "llfloaterimportcollada.h" #include "llfloaterjoystick.h" #include "llfloaterlagmeter.h" #include "llfloaterland.h" @@ -172,6 +173,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>); LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloater>); + LLFloaterReg::add("import_collada", "floater_import_collada.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImportCollada>); LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventory>); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>); LLInspectAvatarUtil::registerFloater(); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 7b9494c02a..53067c5c93 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -39,6 +39,7 @@ #include "llfilepicker.h" #include "llfloaterreg.h" #include "llfloaterbuycurrency.h" +#include "llfloaterimportcollada.h" #include "llfloatermodelpreview.h" #include "llfloatersnapshot.h" #include "llinventorymodel.h" // gInventory @@ -56,7 +57,7 @@ #include "llappviewer.h" #include "lluploaddialog.h" #include "lltrans.h" - +#include "llfloaterimportcollada.h" // linden libraries #include "llassetuploadresponders.h" @@ -263,6 +264,19 @@ class LLFileUploadImage : public view_listener_t } }; +class LLFileUploadScene : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_COLLADA); + if (!filename.empty()) + { + LLImportCollada::getInstance()->importFile(filename); + } + return TRUE; + } +}; + class LLFileUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -517,7 +531,7 @@ void handle_compress_image(void*) } } -void upload_new_resource( +LLUUID upload_new_resource( const std::string& src_filename, std::string name, std::string desc, @@ -555,7 +569,7 @@ void upload_new_resource( short_name.c_str()); args["FILE"] = short_name; upload_error(error_message, "NofileExtension", filename, args); - return; + return LLUUID(); } else if( exten == "bmp") { @@ -569,7 +583,7 @@ void upload_new_resource( args["FILE"] = src_filename; args["ERROR"] = LLImage::getLastError(); upload_error(error_message, "ProblemWithFile", filename, args); - return; + return LLUUID(); } } else if( exten == "tga") @@ -584,7 +598,7 @@ void upload_new_resource( args["FILE"] = src_filename; args["ERROR"] = LLImage::getLastError(); upload_error(error_message, "ProblemWithFile", filename, args); - return; + return LLUUID(); } } else if( exten == "jpg" || exten == "jpeg") @@ -599,7 +613,7 @@ void upload_new_resource( args["FILE"] = src_filename; args["ERROR"] = LLImage::getLastError(); upload_error(error_message, "ProblemWithFile", filename, args); - return; + return LLUUID(); } } else if( exten == "png") @@ -614,7 +628,7 @@ void upload_new_resource( args["FILE"] = src_filename; args["ERROR"] = LLImage::getLastError(); upload_error(error_message, "ProblemWithFile", filename, args); - return; + return LLUUID(); } } else if(exten == "wav") @@ -642,7 +656,7 @@ void upload_new_resource( upload_error(error_message, "UnknownVorbisEncodeFailure", filename, args); break; } - return; + return LLUUID(); } } else if(exten == "tmp") @@ -682,7 +696,7 @@ void upload_new_resource( error_message = llformat("corrupt resource file: %s", src_filename.c_str()); args["FILE"] = src_filename; upload_error(error_message, "CorruptResourceFile", filename, args); - return; + return LLUUID(); } if (2 == tokens_read) @@ -710,7 +724,7 @@ void upload_new_resource( error_message = llformat("unknown linden resource file version in file: %s", src_filename.c_str()); args["FILE"] = src_filename; upload_error(error_message, "UnknownResourceFileVersion", filename, args); - return; + return LLUUID(); } } else @@ -752,7 +766,7 @@ void upload_new_resource( error_message = llformat( "Unable to create output file: %s", filename.c_str()); args["FILE"] = filename; upload_error(error_message, "UnableToCreateOutputFile", filename, args); - return; + return LLUUID(); } fclose(in); @@ -766,7 +780,7 @@ void upload_new_resource( { error_message = llformat("We do not currently support bulk upload of animation files\n"); upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args); - return; + return LLUUID(); } else { @@ -840,6 +854,8 @@ void upload_new_resource( } LLFilePicker::instance().reset(); } + + return uuid; } void upload_done_callback( @@ -1260,6 +1276,7 @@ void init_menu_file() view_listener_t::addCommit(new LLFileUploadSound(), "File.UploadSound"); view_listener_t::addCommit(new LLFileUploadAnim(), "File.UploadAnim"); view_listener_t::addCommit(new LLFileUploadModel(), "File.UploadModel"); + view_listener_t::addCommit(new LLFileUploadScene(), "File.UploadScene"); view_listener_t::addCommit(new LLFileUploadBulk(), "File.UploadBulk"); view_listener_t::addCommit(new LLFileCloseWindow(), "File.CloseWindow"); view_listener_t::addCommit(new LLFileCloseAllWindows(), "File.CloseAllWindows"); diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 858fcd51de..25469e0168 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -41,7 +41,7 @@ class LLTransactionID; void init_menu_file(); -void upload_new_resource( +LLUUID upload_new_resource( const std::string& src_filename, std::string name, std::string desc, diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index c7fcacab8b..5e324f1c6e 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -135,6 +135,16 @@ parameter="" /> <menu_item_call.on_enable function="File.EnableUpload" /> + </menu_item_call> + <menu_item_call + label="Scene..." + layout="topleft" + name="Upload Scene"> + <menu_item_call.on_click + function="File.UploadScene" + parameter="" /> + <menu_item_call.on_enable + function="File.EnableUpload" /> </menu_item_call> <menu_item_call label="Animation (L$[COST])..." -- cgit v1.2.3 From 41f48a16a9e4279eb7805f0ed725b0147305c6ba Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 12 Nov 2009 15:02:08 +0000 Subject: newlineorama. --- indra/llui/lluictrlfactory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 8ab015f2bb..0d1c486a4b 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -454,4 +454,5 @@ const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_ty void LLUICtrlFactory::connect(LLView* parent, LLView* child) { parent->addChild(child); -} \ No newline at end of file +} + -- cgit v1.2.3 From 842bf4d7bb7618f34522e9ee8817b7978229d692 Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Thu, 12 Nov 2009 10:57:39 -0800 Subject: ignoring .orig files --- .hgignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgignore b/.hgignore index 4d98acf5d9..1d4890810f 100644 --- a/.hgignore +++ b/.hgignore @@ -9,6 +9,7 @@ syntax: glob .*.swp #OSX image cache file *.DS_Store +*.orig LICENSES indra/.distcc indra/build-darwin-* -- cgit v1.2.3 From 596d3cfb6018789e3ffca5bf3ae9fa4e1e8a707a Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 12 Nov 2009 13:23:48 -0600 Subject: CTS-15 Force loading of high LOD when opening model import floater. CTS-9 Auto-fill description field with --- indra/newview/llviewermenufile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 505d2afb69..2ce37612b2 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -281,7 +281,11 @@ class LLFileUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterReg::showInstance("upload_model"); + LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::showInstance("upload_model"); + if (fmp) + { + fmp->loadModel(3); + } return TRUE; } -- cgit v1.2.3 From bb72788392ea6d25adb045abd555419cd60c4888 Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Thu, 12 Nov 2009 14:05:01 -0800 Subject: Fixes for mesh inventory type correctness. --- indra/llinventory/llinventorytype.cpp | 28 +++++++++++++++++++++++++++- indra/newview/llinventoryfunctions.cpp | 3 +++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index 2460a2777a..caf8e11929 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -125,7 +125,33 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_NONE, // AT_LINK LLInventoryType::IT_NONE, // AT_LINK_FOLDER - LLInventoryType::IT_MESH, // AT_MESH + + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + LLInventoryType::IT_NONE, // AT_NONE + + LLInventoryType::IT_MESH // AT_MESH }; // static diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 75218e98e0..01c7f0974d 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -323,6 +323,9 @@ const std::string& get_item_icon_name(LLAssetType::EType asset_type, case LLAssetType::AT_LINK_FOLDER: idx = LINKFOLDER_ICON_NAME; break; + case LLAssetType::AT_MESH: + idx = MESH_ICON_NAME; + break; default: break; } -- cgit v1.2.3 From 0c50236a944898502405a31aa1f0b6ae61ae38ae Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 13 Nov 2009 08:59:12 -0600 Subject: CTS-26 Fix for LOD generation always using first file specified. --- indra/llrender/llvertexbuffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index db4189dfea..6e77bb2aab 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -566,7 +566,7 @@ void LLVertexBuffer::destroyGLBuffer() } mGLBuffer = 0; - unbind(); + //unbind(); } void LLVertexBuffer::destroyGLIndices() @@ -593,7 +593,7 @@ void LLVertexBuffer::destroyGLIndices() } mGLIndices = 0; - unbind(); + //unbind(); } void LLVertexBuffer::updateNumVerts(S32 nverts) -- cgit v1.2.3 From c02702f3871979cb7745b49aa502ac3c71f77681 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 13 Nov 2009 17:01:56 -0600 Subject: CTS-7 Add hard edge threshold capability to normal generation. --- indra/llmath/llvolume.cpp | 12 ++++++++++++ indra/llmath/llvolume.h | 1 + 2 files changed, 13 insertions(+) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 6286d1bcea..f252b2a232 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1876,6 +1876,18 @@ bool LLVolumeFace::VertexData::operator==(const LLVolumeFace::VertexData& rhs)co return true; } +bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs, F32 angle_cutoff) const +{ + bool retval = false; + if (rhs.mPosition == mPosition && rhs.mTexCoord == mTexCoord) + { + F32 cur_angle = rhs.mNormal*mNormal; + + retval = cur_angle > angle_cutoff; + } + + return retval; +} BOOL LLVolume::createVolumeFacesFromFile(const std::string& file_name) { diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 9f595ccbc4..d2727d8f21 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -814,6 +814,7 @@ public: bool operator<(const VertexData& rhs) const; bool operator==(const VertexData& rhs) const; + bool compareNormal(const VertexData& rhs, F32 angle_cutoff) const; }; enum -- cgit v1.2.3 From a056423e62ad8525919526abb95e8b23f0681064 Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Tue, 17 Nov 2009 13:42:19 -0800 Subject: Merge of latest viewer 2 changes --- indra/newview/llviewerwindow.cpp | 134 --------------------------------------- 1 file changed, 134 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7b35125b5b..a1539e24a4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3704,140 +3704,6 @@ void LLViewerWindow::playSnapshotAnimAndSound() BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) { return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, do_rebuild, type); - - // *TODO below code was broken in deferred pipeline - /* - if ((!raw) || preview_width < 10 || preview_height < 10) - { - return FALSE; - } - - if(gResizeScreenTexture) //the window is resizing - { - return FALSE ; - } - - setCursor(UI_CURSOR_WAIT); - - // Hide all the UI widgets first and draw a frame - BOOL prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI); - - if ( prev_draw_ui != show_ui) - { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); - } - - BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && LLPipeline::sShowHUDAttachments; - if (hide_hud) - { - LLPipeline::sShowHUDAttachments = FALSE; - } - - S32 render_name = gSavedSettings.getS32("RenderName"); - gSavedSettings.setS32("RenderName", 0); - LLVOAvatar::updateFreezeCounter(1) ; //pause avatar updating for one frame - - S32 w = preview_width ; - S32 h = preview_height ; - LLVector2 display_scale = mDisplayScale ; - mDisplayScale.setVec((F32)w / mWindowRectRaw.getWidth(), (F32)h / mWindowRectRaw.getHeight()) ; - LLRect window_rect = mWindowRectRaw; - mWindowRectRaw.set(0, h, w, 0); - - gDisplaySwapBuffers = FALSE; - gDepthDirty = TRUE; - glClearColor(0.f, 0.f, 0.f, 0.f); - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - setup3DRender(); - - LLFontGL::setFontDisplay(FALSE) ; - LLHUDText::setDisplayText(FALSE) ; - if (type == SNAPSHOT_TYPE_OBJECT_ID) - { - gObjectList.renderPickList(gViewerWindow->getWindowRectScaled(), FALSE, FALSE); - } - else - { - display(do_rebuild, 1.0f, 0, TRUE); - render_ui(); - } - - S32 glformat, gltype, glpixel_length ; - if(SNAPSHOT_TYPE_DEPTH == type) - { - glpixel_length = 4 ; - glformat = GL_DEPTH_COMPONENT ; - gltype = GL_FLOAT ; - } - else - { - glpixel_length = 3 ; - glformat = GL_RGB ; - gltype = GL_UNSIGNED_BYTE ; - } - - raw->resize(w, h, glpixel_length); - glReadPixels(0, 0, w, h, glformat, gltype, raw->getData()); - - if(SNAPSHOT_TYPE_DEPTH == type) - { - LLViewerCamera* camerap = LLViewerCamera::getInstance(); - F32 depth_conversion_factor_1 = (camerap->getFar() + camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); - F32 depth_conversion_factor_2 = (camerap->getFar() - camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); - - //calculate the depth - for (S32 y = 0 ; y < h ; y++) - { - for(S32 x = 0 ; x < w ; x++) - { - S32 i = (w * y + x) << 2 ; - - F32 depth_float_i = *(F32*)(raw->getData() + i); - - F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float_i * depth_conversion_factor_2)); - U8 depth_byte = F32_to_U8(linear_depth_float, camerap->getNear(), camerap->getFar()); - *(raw->getData() + i + 0) = depth_byte; - *(raw->getData() + i + 1) = depth_byte; - *(raw->getData() + i + 2) = depth_byte; - *(raw->getData() + i + 3) = 255; - } - } - } - - LLFontGL::setFontDisplay(TRUE) ; - LLHUDText::setDisplayText(TRUE) ; - mDisplayScale.setVec(display_scale) ; - mWindowRectRaw = window_rect; - setup3DRender(); - gDisplaySwapBuffers = FALSE; - gDepthDirty = TRUE; - - // POST SNAPSHOT - if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) - { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); - } - - if (hide_hud) - { - LLPipeline::sShowHUDAttachments = TRUE; - } - - setCursor(UI_CURSOR_ARROW); - - if (do_rebuild) - { - // If we had to do a rebuild, that means that the lists of drawables to be rendered - // was empty before we started. - // Need to reset these, otherwise we call state sort on it again when render gets called the next time - // and we stand a good chance of crashing on rebuild because the render drawable arrays have multiple copies of - // objects on them. - gPipeline.resetDrawOrders(); - } - - gSavedSettings.setS32("RenderName", render_name); - - return TRUE;*/ } // Saves the image from the screen to the specified filename and path. -- cgit v1.2.3 From 1f71cd20e831983aa5f4682958a3619b9f37a6f1 Mon Sep 17 00:00:00 2001 From: "Jonathan@Chomp.lindenlab.com" <Jonathan@Chomp.lindenlab.com> Date: Wed, 18 Nov 2009 11:38:31 -0800 Subject: Fixed variable price upload path. --- indra/newview/llassetuploadresponders.cpp | 98 ++++++++++++++++++++++--------- indra/newview/llassetuploadresponders.h | 3 + indra/newview/llviewermenufile.cpp | 7 ++- 3 files changed, 77 insertions(+), 31 deletions(-) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index f3dbe6fa31..dddc6fef1c 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -676,18 +676,32 @@ class LLNewAgentInventoryVariablePriceResponder::Impl public: Impl( const LLUUID& vfile_id, + LLAssetType::EType asset_type, const LLSD& inventory_data) : mVFileID(vfile_id), - mInventoryData(inventory_data) + mAssetType(asset_type), + mInventoryData(inventory_data), + mFileName("") { + if (!gVFS->getExists(vfile_id, asset_type)) + { + llwarns + << "LLAssetUploadResponder called with nonexistant " + << "vfile_id " << vfile_id << llendl; + mVFileID.setNull(); + mAssetType = LLAssetType::AT_NONE; + } } Impl( const std::string& file_name, + LLAssetType::EType asset_type, const LLSD& inventory_data) : mFileName(file_name), + mAssetType(asset_type), mInventoryData(inventory_data) { + mVFileID.setNull(); } std::string getFilenameOrIDString() const @@ -707,8 +721,7 @@ public: LLAssetType::EType getAssetType() const { - return LLAssetType::lookup( - mInventoryData["asset_type"].asString()); + return mAssetType; } LLInventoryType::EType getInventoryType() const @@ -898,22 +911,7 @@ public: { case 0: { - if ( getFilename().empty() ) - { - // we have no filename, use virtual file ID instead - LLHTTPClient::postFile( - confirmation_url, - getVFileID(), - getAssetType(), - responder); - } - else - { - LLHTTPClient::postFile( - confirmation_url, - getFilename(), - responder); - } + confirmUpload(confirmation_url, responder); } break; case 1: @@ -923,11 +921,35 @@ public: return false; } - + + void confirmUpload( + const std::string& confirmation_url, + boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder> responder) + { + if ( getFilename().empty() ) + { + // we have no filename, use virtual file ID instead + LLHTTPClient::postFile( + confirmation_url, + getVFileID(), + getAssetType(), + responder); + } + else + { + LLHTTPClient::postFile( + confirmation_url, + getFilename(), + responder); + } + } + + private: std::string mFileName; LLSD mInventoryData; + LLAssetType::EType mAssetType; LLUUID mVFileID; }; @@ -936,19 +958,23 @@ private: /////////////////////////////////////////////// LLNewAgentInventoryVariablePriceResponder::LLNewAgentInventoryVariablePriceResponder( const LLUUID& vfile_id, + LLAssetType::EType asset_type, const LLSD& inventory_info) { mImpl = new Impl( vfile_id, + asset_type, inventory_info); } LLNewAgentInventoryVariablePriceResponder::LLNewAgentInventoryVariablePriceResponder( const std::string& file_name, + LLAssetType::EType asset_type, const LLSD& inventory_info) { mImpl = new Impl( file_name, + asset_type, inventory_info); } @@ -962,8 +988,9 @@ void LLNewAgentInventoryVariablePriceResponder::errorWithContent( const std::string& reason, const LLSD& content) { - llinfos << "LLNewAgentInventoryVariablePrice::error " << statusNum - << " reason: " << reason << llendl; + lldebugs + << "LLNewAgentInventoryVariablePrice::error " << statusNum + << " reason: " << reason << llendl; if ( content.has("error") ) { @@ -988,6 +1015,7 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) static const std::string _CONFIRM_UPLOAD = "confirm_upload"; static const std::string _UPLOAD_PRICE = "upload_price"; + static const std::string _RESOURCE_COST = "resource_cost"; static const std::string _RSVP = "rsvp"; // Check for application level errors @@ -1022,7 +1050,7 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) mImpl->getItemName(), mImpl->getItemDescription(), content, - content["upload_price"].asInteger()); + content[_UPLOAD_PRICE].asInteger()); // TODO* Add bulk (serial) uploading or add // a super class of this that does so @@ -1031,6 +1059,7 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content) { showConfirmationDialog( content[_UPLOAD_PRICE].asInteger(), + content[_RESOURCE_COST].asInteger(), content[_RSVP].asString()); } else @@ -1047,17 +1076,30 @@ void LLNewAgentInventoryVariablePriceResponder::onApplicationLevelError( void LLNewAgentInventoryVariablePriceResponder::showConfirmationDialog( S32 upload_price, + S32 resource_cost, const std::string& confirmation_url) { - if ( 0 == upload_price ) + if ( 0 == upload_price ) { // don't show confirmation dialog for free uploads, I mean, // they're free! - LLSD body; - body["confirm_upload"] = true; - body["expected_upload_price"] = upload_price; - LLHTTPClient::post(confirmation_url, body, this); + // The creating of a new instrusive_ptr(this) + // creates a new boost::intrusive_ptr + // which is a copy of this. This code is required because + // 'this' is always of type Class* and not the intrusive_ptr, + // and thus, a reference to 'this' is not registered + // by using just plain 'this'. + + // Since LLNewAgentInventoryVariablePriceResponder is a + // reference counted class, it is possible (since the + // reference to a plain 'this' would be missed here) that, + // when using plain ol' 'this', that this object + // would be deleted before the callback is triggered + // and cause sadness. + mImpl->confirmUpload( + confirmation_url, + boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder>(this)); } else { diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index 9102f1597e..929a7a5f74 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -87,10 +87,12 @@ class LLNewAgentInventoryVariablePriceResponder : public: LLNewAgentInventoryVariablePriceResponder( const LLUUID& vfile_id, + LLAssetType::EType asset_type, const LLSD& inventory_info); LLNewAgentInventoryVariablePriceResponder( const std::string& file_name, + LLAssetType::EType asset_type, const LLSD& inventory_info); virtual ~LLNewAgentInventoryVariablePriceResponder(); @@ -105,6 +107,7 @@ public: const LLSD& error); virtual void showConfirmationDialog( S32 upload_price, + S32 resource_cost, const std::string& confirmation_url); private: diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 8b101748a3..2c0a41e1ff 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1175,9 +1175,9 @@ BOOL upload_new_variable_price_resource( if ( !url.empty() ) { - llinfos << "New Agent Inventory variable price upload" - << llendl; - + lldebugs + << "New Agent Inventory variable price upload" << llendl; + // Each of the two capabilities has similar data, so // let's reuse that code @@ -1200,6 +1200,7 @@ BOOL upload_new_variable_price_resource( body, new LLNewAgentInventoryVariablePriceResponder( uuid, + asset_type, body)); return TRUE; -- cgit v1.2.3 From 81bfdcbfae4f203e60f00794966383b01475995b Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 18 Nov 2009 18:10:48 -0600 Subject: Tetrahedron displays in place of unloaded mesh. Still has some LOD issues. --- indra/llmath/llvolume.cpp | 96 +++++++++++++++++++++++++++++++++++++++++++++- indra/llmath/llvolume.h | 1 + indra/newview/pipeline.cpp | 9 ++++- 3 files changed, 103 insertions(+), 3 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index f252b2a232..84da1b3c62 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1925,7 +1925,9 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) S32 lod = llclamp((S32) mDetail, 0, 3); - while (lod < 4 && header[nm[lod]]["offset"].asInteger() == -1) + while (lod < 4 && + (header[nm[lod]]["offset"].asInteger() == -1 || + header[nm[lod]]["size"].asInteger() == 0 )) { ++lod; } @@ -1934,7 +1936,9 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) { lod = llclamp((S32) mDetail, 0, 3); - while (lod >= 0 && header[nm[lod]]["offset"].asInteger() == -1) + while (lod >= 0 && + (header[nm[lod]]["offset"].asInteger() == -1 || + header[nm[lod]]["size"].asInteger() == 0) ) { --lod; } @@ -2135,6 +2139,94 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) return TRUE; } +void tetrahedron_set_normal(LLVolumeFace::VertexData* cv) +{ + LLVector3 nrm = (cv[1].mPosition-cv[0].mPosition)%(cv[2].mPosition-cv[0].mPosition); + + nrm.normVec(); + + cv[0].mNormal = nrm; + cv[1].mNormal = nrm; + cv[2].mNormal = nrm; +} + +void LLVolume::makeTetrahedron() +{ + mVolumeFaces.clear(); + + LLVolumeFace face; + + F32 x = 0.5f; + LLVector3 p[] = + { //unit tetrahedron corners + LLVector3(x,x,x), + LLVector3(-x,-x,x), + LLVector3(-x,x,-x), + LLVector3(x,-x,-x) + }; + + LLVolumeFace::VertexData cv[3]; + + //set texture coordinates + cv[0].mTexCoord = LLVector2(0,0); + cv[1].mTexCoord = LLVector2(1,0); + cv[2].mTexCoord = LLVector2(0.5f, 0.5f*F_SQRT3); + + + //side 1 + cv[0].mPosition = p[1]; + cv[1].mPosition = p[0]; + cv[2].mPosition = p[2]; + + tetrahedron_set_normal(cv); + + face.mVertices.push_back(cv[0]); + face.mVertices.push_back(cv[1]); + face.mVertices.push_back(cv[2]); + + //side 2 + cv[0].mPosition = p[3]; + cv[1].mPosition = p[0]; + cv[2].mPosition = p[1]; + + tetrahedron_set_normal(cv); + + face.mVertices.push_back(cv[0]); + face.mVertices.push_back(cv[1]); + face.mVertices.push_back(cv[2]); + + //side 3 + cv[0].mPosition = p[3]; + cv[1].mPosition = p[1]; + cv[2].mPosition = p[2]; + + tetrahedron_set_normal(cv); + + face.mVertices.push_back(cv[0]); + face.mVertices.push_back(cv[1]); + face.mVertices.push_back(cv[2]); + + //side 4 + cv[0].mPosition = p[2]; + cv[1].mPosition = p[0]; + cv[2].mPosition = p[3]; + + tetrahedron_set_normal(cv); + + face.mVertices.push_back(cv[0]); + face.mVertices.push_back(cv[1]); + face.mVertices.push_back(cv[2]); + + //set index buffer + for (U32 i = 0; i < 12; i++) + { + face.mIndices.push_back(i); + } + + mVolumeFaces.push_back(face); + mSculptLevel = 0; +} + void LLVolume::copyVolumeFaces(LLVolume* volume) { mVolumeFaces = volume->mVolumeFaces; diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index d2727d8f21..bf2854ede9 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -969,6 +969,7 @@ protected: public: virtual BOOL createVolumeFacesFromFile(const std::string& file_name); virtual BOOL createVolumeFacesFromStream(std::istream& is); + virtual void makeTetrahedron(); protected: BOOL mUnique; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c262e94ff4..3410ad6559 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8976,6 +8976,9 @@ void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) group->derefLOD(lod); } } + + //nothing found, so make a tetrahedron + volume->makeTetrahedron(); } } @@ -9102,7 +9105,11 @@ void LLPipeline::notifyLoadedMeshes() if (valid) { - mesh->mTargetVolume->copyVolumeFaces(mesh->mVolume); + if (mesh->mVolume->getNumVolumeFaces() > 0) + { + mesh->mTargetVolume->copyVolumeFaces(mesh->mVolume); + } + for (std::set<LLUUID>::iterator vobj_iter = obj_iter->second.begin(); vobj_iter != obj_iter->second.end(); ++vobj_iter) { LLVOVolume* vobj = (LLVOVolume*) gObjectList.findObject(*vobj_iter); -- cgit v1.2.3 From 62233f22469cdc66042fc7bbbbd367dbb7212fde Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 24 Nov 2009 07:38:04 -0600 Subject: Fix for copying of tetrahedrons in place of mesh LODs. Fix for bad tetrahedron bounding box. Bad fix for simultaneous loading of multiple LODs. --- indra/llmath/llvolume.cpp | 31 +++++++++++++++++++++++++-- indra/llmath/llvolume.h | 5 ++++- indra/llmath/llvolumemgr.cpp | 13 ++++++++++++ indra/llmath/llvolumemgr.h | 1 + indra/newview/llvovolume.cpp | 31 ++++----------------------- indra/newview/llvovolume.h | 1 - indra/newview/pipeline.cpp | 50 +++++++++++++++++++++++++++++++++++--------- indra/newview/pipeline.h | 6 ++++-- 8 files changed, 95 insertions(+), 43 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 84da1b3c62..515b1061f9 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1676,6 +1676,7 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mFaceMask = 0x0; mDetail = detail; mSculptLevel = -2; + mIsTetrahedron = FALSE; mLODScaleBias.setVec(1,1,1); // set defaults @@ -1905,7 +1906,7 @@ BOOL LLVolume::createVolumeFacesFromFile(const std::string& file_name) BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) { mSculptLevel = -1; // default is an error occured - + LLSD header; { if (!LLSDSerialize::deserialize(header, is, 1024*1024*1024)) @@ -2048,6 +2049,11 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) { U32 face_count = mdl.size(); + if (face_count == 0) + { + llerrs << "WTF?" << llendl; + } + mVolumeFaces.resize(face_count); for (U32 i = 0; i < face_count; ++i) @@ -2063,8 +2069,9 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) //copy out indices face.mIndices.resize(idx.size()/2); - if (idx.empty()) + if (idx.empty() || face.mIndices.size() < 3) { //why is there an empty index list? + llerrs <<"WTF?" << llendl; continue; } @@ -2150,6 +2157,11 @@ void tetrahedron_set_normal(LLVolumeFace::VertexData* cv) cv[2].mNormal = nrm; } +BOOL LLVolume::isTetrahedron() +{ + return mIsTetrahedron; +} + void LLVolume::makeTetrahedron() { mVolumeFaces.clear(); @@ -2165,6 +2177,9 @@ void LLVolume::makeTetrahedron() LLVector3(x,-x,-x) }; + face.mExtents[0].setVec(-x,-x,-x); + face.mExtents[1].setVec(x,x,x); + LLVolumeFace::VertexData cv[3]; //set texture coordinates @@ -2225,12 +2240,19 @@ void LLVolume::makeTetrahedron() mVolumeFaces.push_back(face); mSculptLevel = 0; + mIsTetrahedron = TRUE; } void LLVolume::copyVolumeFaces(LLVolume* volume) { + if (volume->isTetrahedron()) + { + llerrs << "WTF?" << llendl; + } + mVolumeFaces = volume->mVolumeFaces; mSculptLevel = 0; + mIsTetrahedron = FALSE; } S32 const LL_SCULPT_MESH_MAX_FACES = 8; @@ -2615,6 +2637,11 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, LLMemType m1(LLMemType::MTYPE_VOLUME); U8 sculpt_type = mParams.getSculptType(); + if (sculpt_type & LL_SCULPT_TYPE_MASK == LL_SCULPT_TYPE_MESH) + { + llerrs << "WTF?" << llendl; + } + BOOL data_is_empty = FALSE; if (sculpt_width == 0 || sculpt_height == 0 || sculpt_components < 3 || sculpt_data == NULL) diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index bf2854ede9..8e57f2e280 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -904,7 +904,8 @@ public: BOOL isUnique() const { return mUnique; } S32 getSculptLevel() const { return mSculptLevel; } - + void setSculptLevel(S32 level) { mSculptLevel = level; } + S32 *getTriangleIndices(U32 &num_indices) const; // returns number of triangle indeces required for path/profile mesh @@ -970,11 +971,13 @@ public: virtual BOOL createVolumeFacesFromFile(const std::string& file_name); virtual BOOL createVolumeFacesFromStream(std::istream& is); virtual void makeTetrahedron(); + virtual BOOL isTetrahedron(); protected: BOOL mUnique; F32 mDetail; S32 mSculptLevel; + BOOL mIsTetrahedron; LLVolumeParams mParams; LLPath *mPathp; diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index 61c5a0adc9..419e0015ba 100644 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -375,6 +375,19 @@ F32 LLVolumeLODGroup::getVolumeScaleFromDetail(const S32 detail) return mDetailScales[detail]; } +S32 LLVolumeLODGroup::getVolumeDetailFromScale(const F32 detail) +{ + for (S32 i = 1; i < 4; i++) + { + if (mDetailScales[i] > detail) + { + return i-1; + } + } + + return 3; +} + F32 LLVolumeLODGroup::dump() { F32 usage = 0.f; diff --git a/indra/llmath/llvolumemgr.h b/indra/llmath/llvolumemgr.h index a78ea76a1a..f5dc4cd748 100644 --- a/indra/llmath/llvolumemgr.h +++ b/indra/llmath/llvolumemgr.h @@ -59,6 +59,7 @@ public: static S32 getDetailFromTan(const F32 tan_angle); static void getDetailProximity(const F32 tan_angle, F32 &to_lower, F32& to_higher); static F32 getVolumeScaleFromDetail(const S32 detail); + static S32 getVolumeDetailFromScale(F32 scale); LLVolume* refLOD(const S32 detail); BOOL derefLOD(LLVolume *volumep); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4c126d8fd9..64c2e9e8ec 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -163,7 +163,6 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mRelativeXformInvTrans.setIdentity(); mLOD = MIN_LOD; - mMeshSculptLevel = -2; mTextureAnimp = NULL; mVObjRadius = LLVector3(1,1,0.5f).length(); mNumFaces = 0; @@ -682,25 +681,7 @@ void LLVOVolume::updateTextureVirtualSize() LLUUID id = sculpt_params->getSculptTexture(); U8 sculpt_type = sculpt_params->getSculptType(); - if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) - // mesh is a mesh - { - if (mMeshSculptLevel == -2) - { - // get the asset please - gPipeline.loadMesh(this, id); - /*gAssetStorage->getAssetData(id, LLAssetType::AT_MESH, (LLGetAssetCallback)NULL, NULL, TRUE); - - if (gAssetStorage->hasLocalAsset(id, LLAssetType::AT_MESH)) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE); - mSculptChanged = TRUE; - }*/ - } - } - - else - // mesh is a sculptie + if ((sculpt_type & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH) { mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); @@ -902,14 +883,10 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) { if (getVolume()->getNumVolumeFaces() == 0) - { - //mesh is not loaded, request pipeline load this mesh + { + //load request not yet issued, request pipeline load this mesh LLUUID asset_id = volume_params.getSculptID(); - gPipeline.loadMesh(this, asset_id, detail); - } - else - { - mMeshSculptLevel = 1; + gPipeline.loadMesh(this, asset_id, LLVolumeLODGroup::getVolumeDetailFromScale(getVolume()->getDetail())); } } else // otherwise is sculptie diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 4b247f3778..f14a71130b 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -298,7 +298,6 @@ private: LLFrameTimer mTextureUpdateTimer; S32 mLOD; BOOL mLODChanged; - S32 mMeshSculptLevel; BOOL mSculptChanged; F32 mSpotLightPriority; LLMatrix4 mRelativeXform; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3410ad6559..0ee619244b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8913,23 +8913,29 @@ LLCullResult::sg_list_t::iterator LLPipeline::endAlphaGroups() void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) { + + if (detail < 0 || detail > 4) + { + return; + } + { LLMutexLock lock(mMeshMutex); //add volume to list of loading meshes - mesh_load_map::iterator iter = mLoadingMeshes.find(mesh_id); - if (iter != mLoadingMeshes.end()) + mesh_load_map::iterator iter = mLoadingMeshes[detail].find(mesh_id); + if (iter != mLoadingMeshes[detail].end()) { //request pending for this mesh, append volume id to list iter->second.insert(vobj->getID()); return; } //first request for this mesh - mLoadingMeshes[mesh_id].insert(vobj->getID()); + mLoadingMeshes[detail][mesh_id].insert(vobj->getID()); } if (gAssetStorage->hasLocalAsset(mesh_id, LLAssetType::AT_MESH)) { //already have asset, load desired LOD in background - mPendingMeshes.push_back(new LLMeshThread(mesh_id, vobj->getVolume())); + mPendingMeshes.push_back(new LLMeshThread(mesh_id, vobj->getVolume(), detail)); } else { //fetch asset and load when done @@ -8952,7 +8958,7 @@ void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) for (S32 i = detail-1; i >= 0; --i) { LLVolume* lod = group->refLOD(i); - if (lod && lod->getNumVolumeFaces() > 0) + if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0) { volume->copyVolumeFaces(lod); group->derefLOD(lod); @@ -8966,7 +8972,7 @@ void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) for (S32 i = detail+1; i < 4; ++i) { LLVolume* lod = group->refLOD(i); - if (lod && lod->getNumVolumeFaces() > 0) + if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0) { volume->copyVolumeFaces(lod); group->derefLOD(lod); @@ -8976,6 +8982,10 @@ void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) group->derefLOD(lod); } } + else + { + llerrs << "WTF?" << llendl; + } //nothing found, so make a tetrahedron volume->makeTetrahedron(); @@ -8992,12 +9002,22 @@ void LLPipeline::getMeshAssetCallback(LLVFS *vfs, } -LLPipeline::LLMeshThread::LLMeshThread(LLUUID mesh_id, LLVolume* target) +LLPipeline::LLMeshThread::LLMeshThread(LLUUID mesh_id, LLVolume* target, S32 detail) : LLThread("mesh_loading_thread") { mMeshID = mesh_id; mVolume = NULL; mDetail = target->getDetail(); + + if (detail == -1) + { + mDetailIndex = LLVolumeLODGroup::getVolumeDetailFromScale(target->getDetail()); + } + else + { + mDetailIndex = detail; + } + mTargetVolume = target; } @@ -9073,6 +9093,10 @@ void LLPipeline::notifyLoadedMeshes() for (std::list<LLMeshThread*>::iterator iter = mLoadedMeshes.begin(); iter != mLoadedMeshes.end(); ++iter) { //for each mesh done loading + + + + LLMeshThread* mesh = *iter; if (!mesh->isStopped()) @@ -9081,10 +9105,12 @@ void LLPipeline::notifyLoadedMeshes() continue; } + S32 detail = mesh->mDetailIndex; + //get list of objects waiting to be notified this mesh is loaded - mesh_load_map::iterator obj_iter = mLoadingMeshes.find(mesh->mMeshID); + mesh_load_map::iterator obj_iter = mLoadingMeshes[detail].find(mesh->mMeshID); - if (mesh->mVolume && obj_iter != mLoadingMeshes.end()) + if (mesh->mVolume && obj_iter != mLoadingMeshes[detail].end()) { //make sure target volume is still valid BOOL valid = FALSE; @@ -9109,6 +9135,10 @@ void LLPipeline::notifyLoadedMeshes() { mesh->mTargetVolume->copyVolumeFaces(mesh->mVolume); } + else + { + llwarns << "Mesh loading returned empty volume." << llendl; + } for (std::set<LLUUID>::iterator vobj_iter = obj_iter->second.begin(); vobj_iter != obj_iter->second.end(); ++vobj_iter) { @@ -9120,7 +9150,7 @@ void LLPipeline::notifyLoadedMeshes() } } - mLoadingMeshes.erase(mesh->mMeshID); + mLoadingMeshes[detail].erase(mesh->mMeshID); } delete mesh; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 23e98aa0d6..a31379a209 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -676,8 +676,9 @@ public: protected: std::vector<LLFace*> mSelectedFaces; + typedef std::map<LLUUID, std::set<LLUUID> > mesh_load_map; - mesh_load_map mLoadingMeshes; + mesh_load_map mLoadingMeshes[4]; LLMutex* mMeshMutex; @@ -688,7 +689,8 @@ protected: LLVolume* mTargetVolume; LLUUID mMeshID; F32 mDetail; - LLMeshThread(LLUUID mesh_id, LLVolume* target); + S32 mDetailIndex; + LLMeshThread(LLUUID mesh_id, LLVolume* target, S32 detail = -1); ~LLMeshThread(); void run(); }; -- cgit v1.2.3 From 6d66910c6e2fbb25bf8b5c7b90e795f350342104 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 25 Nov 2009 11:35:41 -0600 Subject: Fix for spam on invalid mesh asset. Fix for index buffer overflow spam and crash in llvertexbuffer. --- indra/llmath/llvolume.cpp | 5 ----- indra/newview/llvovolume.cpp | 5 +++-- indra/newview/pipeline.cpp | 18 ++++++------------ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 515b1061f9..3e547aec6f 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2245,11 +2245,6 @@ void LLVolume::makeTetrahedron() void LLVolume::copyVolumeFaces(LLVolume* volume) { - if (volume->isTetrahedron()) - { - llerrs << "WTF?" << llendl; - } - mVolumeFaces = volume->mVolumeFaces; mSculptLevel = 0; mIsTetrahedron = FALSE; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 64c2e9e8ec..3e9db86cfa 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -882,7 +882,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool // if it's a mesh if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) { - if (getVolume()->getNumVolumeFaces() == 0) + if (getVolume()->getNumVolumeFaces() == 0 || getVolume()->isTetrahedron()) { //load request not yet issued, request pipeline load this mesh LLUUID asset_id = volume_params.getSculptID(); @@ -924,7 +924,8 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool void LLVOVolume::notifyMeshLoaded() { mSculptChanged = TRUE; - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE); + dirtySpatialGroup(TRUE); } // sculpt replaces generate() for sculpted surfaces diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0ee619244b..af3a35615c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1807,8 +1807,6 @@ void LLPipeline::rebuildPriorityGroups() assertInitialized(); - notifyLoadedMeshes(); - // Iterate through all drawables on the priority build queue, for (LLSpatialGroup::sg_list_t::iterator iter = mGroupQ1.begin(); iter != mGroupQ1.end(); ++iter) @@ -1888,6 +1886,8 @@ void LLPipeline::updateGeom(F32 max_dtime) // for now, only LLVOVolume does this to throttle LOD changes LLVOVolume::preUpdateGeom(); + notifyLoadedMeshes(); + // Iterate through all drawables on the priority build queue, for (LLDrawable::drawable_list_t::iterator iter = mBuildQ1.begin(); iter != mBuildQ1.end();) @@ -8913,7 +8913,6 @@ LLCullResult::sg_list_t::iterator LLPipeline::endAlphaGroups() void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) { - if (detail < 0 || detail > 4) { return; @@ -9093,10 +9092,6 @@ void LLPipeline::notifyLoadedMeshes() for (std::list<LLMeshThread*>::iterator iter = mLoadedMeshes.begin(); iter != mLoadedMeshes.end(); ++iter) { //for each mesh done loading - - - - LLMeshThread* mesh = *iter; if (!mesh->isStopped()) @@ -9131,14 +9126,13 @@ void LLPipeline::notifyLoadedMeshes() if (valid) { - if (mesh->mVolume->getNumVolumeFaces() > 0) - { - mesh->mTargetVolume->copyVolumeFaces(mesh->mVolume); - } - else + if (mesh->mVolume->getNumVolumeFaces() <= 0) { llwarns << "Mesh loading returned empty volume." << llendl; + mesh->mVolume->makeTetrahedron(); } + + mesh->mTargetVolume->copyVolumeFaces(mesh->mVolume); for (std::set<LLUUID>::iterator vobj_iter = obj_iter->second.begin(); vobj_iter != obj_iter->second.end(); ++vobj_iter) { -- cgit v1.2.3 From f31f817ee61fa0f8fc05d2caa24f7674852629e5 Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Wed, 25 Nov 2009 13:10:09 -0600 Subject: retry asset upload failures. --- indra/newview/llassetuploadresponders.cpp | 17 +++++++++++++++++ indra/newview/llassetuploadresponders.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index dddc6fef1c..6e32a91078 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -256,6 +256,7 @@ void LLAssetUploadResponder::result(const LLSD& content) lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl; std::string state = content["state"]; + if (state == "upload") { uploadUpload(content); @@ -330,6 +331,22 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( { } +// virtual +void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reason) +{ + LLAssetUploadResponder::error(statusNum, reason); + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE); +} + + +//virtual +void LLNewAgentInventoryResponder::uploadFailure(const LLSD& content) +{ + LLAssetUploadResponder::uploadFailure(content); + + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], FALSE); +} + //virtual void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) { diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index 929a7a5f74..c869988203 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -74,7 +74,9 @@ public: const LLSD& post_data, const std::string& file_name, LLAssetType::EType asset_type); + virtual void error(U32 statusNum, const std::string& reason); virtual void uploadComplete(const LLSD& content); + virtual void uploadFailure(const LLSD& content); }; // A base class which goes through and performs some default -- cgit v1.2.3 From 062a2dd309ca5521d4045eb721496476f43d24dc Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 30 Nov 2009 15:32:10 -0600 Subject: Remove zero area triangles from meshes post-import. --- indra/llmath/llvolume.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 3e547aec6f..1d36da7f52 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1692,10 +1692,9 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mGenerateSingleFace = generate_single_face; - generate(); - if (mParams.getSculptID().isNull() && params.getSculptType() == LL_SCULPT_TYPE_NONE) { + generate(); createVolumeFaces(); } } -- cgit v1.2.3 From f039fa98efedc91965338ef53624279f99914205 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 30 Nov 2009 17:02:38 -0600 Subject: Fix for silly crash due to LLPrimitive having 0 texture entries. --- indra/llmath/llvolume.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 1d36da7f52..858bd9edea 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1692,9 +1692,10 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mGenerateSingleFace = generate_single_face; + generate(); + if (mParams.getSculptID().isNull() && params.getSculptType() == LL_SCULPT_TYPE_NONE) { - generate(); createVolumeFaces(); } } -- cgit v1.2.3 From bb2631180a85df343e6d816fc37d881af31d49fb Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Tue, 1 Dec 2009 17:40:52 -0600 Subject: CTS-4 Only part of an uploaded mesh renders. --- indra/llmath/llvolume.cpp | 1 - indra/llmath/llvolume.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 858bd9edea..fb2de92e35 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2250,7 +2250,6 @@ void LLVolume::copyVolumeFaces(LLVolume* volume) mIsTetrahedron = FALSE; } -S32 const LL_SCULPT_MESH_MAX_FACES = 8; S32 LLVolume::getNumFaces() const { diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 8e57f2e280..59c60ccd92 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -192,6 +192,7 @@ const U8 LL_SCULPT_TYPE_MESH = 5; const U8 LL_SCULPT_FLAG_INVERT = 64; const U8 LL_SCULPT_FLAG_MIRROR = 128; +const S32 LL_SCULPT_MESH_MAX_FACES = 8; class LLProfileParams { -- cgit v1.2.3 From 00962a68e24c4b628716aaa4390468dc5cc6194e Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Wed, 2 Dec 2009 11:56:21 -0600 Subject: CTS-37 Mesh-type assets can't be added to the inventory of a prim --- indra/newview/llpanelobjectinventory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 0c2e87aa3d..7a7372af6e 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1593,6 +1593,11 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* object->getUUID(), object->getName()); break; + case LLAssetType::AT_MESH: + new_bridge = new LLTaskMeshBridge(panel, + object->getUUID(), + object->getName()); + break; break; default: -- cgit v1.2.3 From 9d3968bb837828568bf58113b8315c8ca2e8dae1 Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Thu, 3 Dec 2009 15:12:30 -0800 Subject: hopefully: linux libraries for colladadom (pcre, etc.) --- install.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.xml b/install.xml index 68562ca37a..5629682404 100644 --- a/install.xml +++ b/install.xml @@ -273,9 +273,9 @@ <key>linux</key> <map> <key>md5sum</key> - <string>01d17182ecc6728edaa520b3c780d194</string> + <string>dde909f84fd2b7c56138f8fd193664c4</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-linux-20090921.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-linux-20091203.tar.bz2</uri> </map> <key>windows</key> <map> -- cgit v1.2.3 From 1590f187cf4e33bbb44215ea65fdc291eefd7971 Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Mon, 7 Dec 2009 16:58:05 -0800 Subject: Fixing merge borkasaurs. --- indra/newview/llassetuploadresponders.cpp | 16 ++++++++-------- indra/newview/lltooldraganddrop.cpp | 11 +---------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 6b1897d077..bc606c04a9 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -92,7 +92,7 @@ static void on_new_single_inventory_upload_complete( LLSD args; args["AMOUNT"] = llformat("%d", upload_price); - LLNotifications::instance().add("UploadPayment", args); + LLNotificationsUtil::add("UploadPayment", args); } // Actually add the upload to viewer inventory @@ -157,12 +157,12 @@ static void on_new_single_inventory_upload_complete( // Show the preview panel for textures and sounds to let // user know that the image (or snapshot) arrived intact. - LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); - if ( view ) + LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(); + if ( panel ) { LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); - view->getPanel()->setSelection( + panel->setSelection( server_response["new_inventory_item"].asUUID(), TAKE_FOCUS_NO); @@ -172,7 +172,7 @@ static void on_new_single_inventory_upload_complete( (LLFilePicker::instance().getFileCount() <= FILE_COUNT_DISPLAY_THRESHOLD) ) { - view->getPanel()->openSelected(); + panel->openSelected(); } // restore keyboard focus @@ -775,7 +775,7 @@ public: args["REASON"] = reason; - LLNotifications::instance().add("CannotUploadReason", args); + LLNotificationsUtil::add("CannotUploadReason", args); LLUploadDialog::modalUploadFinished(); } @@ -917,7 +917,7 @@ public: S32 option; std::string confirmation_url; - option = LLNotification::getSelectedOption( + option = LLNotificationsUtil::getSelectedOption( notification, response); @@ -1141,7 +1141,7 @@ void LLNewAgentInventoryVariablePriceResponder::showConfirmationDialog( // when using plain ol' 'this', that this object // would be deleted before the callback is triggered // and cause sadness. - LLNotifications::instance().add( + LLNotificationsUtil::add( "UploadCostConfirmation", substitutions, payload, diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 03c3900235..b367d6aec5 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -385,18 +385,9 @@ LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary() addEntry(DAD_ANIMATION, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_GESTURE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dActivateGesture, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_LINK, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_MESH, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); // TODO: animation on self could play it? edit it? // TODO: gesture on self could play it? edit it? - - -// Source: DAD_MESH - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, }; LLToolDragAndDrop::LLToolDragAndDrop() -- cgit v1.2.3 From cd138869d5bfcf40d3d13d7b887e36263e2919d9 Mon Sep 17 00:00:00 2001 From: Palmer Truelson <palmer@lindenlab.com> Date: Mon, 7 Dec 2009 17:38:45 -0800 Subject: fix of another merge borkasaurus --- indra/newview/llassetuploadresponders.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index bc606c04a9..f5d5559bda 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -380,7 +380,6 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) mPostData["description"], content, expected_upload_cost); - LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); // continue uploading for bulk uploads -- cgit v1.2.3 From 7a7eced4a619d98d808abba3f0bf951bcf4cd95a Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Tue, 8 Dec 2009 16:06:18 -0800 Subject: Fix of last merge borkasaur. Left off a comma on defining the mesh array. Also switched our mesh icon code to sync with viewer 2 and cleared out extra notification --- indra/newview/llinventorybridge.cpp | 4 +-- indra/newview/llviewertexteditor.cpp | 2 +- indra/newview/skins/default/textures/textures.xml | 1 + .../xui/en/floater_inventory_view_finder.xml | 29 +++++++++++++++++----- .../newview/skins/default/xui/en/notifications.xml | 21 ++++------------ 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 59bfc77723..93cfbddc92 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -125,9 +125,9 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Gesture", "Inv_LinkItem", - "Inv_LinkFolder" + "Inv_LinkFolder", - "inv_item_mesh.tga" + "Inv_Mesh" }; // +=================================================+ diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 569ceea431..80b8999a7a 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -534,7 +534,7 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break; case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break; case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; - case LLAssetType::AT_MESH: img_name = "inv_item_mesh.tga"; break; + case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; default: llassert(0); } diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index ac84042584..ff9da8c8a0 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -233,6 +233,7 @@ with the same filename but different name <texture name="Inv_LookFolderOpen" file_name="icons/Inv_LookFolderOpen.png" preload="false" /> <texture name="Inv_LookFolderClosed" file_name="icons/Inv_LookFolderClosed.png" preload="false" /> <texture name="Inv_Landmark" file_name="icons/Inv_Landmark.png" preload="false" /> + <texture name="Inv_Mesh" file_name="icons/Inv_Mesh.png" preload="false" /> <texture name="Inv_Notecard" file_name="icons/Inv_Notecard.png" preload="false" /> <texture name="Inv_Object" file_name="icons/Inv_Object.png" preload="false" /> <texture name="Inv_Pants" file_name="icons/Inv_Pants.png" preload="false" /> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml index 90fee857fb..388825d31a 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml @@ -102,6 +102,23 @@ name="icon_notecard" top="122" width="16" /> + <check_box + height="16" + label="Meshes" + layout="topleft" + left_pad="2" + name="check_mesh" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="Inv_Mesh" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_mesh" + top="142" + width="16" /> <check_box height="16" label="Notecards" @@ -117,7 +134,7 @@ left="8" mouse_opaque="true" name="icon_object" - top="142" + top="162" width="16" /> <check_box height="16" @@ -134,7 +151,7 @@ left="8" mouse_opaque="true" name="icon_script" - top="162" + top="182" width="16" /> <check_box height="16" @@ -151,7 +168,7 @@ left="8" mouse_opaque="true" name="icon_sound" - top="182" + top="202" width="16" /> <check_box height="16" @@ -168,7 +185,7 @@ left="8" mouse_opaque="true" name="icon_texture" - top="202" + top="222" width="16" /> <check_box height="16" @@ -185,7 +202,7 @@ left="8" mouse_opaque="true" name="icon_snapshot" - top="222" + top="242" width="16" /> <check_box height="16" @@ -203,7 +220,7 @@ layout="topleft" left="8" name="All" - top="242" + top="262" width="100" /> <button follows="left|top" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b8b9acbc10..4fbaf06553 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5803,22 +5803,11 @@ Your voice has been muted by moderator. name="okbutton" yestext="OK"/> </notification> - - <notification - icon="alertmodal.tga" - name="ConfirmClearTeleportHistory" - type="alertmodal"> -Are you sure you want to delete your teleport history? - <usetemplate - name="okcancelbuttons" - notext="Cancel" - yestext="OK"/> - </notification> - - <notification - icon="alertmodal.tga" - name="UploadCostConfirmation" - type="alertmodal"> + + <notification + icon="alertmodal.tga" + name="UploadCostConfirmation" + type="alertmodal"> This upload will cost L$[PRICE], do you wish to continue with the upload? <usetemplate name="okcancelbuttons" -- cgit v1.2.3 From 695969c77066de5032bdc9caefecf9b32b076b2f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 11 Dec 2009 14:47:11 -0600 Subject: HTTP Mesh fetch FTW.. still busted --- indra/llcommon/llthread.cpp | 31 +++- indra/llcommon/llthread.h | 22 +++ indra/llmath/llvolume.cpp | 7 +- indra/llmath/llvolume.h | 2 + indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/settings.xml | 2 +- indra/newview/llappviewer.cpp | 8 + indra/newview/llviewerregion.cpp | 1 + indra/newview/llvovolume.cpp | 15 +- indra/newview/pipeline.cpp | 255 +------------------------------- indra/newview/pipeline.h | 34 +---- 11 files changed, 93 insertions(+), 286 deletions(-) diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index b1175836b7..df7ea214cc 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -62,6 +62,9 @@ // //---------------------------------------------------------------------------- +U32 ll_thread_local sThreadID = 0; +U32 LLThread::sIDIter = 0; + // // Handed to the APR thread creation function // @@ -72,6 +75,8 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap // Set thread state to running threadp->mStatus = RUNNING; + sThreadID = threadp->mID; + // Run the user supplied function threadp->run(); @@ -90,6 +95,8 @@ LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : mAPRThreadp(NULL), mStatus(STOPPED) { + mID = ++sIDIter; + // Thread creation probably CAN be paranoid about APR being initialized, if necessary if (poolp) { @@ -273,7 +280,7 @@ void LLThread::wakeLocked() //============================================================================ LLMutex::LLMutex(apr_pool_t *poolp) : - mAPRMutexp(NULL) + mAPRMutexp(NULL), mCount(0), mLockingThread(NO_THREAD) { //if (poolp) //{ @@ -305,7 +312,14 @@ LLMutex::~LLMutex() void LLMutex::lock() { + if (mLockingThread == sThreadID) + { //redundant lock + mCount++; + return; + } + apr_thread_mutex_lock(mAPRMutexp); + #if MUTEX_DEBUG // Have to have the lock before we can access the debug info U32 id = LLThread::currentID(); @@ -313,10 +327,18 @@ void LLMutex::lock() llerrs << "Already locked in Thread: " << id << llendl; mIsLocked[id] = TRUE; #endif + + mLockingThread = sThreadID; } void LLMutex::unlock() { + if (mCount > 0) + { //not the root unlock + mCount--; + return; + } + #if MUTEX_DEBUG // Access the debug info while we have the lock U32 id = LLThread::currentID(); @@ -324,6 +346,8 @@ void LLMutex::unlock() llerrs << "Not locked in Thread: " << id << llendl; mIsLocked[id] = FALSE; #endif + + mLockingThread = NO_THREAD; apr_thread_mutex_unlock(mAPRMutexp); } @@ -341,6 +365,11 @@ bool LLMutex::isLocked() } } +U32 LLMutex::lockingThread() const +{ + return mLockingThread; +} + //============================================================================ LLCondition::LLCondition(apr_pool_t *poolp) : diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index d8aa90de2e..2d553b5258 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -40,8 +40,17 @@ class LLThread; class LLMutex; class LLCondition; +#if LL_WINDOWS +#define ll_thread_local __declspec(thread) +#else +#define ll_thread_local __thread +#endif + class LL_COMMON_API LLThread { +private: + static U32 sIDIter; + public: typedef enum e_thread_status { @@ -82,6 +91,8 @@ public: apr_pool_t *getAPRPool() { return mAPRPoolp; } LLVolatileAPRPool* getLocalAPRFilePool() { return mLocalAPRFilePoolp ; } + U32 getID() const { return mID; } + private: BOOL mPaused; @@ -96,6 +107,7 @@ protected: apr_pool_t *mAPRPoolp; BOOL mIsLocalPool; EThreadStatus mStatus; + U32 mID; //a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used. //Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes. @@ -133,17 +145,27 @@ protected: class LL_COMMON_API LLMutex { public: + typedef enum + { + NO_THREAD = 0xFFFFFFFF + } e_locking_thread; + LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex ~LLMutex(); void lock(); // blocks void unlock(); bool isLocked(); // non-blocking, but does do a lock/unlock so not free + U32 lockingThread() const; //get ID of locking thread protected: apr_thread_mutex_t *mAPRMutexp; + mutable U32 mCount; + mutable U32 mLockingThread; + apr_pool_t *mAPRPoolp; BOOL mIsLocalPool; + S32 mLockCount; #if MUTEX_DEBUG std::map<U32, BOOL> mIsLocked; #endif diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index fb2de92e35..44ff173502 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1952,8 +1952,12 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) } is.seekg(header[nm[lod]]["offset"].asInteger(), std::ios_base::cur); - + return unpackVolumeFaces(is, header[nm[lod]]["size"].asInteger()); +} + +BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) +{ U8* result = NULL; U32 cur_size = 0; @@ -1964,7 +1968,6 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) const U32 CHUNK = 65536; - S32 size = header[nm[lod]]["size"].asInteger(); U8 *in = new U8[size]; is.read((char*) in, size); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 59c60ccd92..9970b24a94 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -971,6 +971,8 @@ protected: public: virtual BOOL createVolumeFacesFromFile(const std::string& file_name); virtual BOOL createVolumeFacesFromStream(std::istream& is); + virtual BOOL unpackVolumeFaces(std::istream& is, S32 size); + virtual void makeTetrahedron(); virtual BOOL isTetrahedron(); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 23f8b4b9ca..52adc740e3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -284,6 +284,7 @@ set(viewer_SOURCE_FILES llmediaremotectrl.cpp llmemoryview.cpp llmenucommands.cpp + llmeshrepository.cpp llmetricperformancetester.cpp llmimetypes.cpp llmorphview.cpp @@ -789,6 +790,7 @@ set(viewer_HEADER_FILES llmediaremotectrl.h llmemoryview.h llmenucommands.h + llmeshrepository.h llmetricperformancetester.h llmimetypes.h llmorphview.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4ed2927ce6..087472661f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9998,7 +9998,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> <key>UseStartScreen</key> <map> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ddc818172d..a56e86c979 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -48,6 +48,7 @@ #include "llwindow.h" #include "llviewerstats.h" #include "llmd5.h" +#include "llmeshrepository.h" #include "llpumpio.h" #include "llmimetypes.h" #include "llslurl.h" @@ -1266,6 +1267,9 @@ bool LLAppViewer::cleanup() llinfos << "Cleaning Up" << llendflush; + // shut down mesh streamer + gMeshRepo.shutdown(); + // Must clean up texture references before viewer window is destroyed. LLHUDManager::getInstance()->updateEffects(); LLHUDObject::updateAll(); @@ -1678,6 +1682,9 @@ bool LLAppViewer::initThreads() mFastTimerLogThread->start(); } + // Mesh streaming and caching + gMeshRepo.init(); + // *FIX: no error handling here! return true; } @@ -2394,6 +2401,7 @@ bool LLAppViewer::initWindow() gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); gPipeline.init(); + stop_glerror(); gViewerWindow->initGLDefaults(); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 8317837520..f173149bf4 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1432,6 +1432,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("FetchLib"); capabilityNames.append("FetchLibDescendents"); capabilityNames.append("GetTexture"); + capabilityNames.append("GetMesh"); capabilityNames.append("GroupProposalBallot"); capabilityNames.append("HomeLocation"); capabilityNames.append("MapLayer"); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7debfb9186..f66f0c2d72 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -70,6 +70,7 @@ #include "llsdutil.h" #include "llmediaentry.h" #include "llmediadataclient.h" +#include "llmeshrepository.h" #include "llagent.h" const S32 MIN_QUIET_FRAMES_COALESCE = 30; @@ -861,6 +862,16 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool { LLVolumeParams volume_params = params; + if (isSculpted()) + { + // if it's a mesh + if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) + { //meshes might not have all LODs, get the force detail to best existing LOD + LLUUID mesh_id = params.getSculptID(); + mLOD = gMeshRepo.getActualMeshLOD(mesh_id, mLOD); + } + } + // Check if we need to change implementations bool is_flexible = (volume_params.getPathParams().getCurveType() == LL_PCODE_PATH_FLEXIBLE); if (is_flexible) @@ -888,6 +899,8 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool } } + + if ((LLPrimitive::setVolume(volume_params, mLOD, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged) { mFaceMappingChanged = TRUE; @@ -906,7 +919,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool { //load request not yet issued, request pipeline load this mesh LLUUID asset_id = volume_params.getSculptID(); - gPipeline.loadMesh(this, asset_id, LLVolumeLODGroup::getVolumeDetailFromScale(getVolume()->getDetail())); + gMeshRepo.loadMesh(this, asset_id, LLVolumeLODGroup::getVolumeDetailFromScale(getVolume()->getDetail())); } } else // otherwise is sculptie diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 610804c5eb..b37645d2de 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -70,6 +70,7 @@ #include "llgldbg.h" #include "llhudmanager.h" #include "lllightconstants.h" +#include "llmeshrepository.h" #include "llresmgr.h" #include "llselectmgr.h" #include "llsky.h" @@ -103,6 +104,7 @@ #include "llspatialpartition.h" #include "llmutelist.h" #include "lltoolpie.h" +#include "llcurl.h" #ifdef _DEBUG @@ -342,8 +344,6 @@ LLPipeline::LLPipeline() : mGlowPool(NULL), mBumpPool(NULL), mWLSkyPool(NULL), - mMeshMutex(NULL), - mMeshThreadCount(0), mLightMask(0), mLightMovingMask(0), mLightingDetail(0), @@ -403,7 +403,6 @@ void LLPipeline::init() stop_glerror(); - mMeshMutex = new LLMutex(NULL); for (U32 i = 0; i < 2; ++i) { mSpotLightFade[i] = 1.f; @@ -478,9 +477,6 @@ void LLPipeline::cleanup() //delete mWLSkyPool; mWLSkyPool = NULL; - delete mMeshMutex; - mMeshMutex = NULL; - releaseGLBuffers(); mBloomImagep = NULL; @@ -1802,6 +1798,8 @@ void LLPipeline::rebuildPriorityGroups() assertInitialized(); + gMeshRepo.notifyLoadedMeshes(); + // Iterate through all drawables on the priority build queue, for (LLSpatialGroup::sg_list_t::iterator iter = mGroupQ1.begin(); iter != mGroupQ1.end(); ++iter) @@ -1881,8 +1879,6 @@ void LLPipeline::updateGeom(F32 max_dtime) // for now, only LLVOVolume does this to throttle LOD changes LLVOVolume::preUpdateGeom(); - notifyLoadedMeshes(); - // Iterate through all drawables on the priority build queue, for (LLDrawable::drawable_list_t::iterator iter = mBuildQ1.begin(); iter != mBuildQ1.end();) @@ -8912,246 +8908,3 @@ LLCullResult::sg_list_t::iterator LLPipeline::endAlphaGroups() } -void LLPipeline::loadMesh(LLVOVolume* vobj, LLUUID mesh_id, S32 detail) -{ - if (detail < 0 || detail > 4) - { - return; - } - - { - LLMutexLock lock(mMeshMutex); - //add volume to list of loading meshes - mesh_load_map::iterator iter = mLoadingMeshes[detail].find(mesh_id); - if (iter != mLoadingMeshes[detail].end()) - { //request pending for this mesh, append volume id to list - iter->second.insert(vobj->getID()); - return; - } - - //first request for this mesh - mLoadingMeshes[detail][mesh_id].insert(vobj->getID()); - } - - if (gAssetStorage->hasLocalAsset(mesh_id, LLAssetType::AT_MESH)) - { //already have asset, load desired LOD in background - mPendingMeshes.push_back(new LLMeshThread(mesh_id, vobj->getVolume(), detail)); - } - else - { //fetch asset and load when done - gAssetStorage->getAssetData(mesh_id, LLAssetType::AT_MESH, - getMeshAssetCallback, vobj->getVolume(), TRUE); - } - - //do a quick search to see if we can't display something while we wait for this mesh to load - LLVolume* volume = vobj->getVolume(); - - if (volume) - { - LLVolumeParams params = volume->getParams(); - - LLVolumeLODGroup* group = LLPrimitive::getVolumeManager()->getGroup(params); - - if (group) - { - //first see what the next lowest LOD available might be - for (S32 i = detail-1; i >= 0; --i) - { - LLVolume* lod = group->refLOD(i); - if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0) - { - volume->copyVolumeFaces(lod); - group->derefLOD(lod); - return; - } - - group->derefLOD(lod); - } - - //no lower LOD is a available, is a higher lod available? - for (S32 i = detail+1; i < 4; ++i) - { - LLVolume* lod = group->refLOD(i); - if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0) - { - volume->copyVolumeFaces(lod); - group->derefLOD(lod); - return; - } - - group->derefLOD(lod); - } - } - else - { - llerrs << "WTF?" << llendl; - } - - //nothing found, so make a tetrahedron - volume->makeTetrahedron(); - } -} - -//static -void LLPipeline::getMeshAssetCallback(LLVFS *vfs, - const LLUUID& asset_uuid, - LLAssetType::EType type, - void* user_data, S32 status, LLExtStat ext_status) -{ - gPipeline.mPendingMeshes.push_back(new LLMeshThread(asset_uuid, (LLVolume*) user_data)); -} - - -LLPipeline::LLMeshThread::LLMeshThread(LLUUID mesh_id, LLVolume* target, S32 detail) -: LLThread("mesh_loading_thread") -{ - mMeshID = mesh_id; - mVolume = NULL; - mDetail = target->getDetail(); - - if (detail == -1) - { - mDetailIndex = LLVolumeLODGroup::getVolumeDetailFromScale(target->getDetail()); - } - else - { - mDetailIndex = detail; - } - - mTargetVolume = target; -} - -LLPipeline::LLMeshThread::~LLMeshThread() -{ - -} - -void LLPipeline::LLMeshThread::run() -{ - if (!gAssetStorage || LLApp::instance()->isQuitting()) - { - return; - } - - char* buffer = NULL; - S32 size = 0; - - LLVFS* vfs = gAssetStorage->mVFS; - - { - LLVFile file(vfs, mMeshID, LLAssetType::AT_MESH, LLVFile::READ); - file.waitForLock(VFSLOCK_READ); - size = file.getSize(); - - if (size == 0) - { - gPipeline.meshLoaded(this); - return; - } - - buffer = new char[size]; - file.read((U8*)&buffer[0], size); - } - - { - std::string buffer_string(buffer, size); - std::istringstream buffer_stream(buffer_string); - - { - LLVolumeParams volume_params; - volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE); - volume_params.setSculptID(mMeshID, LL_SCULPT_TYPE_MESH); - mVolume = new LLVolume(volume_params, mDetail); - mVolume->createVolumeFacesFromStream(buffer_stream); - } - } - delete[] buffer; - - gPipeline.meshLoaded(this); -} - -void LLPipeline::meshLoaded(LLPipeline::LLMeshThread* mesh_thread) -{ - LLMutexLock lock(mMeshMutex); - mLoadedMeshes.push_back(mesh_thread); -} - -void LLPipeline::notifyLoadedMeshes() -{ //called from main thread - - U32 max_thread_count = llmax(gSavedSettings.getU32("MeshThreadCount"), (U32) 1); - while (mMeshThreadCount < max_thread_count && !mPendingMeshes.empty()) - { - LLMeshThread* mesh_thread = mPendingMeshes.front(); - mesh_thread->start(); - ++mMeshThreadCount; - mPendingMeshes.pop_front(); - } - - LLMutexLock lock(mMeshMutex); - std::list<LLMeshThread*> stopping_threads; - - for (std::list<LLMeshThread*>::iterator iter = mLoadedMeshes.begin(); iter != mLoadedMeshes.end(); ++iter) - { //for each mesh done loading - LLMeshThread* mesh = *iter; - - if (!mesh->isStopped()) - { //don't process a LLMeshThread until it's stopped - stopping_threads.push_back(mesh); - continue; - } - - S32 detail = mesh->mDetailIndex; - - //get list of objects waiting to be notified this mesh is loaded - mesh_load_map::iterator obj_iter = mLoadingMeshes[detail].find(mesh->mMeshID); - - if (mesh->mVolume && obj_iter != mLoadingMeshes[detail].end()) - { - //make sure target volume is still valid - BOOL valid = FALSE; - - for (std::set<LLUUID>::iterator vobj_iter = obj_iter->second.begin(); vobj_iter != obj_iter->second.end(); ++vobj_iter) - { - LLVOVolume* vobj = (LLVOVolume*) gObjectList.findObject(*vobj_iter); - - if (vobj) - { - if (vobj->getVolume() == mesh->mTargetVolume) - { - valid = TRUE; - } - } - } - - - if (valid) - { - if (mesh->mVolume->getNumVolumeFaces() <= 0) - { - llwarns << "Mesh loading returned empty volume." << llendl; - mesh->mVolume->makeTetrahedron(); - } - - mesh->mTargetVolume->copyVolumeFaces(mesh->mVolume); - - for (std::set<LLUUID>::iterator vobj_iter = obj_iter->second.begin(); vobj_iter != obj_iter->second.end(); ++vobj_iter) - { - LLVOVolume* vobj = (LLVOVolume*) gObjectList.findObject(*vobj_iter); - if (vobj) - { - vobj->notifyMeshLoaded(); - } - } - } - - mLoadingMeshes[detail].erase(mesh->mMeshID); - } - - delete mesh; - --mMeshThreadCount; - } - - mLoadedMeshes = stopping_threads; -} - diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index f41f6173a9..0b040acf51 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -58,6 +58,8 @@ class LLCubeMap; class LLCullResult; class LLVOAvatar; class LLGLSLShader; +class LLCurlRequest; +class LLMeshResponder; typedef enum e_avatar_skinning_method { @@ -278,10 +280,6 @@ public: LLCullResult::sg_list_t::iterator beginAlphaGroups(); LLCullResult::sg_list_t::iterator endAlphaGroups(); - - //mesh management functions - void loadMesh(LLVOVolume* volume, LLUUID mesh_id, S32 detail = 0); - void addTrianglesDrawn(S32 count); BOOL hasRenderType(const U32 type) const { return (type && (mRenderTypeMask & (1<<type))) ? TRUE : FALSE; } BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } @@ -683,32 +681,8 @@ protected: typedef std::map<LLUUID, std::set<LLUUID> > mesh_load_map; mesh_load_map mLoadingMeshes[4]; - LLMutex* mMeshMutex; - - class LLMeshThread : public LLThread - { - public: - LLPointer<LLVolume> mVolume; - LLVolume* mTargetVolume; - LLUUID mMeshID; - F32 mDetail; - S32 mDetailIndex; - LLMeshThread(LLUUID mesh_id, LLVolume* target, S32 detail = -1); - ~LLMeshThread(); - void run(); - }; - - static void getMeshAssetCallback(LLVFS *vfs, - const LLUUID& asset_uuid, - LLAssetType::EType type, - void* user_data, S32 status, LLExtStat ext_status); - - std::list<LLMeshThread*> mLoadedMeshes; - std::list<LLMeshThread*> mPendingMeshes; - U32 mMeshThreadCount; - - void meshLoaded(LLMeshThread* mesh_thread); - void notifyLoadedMeshes(); + typedef std::list<LLMeshResponder*> mesh_response_list; + mesh_response_list mMeshResponseList; LLPointer<LLViewerFetchedTexture> mFaceSelectImagep; LLPointer<LLViewerTexture> mBloomImagep; -- cgit v1.2.3 From 1709f1efc042dc821888f92190637f6109c9a4ca Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 14 Dec 2009 08:07:31 -0600 Subject: Resolved timeout issues in mesh HTTP transfer. --- indra/llcommon/llthread.h | 560 +++++++++++++++++++++++----------------------- 1 file changed, 280 insertions(+), 280 deletions(-) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 2d553b5258..72c39f2e93 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -1,284 +1,284 @@ -/** - * @file llthread.h - * @brief Base classes for thread, mutex and condition handling. - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLTHREAD_H -#define LL_LLTHREAD_H - -#include "llapp.h" -#include "apr_thread_cond.h" - -class LLThread; -class LLMutex; -class LLCondition; - +/** + * @file llthread.h + * @brief Base classes for thread, mutex and condition handling. + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLTHREAD_H +#define LL_LLTHREAD_H + +#include "llapp.h" +#include "apr_thread_cond.h" + +class LLThread; +class LLMutex; +class LLCondition; + #if LL_WINDOWS #define ll_thread_local __declspec(thread) #else #define ll_thread_local __thread -#endif - -class LL_COMMON_API LLThread -{ -private: - static U32 sIDIter; - -public: - typedef enum e_thread_status - { - STOPPED = 0, // The thread is not running. Not started, or has exited its run function - RUNNING = 1, // The thread is currently running - QUITTING= 2 // Someone wants this thread to quit - } EThreadStatus; - - LLThread(const std::string& name, apr_pool_t *poolp = NULL); - virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state. - virtual void shutdown(); // stops the thread - - bool isQuitting() const { return (QUITTING == mStatus); } - bool isStopped() const { return (STOPPED == mStatus); } - - static U32 currentID(); // Return ID of current thread - static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure. - -public: - // PAUSE / RESUME functionality. See source code for important usage notes. - // Called from MAIN THREAD. - void pause(); - void unpause(); - bool isPaused() { return isStopped() || mPaused == TRUE; } - - // Cause the thread to wake up and check its condition - void wake(); - - // Same as above, but to be used when the condition is already locked. - void wakeLocked(); - - // Called from run() (CHILD THREAD). Pause the thread if requested until unpaused. - void checkPause(); - - // this kicks off the apr thread - void start(void); - - apr_pool_t *getAPRPool() { return mAPRPoolp; } - LLVolatileAPRPool* getLocalAPRFilePool() { return mLocalAPRFilePoolp ; } - - U32 getID() const { return mID; } - -private: - BOOL mPaused; - - // static function passed to APR thread creation routine - static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap); - -protected: - std::string mName; - LLCondition* mRunCondition; - - apr_thread_t *mAPRThreadp; - apr_pool_t *mAPRPoolp; - BOOL mIsLocalPool; - EThreadStatus mStatus; - U32 mID; - - //a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used. - //Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes. - // otherwise it will cause severe memory leaking!!! --bao - LLVolatileAPRPool *mLocalAPRFilePoolp ; - - void setQuitting(); - - // virtual function overridden by subclass -- this will be called when the thread runs - virtual void run(void) = 0; - - // virtual predicate function -- returns true if the thread should wake up, false if it should sleep. - virtual bool runCondition(void); - - // Lock/Unlock Run Condition -- use around modification of any variable used in runCondition() - inline void lockData(); - inline void unlockData(); - - // This is the predicate that decides whether the thread should sleep. - // It should only be called with mRunCondition locked, since the virtual runCondition() function may need to access - // data structures that are thread-unsafe. - bool shouldSleep(void) { return (mStatus == RUNNING) && (isPaused() || (!runCondition())); } - - // To avoid spurious signals (and the associated context switches) when the condition may or may not have changed, you can do the following: - // mRunCondition->lock(); - // if(!shouldSleep()) - // mRunCondition->signal(); - // mRunCondition->unlock(); -}; - -//============================================================================ - -#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO) - -class LL_COMMON_API LLMutex -{ -public: - typedef enum - { - NO_THREAD = 0xFFFFFFFF - } e_locking_thread; - - LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex - ~LLMutex(); - - void lock(); // blocks - void unlock(); - bool isLocked(); // non-blocking, but does do a lock/unlock so not free - U32 lockingThread() const; //get ID of locking thread - -protected: - apr_thread_mutex_t *mAPRMutexp; - mutable U32 mCount; - mutable U32 mLockingThread; - - apr_pool_t *mAPRPoolp; - BOOL mIsLocalPool; - S32 mLockCount; -#if MUTEX_DEBUG - std::map<U32, BOOL> mIsLocked; -#endif -}; - -// Actually a condition/mutex pair (since each condition needs to be associated with a mutex). -class LL_COMMON_API LLCondition : public LLMutex -{ -public: - LLCondition(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well. - ~LLCondition(); - - void wait(); // blocks - void signal(); - void broadcast(); - -protected: - apr_thread_cond_t *mAPRCondp; -}; - -class LLMutexLock -{ -public: - LLMutexLock(LLMutex* mutex) - { - mMutex = mutex; - mMutex->lock(); - } - ~LLMutexLock() - { - mMutex->unlock(); - } -private: - LLMutex* mMutex; -}; - -//============================================================================ - -void LLThread::lockData() -{ - mRunCondition->lock(); -} - -void LLThread::unlockData() -{ - mRunCondition->unlock(); -} - - -//============================================================================ - -// see llmemory.h for LLPointer<> definition - -class LL_COMMON_API LLThreadSafeRefCount -{ -public: - static void initThreadSafeRefCount(); // creates sMutex - static void cleanupThreadSafeRefCount(); // destroys sMutex - -private: - static LLMutex* sMutex; - -private: - LLThreadSafeRefCount(const LLThreadSafeRefCount&); // not implemented - LLThreadSafeRefCount&operator=(const LLThreadSafeRefCount&); // not implemented - -protected: - virtual ~LLThreadSafeRefCount(); // use unref() - -public: - LLThreadSafeRefCount(); - - void ref() - { - if (sMutex) sMutex->lock(); - mRef++; - if (sMutex) sMutex->unlock(); - } - - S32 unref() - { - llassert(mRef >= 1); - if (sMutex) sMutex->lock(); - S32 res = --mRef; - if (sMutex) sMutex->unlock(); - if (0 == res) - { - delete this; - return 0; - } - return res; - } - S32 getNumRefs() const - { - return mRef; - } - -private: - S32 mRef; -}; - -//============================================================================ - -// Simple responder for self destructing callbacks -// Pure virtual class -class LL_COMMON_API LLResponder : public LLThreadSafeRefCount -{ -protected: - virtual ~LLResponder(); -public: - virtual void completed(bool success) = 0; -}; - -//============================================================================ - -#endif // LL_LLTHREAD_H +#endif + +class LL_COMMON_API LLThread +{ +private: + static U32 sIDIter; + +public: + typedef enum e_thread_status + { + STOPPED = 0, // The thread is not running. Not started, or has exited its run function + RUNNING = 1, // The thread is currently running + QUITTING= 2 // Someone wants this thread to quit + } EThreadStatus; + + LLThread(const std::string& name, apr_pool_t *poolp = NULL); + virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state. + virtual void shutdown(); // stops the thread + + bool isQuitting() const { return (QUITTING == mStatus); } + bool isStopped() const { return (STOPPED == mStatus); } + + static U32 currentID(); // Return ID of current thread + static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure. + +public: + // PAUSE / RESUME functionality. See source code for important usage notes. + // Called from MAIN THREAD. + void pause(); + void unpause(); + bool isPaused() { return isStopped() || mPaused == TRUE; } + + // Cause the thread to wake up and check its condition + void wake(); + + // Same as above, but to be used when the condition is already locked. + void wakeLocked(); + + // Called from run() (CHILD THREAD). Pause the thread if requested until unpaused. + void checkPause(); + + // this kicks off the apr thread + void start(void); + + apr_pool_t *getAPRPool() { return mAPRPoolp; } + LLVolatileAPRPool* getLocalAPRFilePool() { return mLocalAPRFilePoolp ; } + + U32 getID() const { return mID; } + +private: + BOOL mPaused; + + // static function passed to APR thread creation routine + static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap); + +protected: + std::string mName; + LLCondition* mRunCondition; + + apr_thread_t *mAPRThreadp; + apr_pool_t *mAPRPoolp; + BOOL mIsLocalPool; + EThreadStatus mStatus; + U32 mID; + + //a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used. + //Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes. + // otherwise it will cause severe memory leaking!!! --bao + LLVolatileAPRPool *mLocalAPRFilePoolp ; + + void setQuitting(); + + // virtual function overridden by subclass -- this will be called when the thread runs + virtual void run(void) = 0; + + // virtual predicate function -- returns true if the thread should wake up, false if it should sleep. + virtual bool runCondition(void); + + // Lock/Unlock Run Condition -- use around modification of any variable used in runCondition() + inline void lockData(); + inline void unlockData(); + + // This is the predicate that decides whether the thread should sleep. + // It should only be called with mRunCondition locked, since the virtual runCondition() function may need to access + // data structures that are thread-unsafe. + bool shouldSleep(void) { return (mStatus == RUNNING) && (isPaused() || (!runCondition())); } + + // To avoid spurious signals (and the associated context switches) when the condition may or may not have changed, you can do the following: + // mRunCondition->lock(); + // if(!shouldSleep()) + // mRunCondition->signal(); + // mRunCondition->unlock(); +}; + +//============================================================================ + +#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO) + +class LL_COMMON_API LLMutex +{ +public: + typedef enum + { + NO_THREAD = 0xFFFFFFFF + } e_locking_thread; + + LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex + ~LLMutex(); + + void lock(); // blocks + void unlock(); + bool isLocked(); // non-blocking, but does do a lock/unlock so not free + U32 lockingThread() const; //get ID of locking thread + +protected: + apr_thread_mutex_t *mAPRMutexp; + mutable U32 mCount; + mutable U32 mLockingThread; + + apr_pool_t *mAPRPoolp; + BOOL mIsLocalPool; + S32 mLockCount; +#if MUTEX_DEBUG + std::map<U32, BOOL> mIsLocked; +#endif +}; + +// Actually a condition/mutex pair (since each condition needs to be associated with a mutex). +class LL_COMMON_API LLCondition : public LLMutex +{ +public: + LLCondition(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well. + ~LLCondition(); + + void wait(); // blocks + void signal(); + void broadcast(); + +protected: + apr_thread_cond_t *mAPRCondp; +}; + +class LLMutexLock +{ +public: + LLMutexLock(LLMutex* mutex) + { + mMutex = mutex; + mMutex->lock(); + } + ~LLMutexLock() + { + mMutex->unlock(); + } +private: + LLMutex* mMutex; +}; + +//============================================================================ + +void LLThread::lockData() +{ + mRunCondition->lock(); +} + +void LLThread::unlockData() +{ + mRunCondition->unlock(); +} + + +//============================================================================ + +// see llmemory.h for LLPointer<> definition + +class LL_COMMON_API LLThreadSafeRefCount +{ +public: + static void initThreadSafeRefCount(); // creates sMutex + static void cleanupThreadSafeRefCount(); // destroys sMutex + +private: + static LLMutex* sMutex; + +private: + LLThreadSafeRefCount(const LLThreadSafeRefCount&); // not implemented + LLThreadSafeRefCount&operator=(const LLThreadSafeRefCount&); // not implemented + +protected: + virtual ~LLThreadSafeRefCount(); // use unref() + +public: + LLThreadSafeRefCount(); + + void ref() + { + if (sMutex) sMutex->lock(); + mRef++; + if (sMutex) sMutex->unlock(); + } + + S32 unref() + { + llassert(mRef >= 1); + if (sMutex) sMutex->lock(); + S32 res = --mRef; + if (sMutex) sMutex->unlock(); + if (0 == res) + { + delete this; + return 0; + } + return res; + } + S32 getNumRefs() const + { + return mRef; + } + +private: + S32 mRef; +}; + +//============================================================================ + +// Simple responder for self destructing callbacks +// Pure virtual class +class LL_COMMON_API LLResponder : public LLThreadSafeRefCount +{ +protected: + virtual ~LLResponder(); +public: + virtual void completed(bool success) = 0; +}; + +//============================================================================ + +#endif // LL_LLTHREAD_H -- cgit v1.2.3 From 081fa98a47d2b592ada0fbb049ff959ac2cd6294 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 15 Dec 2009 17:43:05 -0600 Subject: HTTP Mesh transfer relatively blocking-free. --- indra/llmath/llvolume.cpp | 2 +- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llvovolume.cpp | 20 ++++++++++++++++---- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 44ff173502..844918432d 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2171,7 +2171,7 @@ void LLVolume::makeTetrahedron() LLVolumeFace face; - F32 x = 0.5f; + F32 x = 0.25f; LLVector3 p[] = { //unit tetrahedron corners LLVector3(x,x,x), diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a4142b41b0..4f17775dfd 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7463,6 +7463,17 @@ <key>Value</key> <integer>8</integer> </map> + <key>MeshMaxConcurrentRequests</key> + <map> + <key>Comment</key> + <string>Number of threads to use for loading meshes.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>32</integer> + </map> <key>SafeMode</key> <map> diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index f66f0c2d72..ea0aa54751 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -862,13 +862,21 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool { LLVolumeParams volume_params = params; + S32 lod = mLOD; + if (isSculpted()) { // if it's a mesh if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) { //meshes might not have all LODs, get the force detail to best existing LOD LLUUID mesh_id = params.getSculptID(); - mLOD = gMeshRepo.getActualMeshLOD(mesh_id, mLOD); + + //profile and path params don't matter for meshes + volume_params = LLVolumeParams(); + volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE); + volume_params.setSculptID(mesh_id, LL_SCULPT_TYPE_MESH); + + lod = gMeshRepo.getActualMeshLOD(mesh_id, lod); } } @@ -901,13 +909,13 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool - if ((LLPrimitive::setVolume(volume_params, mLOD, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged) + if ((LLPrimitive::setVolume(volume_params, lod, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged) { mFaceMappingChanged = TRUE; if (mVolumeImpl) { - mVolumeImpl->onSetVolume(volume_params, detail); + mVolumeImpl->onSetVolume(volume_params, mLOD); } if (isSculpted()) @@ -919,7 +927,11 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool { //load request not yet issued, request pipeline load this mesh LLUUID asset_id = volume_params.getSculptID(); - gMeshRepo.loadMesh(this, asset_id, LLVolumeLODGroup::getVolumeDetailFromScale(getVolume()->getDetail())); + S32 available_lod = gMeshRepo.loadMesh(this, asset_id, lod); + if (available_lod != lod) + { + LLPrimitive::setVolume(volume_params, available_lod); + } } } else // otherwise is sculptie -- cgit v1.2.3 From c6aaf115ade4b335df9ca479992b08e028ffd910 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 16 Dec 2009 09:26:53 -0600 Subject: Quick 'n dirty prioritization scheme for mesh loading. Sprinkling of fast timers in areas that are likely to stall. --- indra/newview/llappviewer.cpp | 57 ++++++++++++++++++++++++++---------- indra/newview/lldrawable.cpp | 22 ++++++++++---- indra/newview/llface.cpp | 29 +++++++++++++++--- indra/newview/llviewerobjectlist.cpp | 4 +++ indra/newview/pipeline.cpp | 27 ++++++++++++----- 5 files changed, 106 insertions(+), 33 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8dfc1657cf..0461cf1612 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3387,6 +3387,8 @@ static LLFastTimer::DeclareTimer FTM_OBJECTLIST_UPDATE("Update Objectlist"); static LLFastTimer::DeclareTimer FTM_REGION_UPDATE("Update Region"); static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World"); static LLFastTimer::DeclareTimer FTM_NETWORK("Network"); +static LLFastTimer::DeclareTimer FTM_AGENT_NETWORK("Agent Network"); +static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager"); /////////////////////////////////////////////////////// // idle() @@ -3457,7 +3459,7 @@ void LLAppViewer::idle() if (!gDisconnected) { - LLFastTimer t(FTM_NETWORK); + LLFastTimer t(FTM_AGENT_NETWORK); // Update spaceserver timeinfo LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC)); @@ -3646,7 +3648,7 @@ void LLAppViewer::idle() // { - LLFastTimer t(FTM_NETWORK); + LLFastTimer t(FTM_VLMANAGER); gVLManager.unpackData(); } @@ -3891,7 +3893,12 @@ void LLAppViewer::sendLogoutRequest() static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME; #endif -static LLFastTimer::DeclareTimer FTM_IDLE_NETWORK("Network"); +static LLFastTimer::DeclareTimer FTM_IDLE_NETWORK("Idle Network"); +static LLFastTimer::DeclareTimer FTM_MESSAGE_ACKS("Message Acks"); +static LLFastTimer::DeclareTimer FTM_RETRANSMIT("Retransmit"); +static LLFastTimer::DeclareTimer FTM_TIMEOUT_CHECK("Timeout Check"); +static LLFastTimer::DeclareTimer FTM_DYNAMIC_THROTTLE("Dynamic Throttle"); +static LLFastTimer::DeclareTimer FTM_CHECK_REGION_CIRCUIT("Check Region Circuit"); void LLAppViewer::idleNetwork() { @@ -3945,7 +3952,10 @@ void LLAppViewer::idleNetwork() } // Handle per-frame message system processing. - gMessageSystem->processAcks(); + { + LLFastTimer ftm(FTM_MESSAGE_ACKS); + gMessageSystem->processAcks(); + } #ifdef TIME_THROTTLE_MESSAGES if (total_time >= CheckMessagesMaxTime) @@ -3983,26 +3993,41 @@ void LLAppViewer::idleNetwork() LLViewerStats::getInstance()->mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); // Retransmit unacknowledged packets. - gXferManager->retransmitUnackedPackets(); - gAssetStorage->checkForTimeouts(); + { + LLFastTimer ftm(FTM_RETRANSMIT); + gXferManager->retransmitUnackedPackets(); + } + + { + LLFastTimer ftm(FTM_TIMEOUT_CHECK); + gAssetStorage->checkForTimeouts(); + } + llpushcallstacks ; - gViewerThrottle.updateDynamicThrottle(); + + { + LLFastTimer ftm(FTM_DYNAMIC_THROTTLE); + gViewerThrottle.updateDynamicThrottle(); + } llpushcallstacks ; // Check that the circuit between the viewer and the agent's current // region is still alive - LLViewerRegion *agent_region = gAgent.getRegion(); - if (agent_region && (LLStartUp::getStartupState()==STATE_STARTED)) { - LLUUID this_region_id = agent_region->getRegionID(); - bool this_region_alive = agent_region->isAlive(); - if ((mAgentRegionLastAlive && !this_region_alive) // newly dead - && (mAgentRegionLastID == this_region_id)) // same region + LLFastTimer ftm(FTM_CHECK_REGION_CIRCUIT); + LLViewerRegion *agent_region = gAgent.getRegion(); + if (agent_region && (LLStartUp::getStartupState()==STATE_STARTED)) { - forceDisconnect(LLTrans::getString("AgentLostConnection")); + LLUUID this_region_id = agent_region->getRegionID(); + bool this_region_alive = agent_region->isAlive(); + if ((mAgentRegionLastAlive && !this_region_alive) // newly dead + && (mAgentRegionLastID == this_region_id)) // same region + { + forceDisconnect(LLTrans::getString("AgentLostConnection")); + } + mAgentRegionLastID = this_region_id; + mAgentRegionLastAlive = this_region_alive; } - mAgentRegionLastID = this_region_id; - mAgentRegionLastAlive = this_region_alive; } llpushcallstacks ; } diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index d60330024a..9a3be975cd 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -189,20 +189,30 @@ BOOL LLDrawable::isLight() const } } +static LLFastTimer::DeclareTimer FTM_CLEANUP_DRAWABLE("Cleanup Drawable"); +static LLFastTimer::DeclareTimer FTM_DEREF_DRAWABLE("Deref"); +static LLFastTimer::DeclareTimer FTM_DELETE_FACES("Faces"); + void LLDrawable::cleanupReferences() { - LLFastTimer t(FTM_PIPELINE); + LLFastTimer t(FTM_CLEANUP_DRAWABLE); - std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); - mFaces.clear(); + { + LLFastTimer t(FTM_DELETE_FACES); + std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); + mFaces.clear(); + } gObjectList.removeDrawable(this); gPipeline.unlinkDrawable(this); - // Cleanup references to other objects - mVObjp = NULL; - mParent = NULL; + { + LLFastTimer t(FTM_DEREF_DRAWABLE); + // Cleanup references to other objects + mVObjp = NULL; + mParent = NULL; + } } void LLDrawable::cleanupDeadDrawables() diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 698d8572aa..91e2fef28d 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -183,22 +183,33 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mUsingAtlas = FALSE ; } +static LLFastTimer::DeclareTimer FTM_DESTROY_FACE("Destroy Face"); +static LLFastTimer::DeclareTimer FTM_DESTROY_TEXTURE("Texture"); +static LLFastTimer::DeclareTimer FTM_DESTROY_DRAWPOOL("Drawpool"); +static LLFastTimer::DeclareTimer FTM_DESTROY_TEXTURE_MATRIX("Texture Matrix"); +static LLFastTimer::DeclareTimer FTM_DESTROY_DRAW_INFO("Draw Info"); +static LLFastTimer::DeclareTimer FTM_DESTROY_ATLAS("Atlas"); +static LLFastTimer::DeclareTimer FTM_FACE_DEREF("Deref"); void LLFace::destroy() { + LLFastTimer t(FTM_DESTROY_FACE); if(mTexture.notNull()) { + LLFastTimer t(FTM_DESTROY_TEXTURE); mTexture->removeFace(this) ; } if (mDrawPoolp) { + LLFastTimer t(FTM_DESTROY_DRAWPOOL); mDrawPoolp->removeFace(this); mDrawPoolp = NULL; } if (mTextureMatrix) { + LLFastTimer t(FTM_DESTROY_TEXTURE_MATRIX); delete mTextureMatrix; mTextureMatrix = NULL; @@ -213,11 +224,21 @@ void LLFace::destroy() } } - setDrawInfo(NULL); + { + LLFastTimer t(FTM_DESTROY_DRAW_INFO); + setDrawInfo(NULL); + } - removeAtlas(); - mDrawablep = NULL; - mVObjp = NULL; + { + LLFastTimer t(FTM_DESTROY_ATLAS); + removeAtlas(); + } + + { + LLFastTimer t(FTM_FACE_DEREF); + mDrawablep = NULL; + mVObjp = NULL; + } } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 96828ee1b6..7a6f479685 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -866,8 +866,12 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) mNumDeadObjects++; } +static LLFastTimer::DeclareTimer FTM_REMOVE_DRAWABLE("Remove Drawable"); + void LLViewerObjectList::removeDrawable(LLDrawable* drawablep) { + LLFastTimer t(FTM_REMOVE_DRAWABLE); + if (!drawablep) { return; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b37645d2de..cac266a683 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1143,9 +1143,15 @@ void LLPipeline::allocDrawable(LLViewerObject *vobj) } +static LLFastTimer::DeclareTimer FTM_UNLINK("Unlink"); +static LLFastTimer::DeclareTimer FTM_REMOVE_FROM_MOVE_LIST("Movelist"); +static LLFastTimer::DeclareTimer FTM_REMOVE_FROM_SPATIAL_PARTITION("Spatial Partition"); +static LLFastTimer::DeclareTimer FTM_REMOVE_FROM_LIGHT_SET("Light Set"); +static LLFastTimer::DeclareTimer FTM_REMOVE_FROM_HIGHLIGHT_SET("Highlight Set"); + void LLPipeline::unlinkDrawable(LLDrawable *drawable) { - LLFastTimer t(FTM_PIPELINE); + LLFastTimer t(FTM_UNLINK); assertInitialized(); @@ -1154,6 +1160,7 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable) // Based on flags, remove the drawable from the queues that it's on. if (drawablep->isState(LLDrawable::ON_MOVE_LIST)) { + LLFastTimer t(FTM_REMOVE_FROM_MOVE_LIST); LLDrawable::drawable_vector_t::iterator iter = std::find(mMovedList.begin(), mMovedList.end(), drawablep); if (iter != mMovedList.end()) { @@ -1163,6 +1170,7 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable) if (drawablep->getSpatialGroup()) { + LLFastTimer t(FTM_REMOVE_FROM_SPATIAL_PARTITION); if (!drawablep->getSpatialGroup()->mSpatialPartition->remove(drawablep, drawablep->getSpatialGroup())) { #ifdef LL_RELEASE_FOR_DOWNLOAD @@ -1173,18 +1181,23 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable) } } - mLights.erase(drawablep); - for (light_set_t::iterator iter = mNearbyLights.begin(); - iter != mNearbyLights.end(); iter++) { - if (iter->drawable == drawablep) + LLFastTimer t(FTM_REMOVE_FROM_LIGHT_SET); + mLights.erase(drawablep); + + for (light_set_t::iterator iter = mNearbyLights.begin(); + iter != mNearbyLights.end(); iter++) { - mNearbyLights.erase(iter); - break; + if (iter->drawable == drawablep) + { + mNearbyLights.erase(iter); + break; + } } } { + LLFastTimer t(FTM_REMOVE_FROM_HIGHLIGHT_SET); HighlightItem item(drawablep); mHighlightSet.erase(item); -- cgit v1.2.3 From edb67a898c4d20a1d4f18ad0db9ad02d6157b2ed Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 16 Dec 2009 11:20:44 -0600 Subject: Convert ll_face_list_t in llviewertexture to a std::set to improve performance on face deletion. --- indra/newview/llviewertexture.cpp | 12 ++++++------ indra/newview/llviewertexture.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index faf7a93281..c9558860db 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -614,13 +614,13 @@ void LLViewerTexture::setKnownDrawSize(S32 width, S32 height) //virtual void LLViewerTexture::addFace(LLFace* facep) { - mFaceList.push_back(facep) ; + mFaceList.insert(facep) ; } //virtual void LLViewerTexture::removeFace(LLFace* facep) { - mFaceList.remove(facep) ; + mFaceList.erase(facep); } //virtual @@ -1519,7 +1519,7 @@ void LLViewerFetchedTexture::updateVirtualSize() } if(mFaceList.size() > 0) { - for(std::list<LLFace*>::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) + for(ll_face_list_t::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) { LLFace* facep = *iter ; if(facep->getDrawable()->isRecentlyVisible()) @@ -2391,7 +2391,7 @@ BOOL LLViewerFetchedTexture::insertToAtlas() LLFace* facep; //if the atlas slot pointers for some faces are null, process them later. - ll_face_list_t waiting_list ; + std::vector<LLFace*> waiting_list ; for(ll_face_list_t::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) { @@ -2475,7 +2475,7 @@ BOOL LLViewerFetchedTexture::insertToAtlas() } //process the waiting_list - for(ll_face_list_t::iterator iter = waiting_list.begin(); iter != waiting_list.end(); ++iter) + for(std::vector<LLFace*>::iterator iter = waiting_list.begin(); iter != waiting_list.end(); ++iter) { facep = (LLFace*)*iter ; groupp = facep->getDrawable()->getSpatialGroup() ; @@ -3153,7 +3153,7 @@ F32 LLViewerMediaTexture::getMaxVirtualSize() { if(mFaceList.size() > 0) { - for(std::list<LLFace*>::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) + for(ll_face_list_t::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) { LLFace* facep = *iter ; if(facep->getDrawable()->isRecentlyVisible()) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 141979052d..bf4b1cf800 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -139,7 +139,7 @@ public: static S32 getIndexFromCategory(S32 category) ; static S32 getCategoryFromIndex(S32 index) ; - typedef std::list<LLFace*> ll_face_list_t ; + typedef std::set<LLFace*> ll_face_list_t ; protected: virtual ~LLViewerTexture(); -- cgit v1.2.3 From 4c9d37c0906bd0218a5db08ea4fc253adfc684c9 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 16 Dec 2009 12:31:24 -0600 Subject: Tracking down stalls in llpumpio and agent updates. --- indra/llmessage/llpumpio.cpp | 7 +++++-- indra/newview/llappviewer.cpp | 33 ++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 5e9dfd81fa..e3ce2c5ad3 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -444,13 +444,13 @@ void LLPumpIO::pump() pump(DEFAULT_POLL_TIMEOUT); } -static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); +static LLFastTimer::DeclareTimer FTM_PUMP_IO("Pump IO"); //timeout is in microseconds void LLPumpIO::pump(const S32& poll_timeout) { LLMemType m1(LLMemType::MTYPE_IO_PUMP); - LLFastTimer t1(FTM_PUMP); + LLFastTimer t1(FTM_PUMP_IO); //llinfos << "LLPumpIO::pump()" << llendl; // Run any pending runners. @@ -778,6 +778,8 @@ bool LLPumpIO::respond( return true; } +static LLFastTimer::DeclareTimer FTM_PUMP_CALLBACK_CHAIN("Chain"); + void LLPumpIO::callback() { LLMemType m1(LLMemType::MTYPE_IO_PUMP); @@ -799,6 +801,7 @@ void LLPumpIO::callback() callbacks_t::iterator end = mCallbacks.end(); for(; it != end; ++it) { + LLFastTimer t(FTM_PUMP_CALLBACK_CHAIN); // it's always the first and last time for respone chains (*it).mHead = (*it).mChainLinks.begin(); (*it).mInit = true; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0461cf1612..7fb821c61d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -921,6 +921,9 @@ static LLFastTimer::DeclareTimer FTM_LFS("LFS Thread"); static LLFastTimer::DeclareTimer FTM_PAUSE_THREADS("Pause Threads"); static LLFastTimer::DeclareTimer FTM_IDLE("Idle"); static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); +static LLFastTimer::DeclareTimer FTM_PUMP_ARES("Ares"); +static LLFastTimer::DeclareTimer FTM_PUMP_SERVICE("Service"); +static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback"); bool LLAppViewer::mainLoop() { @@ -1032,10 +1035,20 @@ bool LLAppViewer::mainLoop() LLMemType mt_ip(LLMemType::MTYPE_IDLE_PUMP); pingMainloopTimeout("Main:ServicePump"); LLFastTimer t4(FTM_PUMP); - gAres->process(); - // this pump is necessary to make the login screen show up - gServicePump->pump(); - gServicePump->callback(); + { + LLFastTimer t(FTM_PUMP_ARES); + gAres->process(); + } + { + LLFastTimer t(FTM_PUMP_SERVICE); + // this pump is necessary to make the login screen show up + gServicePump->pump(); + + { + LLFastTimer t(FTM_SERVICE_CALLBACK); + gServicePump->callback(); + } + } } resumeMainloopTimeout(); @@ -3388,6 +3401,8 @@ static LLFastTimer::DeclareTimer FTM_REGION_UPDATE("Update Region"); static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World"); static LLFastTimer::DeclareTimer FTM_NETWORK("Network"); static LLFastTimer::DeclareTimer FTM_AGENT_NETWORK("Agent Network"); +static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot"); +static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update"); static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager"); /////////////////////////////////////////////////////// @@ -3474,9 +3489,12 @@ void LLAppViewer::idle() gAgent.moveYaw(-1.f); } - // Handle automatic walking towards points - gAgentPilot.updateTarget(); - gAgent.autoPilot(&yaw); + { + LLFastTimer t(FTM_AGENT_AUTOPILOT); + // Handle automatic walking towards points + gAgentPilot.updateTarget(); + gAgent.autoPilot(&yaw); + } static LLFrameTimer agent_update_timer; static U32 last_control_flags; @@ -3487,6 +3505,7 @@ void LLAppViewer::idle() if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) { + LLFastTimer t(FTM_AGENT_UPDATE); // Send avatar and camera info last_control_flags = gAgent.getControlFlags(); send_agent_update(TRUE); -- cgit v1.2.3 From 5015886e1763887f534321790d56b6cee5a75dfa Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 18 Dec 2009 13:21:55 -0600 Subject: Timers to track time spent waiting on message system. --- indra/newview/llviewermessage.cpp | 2 ++ indra/newview/llworld.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0f56b7ebd7..0489077dc8 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3144,6 +3144,7 @@ const F32 THRESHOLD_HEAD_ROT_QDOT = 0.9997f; // ~= 2.5 degrees -- if its less th const F32 MAX_HEAD_ROT_QDOT = 0.99999f; // ~= 0.5 degrees -- if its greater than this then no need to update head_rot // between these values we delay the updates (but no more than one second) +static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE_SEND("Send Message"); void send_agent_update(BOOL force_send, BOOL send_reliable) { @@ -3302,6 +3303,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) if (duplicate_count < DUP_MSGS && !gDisconnected) { + LLFastTimer t(FTM_AGENT_UPDATE_SEND); // Build the message msg->newMessageFast(_PREHASH_AgentUpdate); msg->nextBlockFast(_PREHASH_AgentData); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 118d7f8d08..feab6d126b 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1024,9 +1024,11 @@ void LLWorld::disconnectRegions() } } +static LLFastTimer::DeclareTimer FTM_ENABLE_SIMULATOR("Enable Sim"); void process_enable_simulator(LLMessageSystem *msg, void **user_data) { + LLFastTimer t(FTM_ENABLE_SIMULATOR); // enable the appropriate circuit for this simulator and // add its values into the gSimulator structure U64 handle; -- cgit v1.2.3 From 0ed1cd97d4cd1fa11ca21b1b324c80f446f6e675 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 18 Dec 2009 17:14:38 -0600 Subject: Fix for compiler errors introduced in merge. --- indra/llcommon/llthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index f8c7efa7cc..5d5ecd62fc 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -166,7 +166,7 @@ protected: apr_pool_t *mAPRPoolp; BOOL mIsLocalPool; - S32 mLockCount; + #if MUTEX_DEBUG std::map<U32, BOOL> mIsLocked; #endif -- cgit v1.2.3 From 5562dc36a1555480ffbc4e45342206de003254af Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 21 Dec 2009 12:23:58 -0600 Subject: Fix for OSX hating thread local state (hopefully). --- indra/llcommon/llthread.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index df7ea214cc..0385569a02 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -62,7 +62,10 @@ // //---------------------------------------------------------------------------- +#if !LL_DARWIN U32 ll_thread_local sThreadID = 0; +#endif + U32 LLThread::sIDIter = 0; // @@ -75,7 +78,9 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap // Set thread state to running threadp->mStatus = RUNNING; +#if !LL_DARWIN sThreadID = threadp->mID; +#endif // Run the user supplied function threadp->run(); @@ -312,12 +317,16 @@ LLMutex::~LLMutex() void LLMutex::lock() { +#if LL_DARWIN + if (mLockingThread == LLThread::currentID()) +#else if (mLockingThread == sThreadID) +#endif { //redundant lock mCount++; return; } - + apr_thread_mutex_lock(mAPRMutexp); #if MUTEX_DEBUG @@ -328,7 +337,11 @@ void LLMutex::lock() mIsLocked[id] = TRUE; #endif +#if LL_DARWIN + mLockingThread = LLThread::currentID(); +#else mLockingThread = sThreadID; +#endif } void LLMutex::unlock() -- cgit v1.2.3 From a0802dd33996df650a473577fc75bf8276f0d20b Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 22 Dec 2009 17:48:52 -0600 Subject: Added prim cost equivalency to UI for importer and tools floater. --- indra/newview/llfloatertools.cpp | 2 +- indra/newview/llselectmgr.cpp | 25 ++++++++++++++++++++++++- indra/newview/llselectmgr.h | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index babef5b63d..41bb239fda 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -423,7 +423,7 @@ void LLFloaterTools::refresh() LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); childSetTextArg("obj_count", "[COUNT]", obj_count_string); std::string prim_count_string; - LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); + LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount(TRUE)); childSetTextArg("prim_count", "[COUNT]", prim_count_string); // calculate selection rendering cost diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 852f58e354..4ef68df634 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -68,6 +68,7 @@ #include "llhudmanager.h" #include "llinventorymodel.h" #include "llmenugl.h" +#include "llmeshrepository.h" #include "llmutelist.h" #include "llsidepaneltaskinfo.h" #include "llslurl.h" @@ -6124,10 +6125,32 @@ BOOL LLObjectSelection::isEmpty() const //----------------------------------------------------------------------------- // getObjectCount() - returns number of non null objects //----------------------------------------------------------------------------- -S32 LLObjectSelection::getObjectCount() +S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust) { cleanupNodes(); S32 count = mList.size(); + + if (mesh_adjust) + { + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object && object->getVolume()) + { + LLVOVolume* vobj = (LLVOVolume*) object; + if (vobj->isMesh()) + { + LLUUID mesh_id = vobj->getVolume()->getParams().getSculptID(); + U32 cost = gMeshRepo.getResourceCost(mesh_id); + count += cost-1; + } + } + + } + } + return count; } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index f7ce3f72aa..066adf0c10 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -291,7 +291,7 @@ public: LLSelectNode* findNode(LLViewerObject* objectp); // count members - S32 getObjectCount(); + S32 getObjectCount(BOOL mesh_adjust = FALSE); S32 getTECount(); S32 getRootObjectCount(); -- cgit v1.2.3 From 512a5736dceb1cc6db286e5f5baad867ac7a5935 Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Wed, 23 Dec 2009 14:40:48 -0600 Subject: LODs for scene upload --- indra/llmath/llvolume.cpp | 14 ++++++++++++++ indra/llmath/llvolume.h | 2 ++ indra/newview/CMakeLists.txt | 2 ++ 3 files changed, 18 insertions(+) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 844918432d..de32070da1 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -3807,6 +3807,20 @@ S32 LLVolume::getNumTriangleIndices() const return count; } + +S32 LLVolume::getNumTriangles() const +{ + U32 triangle_count = 0; + + for (S32 i = 0; i < getNumVolumeFaces(); ++i) + { + triangle_count += getVolumeFace(i).mIndices.size()/3; + } + + return triangle_count; +} + + //----------------------------------------------------------------------------- // generateSilhouetteVertices() //----------------------------------------------------------------------------- diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 9970b24a94..e3ab648fe3 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -912,6 +912,8 @@ public: // returns number of triangle indeces required for path/profile mesh S32 getNumTriangleIndices() const; + S32 getNumTriangles() const; + void generateSilhouetteVertices(std::vector<LLVector3> &vertices, std::vector<LLVector3> &normals, std::vector<S32> &segments, diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 193109e9f4..cae426e37b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -285,6 +285,7 @@ set(viewer_SOURCE_FILES llmemoryview.cpp llmenucommands.cpp llmeshrepository.cpp + llmeshreduction.cpp llmetricperformancetester.cpp llmimetypes.cpp llmorphview.cpp @@ -796,6 +797,7 @@ set(viewer_HEADER_FILES llmemoryview.h llmenucommands.h llmeshrepository.h + llmeshreduction.h llmetricperformancetester.h llmimetypes.h llmorphview.h -- cgit v1.2.3 From e833e7ad442f5b59f95c6ccfcaaf1d103d247d69 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 4 Jan 2010 11:50:04 -0600 Subject: CTS-54 Fix for SSAO artifacts far away. --- .../shaders/class1/deferred/sunLightF.glsl | 82 ++++++++++++---------- .../shaders/class2/deferred/sunLightF.glsl | 82 ++++++++++++---------- 2 files changed, 92 insertions(+), 72 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index 22bdd2c7f3..fafc2ae3cc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -53,51 +53,61 @@ vec4 getPosition(vec2 pos_screen) //calculate decreases in ambient lighting when crowded out (SSAO) float calcAmbientOcclusion(vec4 pos, vec3 norm) { - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; + float ret = 1.0; - float angle_hidden = 0.0; - int points = 0; + float dist = dot(pos.xyz,pos.xyz); - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) + if (dist < 64.0*64.0) { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); + float angle_hidden = 0.0; + int points = 0; - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + ret = (1.0 - (float(points != 0) * angle_hidden)); + ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); } - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - return (1.0 - (float(points != 0) * angle_hidden)); + return min(ret, 1.0); } void main() diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 4333cc64a7..74a948f584 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -55,51 +55,61 @@ vec4 getPosition(vec2 pos_screen) //calculate decreases in ambient lighting when crowded out (SSAO) float calcAmbientOcclusion(vec4 pos, vec3 norm) { - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; + float ret = 1.0; - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); + float dist = dot(pos.xyz,pos.xyz); - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) + if (dist < 64.0*64.0) { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); + float angle_hidden = 0.0; + int points = 0; - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + ret = (1.0 - (float(points != 0) * angle_hidden)); + ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); } - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - return (1.0 - (float(points != 0) * angle_hidden)); + return min(ret, 1.0); } float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -- cgit v1.2.3 From 078278bf51b50ded63d5f7c4a9d99146f72aba69 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 6 Jan 2010 15:02:43 -0600 Subject: LLImportCollada no longer a singleton to prepare for subclassing. --- indra/newview/app_settings/logcontrol.xml | 2 ++ indra/newview/llassetuploadresponders.cpp | 16 +++++++++------- indra/newview/llassetuploadresponders.h | 11 ++++++++--- indra/newview/llviewermenufile.cpp | 8 ++++++-- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index d7bb64ce8a..a5e2837f16 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -40,6 +40,8 @@ </array> <key>tags</key> <array> + <string>AppInit</string> + <string>Capabilities</string> </array> </map> </array> diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index a0be6efdc2..6324da7499 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -317,16 +317,18 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content) LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, - LLAssetType::EType asset_type) - : LLAssetUploadResponder(post_data, vfile_id, asset_type) + LLAssetType::EType asset_type, + LLImportCollada* import) + : LLAssetUploadResponder(post_data, vfile_id, asset_type), mImport(import) { } LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( const LLSD& post_data, const std::string& file_name, - LLAssetType::EType asset_type) - : LLAssetUploadResponder(post_data, file_name, asset_type) + LLAssetType::EType asset_type, + LLImportCollada* import) + : LLAssetUploadResponder(post_data, file_name, asset_type), mImport(import) { } @@ -334,7 +336,7 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reason) { LLAssetUploadResponder::error(statusNum, reason); - LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE); + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE, mImport); } @@ -343,7 +345,7 @@ void LLNewAgentInventoryResponder::uploadFailure(const LLSD& content) { LLAssetUploadResponder::uploadFailure(content); - LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], FALSE); + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], FALSE, mImport); } //virtual @@ -433,7 +435,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) userdata); } - LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], TRUE); + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], TRUE, mImport); } LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data, diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index c869988203..4b79e15529 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -61,19 +61,24 @@ protected: std::string mFileName; }; - +class LLImportCollada; // TODO*: Remove this once deprecated class LLNewAgentInventoryResponder : public LLAssetUploadResponder { public: + LLImportCollada* mImport; + LLNewAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, - LLAssetType::EType asset_type); + LLAssetType::EType asset_type, + LLImportCollada* import); + LLNewAgentInventoryResponder( const LLSD& post_data, const std::string& file_name, - LLAssetType::EType asset_type); + LLAssetType::EType asset_type, + LLImportCollada* import); virtual void error(U32 statusNum, const std::string& reason); virtual void uploadComplete(const LLSD& content); virtual void uploadFailure(const LLSD& content); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index de6fcbd8bc..47f9031ac2 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -272,7 +272,10 @@ class LLFileUploadScene : public view_listener_t std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_COLLADA); if (!filename.empty()) { - LLImportCollada::getInstance()->importFile(filename); + LLFloaterReg::showInstance("import_collada"); + LLFloaterImportCollada* floater = LLFloaterReg::findTypedInstance<LLFloaterImportCollada>("import_collada"); + floater->enableOK(TRUE); + floater->importFile(filename); } return TRUE; } @@ -1080,7 +1083,8 @@ void upload_new_resource( new LLNewAgentInventoryResponder( body, uuid, - asset_type)); + asset_type, + (LLImportCollada*) userdata)); } else { -- cgit v1.2.3 From 3972ae18d195549968e21c3b744cc3a917679358 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 7 Jan 2010 08:49:34 -0600 Subject: Backed out changeset: 0e0f8b0b0fa8 --- indra/newview/app_settings/logcontrol.xml | 2 -- indra/newview/llassetuploadresponders.cpp | 16 +++++++--------- indra/newview/llassetuploadresponders.h | 11 +++-------- indra/newview/llviewermenufile.cpp | 8 ++------ 4 files changed, 12 insertions(+), 25 deletions(-) diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index a5e2837f16..d7bb64ce8a 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -40,8 +40,6 @@ </array> <key>tags</key> <array> - <string>AppInit</string> - <string>Capabilities</string> </array> </map> </array> diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 6324da7499..a0be6efdc2 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -317,18 +317,16 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content) LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, - LLAssetType::EType asset_type, - LLImportCollada* import) - : LLAssetUploadResponder(post_data, vfile_id, asset_type), mImport(import) + LLAssetType::EType asset_type) + : LLAssetUploadResponder(post_data, vfile_id, asset_type) { } LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( const LLSD& post_data, const std::string& file_name, - LLAssetType::EType asset_type, - LLImportCollada* import) - : LLAssetUploadResponder(post_data, file_name, asset_type), mImport(import) + LLAssetType::EType asset_type) + : LLAssetUploadResponder(post_data, file_name, asset_type) { } @@ -336,7 +334,7 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reason) { LLAssetUploadResponder::error(statusNum, reason); - LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE, mImport); + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE); } @@ -345,7 +343,7 @@ void LLNewAgentInventoryResponder::uploadFailure(const LLSD& content) { LLAssetUploadResponder::uploadFailure(content); - LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], FALSE, mImport); + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], FALSE); } //virtual @@ -435,7 +433,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) userdata); } - LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], TRUE, mImport); + LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], TRUE); } LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data, diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index 4b79e15529..c869988203 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -61,24 +61,19 @@ protected: std::string mFileName; }; -class LLImportCollada; + // TODO*: Remove this once deprecated class LLNewAgentInventoryResponder : public LLAssetUploadResponder { public: - LLImportCollada* mImport; - LLNewAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, - LLAssetType::EType asset_type, - LLImportCollada* import); - + LLAssetType::EType asset_type); LLNewAgentInventoryResponder( const LLSD& post_data, const std::string& file_name, - LLAssetType::EType asset_type, - LLImportCollada* import); + LLAssetType::EType asset_type); virtual void error(U32 statusNum, const std::string& reason); virtual void uploadComplete(const LLSD& content); virtual void uploadFailure(const LLSD& content); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 47f9031ac2..de6fcbd8bc 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -272,10 +272,7 @@ class LLFileUploadScene : public view_listener_t std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_COLLADA); if (!filename.empty()) { - LLFloaterReg::showInstance("import_collada"); - LLFloaterImportCollada* floater = LLFloaterReg::findTypedInstance<LLFloaterImportCollada>("import_collada"); - floater->enableOK(TRUE); - floater->importFile(filename); + LLImportCollada::getInstance()->importFile(filename); } return TRUE; } @@ -1083,8 +1080,7 @@ void upload_new_resource( new LLNewAgentInventoryResponder( body, uuid, - asset_type, - (LLImportCollada*) userdata)); + asset_type)); } else { -- cgit v1.2.3 From 728463b40b9794b9fa4cd5b7bad3f169033d0bc8 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 8 Jan 2010 13:31:04 -0600 Subject: Cleaned up visible edges of projector frustum in diffuse/specular/ambient lighting from projectors. --- .../shaders/class1/deferred/multiSpotLightF.glsl | 102 +++++++++++++++------ .../shaders/class2/deferred/multiSpotLightF.glsl | 58 +++++++++++- .../shaders/class2/deferred/spotLightF.glsl | 11 --- 3 files changed, 128 insertions(+), 43 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 28bcd720c0..2c8d90d1a6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -5,7 +5,6 @@ * $License$ */ - #version 120 #extension GL_ARB_texture_rectangle : enable @@ -15,6 +14,7 @@ uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform samplerCube environmentMap; +uniform sampler2DRect lightMap; uniform sampler2D noiseMap; uniform sampler2D lightFunc; uniform sampler2D projectionMap; @@ -26,12 +26,15 @@ uniform vec3 proj_n; uniform float proj_focus; //distance from plane to begin blurring uniform float proj_lod; //(number of mips in proj map) uniform float proj_range; //range between near clip and far clip plane of projection +uniform float proj_ambient_lod; uniform float proj_ambiance; uniform float near_clip; uniform float far_clip; uniform vec3 proj_origin; //origin of projection to be used for angular attenuation uniform float sun_wash; +uniform int proj_shadow_idx; +uniform float shadow_fade; varying vec4 vary_light; @@ -40,6 +43,52 @@ uniform vec2 screen_res; uniform mat4 inv_proj; +vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float det = max(1.0-lod/(proj_lod*0.5), 0.0); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + + return ret; +} + +vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); + + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); + + return ret; +} + +vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); + + return ret; +} + + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -68,7 +117,7 @@ void main() { discard; } - + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; norm = normalize(norm); @@ -83,7 +132,11 @@ void main() proj_tc.xyz /= proj_tc.w; float fa = gl_Color.a+1.0; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); + if (dist_atten <= 0.0) + { + discard; + } lv = proj_origin-pos.xyz; lv = normalize(lv); @@ -101,32 +154,32 @@ void main() proj_tc.y > 0.0) { float lit = 0.0; + float amb_da = proj_ambiance; + if (da > 0.0) { float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); float lod = diff * proj_lod; - vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); + vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; col = lcol*lit*diff_tex; + amb_da += (da*0.5)*proj_ambiance; } - float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, lod); - //float amb_da = mix(proj_ambiance, proj_ambiance*max(-da, 0.0), max(da, 0.0)); - float amb_da = proj_ambiance; - + //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); + vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); + amb_da += (da*da*0.5+0.5)*proj_ambiance; - + amb_da *= dist_atten * noise; - + amb_da = min(amb_da, 1.0-lit); - + col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -144,35 +197,28 @@ void main() { vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - vec3 stc = (proj_mat * vec4(pfinal.xyz, 1.0)).xyz; + vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); if (stc.z > 0.0) { - stc.xy /= stc.z+proj_near; - + stc.xy /= stc.w; + + float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); + + stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); + vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb; } } } } - /*if (spec.a > 0.0) - { - //vec3 ref = reflect(normalize(pos), norm); - float sa = dot(normalize(lv-normalize(pos)),norm);; - //sa = max(sa, 0.0); - //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*lcol*spec.rgb; - }*/ - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 45884d5732..3e29c684e8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -43,6 +43,52 @@ uniform vec2 screen_res; uniform mat4 inv_proj; +vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float det = max(1.0-lod/(proj_lod*0.5), 0.0); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + + return ret; +} + +vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); + + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); + + return ret; +} + +vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); + + return ret; +} + + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -126,7 +172,7 @@ void main() float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); float lod = diff * proj_lod; - vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); + vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; @@ -137,7 +183,7 @@ void main() } //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, proj_lod); + vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); amb_da += (da*da*0.5+0.5)*proj_ambiance; @@ -167,13 +213,17 @@ void main() if (stc.z > 0.0) { stc.xy /= stc.w; - + + float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); + + stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); + vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index d6534083cf..6617e33c0d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -179,17 +179,6 @@ void main() } } - /*if (spec.a > 0.0) - { - //vec3 ref = reflect(normalize(pos), norm); - float sa = dot(normalize(lv-normalize(pos)),norm);; - //sa = max(sa, 0.0); - //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*lcol*spec.rgb; - }*/ - //attenuate point light contribution by SSAO component col *= texture2DRect(lightMap, frag.xy).g; -- cgit v1.2.3 From 19469efc76ff5e9d7eb03bad711b2c13c19ea404 Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Wed, 13 Jan 2010 15:51:13 -0600 Subject: drag-and-drop mesh asset onto in-world object --- indra/newview/lltooldraganddrop.cpp | 67 +++++++++++++++++++++++++++++++++---- indra/newview/lltooldraganddrop.h | 12 +++++++ 2 files changed, 72 insertions(+), 7 deletions(-) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 7509246374..f05da6e0ed 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -385,7 +385,7 @@ LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary() addEntry(DAD_ANIMATION, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_GESTURE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dActivateGesture, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_LINK, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL)); - addEntry(DAD_MESH, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_MESH, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dMeshObject, &LLToolDragAndDrop::dad3dNULL)); // TODO: animation on self could play it? edit it? // TODO: gesture on self could play it? edit it? }; @@ -1086,6 +1086,31 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, hit_obj->sendTEUpdate(); } +void LLToolDragAndDrop::dropMesh(LLViewerObject* hit_obj, + LLInventoryItem* item, + LLToolDragAndDrop::ESource source, + const LLUUID& src_id) +{ + if (!item) + { + llwarns << "no inventory item." << llendl; + return; + } + LLUUID asset_id = item->getAssetUUID(); + BOOL success = handleDropTextureProtections(hit_obj, item, source, src_id); + if(!success) + { + return; + } + + LLSculptParams sculpt_params; + sculpt_params.setSculptTexture(asset_id); + sculpt_params.setSculptType(LL_SCULPT_TYPE_MESH); + hit_obj->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt_params, TRUE); + + dialog_refresh_all(); +} + /* void LLToolDragAndDrop::dropTextureOneFaceAvatar(LLVOAvatar* avatar, S32 hit_face, LLInventoryItem* item) { @@ -2216,10 +2241,10 @@ EAcceptance LLToolDragAndDrop::dad3dRezScript( return rv; } -EAcceptance LLToolDragAndDrop::dad3dTextureObject( - LLViewerObject* obj, S32 face, MASK mask, BOOL drop) +EAcceptance LLToolDragAndDrop::dad3dApplyToObject( + LLViewerObject* obj, S32 face, MASK mask, BOOL drop, EDragAndDropType cargo_type) { - lldebugs << "LLToolDragAndDrop::dad3dTextureObject()" << llendl; + lldebugs << "LLToolDragAndDrop::dad3dApplyToObject()" << llendl; // *HACK: In order to resolve SL-22177, we need to block drags // from notecards and objects onto other objects. @@ -2253,13 +2278,24 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject( if(drop && (ACCEPT_YES_SINGLE <= rv)) { - if((mask & MASK_SHIFT)) + if (cargo_type == DAD_TEXTURE) { - dropTextureAllFaces(obj, item, mSource, mSourceID); + if((mask & MASK_SHIFT)) + { + dropTextureAllFaces(obj, item, mSource, mSourceID); + } + else + { + dropTextureOneFace(obj, face, item, mSource, mSourceID); + } + } + else if (cargo_type == DAD_MESH) + { + dropMesh(obj, item, mSource, mSourceID); } else { - dropTextureOneFace(obj, face, item, mSource, mSourceID); + llwarns << "unsupported asset type" << llendl; } // VEFFECT: SetTexture @@ -2273,6 +2309,23 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject( // enable multi-drop, although last texture will win return ACCEPT_YES_MULTI; } + + +EAcceptance LLToolDragAndDrop::dad3dTextureObject( + LLViewerObject* obj, S32 face, MASK mask, BOOL drop) +{ + return dad3dApplyToObject(obj, face, mask, drop, DAD_TEXTURE); +} + +EAcceptance LLToolDragAndDrop::dad3dMeshObject( + LLViewerObject* obj, S32 face, MASK mask, BOOL drop) +{ + return dad3dApplyToObject(obj, face, mask, drop, DAD_MESH); +} + + + + /* EAcceptance LLToolDragAndDrop::dad3dTextureSelf( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 79b2bc32a3..8a19eb6c9c 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -154,6 +154,8 @@ protected: MASK mask, BOOL drop); EAcceptance dad3dTextureObject(LLViewerObject* obj, S32 face, MASK mask, BOOL drop); + EAcceptance dad3dMeshObject(LLViewerObject* obj, S32 face, + MASK mask, BOOL drop); // EAcceptance dad3dTextureSelf(LLViewerObject* obj, S32 face, // MASK mask, BOOL drop); EAcceptance dad3dWearItem(LLViewerObject* obj, S32 face, @@ -185,6 +187,11 @@ protected: EAcceptance dad3dActivateGesture(LLViewerObject *obj, S32 face, MASK mask, BOOL drop); + // helper called by methods above to handle "application" of an item + // to an object (texture applied to face, mesh applied to shape, etc.) + EAcceptance dad3dApplyToObject(LLViewerObject* obj, S32 face, MASK mask, BOOL drop, EDragAndDropType cargo_type); + + // set the LLToolDragAndDrop's cursor based on the given acceptance ECursorType acceptanceToCursor( EAcceptance acceptance ); @@ -253,6 +260,11 @@ public: LLInventoryItem* item, ESource source, const LLUUID& src_id); + static void dropMesh(LLViewerObject* hit_obj, + LLInventoryItem* item, + ESource source, + const LLUUID& src_id); + //static void dropTextureOneFaceAvatar(LLVOAvatar* avatar,S32 hit_face, // LLInventoryItem* item) -- cgit v1.2.3 From 04fe0399443cf4a5852e94cd3950ba1fd2d50562 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 14 Jan 2010 13:55:00 -0800 Subject: Backed out changeset d5b761982e63 This got pushed too early - sorry. Sigh. --- indra/llcommon/llfasttimer.h | 163 ++++++------- indra/llplugin/llpluginclassmedia.cpp | 30 +-- indra/llplugin/llpluginclassmedia.h | 12 - indra/llui/llfloater.cpp | 46 ++-- indra/llui/llmenugl.cpp | 2 +- indra/llui/lltexteditor.cpp | 3 +- indra/media_plugins/webkit/media_plugin_webkit.cpp | 1 - indra/newview/CMakeLists.txt | 8 +- indra/newview/app_settings/settings.xml | 13 +- .../darwin/fix_application_icon_position.sh | 14 -- indra/newview/llagent.cpp | 9 +- indra/newview/llagent.h | 1 - indra/newview/llavatarlist.cpp | 7 +- indra/newview/llavatarlistitem.cpp | 251 ++++++++------------ indra/newview/llavatarlistitem.h | 71 ++---- indra/newview/llbottomtray.cpp | 17 +- indra/newview/llcallfloater.cpp | 12 +- indra/newview/llchathistory.cpp | 49 ++-- indra/newview/llfloaterabout.cpp | 2 +- indra/newview/llfloaterchat.cpp | 15 +- indra/newview/llfloatergesture.cpp | 2 +- indra/newview/llfloatergroups.cpp | 9 +- indra/newview/llfloaterland.cpp | 7 +- indra/newview/llfloaterland.h | 1 + indra/newview/llfloaterpreference.cpp | 2 +- indra/newview/llfloaterregioninfo.cpp | 5 - indra/newview/llgesturemgr.cpp | 10 - indra/newview/llgesturemgr.h | 2 - indra/newview/llgroupactions.cpp | 10 +- indra/newview/llimfloater.cpp | 86 +++---- indra/newview/llimfloater.h | 5 +- indra/newview/llimfloatercontainer.cpp | 11 - indra/newview/llimfloatercontainer.h | 6 +- indra/newview/llimview.cpp | 19 +- indra/newview/llimview.h | 5 - indra/newview/llinspectavatar.cpp | 1 - indra/newview/llinspecttoast.cpp | 122 ---------- indra/newview/llinspecttoast.h | 40 ---- indra/newview/llinventorymodel.cpp | 8 +- indra/newview/llinventoryobserver.cpp | 35 +-- indra/newview/llmediactrl.cpp | 45 ++-- indra/newview/llmediactrl.h | 1 + indra/newview/llnamebox.cpp | 24 +- indra/newview/llnamebox.h | 5 - indra/newview/llnearbychat.cpp | 22 +- indra/newview/llnearbychatbar.cpp | 252 +++++--------------- indra/newview/llnearbychatbar.h | 47 ++-- indra/newview/llnearbychathandler.cpp | 25 +- indra/newview/lloutputmonitorctrl.cpp | 65 +----- indra/newview/lloutputmonitorctrl.h | 29 +-- indra/newview/llpanelavatar.cpp | 18 +- indra/newview/llpanelgroup.cpp | 55 +---- indra/newview/llpanelgroup.h | 4 - indra/newview/llpanelgroupgeneral.cpp | 11 +- indra/newview/llpanelgrouproles.cpp | 61 +++-- indra/newview/llpanelgrouproles.h | 13 +- indra/newview/llpanelimcontrolpanel.cpp | 2 +- indra/newview/llpanelpeople.cpp | 8 +- indra/newview/llpanelpick.cpp | 80 +++---- indra/newview/llpanelpick.h | 18 +- indra/newview/llpanelplaces.h | 4 - indra/newview/llpanelteleporthistory.cpp | 2 +- indra/newview/llpanelvolumepulldown.cpp | 154 ------------- indra/newview/llpanelvolumepulldown.h | 64 ------ indra/newview/llparticipantlist.cpp | 8 +- indra/newview/llscreenchannel.cpp | 149 +++++++++--- indra/newview/llscreenchannel.h | 19 +- indra/newview/llspeakers.cpp | 5 - indra/newview/llspeakers.h | 2 - indra/newview/llspeakingindicatormanager.cpp | 254 --------------------- indra/newview/llspeakingindicatormanager.h | 67 ------ indra/newview/llstatusbar.cpp | 19 +- indra/newview/llstatusbar.h | 2 +- indra/newview/llsyswellitem.cpp | 3 +- indra/newview/llsyswellwindow.cpp | 3 +- indra/newview/llsyswellwindow.h | 3 - indra/newview/llteleporthistorystorage.cpp | 7 + indra/newview/lltoastnotifypanel.cpp | 4 +- indra/newview/llviewerdisplay.cpp | 20 +- indra/newview/llviewerfloaterreg.cpp | 5 +- indra/newview/llviewermessage.cpp | 56 +++-- indra/newview/llviewerwindow.cpp | 34 ++- indra/newview/llvoiceclient.cpp | 11 - indra/newview/llvoiceclient.h | 1 - .../default/textures/bottomtray/Unread_Chiclet.png | Bin 328 -> 250 bytes .../default/textures/bottomtray/WellButton_Lit.png | Bin 490 -> 553 bytes .../bottomtray/WellButton_Lit_Selected.png | Bin 302 -> 687 bytes indra/newview/skins/default/textures/textures.xml | 28 ++- .../skins/default/xui/de/floater_buy_currency.xml | 2 +- .../skins/default/xui/de/floater_help_browser.xml | 4 +- indra/newview/skins/default/xui/de/strings.xml | 72 +++--- .../newview/skins/default/xui/en/floater_about.xml | 2 +- .../skins/default/xui/en/floater_about_land.xml | 8 +- .../skins/default/xui/en/floater_buy_currency.xml | 4 +- .../skins/default/xui/en/floater_customize.xml | 120 +++++----- .../skins/default/xui/en/floater_god_tools.xml | 2 +- indra/newview/skins/default/xui/en/floater_im.xml | 2 +- .../skins/default/xui/en/floater_nearby_chat.xml | 4 +- .../skins/default/xui/en/floater_report_abuse.xml | 4 +- .../skins/default/xui/en/floater_select_key.xml | 8 +- .../skins/default/xui/en/floater_top_objects.xml | 20 +- indra/newview/skins/default/xui/en/floater_tos.xml | 6 +- .../default/xui/en/floater_voice_controls.xml | 143 +++++++----- .../newview/skins/default/xui/en/inspect_toast.xml | 19 -- indra/newview/skins/default/xui/en/menu_viewer.xml | 36 ++- .../newview/skins/default/xui/en/notifications.xml | 33 +-- .../default/xui/en/panel_adhoc_control_panel.xml | 17 +- .../default/xui/en/panel_avatar_list_item.xml | 7 +- .../default/xui/en/panel_block_list_sidetray.xml | 6 +- .../skins/default/xui/en/panel_bottomtray.xml | 45 ++-- .../skins/default/xui/en/panel_edit_pick.xml | 32 +-- .../skins/default/xui/en/panel_edit_profile.xml | 3 +- .../newview/skins/default/xui/en/panel_friends.xml | 2 +- .../default/xui/en/panel_group_control_panel.xml | 20 +- .../default/xui/en/panel_group_info_sidetray.xml | 18 +- .../skins/default/xui/en/panel_group_invite.xml | 14 +- .../skins/default/xui/en/panel_group_list_item.xml | 1 - .../skins/default/xui/en/panel_group_notices.xml | 1 - .../skins/default/xui/en/panel_group_roles.xml | 55 ++--- indra/newview/skins/default/xui/en/panel_login.xml | 1 - .../xui/en/panel_media_settings_general.xml | 5 +- .../skins/default/xui/en/panel_my_profile.xml | 20 +- .../skins/default/xui/en/panel_navigation_bar.xml | 4 +- .../skins/default/xui/en/panel_nearby_chat_bar.xml | 4 +- indra/newview/skins/default/xui/en/panel_notes.xml | 6 +- .../newview/skins/default/xui/en/panel_people.xml | 10 +- .../skins/default/xui/en/panel_pick_info.xml | 33 ++- .../default/xui/en/panel_preferences_advanced.xml | 1 + .../default/xui/en/panel_preferences_general.xml | 15 +- .../default/xui/en/panel_preferences_graphics1.xml | 4 +- .../default/xui/en/panel_prim_media_controls.xml | 1 - .../newview/skins/default/xui/en/panel_profile.xml | 26 +-- .../skins/default/xui/en/panel_region_covenant.xml | 10 +- .../skins/default/xui/en/panel_region_estate.xml | 12 +- .../skins/default/xui/en/panel_region_texture.xml | 4 +- .../skins/default/xui/en/panel_status_bar.xml | 36 +-- .../skins/default/xui/en/panel_volume_pulldown.xml | 55 ----- .../skins/default/xui/en/sidepanel_task_info.xml | 36 ++- indra/newview/skins/default/xui/en/strings.xml | 16 +- .../default/xui/en/widgets/chiclet_im_adhoc.xml | 22 +- .../default/xui/en/widgets/chiclet_im_group.xml | 23 +- .../default/xui/en/widgets/chiclet_im_p2p.xml | 18 +- .../skins/default/xui/en/widgets/chiclet_offer.xml | 14 +- .../default/xui/en/widgets/chiclet_script.xml | 14 +- .../default/xui/en/widgets/gesture_combo_box.xml | 30 +++ .../default/xui/en/widgets/gesture_combo_list.xml | 21 -- .../default/xui/en/widgets/location_input.xml | 18 +- .../skins/default/xui/es/floater_buy_currency.xml | 3 - .../skins/default/xui/fr/floater_buy_currency.xml | 4 +- .../skins/default/xui/fr/floater_help_browser.xml | 4 +- indra/newview/skins/default/xui/fr/strings.xml | 74 +++--- .../skins/default/xui/it/floater_buy_currency.xml | 9 +- .../skins/default/xui/ja/floater_buy_currency.xml | 2 +- indra/newview/skins/default/xui/ja/strings.xml | 48 ++-- .../skins/default/xui/pt/floater_buy_currency.xml | 3 - install.xml | 12 +- 156 files changed, 1460 insertions(+), 2689 deletions(-) delete mode 100644 indra/newview/installers/darwin/fix_application_icon_position.sh delete mode 100644 indra/newview/llinspecttoast.cpp delete mode 100644 indra/newview/llinspecttoast.h delete mode 100644 indra/newview/llpanelvolumepulldown.cpp delete mode 100644 indra/newview/llpanelvolumepulldown.h delete mode 100644 indra/newview/llspeakingindicatormanager.cpp delete mode 100644 indra/newview/llspeakingindicatormanager.h delete mode 100644 indra/newview/skins/default/xui/en/inspect_toast.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_volume_pulldown.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml delete mode 100644 indra/newview/skins/default/xui/en/widgets/gesture_combo_list.xml diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 5058a2e772..f5c90291b8 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -39,30 +39,40 @@ #define TIME_FAST_TIMERS 0 #if LL_WINDOWS -// because MS has different signatures for these functions in winnt.h -// need to rename them to avoid conflicts -#define _interlockedbittestandset _renamed_interlockedbittestandset -#define _interlockedbittestandreset _renamed_interlockedbittestandreset -#include <intrin.h> -#undef _interlockedbittestandset -#undef _interlockedbittestandreset - -#define LL_INLINE __forceinline + // shift off lower 8 bits for lower resolution but longer term timing // on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing inline U32 get_cpu_clock_count_32() { - U64 time_stamp = __rdtsc(); - return (U32)(time_stamp >> 8); + U32 ret_val; + __asm + { + _emit 0x0f + _emit 0x31 + shr eax,8 + shl edx,24 + or eax, edx + mov dword ptr [ret_val], eax + } + return ret_val; } // return full timer value, *not* shifted by 8 bits inline U64 get_cpu_clock_count_64() { - return __rdtsc(); + U64 ret_val; + __asm + { + _emit 0x0f + _emit 0x31 + mov eax,eax + mov edx,edx + mov dword ptr [ret_val+4], edx + mov dword ptr [ret_val], eax + } + return ret_val; } -#else -#define LL_INLINE + #endif // LL_WINDOWS #if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) @@ -103,25 +113,10 @@ class LLMutex; #include <queue> #include "llsd.h" + class LL_COMMON_API LLFastTimer { public: - - class NamedTimer; - - struct LL_COMMON_API FrameState - { - FrameState(NamedTimer* timerp); - - U32 mSelfTimeCounter; - U32 mCalls; - FrameState* mParent; // info for caller timer - FrameState* mLastCaller; // used to bootstrap tree construction - NamedTimer* mTimer; - U16 mActiveCount; // number of timers with this ID active on stack - bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame - }; - // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances class LL_COMMON_API NamedTimer : public LLInstanceTracker<NamedTimer> @@ -154,10 +149,24 @@ public: static NamedTimer& getRootNamedTimer(); + struct FrameState + { + FrameState(NamedTimer* timerp); + + U32 mSelfTimeCounter; + U32 mCalls; + FrameState* mParent; // info for caller timer + FrameState* mLastCaller; // used to bootstrap tree construction + NamedTimer* mTimer; + U16 mActiveCount; // number of timers with this ID active on stack + bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame + }; + S32 getFrameStateIndex() const { return mFrameStateIndex; } FrameState& getFrameState() const; + private: friend class LLFastTimer; friend class NamedTimerFactory; @@ -176,6 +185,7 @@ public: static void buildHierarchy(); static void resetFrame(); static void reset(); + // // members @@ -197,47 +207,58 @@ public: std::vector<NamedTimer*> mChildren; bool mCollapsed; // don't show children bool mNeedsSorting; // sort children whenever child added + }; // used to statically declare a new named timer class LL_COMMON_API DeclareTimer : public LLInstanceTracker<DeclareTimer> { - friend class LLFastTimer; public: DeclareTimer(const std::string& name, bool open); DeclareTimer(const std::string& name); static void updateCachedPointers(); + // convertable to NamedTimer::FrameState for convenient usage of LLFastTimer(declared_timer) + operator NamedTimer::FrameState&() { return *mFrameState; } private: - NamedTimer& mTimer; - FrameState* mFrameState; + NamedTimer& mTimer; + NamedTimer::FrameState* mFrameState; }; + public: - LLFastTimer(LLFastTimer::FrameState* state); + static LLMutex* sLogLock; + static std::queue<LLSD> sLogQueue; + static BOOL sLog; + static BOOL sMetricLog; + + typedef std::vector<NamedTimer::FrameState> info_list_t; + static info_list_t& getFrameStateList(); - LL_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer) - : mFrameState(timer.mFrameState) + enum RootTimerMarker { ROOT }; + LLFastTimer(RootTimerMarker); + + LLFastTimer(NamedTimer::FrameState& timer) + : mFrameState(&timer) { #if TIME_FAST_TIMERS U64 timer_start = get_cpu_clock_count_64(); #endif #if FAST_TIMER_ON - LLFastTimer::FrameState* frame_state = mFrameState; - mStartTime = get_cpu_clock_count_32(); + NamedTimer::FrameState* frame_state = &timer; + U32 cur_time = get_cpu_clock_count_32(); + mStartSelfTime = cur_time; + mStartTotalTime = cur_time; frame_state->mActiveCount++; frame_state->mCalls++; // keep current parent as long as it is active when we are frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0); - LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData; - mLastTimerData = *cur_timer_data; - cur_timer_data->mCurTimer = this; - cur_timer_data->mFrameState = frame_state; - cur_timer_data->mChildTime = 0; + mLastTimer = sCurTimer; + sCurTimer = this; #endif #if TIME_FAST_TIMERS U64 timer_end = get_cpu_clock_count_64(); @@ -245,26 +266,26 @@ public: #endif } - LL_INLINE ~LLFastTimer() + ~LLFastTimer() { #if TIME_FAST_TIMERS U64 timer_start = get_cpu_clock_count_64(); #endif #if FAST_TIMER_ON - LLFastTimer::FrameState* frame_state = mFrameState; - U32 total_time = get_cpu_clock_count_32() - mStartTime; + NamedTimer::FrameState* frame_state = mFrameState; + U32 cur_time = get_cpu_clock_count_32(); + frame_state->mSelfTimeCounter += cur_time - mStartSelfTime; - frame_state->mSelfTimeCounter += total_time - LLFastTimer::sCurTimerData.mChildTime; frame_state->mActiveCount--; + LLFastTimer* last_timer = mLastTimer; + sCurTimer = last_timer; // store last caller to bootstrap tree creation - // do this in the destructor in case of recursion to get topmost caller - frame_state->mLastCaller = mLastTimerData.mFrameState; + frame_state->mLastCaller = last_timer->mFrameState; // we are only tracking self time, so subtract our total time delta from parents - mLastTimerData.mChildTime += total_time; - - LLFastTimer::sCurTimerData = mLastTimerData; + U32 total_time = cur_time - mStartTotalTime; + last_timer->mStartSelfTime += total_time; #endif #if TIME_FAST_TIMERS U64 timer_end = get_cpu_clock_count_64(); @@ -273,20 +294,7 @@ public: #endif } -public: - static LLMutex* sLogLock; - static std::queue<LLSD> sLogQueue; - static BOOL sLog; - static BOOL sMetricLog; - static bool sPauseHistory; - static bool sResetHistory; - static U64 sTimerCycles; - static U32 sTimerCalls; - typedef std::vector<FrameState> info_list_t; - static info_list_t& getFrameStateList(); - - // call this once a frame to reset timers static void nextFrame(); @@ -304,26 +312,23 @@ public: static void writeLog(std::ostream& os); static const NamedTimer* getTimerByName(const std::string& name); - struct CurTimerData - { - LLFastTimer* mCurTimer; - FrameState* mFrameState; - U32 mChildTime; - }; - static CurTimerData sCurTimerData; - +public: + static bool sPauseHistory; + static bool sResetHistory; + static U64 sTimerCycles; + static U32 sTimerCalls; + private: + static LLFastTimer* sCurTimer; static S32 sCurFrameIndex; static S32 sLastFrameIndex; static U64 sLastFrameTime; static info_list_t* sTimerInfos; - U32 mStartTime; - LLFastTimer::FrameState* mFrameState; - LLFastTimer::CurTimerData mLastTimerData; - + U32 mStartSelfTime; // start time + time of all child timers + U32 mStartTotalTime; // start time + time of all child timers + NamedTimer::FrameState* mFrameState; + LLFastTimer* mLastTimer; }; -typedef class LLFastTimer LLFastTimer; - #endif // LL_LLFASTTIMER_H diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 3d2eaed5c5..ed8d10a88c 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -37,8 +37,6 @@ #include "llpluginclassmedia.h" #include "llpluginmessageclasses.h" -#include "llqtwebkit.h" - static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256; static int nextPowerOf2( int value ) @@ -126,7 +124,7 @@ void LLPluginClassMedia::reset() mCanPaste = false; mMediaName.clear(); mMediaDescription.clear(); - mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f); + mBackgroundColor = LLColor4::white; // media_browser class mNavigateURI.clear(); @@ -136,9 +134,6 @@ void LLPluginClassMedia::reset() mHistoryForwardAvailable = false; mStatusText.clear(); mProgressPercent = 0; - mClickURL.clear(); - mClickTarget.clear(); - mClickTargetType = TARGET_NONE; // media_time class mCurrentTime = 0.0f; @@ -674,26 +669,6 @@ void LLPluginClassMedia::paste() sendMessage(message); } -LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type) -{ - // convert a LinkTargetType value from llqtwebkit to an ETargetType - // so that we don't expose the llqtwebkit header in viewer code - switch (target_type) - { - case LinkTargetType::LTT_TARGET_NONE: - return LLPluginClassMedia::TARGET_NONE; - - case LinkTargetType::LTT_TARGET_BLANK: - return LLPluginClassMedia::TARGET_BLANK; - - case LinkTargetType::LTT_TARGET_EXTERNAL: - return LLPluginClassMedia::TARGET_EXTERNAL; - - default: - return LLPluginClassMedia::TARGET_OTHER; - } -} - /* virtual */ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { @@ -946,15 +921,12 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { mClickURL = message.getValue("uri"); mClickTarget = message.getValue("target"); - U32 target_type = message.getValueU32("target_type"); - mClickTargetType = ::getTargetTypeFromLLQtWebkit(target_type); mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF); } else if(message_name == "click_nofollow") { mClickURL = message.getValue("uri"); mClickTarget.clear(); - mClickTargetType = TARGET_NONE; mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW); } else diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index ebb9099576..5a1928ab1d 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -214,17 +214,6 @@ public: // This is valid after MEDIA_EVENT_CLICK_LINK_HREF std::string getClickTarget() const { return mClickTarget; }; - typedef enum - { - TARGET_NONE, // empty href target string - TARGET_BLANK, // target to open link in user's preferred browser - TARGET_EXTERNAL, // target to open link in external browser - TARGET_OTHER // nonempty and unsupported target type - }ETargetType; - - // This is valid after MEDIA_EVENT_CLICK_LINK_HREF - ETargetType getClickTargetType() const { return mClickTargetType; }; - std::string getMediaName() const { return mMediaName; }; std::string getMediaDescription() const { return mMediaDescription; }; @@ -355,7 +344,6 @@ protected: std::string mLocation; std::string mClickURL; std::string mClickTarget; - ETargetType mClickTargetType; ///////////////////////////////////////// // media_time class diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a17e306325..845203b420 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -878,11 +878,9 @@ void LLFloater::setSnappedTo(const LLView* snap_view) else { //RN: assume it's a floater as it must be a sibling to our parent floater - const LLFloater* floaterp = dynamic_cast<const LLFloater*>(snap_view); - if (floaterp) - { - setSnapTarget(floaterp->getHandle()); - } + LLFloater* floaterp = (LLFloater*)snap_view; + + setSnapTarget(floaterp->getHandle()); } } @@ -1067,6 +1065,10 @@ void LLFloater::setMinimized(BOOL minimize) reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE ); } + // don't show the help button while minimized - it's + // not very useful when minimized and uses up space + mButtonsEnabled[BUTTON_HELP] = !minimize; + applyTitle (); make_ui_sound("UISndWindowClose"); @@ -1739,32 +1741,14 @@ void LLFloater::updateButtons() S32 button_count = 0; for (S32 i = 0; i < BUTTON_COUNT; i++) { - if (!mButtons[i]) - { - continue; - } + if(!mButtons[i]) continue; + mButtons[i]->setEnabled(mButtonsEnabled[i]); - bool enabled = mButtonsEnabled[i]; - if (i == BUTTON_HELP) - { - // don't show the help button if the floater is minimized - // or if it is a tear-off hosted floater - if (isMinimized() || mButtonsEnabled[BUTTON_TEAR_OFF]) - { - enabled = false; - } - } - if (i == BUTTON_CLOSE && mButtonScale != 1.f) - { - //*HACK: always render close button for hosted floaters so - //that users don't accidentally hit the button when - //closing multiple windows in the chatterbox - enabled = true; - } - - mButtons[i]->setEnabled(enabled); - - if (enabled) + if (mButtonsEnabled[i] + //*HACK: always render close button for hosted floaters + // so that users don't accidentally hit the button when closing multiple windows + // in the chatterbox + || (i == BUTTON_CLOSE && mButtonScale != 1.f)) { button_count++; @@ -1791,7 +1775,7 @@ void LLFloater::updateButtons() // the restore button should have a tab stop so that it takes action when you Ctrl-Tab to a minimized floater mButtons[i]->setTabStop(i == BUTTON_RESTORE); } - else + else if (mButtons[i]) { mButtons[i]->setVisible(FALSE); } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 21f3f15739..bd67949c2a 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2966,7 +2966,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y); LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y); - const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect(); + const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect(); const S32 HPAD = 2; LLRect rect = menu->getRect(); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index f2c3879a6c..e8fc9475a5 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -308,8 +308,7 @@ LLTextEditor::~LLTextEditor() // Scrollbar is deleted by LLView std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); - // context menu is owned by menu holder, not us - //delete mContextMenu; + delete mContextMenu; } //////////////////////////////////////////////////////////// diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 084cdd9561..a0336f6156 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -429,7 +429,6 @@ private: LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); message.setValue("uri", event.getStringValue()); message.setValue("target", event.getStringValue2()); - message.setValueU32("target_type", event.getLinkType()); sendMessage(message); } diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5b4edefbc1..32761dbf27 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -218,6 +218,7 @@ set(viewer_SOURCE_FILES llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp + llfloatervolumepulldown.cpp llfloaterwater.cpp llfloaterwhitelistentry.cpp llfloaterwindlight.cpp @@ -255,7 +256,6 @@ set(viewer_SOURCE_FILES llinspectgroup.cpp llinspectobject.cpp llinspectremoteobject.cpp - llinspecttoast.cpp llinventorybridge.cpp llinventoryclipboard.cpp llinventoryfilter.cpp @@ -355,7 +355,6 @@ set(viewer_SOURCE_FILES llpanelshower.cpp llpanelteleporthistory.cpp llpanelvolume.cpp - llpanelvolumepulldown.cpp llparcelselection.cpp llparticipantlist.cpp llpatchvertexarray.cpp @@ -394,7 +393,6 @@ set(viewer_SOURCE_FILES llspatialpartition.cpp llspeakbutton.cpp llspeakers.cpp - llspeakingindicatormanager.cpp llsplitbutton.cpp llsprite.cpp llstartup.cpp @@ -767,7 +765,6 @@ set(viewer_HEADER_FILES llinspectgroup.h llinspectobject.h llinspectremoteobject.h - llinspecttoast.h llinventorybridge.h llinventoryclipboard.h llinventoryfilter.h @@ -863,7 +860,6 @@ set(viewer_HEADER_FILES llpanelshower.h llpanelteleporthistory.h llpanelvolume.h - llpanelvolumepulldown.h llparcelselection.h llparticipantlist.h llpatchvertexarray.h @@ -904,7 +900,6 @@ set(viewer_HEADER_FILES llspatialpartition.h llspeakbutton.h llspeakers.h - llspeakingindicatormanager.h llsplitbutton.h llsprite.h llstartup.h @@ -1775,7 +1770,6 @@ if (INSTALL) endif (INSTALL) if (LL_TESTS) -else (LL_TESTS) # To add a viewer unit test, just add the test .cpp file below # This creates a separate test project per file listed. include(LLAddBuildTest) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index db759f052a..4bfc6f9e4f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1141,18 +1141,7 @@ <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>5</integer> - </map> - <key>CallFloaterMaxItems</key> - <map> - <key>Comment</key> - <string>Max number of visible participants in voice controls window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>1</integer> </map> diff --git a/indra/newview/installers/darwin/fix_application_icon_position.sh b/indra/newview/installers/darwin/fix_application_icon_position.sh deleted file mode 100644 index a0b72a89f2..0000000000 --- a/indra/newview/installers/darwin/fix_application_icon_position.sh +++ /dev/null @@ -1,14 +0,0 @@ -# just run this script each time after you change the installer's name to fix the icon misalignment -#!/bin/bash -cp -r ./../../../build-darwin-i386/newview/*.dmg ~/Desktop/TempBuild.dmg -hdid ~/Desktop/TempBuild.dmg -open -a finder /Volumes/Second\ Life\ Installer -osascript dmg-cleanup.applescript -cp /Volumes/Second\ Life\ Installer/.DS_Store ~/Desktop/_DS_Store -chflags nohidden ~/Desktop/_DS_Store -cp ~/Desktop/_DS_Store ./firstlook-dmg/_DS_Store -cp ~/Desktop/_DS_Store ./publicnightly-dmg/_DS_Store -cp ~/Desktop/_DS_Store ./release-dmg/_DS_Store -cp ~/Desktop/_DS_Store ./releasecandidate-dmg/_DS_Store -umount /Volumes/Second\ Life\ Installer/ -rm ~/Desktop/_DS_Store ~/Desktop/TempBuild.dmg diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 5ea253709c..5e2e374df6 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -514,8 +514,6 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) } setFocusOnAvatar(TRUE, ANIMATE); - - mCameraFOVZoomFactor = 0.f; } mHUDTargetZoom = 1.f; @@ -3586,7 +3584,7 @@ F32 LLAgent::calcCameraFOVZoomFactor() { return 0.f; } - else if (mFocusObject.notNull() && !mFocusObject->isAvatar() && !mFocusOnAvatar) + else if (mFocusObject.notNull() && !mFocusObject->isAvatar()) { // don't FOV zoom on mostly transparent objects LLVector3 focus_offset = mFocusObjectOffset; @@ -5159,11 +5157,6 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO return FALSE; } -BOOL LLAgent::canJoinGroups() const -{ - return mGroups.count() < MAX_AGENT_GROUPS; -} - LLQuaternion LLAgent::getHeadRotation() { if (mAvatarObject.isNull() || !mAvatarObject->mPelvisp || !mAvatarObject->mHeadp) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index beede7fbe3..2e95dc72be 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -972,7 +972,6 @@ public: BOOL setGroupContribution(const LLUUID& group_id, S32 contribution); BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile); const std::string &getGroupName() const { return mGroupName; } - BOOL canJoinGroups() const; private: std::string mGroupName; LLUUID mGroupID; diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 19e9e52ddf..5df73a994e 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -82,7 +82,7 @@ void LLAvatarList::setSpeakingIndicatorsVisible(bool visible) getItems(items); for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) { - static_cast<LLAvatarListItem*>(*it)->showSpeakingIndicator(mShowSpeakingIndicator); + static_cast<LLAvatarListItem*>(*it)->setSpeakingIndicatorVisible(mShowSpeakingIndicator); } } @@ -323,15 +323,18 @@ boost::signals2::connection LLAvatarList::setRefreshCompleteCallback(const commi void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); + item->showInfoBtn(true); + item->showSpeakingIndicator(true); item->setName(name); item->setAvatarId(id, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); + item->childSetVisible("info_btn", false); item->setAvatarIconVisible(mShowIcons); item->setShowInfoBtn(mShowInfoBtn); item->setShowProfileBtn(mShowProfileBtn); - item->showSpeakingIndicator(mShowSpeakingIndicator); + item->setSpeakingIndicatorVisible(mShowSpeakingIndicator); addItem(item, id, pos); } diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 1043858373..6945ac6932 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -44,10 +44,10 @@ #include "llbutton.h" bool LLAvatarListItem::sStaticInitialized = false; -S32 LLAvatarListItem::sLeftPadding = 0; -S32 LLAvatarListItem::sRightNamePadding = 0; -S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT]; - +S32 LLAvatarListItem::sIconWidth = 0; +S32 LLAvatarListItem::sInfoBtnWidth = 0; +S32 LLAvatarListItem::sProfileBtnWidth = 0; +S32 LLAvatarListItem::sSpeakingIndicatorWidth = 0; LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), @@ -91,25 +91,43 @@ BOOL LLAvatarListItem::postBuild() mProfileBtn->setVisible(false); mProfileBtn->setClickedCallback(boost::bind(&LLAvatarListItem::onProfileBtnClick, this)); + // Remember avatar icon width including its padding from the name text box, + // so that we can hide and show the icon again later. if (!sStaticInitialized) { - // Remember children widths including their padding from the next sibling, - // so that we can hide and show them again later. - initChildrenWidths(this); + sIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; + sInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; + sProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; + sSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; sStaticInitialized = true; } - return TRUE; -} - -S32 LLAvatarListItem::notifyParent(const LLSD& info) -{ - if (info.has("visibility_changed")) +/* + if(!p.buttons.profile) { - updateChildren(); + delete mProfile; + mProfile = NULL; + + LLRect rect; + + rect.setLeftTopAndSize(mName->getRect().mLeft, mName->getRect().mTop, mName->getRect().getWidth() + 30, mName->getRect().getHeight()); + mName->setRect(rect); + + if(mLocator) + { + rect.setLeftTopAndSize(mLocator->getRect().mLeft + 30, mLocator->getRect().mTop, mLocator->getRect().getWidth(), mLocator->getRect().getHeight()); + mLocator->setRect(rect); + } + + if(mInfo) + { + rect.setLeftTopAndSize(mInfo->getRect().mLeft + 30, mInfo->getRect().mTop, mInfo->getRect().getWidth(), mInfo->getRect().getHeight()); + mInfo->setRect(rect); + } } - return 0; +*/ + return TRUE; } void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) @@ -119,8 +137,6 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) mProfileBtn->setVisible(mShowProfileBtn); LLPanel::onMouseEnter(x, y, mask); - - updateChildren(); } void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) @@ -130,8 +146,6 @@ void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) mProfileBtn->setVisible(false); LLPanel::onMouseLeave(x, y, mask); - - updateChildren(); } // virtual, called by LLAvatarTracker @@ -201,8 +215,12 @@ void LLAvatarListItem::showLastInteractionTime(bool show) if (show) return; + LLRect name_rect = mAvatarName->getRect(); + LLRect time_rect = mLastInteractionTime->getRect(); + mLastInteractionTime->setVisible(false); - updateChildren(); + name_rect.mRight += (time_rect.mRight - name_rect.mRight); + mAvatarName->setRect(name_rect); } void LLAvatarListItem::setLastInteractionTime(U32 secs_since) @@ -216,6 +234,12 @@ void LLAvatarListItem::setShowInfoBtn(bool show) if(mShowInfoBtn == show) return; mShowInfoBtn = show; + S32 width_delta = show ? - sInfoBtnWidth : sInfoBtnWidth; + + //Translating speaking indicator + mSpeakingIndicator->translate(width_delta, 0); + //Reshaping avatar name + mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } void LLAvatarListItem::setShowProfileBtn(bool show) @@ -224,17 +248,24 @@ void LLAvatarListItem::setShowProfileBtn(bool show) if(mShowProfileBtn == show) return; mShowProfileBtn = show; + S32 width_delta = show ? - sProfileBtnWidth : sProfileBtnWidth; + + //Translating speaking indicator + mSpeakingIndicator->translate(width_delta, 0); + //Reshaping avatar name + mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } -void LLAvatarListItem::showSpeakingIndicator(bool visible) +void LLAvatarListItem::setSpeakingIndicatorVisible(bool visible) { // Already done? Then do nothing. if (mSpeakingIndicator->getVisible() == (BOOL)visible) return; -// Disabled to not contradict with SpeakingIndicatorManager functionality. EXT-3976 -// probably this method should be totally removed. -// mSpeakingIndicator->setVisible(visible); -// updateChildren(); + mSpeakingIndicator->setVisible(visible); + S32 width_delta = visible ? - sSpeakingIndicatorWidth : sSpeakingIndicatorWidth; + + //Reshaping avatar name + mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } void LLAvatarListItem::setAvatarIconVisible(bool visible) @@ -245,12 +276,36 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible) // Show/hide avatar icon. mAvatarIcon->setVisible(visible); - updateChildren(); + + // Move the avatar name horizontally by icon size + its distance from the avatar name. + LLRect name_rect = mAvatarName->getRect(); + name_rect.mLeft += visible ? sIconWidth : -sIconWidth; + mAvatarName->setRect(name_rect); } void LLAvatarListItem::onInfoBtnClick() { LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); + + /* TODO fix positioning of inspector + localPointToScreen(mXPos, mYPos, &mXPos, &mYPos); + + + LLRect rect; + + // *TODO Vadim: rewrite this. "+= -" looks weird. + S32 delta = mYPos - inspector->getRect().getHeight(); + if(delta < 0) + { + mYPos += -delta; + } + + rect.setLeftTopAndSize(mXPos, mYPos, + inspector->getRect().getWidth(), inspector->getRect().getHeight()); + inspector->setRect(rect); + inspector->setFrontmost(true); + inspector->setVisible(true); + */ } void LLAvatarListItem::onProfileBtnClick() @@ -289,6 +344,21 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str setName(name); } +void LLAvatarListItem::reshapeAvatarName() +{ + S32 width_delta = 0; + width_delta += mShowProfileBtn ? sProfileBtnWidth : 0; + width_delta += mSpeakingIndicator->getVisible() ? sSpeakingIndicatorWidth : 0; + width_delta += mAvatarIcon->getVisible() ? sIconWidth : 0; + width_delta += mShowInfoBtn ? sInfoBtnWidth : 0; + width_delta += mLastInteractionTime->getVisible() ? mLastInteractionTime->getRect().getWidth() : 0; + + S32 height = mAvatarName->getRect().getHeight(); + S32 width = getRect().getWidth() - width_delta; + + mAvatarName->reshape(width, height); +} + // Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", // taking i18n into account. The format string to use is taken from the panel XML. std::string LLAvatarListItem::formatSeconds(U32 secs) @@ -422,133 +492,4 @@ LLAvatarListItem::icon_color_map_t& LLAvatarListItem::getItemIconColorMap() return item_icon_color_map; } -// static -void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) -{ - //profile btn width + padding - S32 profile_btn_width = avatar_item->getRect().getWidth() - avatar_item->mProfileBtn->getRect().mLeft; - - //info btn width + padding - S32 info_btn_width = avatar_item->mProfileBtn->getRect().mLeft - avatar_item->mInfoBtn->getRect().mLeft; - - //speaking indicator width + padding - S32 speaking_indicator_width = avatar_item->mInfoBtn->getRect().mLeft - avatar_item->mSpeakingIndicator->getRect().mLeft; - - // last interaction time textbox width + padding - S32 last_interaction_time_width = avatar_item->mSpeakingIndicator->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft; - - // icon width + padding - S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft; - - sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft; - sRightNamePadding = avatar_item->mLastInteractionTime->getRect().mLeft - avatar_item->mAvatarName->getRect().mRight; - - S32 index = ALIC_COUNT; - sChildrenWidths[--index] = icon_width; - sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space" - sChildrenWidths[--index] = last_interaction_time_width; - sChildrenWidths[--index] = speaking_indicator_width; - sChildrenWidths[--index] = info_btn_width; - sChildrenWidths[--index] = profile_btn_width; -} - -void LLAvatarListItem::updateChildren() -{ - LL_DEBUGS("AvatarItemReshape") << LL_ENDL; - LL_DEBUGS("AvatarItemReshape") << "Updating for: " << getAvatarName() << LL_ENDL; - - S32 name_new_width = getRect().getWidth(); - S32 ctrl_new_left = name_new_width; - S32 name_new_left = sLeftPadding; - - // iterate through all children and set them into correct position depend on each child visibility - // assume that child indexes are in back order: the first in Enum is the last (right) in the item - // iterate & set child views starting from right to left - for (S32 i = 0; i < ALIC_COUNT; ++i) - { - // skip "name" textbox, it will be processed out of loop later - if (ALIC_NAME == i) continue; - - LLView* control = getItemChildView((EAvatarListItemChildIndex)i); - - LL_DEBUGS("AvatarItemReshape") << "Processing control: " << control->getName() << LL_ENDL; - // skip invisible views - if (!control->getVisible()) continue; - - S32 ctrl_width = sChildrenWidths[i]; // including space between current & left controls - - // decrease available for - name_new_width -= ctrl_width; - LL_DEBUGS("AvatarItemReshape") << "width: " << ctrl_width << ", name_new_width: " << name_new_width << LL_ENDL; - - LLRect control_rect = control->getRect(); - LL_DEBUGS("AvatarItemReshape") << "rect before: " << control_rect << LL_ENDL; - - if (ALIC_ICON == i) - { - // assume that this is the last iteration, - // so it is not necessary to save "ctrl_new_left" value calculated on previous iterations - ctrl_new_left = sLeftPadding; - name_new_left = ctrl_new_left + ctrl_width; - } - else - { - ctrl_new_left -= ctrl_width; - } - - LL_DEBUGS("AvatarItemReshape") << "ctrl_new_left: " << ctrl_new_left << LL_ENDL; - - control_rect.setLeftTopAndSize( - ctrl_new_left, - control_rect.mTop, - control_rect.getWidth(), - control_rect.getHeight()); - - LL_DEBUGS("AvatarItemReshape") << "rect after: " << control_rect << LL_ENDL; - control->setShape(control_rect); - } - - // set size and position of the "name" child - LLView* name_view = getItemChildView(ALIC_NAME); - LLRect name_view_rect = name_view->getRect(); - LL_DEBUGS("AvatarItemReshape") << "name rect before: " << name_view_rect << LL_ENDL; - - // apply paddings - name_new_width -= sLeftPadding; - name_new_width -= sRightNamePadding; - - name_view_rect.setLeftTopAndSize( - name_new_left, - name_view_rect.mTop, - name_new_width, - name_view_rect.getHeight()); - - name_view->setShape(name_view_rect); - - LL_DEBUGS("AvatarItemReshape") << "name rect after: " << name_view_rect << LL_ENDL; -} - -LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index) -{ - LLView* child_view = mAvatarName; - if (child_view_index < 0 || ALIC_COUNT <= child_view_index) - { - LL_WARNS("AvatarItemReshape") << "Child view index is out of range: " << child_view_index << LL_ENDL; - return child_view; - } - switch (child_view_index) - { - case ALIC_ICON: child_view = mAvatarIcon; break; - case ALIC_NAME: child_view = mAvatarName; break; - case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break; - case ALIC_SPEAKER_INDICATOR: child_view = mSpeakingIndicator; break; - case ALIC_INFO_BUTTON: child_view = mInfoBtn; break; - case ALIC_PROFILE_BUTTON: child_view = mProfileBtn; break; - default: - LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL; - } - - return child_view; -} - // EOF diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index f76ffb391d..96097bc9b5 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -74,11 +74,6 @@ public: virtual ~LLAvatarListItem(); virtual BOOL postBuild(); - - /** - * Processes notification from speaker indicator to update children when indicator's visibility is changed. - */ - virtual S32 notifyParent(const LLSD& info); virtual void onMouseLeave(S32 x, S32 y, MASK mask); virtual void onMouseEnter(S32 x, S32 y, MASK mask); virtual void setValue(const LLSD& value); @@ -93,8 +88,7 @@ public: //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); void setShowInfoBtn(bool show); - void showSpeakingIndicator(bool show); - void showLastInteractionTime(bool show); + void setSpeakingIndicatorVisible(bool visible); void setAvatarIconVisible(bool visible); const LLUUID& getAvatarId() const; @@ -103,6 +97,17 @@ public: void onInfoBtnClick(); void onProfileBtnClick(); + void showSpeakingIndicator(bool show) { mSpeakingIndicator->setVisible(show); } + void showInfoBtn(bool show_info_btn) {mInfoBtn->setVisible(show_info_btn); } + void showLastInteractionTime(bool show); + + /** + * This method was added to fix EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label) + * But this is a *HACK. The real reason of it was in incorrect logic while hiding profile/info/speaker buttons + * *TODO: new reshape method should be provided in lieu of this one to be called when visibility if those buttons is changed + */ + void reshapeAvatarName(); + protected: /** * Contains indicator to show voice activity. @@ -119,23 +124,6 @@ private: E_UNKNOWN, } EOnlineStatus; - /** - * Enumeration of item elements in order from right to left. - * - * updateChildren() assumes that indexes are in the such order to process avatar icon easier. - * - * @see updateChildren() - */ - typedef enum e_avatar_item_child { - ALIC_PROFILE_BUTTON, - ALIC_INFO_BUTTON, - ALIC_SPEAKER_INDICATOR, - ALIC_INTERACTION_TIME, - ALIC_NAME, - ALIC_ICON, - ALIC_COUNT, - } EAvatarListItemChildIndex; - void setNameInternal(const std::string& name, const std::string& highlight); void onNameCache(const std::string& first_name, const std::string& last_name); @@ -147,26 +135,6 @@ private: typedef std::map<EItemState, LLColor4> icon_color_map_t; static icon_color_map_t& getItemIconColorMap(); - /** - * Initializes widths of all children to use them while changing visibility of any of them. - * - * @see updateChildren() - */ - static void initChildrenWidths(LLAvatarListItem* self); - - /** - * Updates position and rectangle of visible children to fit all available item's width. - */ - void updateChildren(); - - /** - * Gets child view specified by index. - * - * This method implemented via switch by all EAvatarListItemChildIndex values. - * It is used to not store children in array or vector to avoid of increasing memory usage. - */ - LLView* getItemChildView(EAvatarListItemChildIndex child_index); - LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; LLStyle::Params mAvatarNameStyle; @@ -183,17 +151,10 @@ private: bool mShowProfileBtn; static bool sStaticInitialized; // this variable is introduced to improve code readability - static S32 sLeftPadding; // padding to first left visible child (icon or name) - static S32 sRightNamePadding; // right padding from name to next visible child - - /** - * Contains widths of each child specified by EAvatarListItemChildIndex - * including padding to the next right one. - * - * @see initChildrenWidths() - */ - static S32 sChildrenWidths[ALIC_COUNT]; - + static S32 sIconWidth; // icon width + padding + static S32 sInfoBtnWidth; //info btn width + padding + static S32 sProfileBtnWidth; //profile btn width + padding + static S32 sSpeakingIndicatorWidth; //speaking indicator width + padding }; #endif //LL_LLAVATARLISTITEM_H diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index beccefa430..976b312509 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -161,9 +161,6 @@ void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& nam { chiclet->setIMSessionName(name); chiclet->setOtherParticipantId(other_participant_id); - - LLIMFloater::onIMChicletCreated(session_id); - } else { @@ -254,24 +251,14 @@ void LLBottomTray::setVisible(BOOL visible) { LLView* viewp = *child_it; std::string name = viewp->getName(); - - // Chat bar and gesture button are shown even in mouselook mode. But the move, camera and snapshot buttons shouldn't be displayed. See EXT-3988. - if ("chat_bar" == name || "gesture_panel" == name || (visibility && ("movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name))) + + if ("chat_bar" == name || "movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name || "gesture_panel" == name) continue; else { viewp->setVisible(visibility); } } - - // Apply the saved settings when we are not in mouselook mode, see EXT-3988. - if (visibility) - { - showCameraButton(gSavedSettings.getBOOL("ShowCameraButton")); - showSnapshotButton(gSavedSettings.getBOOL("ShowSnapshotButton")); - showMoveButton(gSavedSettings.getBOOL("ShowMoveButton")); - showGestureButton(gSavedSettings.getBOOL("ShowGestureButton")); - } } } diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index c0efb85b51..1468f6d584 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -51,7 +51,6 @@ #include "lltransientfloatermgr.h" #include "llviewerwindow.h" #include "llvoicechannel.h" -#include "lllayoutstack.h" static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids); @@ -315,7 +314,7 @@ void LLCallFloater::updateSession() //hide "Leave Call" button for nearby chat bool is_local_chat = mVoiceType == VC_LOCAL_CHAT; - childSetVisible("leave_call_btn_panel", !is_local_chat); + childSetVisible("leave_call_btn", !is_local_chat); refreshParticipantList(); updateAgentModeratorState(); @@ -819,8 +818,8 @@ void reshape_floater(LLCallFloater* floater, S32 delta_height) } } - floater->setShape(floater_rect); - floater->getChild<LLLayoutStack>("my_call_stack")->updateLayout(FALSE); + floater->reshape(floater_rect.getWidth(), floater_rect.getHeight()); + floater->setRect(floater_rect); } void LLCallFloater::reshapeToFitContent() @@ -865,8 +864,9 @@ S32 LLCallFloater::getParticipantItemHeight() S32 LLCallFloater::getMaxVisibleItems() { - static LLCachedControl<S32> max_visible_items(*LLUI::sSettingGroups["config"],"CallFloaterMaxItems"); - return max_visible_items; + S32 value = 5; // default value, in case convertToS32() fails. + LLStringUtil::convertToS32(getString("max_visible_items"), value); + return value; } //EOF diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2fc83c7e54..cda3e3a419 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -499,24 +499,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ style_params.font.name(font_name); style_params.font.size(font_size); style_params.font.style(input_append_params.font.style); - - std::string prefix = chat.mText.substr(0, 4); - - //IRC styled /me messages. - bool irc_me = prefix == "/me " || prefix == "/me'"; - - // Delimiter after a name in header copy/past and in plain text mode - std::string delimiter = (chat.mChatType != CHAT_TYPE_SHOUT && chat.mChatType != CHAT_TYPE_WHISPER) - ? ": " - : " "; - - // Don't add any delimiter after name in irc styled messages - if (irc_me || chat.mChatStyle == CHAT_STYLE_IRC) - { - delimiter = LLStringUtil::null; - style_params.font.style = "ITALIC"; - } - + if (use_plain_text_chat_history) { mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, style_params); @@ -529,11 +512,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ LLStyle::Params link_params(style_params); link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); // Convert the name to a hotlink and add to message. - mEditor->appendText(chat.mFromName + delimiter, false, link_params); + mEditor->appendText(chat.mFromName + ": ", false, link_params); } else { - mEditor->appendText(chat.mFromName + delimiter, false, style_params); + mEditor->appendText(chat.mFromName + ": ", false, style_params); } } } @@ -579,22 +562,36 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ std::string header_text = "[" + chat.mTimeStr + "] "; if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - header_text += chat.mFromName + delimiter; + header_text += chat.mFromName + ": "; mEditor->appendWidget(p, header_text, false); mLastFromName = chat.mFromName; mLastFromID = chat.mFromID; mLastMessageTime = new_message_time; } - - std::string message = irc_me ? chat.mText.substr(3) : chat.mText; - if ( message.size() > 0 && !LLStringOps::isSpace(message[message.size() - 1]) ) + //Handle IRC styled /me messages. + std::string prefix = chat.mText.substr(0, 4); + if (prefix == "/me " || prefix == "/me'") { + style_params.font.style = "ITALIC"; + + if (chat.mFromName.size() > 0) + mEditor->appendText(chat.mFromName, TRUE, style_params); // Ensure that message ends with NewLine, to avoid losing of new lines // while copy/paste from text chat. See EXT-3263. - message += NEW_LINE; + mEditor->appendText(chat.mText.substr(3) + NEW_LINE, FALSE, style_params); + } + else + { + std::string message(chat.mText); + if ( message.size() > 0 && !LLStringOps::isSpace(message[message.size() - 1]) ) + { + // Ensure that message ends with NewLine, to avoid losing of new lines + // while copy/paste from text chat. See EXT-3263. + message += NEW_LINE; + } + mEditor->appendText(message, FALSE, style_params); } - mEditor->appendText(message, FALSE, style_params); mEditor->blockUndo(); // automatically scroll to end when receiving chat from myself diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index ef69f39ad2..aa343b2f69 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -269,7 +269,7 @@ LLSD LLFloaterAbout::getInfo() info["VIVOX_VERSION"] = gVoiceClient ? gVoiceClient->getAPIVersion() : LLTrans::getString("NotConnected"); // TODO: Implement media plugin version query - info["QT_WEBKIT_VERSION"] = "4.6 (version number hard-coded)"; + info["QT_WEBKIT_VERSION"] = "4.5.2 (version number hard-coded)"; if (gPacketsIn > 0) { diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 18b9f0484f..b9e0f928f1 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -190,14 +190,7 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) { if (log_to_file && (gSavedPerAccountSettings.getBOOL("LogChat"))) { - if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT) - { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); - } - else - { - LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText); - } + LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); } LLColor4 color = get_text_color(chat); @@ -318,10 +311,8 @@ void LLFloaterChat::addChat(const LLChat& chat, BOOL from_instant_message, BOOL triggerAlerts(chat.mText); // Add the sender to the list of people with which we've recently interacted. - // this is not the best place to add _all_ messages to recent list - // comment this for now, may remove later on code cleanup - //if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) - // LLRecentPeople::instance().add(chat.mFromID); + if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) + LLRecentPeople::instance().add(chat.mFromID); bool add_chat = true; bool log_chat = true; diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 6a9c602db2..5072bc8c82 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -415,7 +415,7 @@ void LLFloaterGesture::onClickPlay() LL_DEBUGS("Gesture")<<" Trying to play gesture id: "<< item_id <<LL_ENDL; if(!LLGestureManager::instance().isGestureActive(item_id)) { - // we need to inform server about gesture activating to be consistent with LLPreviewGesture and LLGestureComboList. + // we need to inform server about gesture activating to be consistent with LLPreviewGesture and LLGestureComboBox. BOOL inform_server = TRUE; BOOL deactivate_similar = FALSE; LLGestureManager::instance().setGestureLoadedCallback(item_id, boost::bind(&LLFloaterGesture::playGesture, this, item_id)); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 29f415bd43..7cb925bc0b 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -247,7 +247,14 @@ void LLPanelGroups::enableButtons() childDisable("IM"); childDisable("Leave"); } - childSetEnabled("Create", gAgent.canJoinGroups()); + if(gAgent.mGroups.count() < MAX_AGENT_GROUPS) + { + childEnable("Create"); + } + else + { + childDisable("Create"); + } } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 42c961a956..598a13de15 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -276,7 +276,6 @@ void LLFloaterLand::refresh() mPanelAudio->refresh(); mPanelMedia->refresh(); mPanelAccess->refresh(); - mPanelCovenant->refresh(); } @@ -2796,6 +2795,12 @@ LLPanelLandCovenant::~LLPanelLandCovenant() { } +BOOL LLPanelLandCovenant::postBuild() +{ + refresh(); + return TRUE; +} + // virtual void LLPanelLandCovenant::refresh() { diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index a4785e8f5b..d7d02ba1a3 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -391,6 +391,7 @@ class LLPanelLandCovenant public: LLPanelLandCovenant(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandCovenant(); + virtual BOOL postBuild(); void refresh(); static void updateCovenantText(const std::string& string); static void updateEstateName(const std::string& name); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 9af37e8174..d0716f67b8 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -602,8 +602,8 @@ void LLFloaterPreference::onBtnOK() apply(); closeFloater(false); - LLUIColorTable::instance().saveUserSettings(); gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); + LLUIColorTable::instance().saveUserSettings(); std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); // save all settings, even if equals defaults gCrashSettings.saveToFile(crash_settings_filename, FALSE); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 0402ba20e2..c4b87c1b2d 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -406,11 +406,6 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region) { - if (!region) - { - return; - } - // call refresh from region on all panels std::for_each( mInfoPanels.begin(), diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 82293b4aa0..df7aa9eabf 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -417,16 +417,6 @@ BOOL LLGestureManager::isGesturePlaying(const LLUUID& item_id) return gesture->mPlaying; } -BOOL LLGestureManager::isGesturePlaying(LLMultiGesture* gesture) -{ - if(!gesture) - { - return FALSE; - } - - return gesture->mPlaying; -} - void LLGestureManager::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_gesture, const LLUUID& asset_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index c562587c6f..e80eea9ae9 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -103,8 +103,6 @@ public: BOOL isGesturePlaying(const LLUUID& item_id); - BOOL isGesturePlaying(LLMultiGesture* gesture); - const item_map_t& getActiveGestures() const { return mActive; } // Force a gesture to be played, for example, if it is being // previewed. diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index d6e2bb0445..7dd8ea694e 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -146,12 +146,6 @@ void LLGroupActions::startCall(const LLUUID& group_id) // static void LLGroupActions::join(const LLUUID& group_id) { - if (!gAgent.canJoinGroups()) - { - LLNotificationsUtil::add("JoinedTooManyGroups"); - return; - } - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); @@ -232,9 +226,7 @@ void LLGroupActions::activate(const LLUUID& group_id) static bool isGroupUIVisible() { - static LLPanel* panel = 0; - if(!panel) - panel = LLSideTray::getInstance()->findChild<LLPanel>("panel_group_info_sidetray"); + LLPanel* panel = LLSideTray::getInstance()->findChild<LLPanel>("panel_group_info_sidetray"); if(!panel) return false; return panel->isInVisibleChain(); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index aee34eb0af..b05568f353 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -361,7 +361,35 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { if (!gIMMgr->hasSession(session_id)) return NULL; - if(!isChatMultiTab()) + // we should make sure all related chiclets are in place when the session is a voice call + // chiclets come firts, then comes IM window + if (gIMMgr->isVoiceCall(session_id)) + { + LLIMModel* im_model = LLIMModel::getInstance(); + LLBottomTray* b_tray = LLBottomTray::getInstance(); + + //*TODO hide that into Bottom tray + if (!b_tray->getChicletPanel()->findChiclet<LLChiclet>(session_id)) + { + LLIMChiclet* chiclet = b_tray->createIMChiclet(session_id); + if(chiclet) + { + chiclet->setIMSessionName(im_model->getName(session_id)); + chiclet->setOtherParticipantId(im_model->getOtherParticipantID(session_id)); + } + } + + LLIMWellWindow::getInstance()->addIMRow(session_id); + } + + bool not_existed = true; + + if(isChatMultiTab()) + { + LLIMFloater* target_floater = findInstance(session_id); + not_existed = NULL == target_floater; + } + else { //hide all LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); @@ -376,33 +404,19 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) } } - bool exist = findInstance(session_id); - - LLIMFloater* floater = getInstance(session_id); - if (!floater) return NULL; + LLIMFloater* floater = LLFloaterReg::showTypedInstance<LLIMFloater>("impanel", session_id); if(isChatMultiTab()) { - LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); - // do not add existed floaters to avoid adding torn off instances - if (!exist) + if (not_existed) { // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; - - if (floater_container) - { - floater_container->addFloater(floater, TRUE, i_pt); - } - } - if (floater_container) - { - //selecting the panel resets a chiclet's counter - floater_container->selectFloater(floater); - floater_container->setVisible(TRUE); + LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance<LLIMFloaterContainer>("im_container"); + floater_container->addFloater(floater, TRUE, i_pt); } } else @@ -429,8 +443,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) } // window is positioned, now we can show it. + floater->setVisible(true); } - floater->setVisible(TRUE); return floater; } @@ -470,6 +484,16 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) } } +void LLIMFloater::setTornOff(bool torn_off) +{ + // When IM Floater isn't torn off, "close" button should be hidden. + // This call will just disables it, since there is a hack in LLFloater::updateButton, + // which prevents hiding of close button in that case. + setCanClose(torn_off); + + LLTransientDockableFloater::setTornOff(torn_off); +} + void LLIMFloater::setVisible(BOOL visible) { LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*> @@ -524,11 +548,6 @@ LLIMFloater* LLIMFloater::findInstance(const LLUUID& session_id) return LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id); } -LLIMFloater* LLIMFloater::getInstance(const LLUUID& session_id) -{ - return LLFloaterReg::getTypedInstance<LLIMFloater>("impanel", session_id); -} - void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) { mSessionInitialized = true; @@ -1007,20 +1026,3 @@ void LLIMFloater::sRemoveTypingIndicator(const LLSD& data) floater->removeTypingIndicator(); } - -void LLIMFloater::onIMChicletCreated( const LLUUID& session_id ) -{ - - if (isChatMultiTab()) - { - LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance(); - if (!im_box) return; - - if (LLIMFloater::findInstance(session_id)) return; - - LLIMFloater* new_tab = LLIMFloater::getInstance(session_id); - - im_box->addFloater(new_tab, FALSE, LLTabContainer::END); - } - -} diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index d9db385d06..bc7a43e852 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -64,6 +64,7 @@ public: // LLFloater overrides /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); + /*virtual*/ void setTornOff(bool torn_off); // Make IM conversion visible and update the message history static LLIMFloater* show(const LLUUID& session_id); @@ -74,8 +75,6 @@ public: static LLIMFloater* findInstance(const LLUUID& session_id); - static LLIMFloater* getInstance(const LLUUID& session_id); - void sessionInitReplyReceived(const LLUUID& im_session_id); // get new messages from LLIMModel @@ -114,8 +113,6 @@ public: //used as a callback on receiving new IM message static void sRemoveTypingIndicator(const LLSD& data); - static void onIMChicletCreated(const LLUUID& session_id); - private: // process focus events to set a currently active session /* virtual */ void onFocusLost(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 6cc985aef4..2d7333f7e4 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -34,7 +34,6 @@ #include "llviewerprecompiledheaders.h" #include "llimfloatercontainer.h" -#include "llfloaterreg.h" // // LLIMFloaterContainer @@ -94,14 +93,4 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, } } -LLIMFloaterContainer* LLIMFloaterContainer::findInstance() -{ - return LLFloaterReg::findTypedInstance<LLIMFloaterContainer>("im_container"); -} - -LLIMFloaterContainer* LLIMFloaterContainer::getInstance() -{ - return LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container"); -} - // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index d4a542dfc2..ead7cf4730 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -52,11 +52,7 @@ public: LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); static LLFloater* getCurrentVoiceFloater(); - - static LLIMFloaterContainer* findInstance(); - - static LLIMFloaterContainer* getInstance(); - + protected: LLFloater* mActiveVoiceFloater; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index e9661003ea..daabf1f717 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -382,6 +382,10 @@ void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& f mSpeakers->speakerChatted(from_id); mSpeakers->setSpeakerTyping(from_id, FALSE); } + + if( mSessionType == P2P_SESSION || + mSessionType == ADHOC_SESSION) + LLRecentPeople::instance().add(from_id); } void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& history) @@ -680,12 +684,6 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co LLIMSession* session = addMessageSilently(session_id, from, from_id, utf8_text, log2file); if (!session) return false; - //good place to add some1 to recent list - //other places may be called from message history. - if( !from_id.isNull() && - ( session->isP2PSessionType() || session->isAdHocSessionType() ) ) - LLRecentPeople::instance().add(from_id); - // notify listeners LLSD arg; arg["session_id"] = session_id; @@ -1379,7 +1377,7 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) } sSession = session; - sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3)); + sSession->mVoiceChannel->setStateChangedCallback(LLCallDialogManager::onVoiceChannelStateChanged); if(sCurrentSessionlName != session->mName) { sPreviousSessionlName = sCurrentSessionlName; @@ -1603,12 +1601,7 @@ void LLOutgoingCallDialog::show(const LLSD& key) if (!mPayload["disconnected_channel_name"].asString().empty()) { - std::string channel_name = mPayload["disconnected_channel_name"].asString(); - if (LLIMModel::LLIMSession::AVALINE_SESSION == mPayload["session_type"].asInteger()) - { - channel_name = LLTextUtil::formatPhoneNumber(channel_name); - } - childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", channel_name); + childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); childSetTextArg("nearby_P2P", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index e72bda6c2b..20d8e28392 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -78,11 +78,6 @@ public: bool isP2P(); bool isOtherParticipantAvaline(); - bool isP2PSessionType() const { return mSessionType == P2P_SESSION;} - bool isAdHocSessionType() const { return mSessionType == ADHOC_SESSION;} - bool isGroupSessionType() const { return mSessionType == GROUP_SESSION;} - bool isAvalineSessionType() const { return mSessionType == AVALINE_SESSION;} - LLUUID mSessionID; std::string mName; EInstantMessage mType; diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 0374a1d25b..8f4fba244d 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -418,7 +418,6 @@ void LLInspectAvatar::updateModeratorPanel() LLPointer<LLSpeaker> selected_speakerp = speaker_mgr->findSpeaker(mAvatarID); if(speaker_mgr->isVoiceActive() && selected_speakerp && - selected_speakerp->isInVoiceChannel() && ((self_speakerp && self_speakerp->mIsModerator) || gAgent.isGodlike())) { getChild<LLUICtrl>("enable_voice")->setVisible(selected_speakerp->mModeratorMutedVoice); diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp deleted file mode 100644 index 3ca8fa2f56..0000000000 --- a/indra/newview/llinspecttoast.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @file llinspecttoast.cpp - * @brief Toast inspector implementation. - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" // must be first include - -#include "llinspecttoast.h" -#include "llinspect.h" -#include "llfloaterreg.h" -#include "llscreenchannel.h" -#include "llchannelmanager.h" -#include "lltransientfloatermgr.h" - -using namespace LLNotificationsUI; - -/** - * Represents inspectable toast . - */ -class LLInspectToast: public LLInspect -{ -public: - - LLInspectToast(const LLSD& notification_idl); - virtual ~LLInspectToast(); - - /*virtual*/ void onOpen(const LLSD& notification_id); -private: - void onToastDestroy(LLToast * toast); - -private: - LLPanel* mPanel; - LLScreenChannel* mScreenChannel; -}; - -LLInspectToast::LLInspectToast(const LLSD& notification_id) : - LLInspect(LLSD()), mPanel(NULL) -{ - LLScreenChannelBase* channel = LLChannelManager::getInstance()->findChannelByID( - LLUUID(gSavedSettings.getString("NotificationChannelUUID"))); - mScreenChannel = dynamic_cast<LLScreenChannel*>(channel); - if(NULL == mScreenChannel) - { - llwarns << "Could not get requested screen channel." << llendl; - return; - } - - LLTransientFloaterMgr::getInstance()->addControlView(this); -} -LLInspectToast::~LLInspectToast() -{ - LLTransientFloaterMgr::getInstance()->removeControlView(this); -} - -void LLInspectToast::onOpen(const LLSD& notification_id) -{ - LLInspect::onOpen(notification_id); - LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id); - if (toast == NULL) - { - llwarns << "Could not get requested toast from screen channel." << llendl; - return; - } - toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1)); - - LLPanel * panel = toast->getPanel(); - panel->setVisible(TRUE); - panel->setMouseOpaque(FALSE); - if(mPanel != NULL && mPanel->getParent() == this) - { - removeChild(mPanel); - } - addChild(panel); - panel->setFocus(TRUE); - mPanel = panel; - - - LLRect panel_rect; - panel_rect = panel->getRect(); - reshape(panel_rect.getWidth(), panel_rect.getHeight()); - - LLUI::positionViewNearMouse(this); -} - -void LLInspectToast::onToastDestroy(LLToast * toast) -{ - closeFloater(false); -} - -void LLNotificationsUI::registerFloater() -{ - LLFloaterReg::add("inspect_toast", "inspect_toast.xml", - &LLFloaterReg::build<LLInspectToast>); -} - diff --git a/indra/newview/llinspecttoast.h b/indra/newview/llinspecttoast.h deleted file mode 100644 index ff547154b8..0000000000 --- a/indra/newview/llinspecttoast.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @file llinspecttoast.h - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLINSPECTTOAST_H -#define LL_LLINSPECTTOAST_H - -namespace LLNotificationsUI -{ -void registerFloater(); -} - -#endif diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index a468a9a95c..711114173c 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2001,16 +2001,14 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const } if(!accounted) { - // Error condition, this means that the category did not register that - // it got new descendents (perhaps because it is still being loaded) - // which means its descendent count will be wrong. - llwarns << "Accounting failed for '" << cat->getName() << "' version:" + lldebugs << "No accounting for: '" << cat->getName() << "' " << version << llendl; } } else { - llwarns << "No category found for update " << update.mCategoryID << llendl; + llwarns << "No category found for update " << update.mCategoryID + << llendl; } } diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 2fb8aea4e9..2d9ea21b5f 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -311,10 +311,10 @@ bool LLInventoryFetchDescendentsObserver::isEverythingComplete() const bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* cat) { - const S32 version = cat->getVersion(); - const S32 expected_num_descendents = cat->getDescendentCount(); - if ((version == LLViewerInventoryCategory::VERSION_UNKNOWN) || - (expected_num_descendents == LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN)) + S32 version = cat->getVersion(); + S32 descendents = cat->getDescendentCount(); + if((LLViewerInventoryCategory::VERSION_UNKNOWN == version) + || (LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN == descendents)) { return false; } @@ -325,28 +325,15 @@ bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* gInventory.getDirectDescendentsOf(cat->getUUID(), cats, items); if(!cats || !items) { - llwarns << "Category '" << cat->getName() << "' descendents corrupted, fetch failed." << llendl; - // NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean - // that the cat just doesn't have any items or subfolders). - // Unrecoverable, so just return done so that this observer can be cleared - // from memory. + // bit of a hack - pretend we're done if they are gone or + // incomplete. should never know, but it would suck if this + // kept tight looping because of a corrupt memory state. return true; } - const S32 current_num_known_descendents = cats->count() + items->count(); - - // Got the number of descendents that we were expecting, so we're done. - if (current_num_known_descendents == expected_num_descendents) - { - return true; - } - - // Error condition, but recoverable. This happens if something was added to the - // category before it was initialized, so accountForUpdate didn't update descendent - // count and thus the category thinks it has fewer descendents than it actually has. - if (current_num_known_descendents >= expected_num_descendents) + S32 known = cats->count() + items->count(); + if(descendents == known) { - llwarns << "Category '" << cat->getName() << "' expected descendentcount:" << expected_num_descendents << " descendents but got descendentcount:" << current_num_known_descendents << llendl; - cat->setDescendentCount(current_num_known_descendents); + // hey - we're done. return true; } return false; @@ -365,7 +352,7 @@ void LLInventoryFetchComboObserver::changed(U32 mask) continue; } if(item->isComplete()) - { + { mCompleteItems.push_back(*it); it = mIncompleteItems.erase(it); continue; diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 87ebce1d34..6b0f9b709d 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -84,6 +84,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mHomePageUrl( "" ), mIgnoreUIScale( true ), mAlwaysRefresh( false ), + mExternalUrl( "" ), mMediaSource( 0 ), mTakeFocusOnClick( true ), mCurrentNavUrl( "" ), @@ -876,27 +877,9 @@ bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( 0 == option ) { - LLSD payload = notification["payload"]; - std::string url = payload["url"].asString(); - S32 target_type = payload["target_type"].asInteger(); - - switch (target_type) - { - case LLPluginClassMedia::TARGET_EXTERNAL: - // load target in an external browser - LLWeb::loadURLExternal(url); - break; - - case LLPluginClassMedia::TARGET_BLANK: - // load target in the user's preferred browser - LLWeb::loadURL(url); - break; - - default: - // unsupported link target - shouldn't happen - LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL; - break; - } + // open in external browser because we don't support + // creation of our own secondary browser windows + LLWeb::loadURLExternal( notification["payload"]["external_url"].asString() ); } return false; } @@ -1010,18 +993,20 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) { // retrieve the event parameters + std::string target = self->getClickTarget(); std::string url = self->getClickURL(); - U32 target_type = self->getClickTargetType(); - // is there is a target specified for the link? - if (target_type == LLPluginClassMedia::TARGET_EXTERNAL || - target_type == LLPluginClassMedia::TARGET_BLANK) + // if there is a value for the target + if ( !target.empty() ) { - LLSD payload; - payload["url"] = url; - payload["target_type"] = LLSD::Integer(target_type); - LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); - return; + if ( target == "_external" ) + { + mExternalUrl = url; + LLSD payload; + payload["external_url"] = mExternalUrl; + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); + return; + } } const std::string protocol1( "http://" ); diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index b0aca3cfa4..8f9e6e7179 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -182,6 +182,7 @@ public: bool mOpenLinksInInternalBrowser; bool mTrusted; std::string mHomePageUrl; + std::string mExternalUrl; std::string mCurrentNavUrl; bool mIgnoreUIScale; bool mAlwaysRefresh; diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index d434017804..2f4a266198 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -52,7 +52,6 @@ LLNameBox::LLNameBox(const Params& p) : LLTextBox(p) { mNameID = LLUUID::null; - mLink = p.link; LLNameBox::sInstances.insert(this); setText(LLStringUtil::null); } @@ -77,7 +76,7 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group) gCacheName->getGroupName(name_id, name); } - setName(name, is_group); + setText(name); } void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, @@ -94,7 +93,7 @@ void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, { name = firstname; } - setName(name, is_group); + setText(name); } } @@ -110,22 +109,3 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, box->refresh(id, firstname, lastname, is_group); } } - -void LLNameBox::setName(const std::string& name, BOOL is_group) -{ - if (mLink) - { - std::string url; - - if (is_group) - url = "[secondlife:///app/group/" + LLURI::escape(name) + "/about " + name + "]"; - else - url = "[secondlife:///app/agent/" + mNameID.asString() + "/about " + name + "]"; - - setText(url); - } - else - { - setText(name); - } -} diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index 0109525e85..3edb36883f 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -47,11 +47,9 @@ public: struct Params : public LLInitParam::Block<Params, LLTextBox::Params> { Optional<bool> is_group; - Optional<bool> link; Params() : is_group("is_group", false) - , link("link", false) {} }; @@ -69,13 +67,10 @@ protected: friend class LLUICtrlFactory; private: - void setName(const std::string& name, BOOL is_group); - static std::set<LLNameBox*> sInstances; private: LLUUID mNameID; - BOOL mLink; }; diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index a7c1e73328..fc0e51b76d 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -179,7 +179,27 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive) if (!chat.mMuted) { tmp_chat.mFromName = chat.mFromName; - mChatHistory->appendMessage(chat, use_plain_text_chat_history); + + if (chat.mChatStyle == CHAT_STYLE_IRC) + { + LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLViewerChat::getChatColor(chat,txt_color); + LLFontGL* fontp = LLViewerChat::getChatFont(); + std::string font_name = LLFontGL::nameFromFont(fontp); + std::string font_size = LLFontGL::sizeFromFont(fontp); + LLStyle::Params append_style_params; + append_style_params.color(txt_color); + append_style_params.readonly_color(txt_color); + append_style_params.font.name(font_name); + append_style_params.font.size(font_size); + append_style_params.font.style = "ITALIC"; + + mChatHistory->appendMessage(chat, use_plain_text_chat_history, append_style_params); + } + else + { + mChatHistory->appendMessage(chat, use_plain_text_chat_history); + } } if(archive) diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 6cf8bcb417..8dbaa5ac53 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -48,16 +48,13 @@ #include "llcommandhandler.h" #include "llviewercontrol.h" #include "llnavigationbar.h" -#include "llwindow.h" -#include "llviewerwindow.h" -#include "llrootview.h" S32 LLNearbyChatBar::sLastSpecialChatChannel = 0; // legacy callback glue void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); -static LLDefaultChildRegistry::Register<LLGestureComboList> r("gesture_combo_list"); +static LLDefaultChildRegistry::Register<LLGestureComboBox> r("gesture_combo_box"); struct LLChatTypeTrigger { std::string name; @@ -69,42 +66,13 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { { "/shout" , CHAT_TYPE_SHOUT} }; -LLGestureComboList::Params::Params() -: combo_button("combo_button"), - combo_list("combo_list") -{ -} - -LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) -: LLUICtrl(p) +LLGestureComboBox::LLGestureComboBox(const LLGestureComboBox::Params& p) + : LLComboBox(p) + , mGestureLabelTimer() , mLabel(p.label) , mViewAllItemIndex(0) { - LLButton::Params button_params = p.combo_button; - button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT); - - mButton = LLUICtrlFactory::create<LLButton>(button_params); - mButton->reshape(getRect().getWidth(),getRect().getHeight()); - mButton->setCommitCallback(boost::bind(&LLGestureComboList::onButtonCommit, this)); - - addChild(mButton); - - LLScrollListCtrl::Params params = p.combo_list; - params.name("GestureComboList"); - params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2)); - params.visible(false); - params.commit_on_keyboard_movement(false); - - mList = LLUICtrlFactory::create<LLScrollListCtrl>(params); - - // *HACK: adding list as a child to NonSideTrayView to make it fully visible without - // making it top control (because it would cause problems). - gViewerWindow->getNonSideTrayView()->addChild(mList); - mList->setVisible(FALSE); - - //****************************Gesture Part********************************/ - - setCommitCallback(boost::bind(&LLGestureComboList::onCommitGesture, this)); + setCommitCallback(boost::bind(&LLGestureComboBox::onCommitGesture, this)); // now register us as observer since we have a place to put the results LLGestureManager::instance().addObserver(this); @@ -112,139 +80,23 @@ LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) // refresh list from current active gestures refreshGestures(); - setFocusLostCallback(boost::bind(&LLGestureComboList::hideList, this)); -} - -BOOL LLGestureComboList::handleKey(KEY key, MASK mask, BOOL called_from_parent) -{ - BOOL handled = FALSE; - - if (key == KEY_ESCAPE && mask == MASK_NONE ) - { - hideList(); - handled = TRUE; - } - else - { - handled = mList->handleKey(key, mask, called_from_parent); - } - - return handled; -} - -void LLGestureComboList::showList() -{ - LLRect rect = mList->getRect(); - LLRect screen; - mButton->localRectToScreen(getRect(), &screen); - - // Calculating amount of space between the navigation bar and gestures combo - LLNavigationBar* nb = LLNavigationBar::getInstance(); - - S32 x, nb_bottom; - nb->localPointToScreen(0, 0, &x, &nb_bottom); - - S32 max_height = nb_bottom - screen.mTop; - mList->calcColumnWidths(); - rect.setOriginAndSize(screen.mLeft, screen.mTop, llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); - - mList->setRect(rect); - mList->fitContents( llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); - - gFocusMgr.setKeyboardFocus(this); - - // Show the list and push the button down - mButton->setToggleState(TRUE); - mList->setVisible(TRUE); -} - -void LLGestureComboList::onButtonCommit() -{ - if (!mList->getVisible()) - { - // highlight the last selected item from the original selection before potentially selecting a new item - // as visual cue to original value of combo box - LLScrollListItem* last_selected_item = mList->getLastSelectedItem(); - if (last_selected_item) - { - mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item)); - } - - if (mList->getItemCount() != 0) - { - showList(); - } - } - else - { - hideList(); - } -} - -void LLGestureComboList::hideList() -{ - if (mList->getVisible()) - { - mButton->setToggleState(FALSE); - mList->setVisible(FALSE); - mList->mouseOverHighlightNthItem(-1); - gFocusMgr.setKeyboardFocus(NULL); - } -} - -S32 LLGestureComboList::getCurrentIndex() const -{ - LLScrollListItem* item = mList->getFirstSelected(); - if( item ) - { - return mList->getItemIndex( item ); - } - return -1; -} - -void LLGestureComboList::onItemSelected(const LLSD& data) -{ - const std::string name = mList->getSelectedItemLabel(); - - S32 cur_id = getCurrentIndex(); - mLastSelectedIndex = cur_id; - if (cur_id != mList->getItemCount()-1 && cur_id != -1) - { - mButton->setLabel(name); - } - - // hiding the list reasserts the old value stored in the text editor/dropdown button - hideList(); - - // commit does the reverse, asserting the value in the list - onCommit(); -} - -void LLGestureComboList::sortByName(bool ascending) -{ - mList->sortOnce(0, ascending); + // This forces using of halign from xml, since LLComboBox + // sets it to LLFontGL::LEFT, if text entry is disabled + mButton->setHAlign(p.drop_down_button.font_halign); } -LLSD LLGestureComboList::getValue() const +LLGestureComboBox::~LLGestureComboBox() { - LLScrollListItem* item = mList->getFirstSelected(); - if( item ) - { - return item->getValue(); - } - else - { - return LLSD(); - } + LLGestureManager::instance().removeObserver(this); } -void LLGestureComboList::refreshGestures() +void LLGestureComboBox::refreshGestures() { //store current selection so we can maintain it LLSD cur_gesture = getValue(); - - mList->selectFirstItem(); - mList->clearRows(); + selectFirstItem(); + // clear + clearRows(); mGestures.clear(); LLGestureManager::item_map_t::const_iterator it; @@ -255,7 +107,7 @@ void LLGestureComboList::refreshGestures() LLMultiGesture* gesture = (*it).second; if (gesture) { - mList->addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx)); + addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx)); mGestures.push_back(gesture); idx++; } @@ -265,42 +117,23 @@ void LLGestureComboList::refreshGestures() // store index followed by the last added Gesture and add View All item at bottom mViewAllItemIndex = idx; - - mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); + addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); // Insert label after sorting, at top, with separator below it - mList->addSeparator(ADD_TOP); - mList->addSimpleElement(mLabel, ADD_TOP); + addSeparator(ADD_TOP); + addSimpleElement(mLabel, ADD_TOP); if (cur_gesture.isDefined()) { - mList->selectByValue(cur_gesture); - + selectByValue(cur_gesture); } else { - mList->selectFirstItem(); + selectFirstItem(); } - - LLCtrlListInterface* gestures = getListInterface(); - LLMultiGesture* gesture = NULL; - - if (gestures) - { - S32 index = gestures->getSelectedValue().asInteger(); - if(index > 0) - gesture = mGestures.at(index); - } - - if(gesture && LLGestureManager::instance().isGesturePlaying(gesture)) - { - return; - } - - mButton->setLabel(mLabel); } -void LLGestureComboList::onCommitGesture() +void LLGestureComboBox::onCommitGesture() { LLCtrlListInterface* gestures = getListInterface(); if (gestures) @@ -331,11 +164,50 @@ void LLGestureComboList::onCommitGesture() } } } + + mGestureLabelTimer.start(); + // free focus back to chat bar + setFocus(FALSE); } -LLGestureComboList::~LLGestureComboList() +//virtual +void LLGestureComboBox::draw() { - LLGestureManager::instance().removeObserver(this); + // HACK: Leave the name of the gesture in place for a few seconds. + const F32 SHOW_GESTURE_NAME_TIME = 2.f; + if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) + { + LLCtrlListInterface* gestures = getListInterface(); + if (gestures) gestures->selectFirstItem(); + mGestureLabelTimer.stop(); + } + + LLComboBox::draw(); +} + +//virtual +void LLGestureComboBox::showList() +{ + LLComboBox::showList(); + + // Calculating amount of space between the navigation bar and gestures combo + LLNavigationBar* nb = LLNavigationBar::getInstance(); + S32 x, nb_bottom; + nb->localPointToScreen(0, 0, &x, &nb_bottom); + + S32 list_bottom; + mList->localPointToScreen(0, 0, &x, &list_bottom); + + S32 max_height = nb_bottom - list_bottom; + + LLRect rect = mList->getRect(); + // List overlapped navigation bar, downsize it + if (rect.getHeight() > max_height) + { + rect.setOriginAndSize(rect.mLeft, rect.mBottom, rect.getWidth(), max_height); + mList->setRect(rect); + mList->reshape(rect.getWidth(), rect.getHeight()); + } } LLNearbyChatBar::LLNearbyChatBar() diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index d9a7403611..224118e088 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -42,52 +42,33 @@ #include "llspeakers.h" -class LLGestureComboList - : public LLGestureManagerObserver - , public LLUICtrl +class LLGestureComboBox + : public LLComboBox + , public LLGestureManagerObserver { public: - struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> - { - Optional<LLButton::Params> combo_button; - Optional<LLScrollListCtrl::Params> combo_list; - - Params(); - }; - + struct Params : public LLInitParam::Block<Params, LLComboBox::Params> { }; protected: - + LLGestureComboBox(const Params&); friend class LLUICtrlFactory; - LLGestureComboList(const Params&); - std::vector<LLMultiGesture*> mGestures; - std::string mLabel; - LLSD::Integer mViewAllItemIndex; - public: + ~LLGestureComboBox(); - ~LLGestureComboList(); - - LLCtrlListInterface* getListInterface() { return (LLCtrlListInterface*)mList; }; - virtual void showList(); - virtual void hideList(); - virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); - - S32 getCurrentIndex() const; - void onItemSelected(const LLSD& data); - void sortByName(bool ascending = true); void refreshGestures(); void onCommitGesture(); - void onButtonCommit(); - virtual LLSD getValue() const; + virtual void draw(); // LLGestureManagerObserver trigger virtual void changed() { refreshGestures(); } -private: +protected: + + virtual void showList(); - LLButton* mButton; - LLScrollListCtrl* mList; - S32 mLastSelectedIndex; + LLFrameTimer mGestureLabelTimer; + std::vector<LLMultiGesture*> mGestures; + std::string mLabel; + LLSD::Integer mViewAllItemIndex; }; class LLNearbyChatBar diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 96442fafcc..9e13a626b4 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -180,11 +180,6 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) if(panel && panel->messageID() == fromID && panel->canAddText()) { - if (CHAT_STYLE_IRC == notification["chat_style"].asInteger()) - { - notification["message"] = notification["from"].asString() + notification["message"].asString(); - } - panel->addMessage(notification); toast->reshapeToPanel(); toast->resetTimer(); @@ -307,6 +302,7 @@ LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& i channel->setCreatePanelCallback(callback); mChannel = LLChannelManager::getInstance()->addChannel(channel); + mChannel->setOverflowFormatString("You have %d unread nearby chat messages"); } LLNearbyChatHandler::~LLNearbyChatHandler() @@ -336,22 +332,25 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) LLChat& tmp_chat = const_cast<LLChat&>(chat_msg); - LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if (tmp_chat.mChatStyle == CHAT_STYLE_IRC) + { + if(!tmp_chat.mFromName.empty()) + tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3); + else + tmp_chat.mText = tmp_chat.mText.substr(3); + } + { //sometimes its usefull to have no name at all... //if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null) // tmp_chat.mFromName = tmp_chat.mFromID.asString(); } + + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); nearby_chat->addMessage(chat_msg); if(nearby_chat->getVisible()) return;//no need in toast if chat is visible - - // Handle irc styled messages for toast panel - if (tmp_chat.mChatStyle == CHAT_STYLE_IRC) - { - tmp_chat.mText = tmp_chat.mText.substr(3); - } - + // arrange a channel on a screen if(!mChannel->getVisible()) { diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index f816dc589d..63803469dd 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -77,9 +77,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mImageLevel3(p.image_level_3), mAutoUpdate(p.auto_update), mSpeakerId(p.speaker_id), - mIsAgentControl(false), - mIsSwitchDirty(false), - mShouldSwitchOn(false) + mIsAgentControl(false) { //static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); //static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); @@ -110,7 +108,6 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) LLOutputMonitorCtrl::~LLOutputMonitorCtrl() { LLMuteList::getInstance()->removeObserver(this); - LLSpeakingIndicatorManager::unregisterSpeakingIndicator(mSpeakerId, this); } void LLOutputMonitorCtrl::setPower(F32 val) @@ -120,26 +117,6 @@ void LLOutputMonitorCtrl::setPower(F32 val) void LLOutputMonitorCtrl::draw() { - // see also switchIndicator() - if (mIsSwitchDirty) - { - mIsSwitchDirty = false; - if (mShouldSwitchOn) - { - // just notify parent visibility may have changed - notifyParentVisibilityChanged(); - } - else - { - // make itself invisible and notify parent about this - setVisible(FALSE); - notifyParentVisibilityChanged(); - - // no needs to render for invisible element - return; - } - } - // Copied from llmediaremotectrl.cpp // *TODO: Give the LLOutputMonitorCtrl an agent-id to monitor, then // call directly into gVoiceClient to ask if that agent-id is muted, is @@ -252,7 +229,6 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id) if (speaker_id.isNull() || speaker_id == mSpeakerId) return; mSpeakerId = speaker_id; - LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this); //mute management if (mAutoUpdate) @@ -275,42 +251,3 @@ void LLOutputMonitorCtrl::onChange() // check only blocking on voice. EXT-3542 setIsMuted(LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat)); } - -// virtual -void LLOutputMonitorCtrl::switchIndicator(bool switch_on) -{ - // ensure indicator is visible in case it is not in visible chain - // to be called when parent became visible next time to notify parent that visibility is changed. - setVisible(TRUE); - - // if parent is in visible chain apply switch_on state and notify it immediately - if (getParent() && getParent()->isInVisibleChain()) - { - LL_DEBUGS("SpeakingIndicator") << "Indicator is in visible chain, notifying parent: " << mSpeakerId << LL_ENDL; - setVisible((BOOL)switch_on); - notifyParentVisibilityChanged(); - } - - // otherwise remember necessary state and mark itself as dirty. - // State will be applied i next draw when parents chain became visible. - else - { - LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL; - mIsSwitchDirty = true; - mShouldSwitchOn = switch_on; - } -} - -////////////////////////////////////////////////////////////////////////// -// PRIVATE SECTION -////////////////////////////////////////////////////////////////////////// -void LLOutputMonitorCtrl::notifyParentVisibilityChanged() -{ - LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << " ,new_visibility: " << getVisible() << LL_ENDL; - - LLSD params = LLSD().with("visibility_changed", getVisible()); - - notifyParent(params); -} - -// EOF diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index 2bbfa251e9..85ea552a57 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -36,7 +36,6 @@ #include "v4color.h" #include "llview.h" #include "llmutelist.h" -#include "llspeakingindicatormanager.h" class LLTextBox; class LLUICtrlFactory; @@ -46,7 +45,7 @@ class LLUICtrlFactory; // class LLOutputMonitorCtrl -: public LLView, public LLSpeakingIndicator, LLMuteListObserver +: public LLView, LLMuteListObserver { public: struct Params : public LLInitParam::Block<Params, LLView::Params> @@ -91,29 +90,7 @@ public: //called by mute list virtual void onChange(); - /** - * Implementation of LLSpeakingIndicator interface. - * Behavior is implemented via changing visibility. - * - * If instance is in visible chain now (all parents are visible) it changes visibility - * and notify parent about this. - * - * Otherwise it marks an instance as dirty and stores necessary visibility. - * It will be applied in next draw and parent will be notified. - */ - virtual void switchIndicator(bool switch_on); - private: - - /** - * Notifies parent about changed visibility. - * - * Passes LLSD with "visibility_changed" => <current visibility> value. - * For now it is processed by LLAvatarListItem to update (reshape) its children. - * Implemented fo complete EXT-3976 - */ - void notifyParentVisibilityChanged(); - //static LLColor4 sColorMuted; //static LLColor4 sColorNormal; //static LLColor4 sColorOverdriven; @@ -140,10 +117,6 @@ private: /** uuid of a speaker being monitored */ LLUUID mSpeakerId; - - /** indicates if the instance is dirty and should notify parent */ - bool mIsSwitchDirty; - bool mShouldSwitchOn; }; #endif diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 85e95ca1d6..fb898f7cdf 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -52,7 +52,6 @@ #include "llfloaterreg.h" #include "llnotificationsutil.h" #include "llvoiceclient.h" -#include "llnamebox.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLDropTarget @@ -596,10 +595,7 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g groups += ", "; std::string group_name = LLURI::escape(it->first); - std::string group_url= it->second.notNull() - ? "[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]" - : getString("no_group_text"); - + std::string group_url="[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]"; groups += group_url; } @@ -625,15 +621,19 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data) { - LLNameBox* name_box = getChild<LLNameBox>("partner_text"); if (avatar_data->partner_id.notNull()) { - name_box->setNameID(avatar_data->partner_id, FALSE); + std::string first, last; + BOOL found = gCacheName->getName(avatar_data->partner_id, first, last); + if (found) + { + childSetTextArg("partner_text", "[FIRST]", first); + childSetTextArg("partner_text", "[LAST]", last); + } } else { - name_box->setNameID(LLUUID::null, FALSE); - name_box->setText(getString("no_partner_text")); + childSetTextArg("partner_text", "[FIRST]", getString("no_partner_text")); } } diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index daec793d75..94de17c17d 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -151,11 +151,6 @@ BOOL LLPanelGroup::postBuild() button->setVisible(true); button->setEnabled(false); - button = getChild<LLButton>("btn_call"); - button->setClickedCallback(onBtnGroupCallClicked, this); - - button = getChild<LLButton>("btn_chat"); - button->setClickedCallback(onBtnGroupChatClicked, this); button = getChild<LLButton>("btn_join"); button->setVisible(false); @@ -220,8 +215,6 @@ void LLPanelGroup::reposButtons() reposButton("btn_create"); reposButton("btn_refresh"); reposButton("btn_cancel"); - reposButton("btn_chat"); - reposButton("btn_call"); } void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent ) @@ -269,18 +262,6 @@ void LLPanelGroup::onBtnApply(void* user_data) self->apply(); } -void LLPanelGroup::onBtnGroupCallClicked(void* user_data) -{ - LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - self->callGroup(); -} - -void LLPanelGroup::onBtnGroupChatClicked(void* user_data) -{ - LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - self->chatGroup(); -} - void LLPanelGroup::onBtnJoin() { lldebugs << "joining group: " << mID << llendl; @@ -368,8 +349,6 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) LLButton* button_create = findChild<LLButton>("btn_create"); LLButton* button_join = findChild<LLButton>("btn_join"); LLButton* button_cancel = findChild<LLButton>("btn_cancel"); - LLButton* button_call = findChild<LLButton>("btn_call"); - LLButton* button_chat = findChild<LLButton>("btn_chat"); bool is_null_group_id = group_id == LLUUID::null; @@ -383,11 +362,6 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) if(button_cancel) button_cancel->setVisible(!is_null_group_id); - if(button_call) - button_call->setVisible(!is_null_group_id); - if(button_chat) - button_chat->setVisible(!is_null_group_id); - getChild<LLUICtrl>("prepend_founded_by")->setVisible(!is_null_group_id); LLAccordionCtrl* tab_ctrl = findChild<LLAccordionCtrl>("group_accordion"); @@ -449,15 +423,12 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) getChild<LLUICtrl>("group_name")->setVisible(true); getChild<LLUICtrl>("group_name_editor")->setVisible(false); - - if(button_apply) - button_apply->setVisible(is_member); } reposButtons(); } -bool LLPanelGroup::apply(LLPanelGroupTab* tab) +bool LLPanelGroup::apply(LLPanelGroupTab* tab) { if(!tab) return false; @@ -500,17 +471,12 @@ void LLPanelGroup::draw() childEnable("btn_refresh"); } - LLButton* button_apply = findChild<LLButton>("btn_apply"); - - if(button_apply && button_apply->getVisible()) - { - bool enable = false; - std::string mesg; - for(std::vector<LLPanelGroupTab* >::iterator it = mTabs.begin();it!=mTabs.end();++it) - enable = enable || (*it)->needsApply(mesg); + bool enable = false; + std::string mesg; + for(std::vector<LLPanelGroupTab* >::iterator it = mTabs.begin();it!=mTabs.end();++it) + enable = enable || (*it)->needsApply(mesg); - childSetEnabled("btn_apply", enable); - } + childSetEnabled("btn_apply", enable); } void LLPanelGroup::refreshData() @@ -525,15 +491,6 @@ void LLPanelGroup::refreshData() mRefreshTimer.setTimerExpirySec(5); } -void LLPanelGroup::callGroup() -{ - LLGroupActions::startCall(getID()); -} - -void LLPanelGroup::chatGroup() -{ - LLGroupActions::startIM(getID()); -} void LLPanelGroup::showNotice(const std::string& subject, const std::string& message, diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index 7ea5e67b44..f6aefdb676 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -74,8 +74,6 @@ public: bool apply(); void refreshData(); - void callGroup(); - void chatGroup(); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -105,8 +103,6 @@ protected: static void onBtnApply(void*); static void onBtnRefresh(void*); - static void onBtnGroupCallClicked(void*); - static void onBtnGroupChatClicked(void*); void reposButton(const std::string& name); void reposButtons(); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 21b253223f..31dfdde887 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -580,6 +580,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } } + mComboActiveTitle->resetDirty(); } // If this was just a titles update, we are done. @@ -594,6 +595,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlShowInGroupList->set(gdatap->mShowInList); mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident); + mCtrlShowInGroupList->resetDirty(); + } if (mComboMature) { @@ -607,16 +610,19 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } mComboMature->setEnabled(mAllowEdit && can_change_ident); mComboMature->setVisible( !gAgent.isTeen() ); + mComboMature->resetDirty(); } if (mCtrlOpenEnrollment) { mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment); mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts); + mCtrlOpenEnrollment->resetDirty(); } if (mCtrlEnrollmentFee) { mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0); mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts); + mCtrlEnrollmentFee->resetDirty(); } if (mSpinEnrollmentFee) @@ -626,6 +632,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mSpinEnrollmentFee->setEnabled( mAllowEdit && (fee > 0) && can_change_member_opts); + mSpinEnrollmentFee->resetDirty(); } if (mCtrlReceiveNotices) { @@ -634,6 +641,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlReceiveNotices->setEnabled(mAllowEdit); } + mCtrlReceiveNotices->resetDirty(); } @@ -657,6 +665,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mEditCharter) { mEditCharter->setText(gdatap->mCharter); + mEditCharter->resetDirty(); } if (mListVisibleMembers) @@ -684,8 +693,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mListVisibleMembers->addElement(row); } } - - resetDirty(); } void LLPanelGroupGeneral::updateMembers() diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 0e55ff3214..29b647415c 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -460,8 +460,17 @@ LLPanelGroupSubTab::~LLPanelGroupSubTab() { } -BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root) -{ +BOOL LLPanelGroupSubTab::postBuild() +{ + // Hook up the search widgets. + bool recurse = true; + mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse); + + if (!mSearchEditor) + return FALSE; + + mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); + // Get icons for later use. mActionIcons.clear(); @@ -479,19 +488,6 @@ BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root) { mActionIcons["partial"] = getString("power_partial_icon"); } - return TRUE; -} - -BOOL LLPanelGroupSubTab::postBuild() -{ - // Hook up the search widgets. - bool recurse = true; - mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse); - - if (!mSearchEditor) - return FALSE; - - mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); return LLPanelGroupTab::postBuild(); } @@ -571,6 +567,7 @@ bool LLPanelGroupSubTab::matchesActionSearchFilter(std::string action) void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, + icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -591,6 +588,7 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, allowed_by_some, allowed_by_all, (*ras_it), + icons, commit_callback, show_all, filter, @@ -602,6 +600,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, LLRoleActionSet* action_set, + icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -615,26 +614,26 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, LLSD row; row["columns"][0]["column"] = "icon"; - row["columns"][0]["type"] = "icon"; - - icon_map_t::iterator iter = mActionIcons.find("folder"); - if (iter != mActionIcons.end()) + icon_map_t::iterator iter = icons.find("folder"); + if (iter != icons.end()) { + row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = (*iter).second; } row["columns"][1]["column"] = "action"; - row["columns"][1]["type"] = "text"; row["columns"][1]["value"] = action_set->mActionSetData->mName; row["columns"][1]["font"]["name"] = "SANSSERIF_SMALL"; - + row["columns"][1]["font"]["style"] = "BOLD"; LLScrollListItem* title_row = ctrl->addElement(row, ADD_BOTTOM, action_set->mActionSetData); - LLScrollListText* name_textp = dynamic_cast<LLScrollListText*>(title_row->getColumn(2)); //?? I have no idea fix getColumn(1) return column spacer... + LLScrollListText* name_textp = dynamic_cast<LLScrollListText*>(title_row->getColumn(1)); if (name_textp) name_textp->setFontStyle(LLFontGL::BOLD); + + bool category_matches_filter = (filter) ? matchesActionSearchFilter(action_set->mActionSetData->mName) : true; std::vector<LLRoleAction*>::iterator ra_it = action_set->mActions.begin(); @@ -687,8 +686,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, { if (show_full_strength) { - icon_map_t::iterator iter = mActionIcons.find("full"); - if (iter != mActionIcons.end()) + icon_map_t::iterator iter = icons.find("full"); + if (iter != icons.end()) { row["columns"][column_index]["column"] = "checkbox"; row["columns"][column_index]["type"] = "icon"; @@ -698,8 +697,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, } else { - icon_map_t::iterator iter = mActionIcons.find("partial"); - if (iter != mActionIcons.end()) + icon_map_t::iterator iter = icons.find("partial"); + if (iter != icons.end()) { row["columns"][column_index]["column"] = "checkbox"; row["columns"][column_index]["type"] = "icon"; @@ -793,8 +792,6 @@ LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab() BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) { - LLPanelGroupSubTab::postBuildSubTab(root); - // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -891,6 +888,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() buildActionsList(mAllowedActionsList, allowed_by_some, allowed_by_all, + mActionIcons, NULL, FALSE, FALSE, @@ -1213,6 +1211,7 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, buildActionsList(mAllowedActionsList, powers_some_have, powers_all_have, + mActionIcons, NULL, FALSE, FALSE, @@ -1685,8 +1684,6 @@ LLPanelGroupRolesSubTab::~LLPanelGroupRolesSubTab() BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) { - LLPanelGroupSubTab::postBuildSubTab(root); - // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -1997,6 +1994,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() buildActionsList(mAllowedActionsList, rd.mRolePowers, 0LL, + mActionIcons, boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false), TRUE, FALSE, @@ -2383,8 +2381,6 @@ LLPanelGroupActionsSubTab::~LLPanelGroupActionsSubTab() BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) { - LLPanelGroupSubTab::postBuildSubTab(root); - // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -2452,6 +2448,7 @@ void LLPanelGroupActionsSubTab::update(LLGroupChange gc) buildActionsList(mActionList, GP_ALL_POWERS, GP_ALL_POWERS, + mActionIcons, NULL, FALSE, TRUE, diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 2f81900e60..bb3c9096cf 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -108,7 +108,7 @@ public: virtual BOOL postBuild(); // This allows sub-tabs to collect child widgets from a higher level in the view hierarchy. - virtual BOOL postBuildSubTab(LLView* root); + virtual BOOL postBuildSubTab(LLView* root) { return TRUE; } virtual void setSearchFilter( const std::string& filter ); @@ -117,15 +117,10 @@ public: // Helper functions bool matchesActionSearchFilter(std::string action); - - - void setFooterEnabled(BOOL enable); - - virtual void setGroupID(const LLUUID& id); -protected: void buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, + icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -134,11 +129,15 @@ protected: U64 allowed_by_some, U64 allowed_by_all, LLRoleActionSet* action_set, + icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, BOOL is_owner_role); + void setFooterEnabled(BOOL enable); + + virtual void setGroupID(const LLUUID& id); protected: LLPanel* mHeader; LLPanel* mFooter; diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 0cfe501fab..b547997e7a 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -302,7 +302,7 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) { LLPanelChatControlPanel::setSessionId(session_id); - mGroupID = session_id; + mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); // for group and Ad-hoc chat we need to include agent into list if(!mParticipantList) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 03cc870a59..e14a5778ad 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -35,7 +35,6 @@ // libs #include "llfloaterreg.h" #include "llmenugl.h" -#include "llnotificationsutil.h" #include "llfiltereditor.h" #include "lltabcontainer.h" #include "lluictrlfactory.h" @@ -751,6 +750,7 @@ void LLPanelPeople::updateButtons() LLPanel* groups_panel = mTabContainer->getCurrentPanel(); groups_panel->childSetEnabled("activate_btn", item_selected && !cur_group_active); // "none" or a non-active group selected + groups_panel->childSetEnabled("plus_btn", item_selected); groups_panel->childSetEnabled("minus_btn", item_selected && selected_id.notNull()); } else @@ -1138,12 +1138,6 @@ void LLPanelPeople::onAvatarPicked( void LLPanelPeople::onGroupPlusButtonClicked() { - if (!gAgent.canJoinGroups()) - { - LLNotificationsUtil::add("JoinedTooManyGroups"); - return; - } - LLMenuGL* plus_menu = (LLMenuGL*)mGroupPlusMenuHandle.get(); if (!plus_menu) return; diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index e7615929c8..7a4dd3569d 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -35,30 +35,24 @@ // profile. #include "llviewerprecompiledheaders.h" - -#include "llpanelpick.h" - +#include "llpanel.h" #include "message.h" - -#include "llparcel.h" - +#include "llagent.h" +#include "llagentpicksinfo.h" #include "llbutton.h" -#include "llfloaterreg.h" #include "lliconctrl.h" #include "lllineeditor.h" -#include "llpanel.h" -#include "llscrollcontainer.h" +#include "llparcel.h" +#include "llviewerparcelmgr.h" #include "lltexteditor.h" - -#include "llagent.h" -#include "llagentpicksinfo.h" -#include "llavatarpropertiesprocessor.h" -#include "llfloaterworldmap.h" #include "lltexturectrl.h" #include "lluiconstants.h" -#include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llworldmap.h" +#include "llfloaterworldmap.h" +#include "llfloaterreg.h" +#include "llavatarpropertiesprocessor.h" +#include "llpanelpick.h" #define XML_PANEL_EDIT_PICK "panel_edit_pick.xml" @@ -99,10 +93,6 @@ LLPanelPickInfo::LLPanelPickInfo() , mPickId(LLUUID::null) , mParcelId(LLUUID::null) , mRequestedId(LLUUID::null) - , mScrollingPanelMinHeight(0) - , mScrollingPanelWidth(0) - , mScrollingPanel(NULL) - , mScrollContainer(NULL) { } @@ -156,35 +146,9 @@ BOOL LLPanelPickInfo::postBuild() childSetAction("show_on_map_btn", boost::bind(&LLPanelPickInfo::onClickMap, this)); childSetAction("back_btn", boost::bind(&LLPanelPickInfo::onClickBack, this)); - mScrollingPanel = getChild<LLPanel>("scroll_content_panel"); - mScrollContainer = getChild<LLScrollContainer>("profile_scroll"); - - mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); - mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); - return TRUE; } -void LLPanelPickInfo::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLPanel::reshape(width, height, called_from_parent); - - if (!mScrollContainer || !mScrollingPanel) - return; - - static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); - - S32 scroll_height = mScrollContainer->getRect().getHeight(); - if (mScrollingPanelMinHeight >= scroll_height) - { - mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight); - } - else - { - mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height); - } -} - void LLPanelPickInfo::processProperties(void* data, EAvatarProcessorType type) { if(APT_PICK_INFO != type) @@ -320,6 +284,7 @@ void LLPanelPickInfo::setPickName(const std::string& name) void LLPanelPickInfo::setPickDesc(const std::string& desc) { childSetValue(XML_DESC, desc); + updateContentPanelRect(); } void LLPanelPickInfo::setPickLocation(const std::string& location) @@ -327,6 +292,31 @@ void LLPanelPickInfo::setPickLocation(const std::string& location) childSetValue(XML_LOCATION, location); } +void LLPanelPickInfo::updateContentPanelRect() +{ + LLTextBox* desc = getChild<LLTextBox>(XML_DESC); + + S32 text_height = desc->getTextPixelHeight(); + LLRect text_rect = desc->getRect(); + + // let text-box height fit text height + text_rect.set(text_rect.mLeft, text_rect.mTop, text_rect.mRight, text_rect.mTop - text_height); + desc->setRect(text_rect); + desc->reshape(text_rect.getWidth(), text_rect.getHeight()); + // force reflow + desc->setText(desc->getText()); + + // bottom of description text-box will be bottom of content panel + desc->localRectToOtherView(desc->getLocalRect(), &text_rect, getChild<LLView>("profile_scroll")); + + LLPanel* content_panel = getChild<LLPanel>("scroll_content_panel"); + LLRect content_rect = content_panel->getRect(); + content_rect.set(content_rect.mLeft, content_rect.mTop, content_rect.mRight, text_rect.mBottom); + // Somehow setRect moves all elements down. + // Single reshape() updates rect and does not move anything. + content_panel->reshape(content_rect.getWidth(), content_rect.getHeight()); +} + void LLPanelPickInfo::onClickMap() { LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal()); diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 62c3b20c0d..12b5a116b4 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -43,7 +43,6 @@ class LLIconCtrl; class LLTextureCtrl; -class LLScrollContainer; class LLMessageSystem; class LLAvatarPropertiesObserver; @@ -70,8 +69,6 @@ public: /*virtual*/ BOOL postBuild(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); /** @@ -142,6 +139,15 @@ protected: virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } virtual LLVector3d& getPosGlobal() { return mPosGlobal; } + /** + * Reshapes content panel to fit all elements. + * + * Assume that description text-box is the last element of panel. + * Reshape text-box to fit text height and then reshape content panel to fit + * text-box bottom. EXT-1326 + */ + void updateContentPanelRect(); + /** * Callback for "Map" button, opens Map */ @@ -156,11 +162,7 @@ protected: protected: - S32 mScrollingPanelMinHeight; - S32 mScrollingPanelWidth; - LLScrollContainer* mScrollContainer; - LLPanel* mScrollingPanel; - LLTextureCtrl* mSnapshotCtrl; + LLTextureCtrl* mSnapshotCtrl; LLUUID mAvatarId; LLVector3d mPosGlobal; diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index b134cf0cba..5ee8704992 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -71,10 +71,6 @@ public: void setItem(LLInventoryItem* item); - LLInventoryItem* getItem() { return mItem; } - - std::string getPlaceInfoType() { return mPlaceInfoType; } - private: void onLandmarkLoaded(LLLandmark* landmark); void onFilterEdit(const std::string& search_string, bool force_filter); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 0a2217fc51..65a3d9d41b 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -550,7 +550,7 @@ void LLTeleportHistoryPanel::updateVerbs() LLTeleportHistoryFlatItem* itemp = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem()); - mTeleportBtn->setEnabled(NULL != itemp); + mTeleportBtn->setEnabled(NULL != itemp && itemp->getIndex() < (S32)mTeleportHistory->getItems().size() - 1); mShowOnMapBtn->setEnabled(NULL != itemp); } diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp deleted file mode 100644 index 74e37efe4e..0000000000 --- a/indra/newview/llpanelvolumepulldown.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @file llpanelvolumepulldown.cpp - * @author Tofu Linden - * @brief A floater showing the master volume pull-down - * - * $LicenseInfo:firstyear=2008&license=viewergpl$ - * - * Copyright (c) 2008-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llpanelvolumepulldown.h" - -// Viewer libs -#include "llviewercontrol.h" -#include "llstatusbar.h" - -// Linden libs -#include "llbutton.h" -#include "lltabcontainer.h" -#include "llfloaterreg.h" -#include "llfloaterpreference.h" -#include "llslider.h" - -/* static */ const F32 LLPanelVolumePulldown::sAutoCloseFadeStartTimeSec = 4.0f; -/* static */ const F32 LLPanelVolumePulldown::sAutoCloseTotalTimeSec = 5.0f; - -///---------------------------------------------------------------------------- -/// Class LLPanelVolumePulldown -///---------------------------------------------------------------------------- - -// Default constructor -LLPanelVolumePulldown::LLPanelVolumePulldown() -{ - mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2)); - mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2)); - LLUICtrlFactory::instance().buildPanel(this, "panel_volume_pulldown.xml"); -} - -BOOL LLPanelVolumePulldown::postBuild() -{ - // set the initial volume-slider's position to reflect reality - LLSlider* volslider = getChild<LLSlider>( "mastervolume" ); - volslider->setValue(gSavedSettings.getF32("AudioLevelMaster")); - - return LLPanel::postBuild(); -} - -/*virtual*/ -void LLPanelVolumePulldown::onMouseEnter(S32 x, S32 y, MASK mask) -{ - mHoverTimer.stop(); - LLPanel::onMouseEnter(x,y,mask); -} - - -/*virtual*/ -void LLPanelVolumePulldown::onMouseLeave(S32 x, S32 y, MASK mask) -{ - mHoverTimer.start(); - LLPanel::onMouseLeave(x,y,mask); -} - -/*virtual*/ -void LLPanelVolumePulldown::handleVisibilityChange ( BOOL new_visibility ) -{ - if (new_visibility) - { - mHoverTimer.start(); // timer will be stopped when mouse hovers over panel - gFocusMgr.setTopCtrl(this); - } - else - { - mHoverTimer.stop(); - gFocusMgr.setTopCtrl(NULL); - } -} - -/*virtual*/ -void LLPanelVolumePulldown::onTopLost() -{ - setVisible(FALSE); -} - -void LLPanelVolumePulldown::onAdvancedButtonClick(const LLSD& user_data) -{ - // close the global volume minicontrol, we're bringing up the big one - setVisible(FALSE); - - // bring up the prefs floater - LLFloaterPreference* prefsfloater = dynamic_cast<LLFloaterPreference*> - (LLFloaterReg::showInstance("preferences")); - if (prefsfloater) - { - // grab the 'audio' panel from the preferences floater and - // bring it the front! - LLTabContainer* tabcontainer = prefsfloater->getChild<LLTabContainer>("pref core"); - LLPanel* audiopanel = prefsfloater->getChild<LLPanel>("audio"); - if (tabcontainer && audiopanel) - { - tabcontainer->selectTabPanel(audiopanel); - } - } -} - -void LLPanelVolumePulldown::setControlFalse(const LLSD& user_data) -{ - std::string control_name = user_data.asString(); - LLControlVariable* control = findControl(control_name); - - if (control) - control->set(LLSD(FALSE)); -} - -//virtual -void LLPanelVolumePulldown::draw() -{ - F32 alpha = mHoverTimer.getStarted() - ? clamp_rescale(mHoverTimer.getElapsedTimeF32(), sAutoCloseFadeStartTimeSec, sAutoCloseTotalTimeSec, 1.f, 0.f) - : 1.0f; - LLViewDrawContext context(alpha); - - LLPanel::draw(); - - if (alpha == 0.f) - { - setVisible(FALSE); - } -} - diff --git a/indra/newview/llpanelvolumepulldown.h b/indra/newview/llpanelvolumepulldown.h deleted file mode 100644 index 9f20caa1a8..0000000000 --- a/indra/newview/llpanelvolumepulldown.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file llpanelvolumepulldown.h - * @author Tofu Linden - * @brief A panel showing the master volume pull-down - * - * $LicenseInfo:firstyear=2008&license=viewergpl$ - * - * Copyright (c) 2008-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLPANELVOLUMEPULLDOWN_H -#define LL_LLPANELVOLUMEPULLDOWN_H - -#include "linden_common.h" - -#include "llpanel.h" - -class LLFrameTimer; - -class LLPanelVolumePulldown : public LLPanel -{ - public: - LLPanelVolumePulldown(); - /*virtual*/ void draw(); - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ void handleVisibilityChange ( BOOL new_visibility ); - /*virtual*/ void onTopLost(); - /*virtual*/ BOOL postBuild(); - - private: - void setControlFalse(const LLSD& user_data); - void onAdvancedButtonClick(const LLSD& user_data); - - LLFrameTimer mHoverTimer; - static const F32 sAutoCloseFadeStartTimeSec; - static const F32 sAutoCloseTotalTimeSec; -}; - - -#endif // LL_LLPANELVOLUMEPULLDOWN_H diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index b6f78d08f1..e2da4c4475 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -166,6 +166,7 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) { name.erase(found, moderator_indicator_len); item->setName(name); + item->reshapeAvatarName(); } } } @@ -187,6 +188,7 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) name += " "; name += moderator_indicator; item->setName(name); + item->reshapeAvatarName(); } } } @@ -277,9 +279,6 @@ bool LLParticipantList::onModeratorUpdateEvent(LLPointer<LLOldEvents::LLEvent> e mModeratorList.erase(id); } } - - // apply changes immediately - onAvatarListRefreshed(mAvatarList, LLSD()); } } return true; @@ -593,7 +592,8 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& if (speakerp.notNull()) { // not in voice participants can not be moderated - return speakerp->isInVoiceChannel(); + return speakerp->mStatus == LLSpeaker::STATUS_VOICE_ACTIVE + || speakerp->mStatus == LLSpeaker::STATUS_MUTED; } } return false; diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 027f3daffb..da3f1543dd 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -59,14 +59,17 @@ bool LLScreenChannel::mWasStartUpToastShown = false; // LLScreenChannelBase ////////////////////// LLScreenChannelBase::LLScreenChannelBase(const LLUUID& id) : - mToastAlignment(NA_BOTTOM) + mOverflowToastPanel(NULL) + ,mToastAlignment(NA_BOTTOM) ,mCanStoreToasts(true) ,mHiddenToastsNum(0) + ,mOverflowToastHidden(false) ,mHoveredToast(NULL) ,mControlHovering(false) ,mShowToasts(true) { mID = id; + mOverflowFormatString = LLTrans::getString("OverflowInfoChannelString"); mWorldViewRectConnection = gViewerWindow->setOnWorldViewRectUpdated(boost::bind(&LLScreenChannelBase::updatePositionAndSize, this, _1, _2)); setMouseOpaque( false ); setVisible(FALSE); @@ -214,6 +217,11 @@ void LLScreenChannel::addToast(const LLToast::Params& p) ToastElem new_toast_elem(p); + // reset HIDDEN flags for the Overflow Toast + mOverflowToastHidden = false; + if(mOverflowToastPanel) + mOverflowToastPanel->setIsHidden(false); + new_toast_elem.toast->setOnFadeCallback(boost::bind(&LLScreenChannel::onToastFade, this, _1)); new_toast_elem.toast->setOnToastDestroyedCallback(boost::bind(&LLScreenChannel::onToastDestroyed, this, _1)); if(mControlHovering) @@ -314,6 +322,8 @@ void LLScreenChannel::loadStoredToastsToChannel() if(mStoredToastList.size() == 0) return; + + mOverflowToastHidden = false; for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it) { @@ -334,6 +344,8 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) if( it == mStoredToastList.end() ) return; + mOverflowToastHidden = false; + LLToast* toast = (*it).toast; if(toast->getVisible()) @@ -345,6 +357,7 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) toast->setIsHidden(false); toast->resetTimer(); mToastList.push_back((*it)); + mStoredToastList.erase(it); redrawToasts(); } @@ -478,7 +491,7 @@ void LLScreenChannel::showToastsBottom() if(floater && floater->overlapsScreenChannel()) { LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); - if(toast_rect.mTop > world_rect.mTop) + if(toast_rect.mTop + getOverflowToastHeight() + toast_margin > world_rect.mTop) { break; } @@ -514,7 +527,7 @@ void LLScreenChannel::showToastsBottom() } } - if(it != mToastList.rend()) + if(it != mToastList.rend() && !mOverflowToastHidden) { mHiddenToastsNum = 0; for(; it != mToastList.rend(); it++) @@ -523,6 +536,7 @@ void LLScreenChannel::showToastsBottom() (*it).toast->setVisible(FALSE); mHiddenToastsNum++; } + createOverflowToast(bottom, gSavedSettings.getS32("NotificationTipToastLifeTime")); } else { @@ -552,6 +566,94 @@ void LLScreenChannel::showToastsTop() { } +//-------------------------------------------------------------------------- +void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer) +{ + LLRect toast_rect; + LLToast::Params p; + p.lifetime_secs = timer; + + if(!mOverflowToastPanel) + mOverflowToastPanel = new LLToast(p); + + if(!mOverflowToastPanel) + return; + + mOverflowToastPanel->startFading(); + mOverflowToastPanel->setOnFadeCallback(boost::bind(&LLScreenChannel::onOverflowToastHide, this)); + + LLTextBox* text_box = mOverflowToastPanel->getChild<LLTextBox>("toast_text"); + std::string text = llformat(mOverflowFormatString.c_str(),mHiddenToastsNum); + if(mHiddenToastsNum == 1) + { + text += "."; + } + else + { + text += "s."; + } + + toast_rect = mOverflowToastPanel->getRect(); + mOverflowToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true); + toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight()); + mOverflowToastPanel->setRect(toast_rect); + + // don't show overflow toast if there is not enough space for it. + LLDockableFloater* floater = dynamic_cast<LLDockableFloater*>(LLDockableFloater::getInstanceHandle().get()); + if(floater && floater->overlapsScreenChannel()) + { + LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); + if(toast_rect.mTop > world_rect.mTop) + { + closeOverflowToastPanel(); + return; + } + } + + text_box->setValue(text); + text_box->setVisible(TRUE); + + mOverflowToastPanel->setVisible(TRUE); +} + +//-------------------------------------------------------------------------- +void LLScreenChannel::onOverflowToastHide() +{ + mOverflowToastHidden = true; + + // remove all hidden toasts from channel and save interactive notifications + for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end();) + { + if(!(*it).toast->getVisible()) + { + if((*it).toast->getCanBeStored()) + { + storeToast((*it)); + } + else + { + deleteToast((*it).toast); + } + + it = mToastList.erase(it); + } + else + { + ++it; + } + } +} + +//-------------------------------------------------------------------------- +void LLScreenChannel::closeOverflowToastPanel() +{ + if(mOverflowToastPanel != NULL) + { + mOverflowToastPanel->setVisible(FALSE); + mOverflowToastPanel->stopFading(); + } +} + //-------------------------------------------------------------------------- void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) { @@ -597,6 +699,24 @@ F32 LLScreenChannel::getHeightRatio() return ratio; } +S32 LLScreenChannel::getOverflowToastHeight() +{ + if(mOverflowToastPanel) + { + return mOverflowToastPanel->getRect().getHeight(); + } + + static S32 height = 0; + if(0 == height) + { + LLToast::Params p; + LLToast* toast = new LLToast(p); + height = toast->getRect().getHeight(); + delete toast; + } + return height; +} + //-------------------------------------------------------------------------- void LLScreenChannel::updateStartUpString(S32 num) { @@ -658,19 +778,6 @@ void LLScreenChannel::hideToastsFromScreen() (*it).toast->setVisible(FALSE); } -//-------------------------------------------------------------------------- -void LLScreenChannel::hideToast(const LLUUID& notification_id) -{ - std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), notification_id); - if(mToastList.end() != it) - { - ToastElem te = *it; - te.toast->setVisible(FALSE); - te.toast->stopTimer(); - mToastList.erase(it); - } -} - //-------------------------------------------------------------------------- void LLScreenChannel::removeToastsFromChannel() { @@ -789,13 +896,3 @@ void LLScreenChannel::updateShowToastsState() //-------------------------------------------------------------------------- -LLToast* LLScreenChannel::getToastByNotificationID(LLUUID id) -{ - std::vector<ToastElem>::iterator it = find(mStoredToastList.begin(), - mStoredToastList.end(), id); - - if (it == mStoredToastList.end()) - return NULL; - - return it->toast; -} diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 88053d87d9..38f27f756b 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -72,7 +72,8 @@ public: virtual void setToastAlignment(EToastAlignment align) {mToastAlignment = align;} virtual void setChannelAlignment(EChannelAlignment align) {mChannelAlignment = align;} - + virtual void setOverflowFormatString ( const std::string& str) { mOverflowFormatString = str; } + // kill or modify a toast by its ID virtual void killToastByNotificationID(LLUUID id) {}; virtual void modifyToastNotificationByID(LLUUID id, LLSD data) {}; @@ -120,13 +121,17 @@ protected: LLToast* mHoveredToast; bool mCanStoreToasts; bool mDisplayToastsAlways; + bool mOverflowToastHidden; // controls whether a channel shows toasts or not bool mShowToasts; // EToastAlignment mToastAlignment; EChannelAlignment mChannelAlignment; + // attributes for the Overflow Toast S32 mHiddenToastsNum; + LLToast* mOverflowToastPanel; + std::string mOverflowFormatString; // channel's ID LLUUID mID; @@ -171,8 +176,6 @@ public: void modifyToastByNotificationID(LLUUID id, LLPanel* panel); // hide all toasts from screen, but not remove them from a channel void hideToastsFromScreen(); - // hide toast by notification id - void hideToast(const LLUUID& notification_id); // removes all toasts from a channel void removeToastsFromChannel(); // show all toasts in a channel @@ -187,6 +190,8 @@ public: void removeToastsBySessionID(LLUUID id); // remove all storable toasts from screen and store them void removeAndStoreAllStorableToasts(); + // close the Overflow Toast + void closeOverflowToastPanel(); // close the StartUp Toast void closeStartUpToast(); @@ -209,8 +214,6 @@ public: // update number of notifications in the StartUp Toast void updateStartUpString(S32 num); - LLToast* getToastByNotificationID(LLUUID id); - // Channel's signals // signal on storing of faded toasts event typedef boost::function<void (LLPanel* info_panel, const LLUUID id)> store_tost_callback_t; @@ -254,6 +257,7 @@ private: void onToastHover(LLToast* toast, bool mouse_enter); void onToastFade(LLToast* toast); void onToastDestroyed(LLToast* toast); + void onOverflowToastHide(); void onStartUpToastHide(); // @@ -266,6 +270,9 @@ private: void showToastsCentre(); void showToastsTop(); + // create the Overflow Toast + void createOverflowToast(S32 bottom, F32 timer); + // create the StartUp Toast void createStartUpToast(S32 notif_num, F32 timer); @@ -274,6 +281,8 @@ private: */ static F32 getHeightRatio(); + S32 getOverflowToastHeight(); + // Channel's flags static bool mWasStartUpToastShown; diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 0dd9203c6d..010dfd1b33 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -88,11 +88,6 @@ void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, c mDisplayName = first + " " + last; } -bool LLSpeaker::isInVoiceChannel() -{ - return mStatus == LLSpeaker::STATUS_VOICE_ACTIVE || mStatus == LLSpeaker::STATUS_MUTED; -} - LLSpeakerUpdateModeratorEvent::LLSpeakerUpdateModeratorEvent(LLSpeaker* source) : LLEvent(source, "Speaker add moderator event"), mSpeakerID (source->mID), diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index da8dfdf548..1a8c23f56a 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -67,8 +67,6 @@ public: void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); - bool isInVoiceChannel(); - ESpeakerStatus mStatus; // current activity status in speech group F32 mLastSpokeTime; // timestamp when this speaker last spoke F32 mSpeechVolume; // current speech amplitude (timea average rms amplitude?) diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp deleted file mode 100644 index 42db6bf9c3..0000000000 --- a/indra/newview/llspeakingindicatormanager.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/** - * @file llspeakingindicatormanager.cpp - * @author Mike Antipov - * @brief Implementation of SpeackerIndicatorManager class to process registered LLSpeackerIndicator - * depend on avatars are in the same voice channel. - * - * $LicenseInfo:firstyear=2010&license=viewergpl$ - * - * Copyright (c) 2010, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llspeakingindicatormanager.h" - - -#include "llagentdata.h" -#include "llvoicechannel.h" -#include "llvoiceclient.h" - -/** - * This class intended to control visibility of avatar speaking indicators depend on whether avatars - * are in the same voice channel. - * - * Speaking indicator should be visible for avatars in the same voice channel. See EXT-3976. - * - * It stores passed instances of LLOutputMonitorCtrl in a multimap by avatar LLUUID. - * It observes changing of voice channel and changing of participant list in voice channel. - * When voice channel or voice participant list is changed it updates visibility of an appropriate - * speaking indicator. - * - * Several indicators can be registered for the same avatar. - */ -class SpeakingIndicatorManager : public LLSingleton<SpeakingIndicatorManager>, LLVoiceClientParticipantObserver -{ - LOG_CLASS(SpeakingIndicatorManager); -public: - - /** - * Stores passed speaking indicator to control its visibility. - * - * Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent. - * It ignores instances of Agent's indicator. - * - * @param speaker_id LLUUID of an avatar whose speaking indicator is registered. - * @param speaking_indicator instance of the speaking indicator to be registered. - */ - void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator); - - /** - * Removes passed speaking indicator from observing. - * - * @param speaker_id LLUUID of an avatar whose speaking indicator should be unregistered. - * @param speaking_indicator instance of the speaking indicator to be unregistered. - */ - void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator); - -private: - typedef std::set<LLUUID> speaker_ids_t; - typedef std::multimap<LLUUID, LLSpeakingIndicator*> speaking_indicators_mmap_t; - typedef speaking_indicators_mmap_t::value_type speaking_indicator_value_t; - typedef speaking_indicators_mmap_t::const_iterator indicator_const_iterator; - typedef std::pair<indicator_const_iterator, indicator_const_iterator> indicator_range_t; - - friend class LLSingleton<SpeakingIndicatorManager>; - SpeakingIndicatorManager(); - ~SpeakingIndicatorManager(); - - /** - * Callback to determine when voice channel is changed. - * - * It switches all registered speaking indicators off. - * To reduce overheads only switched on indicators are processed. - */ - void sOnCurrentChannelChanged(const LLUUID& session_id); - - /** - * Callback of changing voice participant list (from LLVoiceClientParticipantObserver). - * - * Switches off indicators had been switched on and switches on indicators of current participants list. - * There is only a few indicators in lists should be switched off/on. - * So, method does not calculate difference between these list it only switches off already - * switched on indicators and switches on indicators of voice channel participants - */ - void onChange(); - - /** - * Changes state of indicators specified by LLUUIDs - * - * @param speakers_uuids - avatars' LLUUIDs whose speaking indicators should be switched - * @param switch_on - if TRUE specified indicator will be switched on, off otherwise. - */ - void switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on); - - /** - * Multimap with all registered speaking indicators - */ - speaking_indicators_mmap_t mSpeakingIndicators; - - /** - * LUUIDs of avatar for which we have speaking indicators switched on. - * - * Is used to switch off all previously ON indicators when voice participant list is changed. - * - * @see onChange() - */ - speaker_ids_t mSwitchedIndicatorsOn; -}; - -////////////////////////////////////////////////////////////////////////// -// PUBLIC SECTION -////////////////////////////////////////////////////////////////////////// -void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator) -{ - if (speaker_id == gAgentID) return; - - LL_DEBUGS("SpeakingIndicator") << "Registering indicator: " << speaker_id << LL_ENDL; - speaking_indicator_value_t value_type(speaker_id, speaking_indicator); - mSpeakingIndicators.insert(value_type); - - speaker_ids_t speakers_uuids; - BOOL is_in_same_voice = LLVoiceClient::getInstance()->findParticipantByID(speaker_id) != NULL; - - speakers_uuids.insert(speaker_id); - switchSpeakerIndicators(speakers_uuids, is_in_same_voice); -} - -void SpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator) -{ - speaking_indicators_mmap_t::iterator it; - it = mSpeakingIndicators.find(speaker_id); - for (;it != mSpeakingIndicators.end(); ++it) - { - if (it->second == speaking_indicator) - { - mSpeakingIndicators.erase(it); - break; - } - } -} - -////////////////////////////////////////////////////////////////////////// -// PRIVATE SECTION -////////////////////////////////////////////////////////////////////////// -SpeakingIndicatorManager::SpeakingIndicatorManager() -{ - LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&SpeakingIndicatorManager::sOnCurrentChannelChanged, this, _1)); - LLVoiceClient::getInstance()->addObserver(this); -} - -SpeakingIndicatorManager::~SpeakingIndicatorManager() -{ - // Don't use LLVoiceClient::getInstance() here without check - // singleton MAY have already been destroyed. - if(LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(this); - } -} - -void SpeakingIndicatorManager::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) -{ - switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE); - mSwitchedIndicatorsOn.clear(); -} - -void SpeakingIndicatorManager::onChange() -{ - LL_DEBUGS("SpeakingIndicator") << "Voice participant list was changed, updating indicators" << LL_ENDL; - - speaker_ids_t speakers_uuids; - LLVoiceClient::getInstance()->getParticipantsUUIDSet(speakers_uuids); - - LL_DEBUGS("SpeakingIndicator") << "Switching all OFF, count: " << mSwitchedIndicatorsOn.size() << LL_ENDL; - // switch all indicators off - switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE); - mSwitchedIndicatorsOn.clear(); - - LL_DEBUGS("SpeakingIndicator") << "Switching all ON, count: " << speakers_uuids.size() << LL_ENDL; - // then switch current voice participants indicators on - switchSpeakerIndicators(speakers_uuids, TRUE); -} - -void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on) -{ - speaker_ids_t::const_iterator it_uuid = speakers_uuids.begin(); - for (; it_uuid != speakers_uuids.end(); ++it_uuid) - { - LL_DEBUGS("SpeakingIndicator") << "Looking for indicator: " << *it_uuid << LL_ENDL; - indicator_range_t it_range = mSpeakingIndicators.equal_range(*it_uuid); - indicator_const_iterator it_indicator = it_range.first; - bool was_found = false; - for (; it_indicator != it_range.second; ++it_indicator) - { - was_found = true; - LLSpeakingIndicator* indicator = (*it_indicator).second; - indicator->switchIndicator(switch_on); - } - - if (was_found) - { - LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL; - - if (switch_on) - { - // store switched on indicator to be able switch it off - mSwitchedIndicatorsOn.insert(*it_uuid); - } - } - else - { - LL_WARNS("SpeakingIndicator") << "indicator was not found among registered: " << *it_uuid << LL_ENDL; - } - } -} - -/************************************************************************/ -/* LLSpeakingIndicatorManager namespace implementation */ -/************************************************************************/ - -void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator) -{ - SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator); -} - -void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator) -{ - SpeakingIndicatorManager::instance().unregisterSpeakingIndicator(speaker_id, speaking_indicator); -} - -// EOF - diff --git a/indra/newview/llspeakingindicatormanager.h b/indra/newview/llspeakingindicatormanager.h deleted file mode 100644 index ce0158f7d8..0000000000 --- a/indra/newview/llspeakingindicatormanager.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file llspeakingindicatormanager.h - * @author Mike Antipov - * @brief Interfeace of LLSpeackerIndicator class to be processed depend on avatars are in the same voice channel. - * Also register/unregister methods for this class are declared - * - * $LicenseInfo:firstyear=2010&license=viewergpl$ - * - * Copyright (c) 2010, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLSPEAKINGINDICATORMANAGER_H -#define LL_LLSPEAKINGINDICATORMANAGER_H - -class LLSpeakingIndicator -{ -public: - virtual void switchIndicator(bool switch_on) = 0; -}; - -// See EXT-3976. -namespace LLSpeakingIndicatorManager -{ - /** - * Stores passed speaking indicator to control its visibility. - * - * Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent. - * It ignores instances of Agent's indicator. - * - * @param speaker_id LLUUID of an avatar whose speaker indicator is registered. - * @param speaking_indicator instance of the speaker indicator to be registered. - */ - void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator); - - /** - * Removes passed speaking indicator from observing. - * - * @param speaker_id LLUUID of an avatar whose speaker indicator should be unregistered. - * @param speaking_indicator instance of the speaker indicator to be unregistered. - */ - void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator); -} - -#endif // LL_LLSPEAKINGINDICATORMANAGER_H diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index b3b2b9ee5d..5ce3bbb9f6 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -42,7 +42,7 @@ #include "llfloaterbuycurrency.h" #include "llfloaterchat.h" #include "llfloaterlagmeter.h" -#include "llpanelvolumepulldown.h" +#include "llfloatervolumepulldown.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" #include "llhudicon.h" @@ -204,21 +204,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) addChild(mSGPacketLoss); childSetActionTextbox("stat_btn", onClickStatGraph); - - mPanelVolumePulldown = new LLPanelVolumePulldown(); - addChild(mPanelVolumePulldown); - - LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); - LLButton* volbtn = getChild<LLButton>( "volume_btn" ); - volume_pulldown_rect.setLeftTopAndSize(volbtn->getRect().mLeft - - (volume_pulldown_rect.getWidth() - volbtn->getRect().getWidth())/2, - volbtn->calcScreenRect().mBottom, - volume_pulldown_rect.getWidth(), - volume_pulldown_rect.getHeight()); - - mPanelVolumePulldown->setShape(volume_pulldown_rect); - mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); - mPanelVolumePulldown->setVisible(FALSE); } LLStatusBar::~LLStatusBar() @@ -516,7 +501,7 @@ static void onClickScriptDebug(void*) void LLStatusBar::onMouseEnterVolume(LLUICtrl* ctrl) { // show the master volume pull-down - gStatusBar->mPanelVolumePulldown->setVisible(TRUE); + LLFloaterReg::showInstance("volume_pulldown"); } static void onClickVolume(void* data) diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 0e98da0fe4..f77cc1acb8 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -112,7 +112,7 @@ private: S32 mSquareMetersCommitted; LLFrameTimer* mBalanceTimer; LLFrameTimer* mHealthTimer; - LLPanelVolumePulldown* mPanelVolumePulldown; + static std::vector<std::string> sDays; static std::vector<std::string> sMonths; static const U32 MAX_DATE_STRING_LENGTH; diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp index 0cfcfdc634..eef8435006 100644 --- a/indra/newview/llsyswellitem.cpp +++ b/indra/newview/llsyswellitem.cpp @@ -77,11 +77,10 @@ void LLSysWellItem::onClickCloseBtn() //--------------------------------------------------------------------------------- BOOL LLSysWellItem::handleMouseDown(S32 x, S32 y, MASK mask) { - BOOL res = LLPanel::handleMouseDown(x, y, mask); if(!mCloseBtn->getRect().pointInRect(x, y)) mOnItemClick(this); - return res; + return LLPanel::handleMouseDown(x, y, mask); } //--------------------------------------------------------------------------------- diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index ba15053381..44cf82540a 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -700,7 +700,8 @@ void LLNotificationWellWindow::connectListUpdaterToSignal(std::string notificati void LLNotificationWellWindow::onItemClick(LLSysWellItem* item) { LLUUID id = item->getID(); - LLFloaterReg::showInstance("inspect_toast", id); + if(mChannel) + mChannel->loadStoredToastByNotificationIDToChannel(id); } void LLNotificationWellWindow::onItemClose(LLSysWellItem* item) diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 0c81d1f369..ded3abcbf4 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -162,9 +162,6 @@ private: void onItemClick(LLSysWellItem* item); void onItemClose(LLSysWellItem* item); - // ID of a toast loaded by user (by clicking notification well item) - LLUUID mLoadedToastId; - }; /** diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index c635f91423..d3bbda1c72 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -246,6 +246,13 @@ void LLTeleportHistoryStorage::goToItem(S32 idx) dump(); return; } + + if (idx == (S32)mItems.size() - 1) + { + llwarns << "Will not teleport to the same location." << llendl; + dump(); + return; + } // Attempt to teleport to the requested item. gAgent.teleportViaLocation(mItems[idx].mGlobalPos); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index d0c125eb77..766cf83a01 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -179,9 +179,7 @@ void LLToastNotifyPanel::adjustPanelForScriptNotice(const LLNotificationFormPtr //adjust layout LLRect button_rect = mControlPanel->getRect(); reshape(getRect().getWidth(), mInfoPanel->getRect().getHeight() + button_panel_height); - button_rect.set(0, button_rect.mBottom + button_panel_height, button_rect.getWidth(), button_rect.mBottom); mControlPanel->reshape(button_rect.getWidth(), button_panel_height); - mControlPanel->setRect(button_rect); } // static @@ -219,7 +217,7 @@ LLButton* LLToastNotifyPanel::addButton(const std::string& name, const std::stri S32 ignore_pad = 0; S32 button_index = mNumButtons; S32 index = button_index; - S32 x = HPAD * 2; // *2 - to make a nice offset + S32 x = (HPAD * 4) + 32; if (mIsScriptDialog) { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index b16134cc28..66451f47a3 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1005,7 +1005,7 @@ void render_hud_attachments() LLRect get_whole_screen_region() { - LLRect whole_screen = gViewerWindow->getWorldViewRectScaled(); + LLRect whole_screen = gViewerWindow->getWindowRectScaled(); // apply camera zoom transform (for high res screenshots) F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor(); @@ -1013,13 +1013,13 @@ LLRect get_whole_screen_region() if (zoom_factor > 1.f) { S32 num_horizontal_tiles = llceil(zoom_factor); - S32 tile_width = llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); - S32 tile_height = llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); + S32 tile_width = llround((F32)gViewerWindow->getWindowWidthScaled() / zoom_factor); + S32 tile_height = llround((F32)gViewerWindow->getWindowHeightScaled() / zoom_factor); int tile_y = sub_region / num_horizontal_tiles; int tile_x = sub_region - (tile_y * num_horizontal_tiles); glh::matrix4f mat; - whole_screen.setLeftTopAndSize(tile_x * tile_width, gViewerWindow->getWorldViewHeightScaled() - (tile_y * tile_height), tile_width, tile_height); + whole_screen.setLeftTopAndSize(tile_x * tile_width, gViewerWindow->getWindowHeightScaled() - (tile_y * tile_height), tile_width, tile_height); } return whole_screen; } @@ -1039,12 +1039,12 @@ bool get_hud_matrices(const LLRect& screen_region, glh::matrix4f &proj, glh::mat F32 aspect_ratio = LLViewerCamera::getInstance()->getAspect(); glh::matrix4f mat; - F32 scale_x = (F32)gViewerWindow->getWorldViewWidthScaled() / (F32)screen_region.getWidth(); - F32 scale_y = (F32)gViewerWindow->getWorldViewHeightScaled() / (F32)screen_region.getHeight(); + F32 scale_x = (F32)gViewerWindow->getWindowWidthScaled() / (F32)screen_region.getWidth(); + F32 scale_y = (F32)gViewerWindow->getWindowHeightScaled() / (F32)screen_region.getHeight(); mat.set_scale(glh::vec3f(scale_x, scale_y, 1.f)); mat.set_translate( - glh::vec3f(clamp_rescale((F32)screen_region.getCenterX(), 0.f, (F32)gViewerWindow->getWorldViewWidthScaled(), 0.5f * scale_x * aspect_ratio, -0.5f * scale_x * aspect_ratio), - clamp_rescale((F32)screen_region.getCenterY(), 0.f, (F32)gViewerWindow->getWorldViewHeightScaled(), 0.5f * scale_y, -0.5f * scale_y), + glh::vec3f(clamp_rescale((F32)screen_region.getCenterX(), 0.f, (F32)gViewerWindow->getWindowWidthScaled(), 0.5f * scale_x * aspect_ratio, -0.5f * scale_x * aspect_ratio), + clamp_rescale((F32)screen_region.getCenterY(), 0.f, (F32)gViewerWindow->getWindowHeightScaled(), 0.5f * scale_y, -0.5f * scale_y), 0.f)); proj *= mat; @@ -1294,8 +1294,8 @@ void render_ui_2d() if (gAgent.getAvatarObject() && gAgent.mHUDCurZoom < 0.98f) { glPushMatrix(); - S32 half_width = (gViewerWindow->getWorldViewWidthScaled() / 2); - S32 half_height = (gViewerWindow->getWorldViewHeightScaled() / 2); + S32 half_width = (gViewerWindow->getWindowWidthScaled() / 2); + S32 half_height = (gViewerWindow->getWindowHeightScaled() / 2); glScalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f); glTranslatef((F32)half_width, (F32)half_height, 0.f); F32 zoom = gAgent.mHUDCurZoom; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 0edd4ac025..801c2d0fd2 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -107,6 +107,7 @@ #include "llfloateruipreview.h" #include "llfloaterurldisplay.h" #include "llfloatervoicedevicesettings.h" +#include "llfloatervolumepulldown.h" #include "llfloaterwater.h" #include "llfloaterwhitelistentry.h" #include "llfloaterwindlight.h" @@ -117,7 +118,6 @@ #include "llinspectgroup.h" #include "llinspectobject.h" #include "llinspectremoteobject.h" -#include "llinspecttoast.h" #include "llmediaremotectrl.h" #include "llmoveview.h" #include "llnearbychat.h" @@ -189,7 +189,6 @@ void LLViewerFloaterReg::registerFloaters() LLInspectGroupUtil::registerFloater(); LLInspectObjectUtil::registerFloater(); LLInspectRemoteObjectUtil::registerFloater(); - LLNotificationsUI::registerFloater(); LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLagMeter>); LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>); @@ -261,7 +260,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImagePreview>, "upload"); LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload"); LLFloaterReg::add("upload_model", "floater_model_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelPreview>, "upload"); - + LLFloaterReg::add("volume_pulldown", "floater_volume_pulldown.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVolumePulldown>); LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 43c7574830..42c45589c0 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -904,19 +904,7 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f LLPanelPlaces *places_panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); if (places_panel) { - // we are creating a landmark - if("create_landmark" == places_panel->getPlaceInfoType() && !places_panel->getItem()) - { - places_panel->setItem(item); - } - // we are opening a group notice attachment - else - { - LLSD args; - args["type"] = "landmark"; - args["id"] = item_id; - LLSideTray::getInstance()->showPanel("panel_places", args); - } + places_panel->setItem(item); } } } @@ -1110,6 +1098,28 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this)); } + // *NOTE dzaporozhan + // Restored from viewer-1-23 to fix EXT-3520 + // Saves Group Notice Attachments to inventory. + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_ImprovedInstantMessage); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_MessageBlock); + msg->addBOOLFast(_PREHASH_FromGroup, FALSE); + msg->addUUIDFast(_PREHASH_ToAgentID, mFromID); + msg->addU8Fast(_PREHASH_Offline, IM_ONLINE); + msg->addUUIDFast(_PREHASH_ID, mTransactionID); + msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary + std::string name; + LLAgentUI::buildFullname(name); + msg->addStringFast(_PREHASH_FromAgentName, name); + msg->addStringFast(_PREHASH_Message, ""); + msg->addU32Fast(_PREHASH_ParentEstateID, 0); + msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); + msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); + std::string from_string; // Used in the pop-up. std::string chatHistory_string; // Used in chat history. @@ -1145,10 +1155,8 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& } } break; - case IM_GROUP_NOTICE: - send_auto_receive_response(); - break; case IM_TASK_INVENTORY_OFFERED: + case IM_GROUP_NOTICE: case IM_GROUP_NOTICE_REQUESTED: // This is an offer from a task or group. // We don't use a new instance of an opener @@ -1163,6 +1171,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // end switch (mIM) case IOR_ACCEPT: + msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1)); + msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData), sizeof(mFolderID.mData)); + msg->sendReliable(mHost); + //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { @@ -1185,10 +1197,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& { chat.mMuted = TRUE; } - - // *NOTE dzaporozhan - // Disabled logging to old chat floater to fix crash in group notices - EXT-4149 - // LLFloaterChat::addChatHistory(chat); + LLFloaterChat::addChatHistory(chat); LLInventoryFetchComboObserver::folder_ref_t folders; LLInventoryFetchComboObserver::item_ref_t items; @@ -1759,9 +1768,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else if (from_id.isNull()) { - LLSD args; - args["MESSAGE"] = message; - LLNotificationsUtil::add("SystemMessage", args); + // Messages from "Second Life" ID don't go to IM history + // messages which should be routed to IM window come from a user ID with name=SYSTEM_NAME + chat.mText = name + ": " + message; + LLFloaterChat::addChat(chat, FALSE, FALSE); } else if (to_id.isNull()) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 33bfee798a..9285ab94dc 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -604,6 +604,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK { const char* buttonname = ""; const char* buttonstatestr = ""; + BOOL handled = FALSE; S32 x = pos.mX; S32 y = pos.mY; x = llround((F32)x / mDisplayScale.mV[VX]); @@ -698,10 +699,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK } else { - if (top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask)) - { - return TRUE; - } + handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask); } } @@ -719,12 +717,34 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl; } - // Do not allow tool manager to handle mouseclicks if we have disconnected - if(!gDisconnected && LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) + if (down) { - return TRUE; + if (gDisconnected) + { + return FALSE; + } + + if(LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) + { + return TRUE; + } } + else + { + if( !handled ) + { + handled = mRootView->handleAnyMouseClick(x, y, mask, clicktype, down); + } + if( !handled ) + { + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); + if (tool) + { + handled = tool->handleAnyMouseClick(x, y, mask, clicktype, down); + } + } + } // If we got this far on a down-click, it wasn't handled. // Up-clicks, though, are always handled as far as the OS is concerned. diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 42b8a1c2b6..423c46e14c 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5004,17 +5004,6 @@ LLVoiceClient::participantMap *LLVoiceClient::getParticipantList(void) return result; } -void LLVoiceClient::getParticipantsUUIDSet(std::set<LLUUID>& participant_uuids) -{ - if (NULL == mAudioSession) return; - - participantUUIDMap::const_iterator it = mAudioSession->mParticipantsByUUID.begin(), - it_end = mAudioSession->mParticipantsByUUID.end(); - for (; it != it_end; ++it) - { - participant_uuids.insert((*(*it).first)); - } -} LLVoiceClient::participantState *LLVoiceClient::sessionState::findParticipant(const std::string &uri) { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 6231c6ba29..724179847d 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -354,7 +354,6 @@ static void updatePosition(void); participantState *findParticipantByID(const LLUUID& id); participantMap *getParticipantList(void); - void getParticipantsUUIDSet(std::set<LLUUID>& participant_uuids); typedef std::map<const std::string*, sessionState*, stringMapComparitor> sessionMap; typedef std::set<sessionState*> sessionSet; diff --git a/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png b/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png index 6343ddf035..447e0af0be 100644 Binary files a/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png and b/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png differ diff --git a/indra/newview/skins/default/textures/bottomtray/WellButton_Lit.png b/indra/newview/skins/default/textures/bottomtray/WellButton_Lit.png index 661d1c5611..dd9133bcc4 100644 Binary files a/indra/newview/skins/default/textures/bottomtray/WellButton_Lit.png and b/indra/newview/skins/default/textures/bottomtray/WellButton_Lit.png differ diff --git a/indra/newview/skins/default/textures/bottomtray/WellButton_Lit_Selected.png b/indra/newview/skins/default/textures/bottomtray/WellButton_Lit_Selected.png index f927fd3989..0080e71f41 100644 Binary files a/indra/newview/skins/default/textures/bottomtray/WellButton_Lit_Selected.png and b/indra/newview/skins/default/textures/bottomtray/WellButton_Lit_Selected.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index cfa7479fa9..db60b90a93 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -224,7 +224,7 @@ with the same filename but different name scale.left="4" scale.top="28" scale.right="60" scale.bottom="4" /> <texture name="Inspector_Hover" file_name="windows/Inspector_Hover.png" preload="false" /> <texture name="Inspector_I" file_name="windows/Inspector_I.png" preload="false" /> - + <texture name="Inv_Acessories" file_name="icons/Inv_Accessories.png" preload="false" /> <texture name="Inv_Alpha" file_name="icons/Inv_Alpha.png" preload="false" /> <texture name="Inv_Animation" file_name="icons/Inv_Animation.png" preload="false" /> @@ -650,12 +650,6 @@ with the same filename but different name <texture name="PowerOff_Over" file_name="icons/PowerOff_Over.png" preload="false" /> <texture name="PowerOff_Press" file_name="icons/PowerOff_Press.png" preload="false" /> - <texture name="pixiesmall.j2c" use_mips="true" /> - <texture name="script_error.j2c" use_mips="true" /> - <texture name="silhouette.j2c" use_mips="true" /> - <texture name="foot_shadow.j2c" use_mips="true" /> - <texture name="cloud-particle.j2c" use_mips="true" /> - <!--WARNING OLD ART BELOW *do not use*--> <texture name="icn_chatbar.tga" /> <texture name="icn_media_web.tga" preload="true" /> @@ -684,6 +678,8 @@ with the same filename but different name <texture name="toggle_button_off" file_name="toggle_button_off.png" preload="true" /> <texture name="toggle_button_selected" file_name="toggle_button_selected.png" preload="true" /> + + <texture name="sm_rounded_corners_simple.tga" scale.left="4" scale.top="4" scale.bottom="4" scale.right="4" /> <texture name="color_swatch_alpha.tga" preload="true" /> <texture name="button_anim_pause.tga" /> @@ -702,6 +698,7 @@ with the same filename but different name <texture name="icon_event_mature.tga" /> <texture name="icon_for_sale.tga" /> <texture name="icon_place_for_sale.tga" /> + <texture name="icon_popular.tga" /> <texture name="icon_top_pick.tga" /> <texture name="inv_folder_mesh.tga"/> @@ -722,10 +719,27 @@ with the same filename but different name <texture name="map_telehub.tga" /> <texture name="map_track_16.tga" /> + <texture name="media_icon.tga" file_name="icn_label_media.tga" /> + <texture name="music_icon.tga" file_name="icn_label_music.tga" /> + + <texture name="notify_tip_icon.tga" /> <texture name="notify_caution_icon.tga" /> <texture name="notify_next.png" preload="true" /> <texture name="notify_box_icon.tga" /> + <texture name="pixiesmall.j2c" use_mips="true" /> + <texture name="script_error.j2c" use_mips="true" /> + <texture name="silhouette.j2c" use_mips="true" /> + <texture name="foot_shadow.j2c" use_mips="true" /> + <texture name="cloud-particle.j2c" use_mips="true" /> + + <texture name="status_no_build.tga" /> + <texture name="status_voice.tga" /> + <texture name="status_no_fly.tga" /> + <texture name="status_health.tga" /> + <texture name="status_no_push.tga" /> + <texture name="status_no_scripts.tga" /> + <texture name="icn_active-speakers-dot-lvl0.tga" /> <texture name="icn_active-speakers-dot-lvl1.tga" /> <texture name="icn_active-speakers-dot-lvl2.tga" /> diff --git a/indra/newview/skins/default/xui/de/floater_buy_currency.xml b/indra/newview/skins/default/xui/de/floater_buy_currency.xml index c320e796c2..3c336cc40b 100644 --- a/indra/newview/skins/default/xui/de/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/de/floater_buy_currency.xml @@ -46,7 +46,7 @@ [AMT] L$ </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE payment method] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=de-DE exchange rate] + [http://www.secondlife.com/ payment method] | [http://www.secondlife.com/ currency] | [http://www.secondlife.com exchange rate] </text> <text name="exchange_rate_note"> Geben Sie den Betrag erneut ein, um die aktuellste Umtauschrate anzuzeigen. diff --git a/indra/newview/skins/default/xui/de/floater_help_browser.xml b/indra/newview/skins/default/xui/de/floater_help_browser.xml index 2344d6f412..53bddcced1 100644 --- a/indra/newview/skins/default/xui/de/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/de/floater_help_browser.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="floater_help_browser" title="HILFE-BROWSER"> <floater.string name="home_page_url"> - http://de.secondlife.com + http://www.secondlife.com </floater.string> <floater.string name="support_page_url"> - http://de.secondlife.com/support + http://support.secondlife.com </floater.string> <layout_stack name="stack1"> <layout_panel name="external_controls"> diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index e93a38f187..809ac33e15 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -166,7 +166,7 @@ <string name="TooltipSLAPP"> Anklicken, um Befehl secondlife:// auszuführen </string> - <string name="CurrentURL" value=" CurrentURL: [CurrentURL]"/> + <string name="CurrentURL" value="CurrentURL: [CurrentURL]"/> <string name="SLurlLabelTeleport"> Teleportieren nach </string> @@ -821,46 +821,46 @@ <string name="InventoryNoTexture"> Sie haben keine Kopie dieser Textur in Ihrem Inventar. </string> - <string name="no_transfer" value=" (kein Transferieren)"/> - <string name="no_modify" value=" (kein Bearbeiten)"/> - <string name="no_copy" value=" (kein Kopieren)"/> - <string name="worn" value=" (getragen)"/> - <string name="link" value=" (Link)"/> - <string name="broken_link" value=" (unvollständiger_Link)"/> + <string name="no_transfer" value="(kein Transferieren)"/> + <string name="no_modify" value="(kein Bearbeiten)"/> + <string name="no_copy" value="(kein Kopieren)"/> + <string name="worn" value="(getragen)"/> + <string name="link" value="(Link)"/> + <string name="broken_link" value="(unvollständiger_Link)"/> <string name="LoadingContents"> Inhalte werden geladen... </string> <string name="NoContents"> Keine Inhalte </string> - <string name="WornOnAttachmentPoint" value=" (getragen am [ATTACHMENT_POINT])"/> + <string name="WornOnAttachmentPoint" value="(getragen am [ATTACHMENT_POINT])"/> <string name="PermYes"> Ja </string> <string name="PermNo"> Nein </string> - <string name="Chat" value=" Chat:"/> - <string name="Sound" value=" Sound:"/> - <string name="Wait" value=" --- Warten:"/> - <string name="AnimFlagStop" value=" Animation stoppen:"/> - <string name="AnimFlagStart" value=" Animation starten:"/> - <string name="Wave" value=" Winken"/> - <string name="HelloAvatar" value=" Hallo Avatar!"/> - <string name="ViewAllGestures" value=" Alle anzeigen >>"/> - <string name="Animations" value=" Animationen,"/> - <string name="Calling Cards" value=" Visitenkarten,"/> - <string name="Clothing" value=" Kleidung,"/> - <string name="Gestures" value=" Gesten,"/> - <string name="Landmarks" value=" Landmarken,"/> - <string name="Notecards" value=" Notizkarten,"/> - <string name="Objects" value=" Objekte,"/> - <string name="Scripts" value=" Skripts,"/> - <string name="Sounds" value=" Sounds,"/> - <string name="Textures" value=" Texturen,"/> - <string name="Snapshots" value=" Fotos,"/> - <string name="No Filters" value="Nein "/> - <string name="Since Logoff" value=" - Seit Abmeldung"/> + <string name="Chat" value="Chat:"/> + <string name="Sound" value="Sound:"/> + <string name="Wait" value="--- Warten:"/> + <string name="AnimFlagStop" value="Animation stoppen:"/> + <string name="AnimFlagStart" value="Animation starten:"/> + <string name="Wave" value="Winken"/> + <string name="HelloAvatar" value="Hallo Avatar!"/> + <string name="ViewAllGestures" value="Alle anzeigen >>"/> + <string name="Animations" value="Animationen,"/> + <string name="Calling Cards" value="Visitenkarten,"/> + <string name="Clothing" value="Kleidung,"/> + <string name="Gestures" value="Gesten,"/> + <string name="Landmarks" value="Landmarken,"/> + <string name="Notecards" value="Notizkarten,"/> + <string name="Objects" value="Objekte,"/> + <string name="Scripts" value="Skripts,"/> + <string name="Sounds" value="Sounds,"/> + <string name="Textures" value="Texturen,"/> + <string name="Snapshots" value="Fotos,"/> + <string name="No Filters" value="Nein"/> + <string name="Since Logoff" value="- Seit Abmeldung"/> <string name="InvFolder My Inventory"> Mein Inventar </string> @@ -1239,13 +1239,13 @@ <string name="GroupsNone"> keine </string> - <string name="Group" value=" (Gruppe)"/> + <string name="Group" value="(Gruppe)"/> <string name="Unknown"> (unbekannt) </string> - <string name="SummaryForTheWeek" value="Zusammenfassung für diese Woche, beginnend am "/> - <string name="NextStipendDay" value="Der nächste Stipendium-Tag ist "/> - <string name="GroupIndividualShare" value=" Gruppenanteil Einzelanteil"/> + <string name="SummaryForTheWeek" value="Zusammenfassung für diese Woche, beginnend am"/> + <string name="NextStipendDay" value="Der nächste Stipendium-Tag ist"/> + <string name="GroupIndividualShare" value="Gruppenanteil Einzelanteil"/> <string name="Balance"> Kontostand </string> @@ -1324,8 +1324,8 @@ <string name="covenant_last_modified"> Zuletzt geändert: </string> - <string name="none_text" value=" (keiner)"/> - <string name="never_text" value=" (nie)"/> + <string name="none_text" value="(keiner)"/> + <string name="never_text" value="(nie)"/> <string name="GroupOwned"> In Gruppenbesitz </string> @@ -1616,7 +1616,7 @@ Falls der Fehler dann weiterhin auftritt, müssen Sie [APP_NAME] von Ihrem Syste Unbehebbarer Fehler </string> <string name="MBRequiresAltiVec"> - [APP_NAME] erfordert einen Prozessor mit AltiVec (G4 oder später). + [APP_NAME] erfordert einen Prozessor mit AltiVec (G4 oder später). </string> <string name="MBAlreadyRunning"> [APP_NAME] läuft bereits. diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 9806f45bc4..82ed1a7d7f 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -112,7 +112,7 @@ Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number word_wrap="true"> Second Life is brought to you by Philip, Tessa, Andrew, Cory, James, Ben, Char, Charlie, Colin, Dan, Daniel, Doug, Eric, Hamlet, Haney, Eve, Hunter, Ian, Jeff, Jennifer, Jim, John, Lee, Mark, Peter, Phoenix, Richard, Robin, Xenon, Steve, Tanya, Eddie, Avi, Frank, Bruce, Aaron, Alice, Bob, Debra, Eileen, Helen, Janet, Louie, Leviathania, Stefan, Ray, Kevin, Tom, Mikeb, MikeT, Burgess, Elena, Tracy, Bill, Todd, Ryan, Zach, Sarah, Nova, Tim, Stephanie, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Magellan, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Ventrella, Jack, Vektor, Iris, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Altruima, Jesse, Teeny, Monroe, Icculus, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Satoko, Yuko, Makiko, Thomas, Harry, Seth, Alexei, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, beez, Milo, Hermia, Red, Thrax, Joe, Sally, Magenta, Mogura, Paul, Jose, Rejean, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Jean, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, dustin, George, Del, Matthew, Cat, Jacqui, Lightfoot, Adrian, Viola, Alfred, Noel, Irfan, Sunil, Yool, Rika, Jane, Xtreme, Frontier, a2, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Gulliver, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Anthony, Jeremy, JP, Jake, Maurice, Madhavi, Leopard, Kyle, Joon, Kari, Bert, Belinda, Jon, Kristi, Bridie, Pramod, KJ, Socrates, Maria, Ivan, Aric, Yamasaki, Adreanne, Jay, MitchK, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Rohn, Colossus, Zen, BigPapi, Brad, Pastrami, Kurz, Mani, Neuro, Jaime, MJ, Rowan, Sgt, Elvis, Gecko, Samuel, Sardonyx, Leo, Bryan, Niko, Soft, Poppy, Rachel, Aki, Angelo, Banzai, Alexa, Sue, CeeLo, Bender, CG, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Heidy, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Winnie, Stella, Milton, Rothman, Niall, Marin, Allison, Katie, Dawn, Katt, Dusty, Kalpana, Judy, Andrea, Ambroff, Infinity, Gail, Rico, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Vidtuts, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Austin, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Yang, T, Simone, Maestro, Scott, Charlene, Quixote, Amanda, Susan, Zed, Anne, Enkidu, Esbee, Joroan, Katelin, Roxie, Tay, Scarlet, Kevin, Johnny, Wolfgang, Andren, Bob, Howard, Merov, Rand, Ray, Michon, Newell, Galen, Dessie, Les and many others. -Thank you to the following Residents for helping to ensure that this is the best version yet: (in progress) +Thank you to the following residents for helping to ensure that this is the best version yet: (in progress) diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 900f4c5956..33fdd923ad 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1036,7 +1036,7 @@ Leyla Linden </text> name="Autoreturn" top="164" width="294"> - Autoreturn other Residents' objects (minutes, 0 for off): + Autoreturn other residents' objects (minutes, 0 for off): </text> <line_editor border_style="line" @@ -1175,7 +1175,7 @@ Only large parcels can be listed in search. name="allow_label" top="10" width="278"> - Allow other Residents to: + Allow other residents to: </text> <check_box height="16" @@ -1917,7 +1917,7 @@ Only large parcels can be listed in search. layout="topleft" left_delta="0" name="limit_payment" - tool_tip="Ban unidentified Residents." + tool_tip="Ban unidentified residents." top_pad="4" width="278" /> <check_box @@ -1927,7 +1927,7 @@ Only large parcels can be listed in search. layout="topleft" left_delta="0" name="limit_age_verified" - tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information." + tool_tip="Ban residents who have not verified their age. See the [SUPPORT_SITE] for more information." top_pad="4" width="278" /> <check_box diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index d202bf1b9f..86229c6691 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -107,7 +107,7 @@ height="16" layout="topleft" top_delta="0" - left="217" + left="242" name="currency_label" width="15"> L$ @@ -123,7 +123,7 @@ label="L$" left_pad="3" name="currency_amt" - width="85"> + width="60"> 1234 </line_editor> <text diff --git a/indra/newview/skins/default/xui/en/floater_customize.xml b/indra/newview/skins/default/xui/en/floater_customize.xml index ddc0d9af72..0dc7d62b19 100644 --- a/indra/newview/skins/default/xui/en/floater_customize.xml +++ b/indra/newview/skins/default/xui/en/floater_customize.xml @@ -260,9 +260,10 @@ left="10" name="not worn instructions" top="31" - word_wrap="true" width="373"> - Put on a new shape by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new shape by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -273,7 +274,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -300,7 +300,7 @@ left="10" name="Create New" top="104" - width="160" /> + width="140" /> <button follows="right|bottom" height="23" @@ -463,9 +463,10 @@ left="10" name="not worn instructions" top="31" - word_wrap="true" width="373"> - Put on a new skin by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new skin by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -476,7 +477,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -542,7 +542,7 @@ left_delta="0" name="Create New" top_delta="-249" - width="160" /> + width="120" /> <button follows="right|bottom" height="23" @@ -713,9 +713,10 @@ left="10" name="not worn instructions" top="31" - word_wrap="true" width="373"> - Put on a new hair by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new hair by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -726,7 +727,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -765,7 +765,7 @@ left_delta="0" name="Create New" top_delta="-89" - width="160" /> + width="120" /> <button follows="right|bottom" height="23" @@ -898,9 +898,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on a new set of eyes by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new eyes by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -911,7 +912,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -950,7 +950,7 @@ left_delta="0" name="Create New" top_delta="39" - width="160" /> + width="120" /> <button follows="right|bottom" height="23" @@ -1056,7 +1056,7 @@ left_delta="0" name="Create New" top_delta="-41" - width="160" /> + width="120" /> <button follows="left|top" height="23" @@ -1170,9 +1170,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on a new shirt by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new shirt by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -1183,7 +1184,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1262,7 +1262,7 @@ left_delta="0" name="Create New" top_delta="-41" - width="160" /> + width="120" /> <button follows="left|top" height="23" @@ -1376,9 +1376,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on new pants by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new pants by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -1389,7 +1390,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1509,9 +1509,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on a new pair of shoes by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new shoes by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -1522,7 +1523,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1572,7 +1572,7 @@ left_delta="0" name="Create New" top_delta="-41" - width="160" /> + width="120" /> <button follows="left|top" height="23" @@ -1715,9 +1715,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on new socks by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new socks by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -1728,7 +1729,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1778,7 +1778,7 @@ left_delta="0" name="Create New" top_delta="-41" - width="160" /> + width="120" /> <button follows="left|top" height="23" @@ -1921,9 +1921,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on a new jacket by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new jacket by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -1934,7 +1935,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1996,7 +1996,7 @@ left_delta="0" name="Create New" top_delta="-121" - width="160" /> + width="140" /> <button follows="left|top" height="23" @@ -2139,9 +2139,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on new gloves by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new gloves by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -2152,7 +2153,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -2202,7 +2202,7 @@ left_delta="0" name="Create New" top_delta="-41" - width="160" /> + width="130" /> <button follows="left|top" height="23" @@ -2345,9 +2345,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on a new undershirt by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new undershirt by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -2358,7 +2359,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -2551,9 +2551,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on new underpants by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new underpants by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -2564,7 +2565,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -2757,9 +2757,10 @@ left_delta="0" name="not worn instructions" top_pad="8" - word_wrap="true" width="373"> - Put on a new skirt by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new skirt by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -2770,7 +2771,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -2820,7 +2820,7 @@ left_delta="0" name="Create New" top_delta="-41" - width="160" /> + width="120" /> <button follows="left|top" height="23" @@ -2962,10 +2962,11 @@ layout="topleft" left_delta="-2" name="not worn instructions" - top_pad="8" - word_wrap="true" + top_delta="2" width="373"> - Put on a new alpha mask by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new alpha mask by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -2976,7 +2977,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -3108,7 +3108,7 @@ left="8" name="Create New" top="104" - width="160" /> + width="120" /> <button follows="left|top" height="23" @@ -3250,10 +3250,11 @@ layout="topleft" left_delta="-2" name="not worn instructions" - top_pad="8" - word_wrap="true" + top_delta="2" width="373"> - Put on a new tattoo by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. + Put on a new tattoo by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. </text> <text type="string" @@ -3264,7 +3265,6 @@ left_delta="0" name="no modify instructions" top_delta="0" - word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -3327,7 +3327,7 @@ left_delta="0" name="Create New" top_delta="-121" - width="160" /> + width="120" /> <button follows="left|top" height="23" diff --git a/indra/newview/skins/default/xui/en/floater_god_tools.xml b/indra/newview/skins/default/xui/en/floater_god_tools.xml index 0fac6cd5f1..b01c0edc8b 100644 --- a/indra/newview/skins/default/xui/en/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_god_tools.xml @@ -123,7 +123,7 @@ layout="topleft" left_delta="0" name="check reset home" - tool_tip="When Resident teleports out, reset their home to the destination position." + tool_tip="When resident teleports out, reset their home to the destination position." top_pad="4" width="180"> <check_box.commit_callback diff --git a/indra/newview/skins/default/xui/en/floater_im.xml b/indra/newview/skins/default/xui/en/floater_im.xml index a21242ffe1..92a6111759 100644 --- a/indra/newview/skins/default/xui/en/floater_im.xml +++ b/indra/newview/skins/default/xui/en/floater_im.xml @@ -26,7 +26,7 @@ </multi_floater.string> <multi_floater.string name="muted_message"> - You have blocked this Resident. Sending a message will automatically unblock them. + You have blocked this resident. Sending a message will automatically unblock them. </multi_floater.string> <multi_floater.string name="generic_request_error"> diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml index ae686d9ab7..920f0c909a 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -4,8 +4,8 @@ border_drop_shadow_visible="false" drop_shadow_visible="false" border="false" - bg_opaque_image="Window_Foreground" - bg_alpha_image="Window_Background" + bg_opaque_image="Inspector_Background" + bg_alpha_image="Toast_Background" bg_alpha_color="0 0 0 0" legacy_header_height="18" can_minimize="true" diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index aa219b9615..f1a75bfcb4 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -201,11 +201,11 @@ name="Age__Age_play" value="31" /> <combo_box.item - label="Age > Adult Resident on Teen Second Life" + label="Age > Adult resident on Teen Second Life" name="Age__Adult_resident_on_Teen_Second_Life" value="32" /> <combo_box.item - label="Age > Underage Resident outside of Teen Second Life" + label="Age > Underage resident outside of Teen Second Life" name="Age__Underage_resident_outside_of_Teen_Second_Life" value="33" /> <combo_box.item diff --git a/indra/newview/skins/default/xui/en/floater_select_key.xml b/indra/newview/skins/default/xui/en/floater_select_key.xml index 4e89df5a73..93aa1f0e31 100644 --- a/indra/newview/skins/default/xui/en/floater_select_key.xml +++ b/indra/newview/skins/default/xui/en/floater_select_key.xml @@ -15,12 +15,13 @@ follows="left|top" height="30" layout="topleft" - left="30" + left="10" name="Save item as:" top="25" word_wrap="true" - width="180"> - Press a key to set your Speak button trigger. + width="220"> + Press a key to set your +Speak button trigger. </text> <button height="23" @@ -29,6 +30,5 @@ layout="topleft" right="-10" name="Cancel" - top_pad="8" width="100" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_top_objects.xml b/indra/newview/skins/default/xui/en/floater_top_objects.xml index b06c6dc215..68bb500c78 100644 --- a/indra/newview/skins/default/xui/en/floater_top_objects.xml +++ b/indra/newview/skins/default/xui/en/floater_top_objects.xml @@ -9,7 +9,7 @@ name="top_objects" help_topic="top_objects" title="Top Objects" - width="800"> + width="550"> <floater.string name="top_scripts_title"> Top Scripts @@ -64,7 +64,7 @@ multi_select="true" name="objects_list" top_delta="17" - width="780"> + width="530"> <scroll_list.columns label="Score" name="score" @@ -84,15 +84,11 @@ <scroll_list.columns label="Time" name="time" - width="150" /> + width="100" /> <scroll_list.columns label="Mono Time" name="mono_time" - width="100" /> - <scroll_list.columns - label="URLs" - name="URLs" - width="100" /> + width="55" /> <scroll_list.commit_callback function="TopObjects.CommitObjectsList" /> </scroll_list> @@ -116,7 +112,7 @@ left_pad="3" name="id_editor" top_delta="-3" - width="575" /> + width="325" /> <button follows="bottom|right" height="23" @@ -148,7 +144,7 @@ left_pad="3" name="object_name_editor" top_delta="-3" - width="575" /> + width="325" /> <button follows="bottom|right" height="23" @@ -180,7 +176,7 @@ left_pad="3" name="owner_name_editor" top_delta="-3" - width="575" /> + width="325" /> <button follows="bottom|right" height="23" @@ -194,7 +190,7 @@ function="TopObjects.GetByOwnerName" /> </button> <button - follows="bottom|right" + follows="top|left" height="22" image_overlay="Refresh_Off" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml index 5e168fe4aa..1adb824e2a 100644 --- a/indra/newview/skins/default/xui/en/floater_tos.xml +++ b/indra/newview/skins/default/xui/en/floater_tos.xml @@ -49,9 +49,9 @@ left_delta="0" name="tos_heading" top_delta="-399" - word_wrap="true" width="552"> - Please read the following Terms of Service carefully. To continue logging in to [SECOND_LIFE], you must accept the agreement. + Please read the following Terms of Service carefully. To continue logging in to [SECOND_LIFE], +you must accept the agreement. </text> <web_browser follows="left|top" @@ -60,6 +60,6 @@ left_delta="0" name="tos_html" start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody text=%22000000%22%3E%3Ch2%3E Loading %3Ca%20target%3D%22_external%22%20href%3D%22http%3A//secondlife.com/app/tos/%22%3ETerms%20of%20Service%3C/a%3E...%3C/h2%3E %3C/body%3E %3C/html%3E" - top_delta="40" + top_delta="0" width="568" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index ae198d69a3..b9649e9c57 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -3,9 +3,9 @@ can_resize="true" can_minimize="true" can_close="false" - height="275" + height="270" layout="topleft" - min_height="100" + min_height="122" min_width="190" name="floater_voice_controls" help_topic="floater_voice_controls" @@ -33,23 +33,27 @@ name="no_one_near"> No one near has voice enabled </string> - <layout_stack - clip="false" - follows="all" - height="262" + <string + name="max_visible_items"> + 5 + </string> + <panel + bevel_style="out" + border="true" + follows="left|right|top" + height="62" + layout="topleft" + left="0" + name="control_panel" + top="0" + width="282"> + <panel + height="18" + follows="top|left|right" layout="topleft" left="10" - mouse_opaque="false" - name="my_call_stack" - orientation="vertical" + name="my_panel" width="263"> - <layout_panel - follows="top|left|right" - user_resize="false" - auto_resize="false" - layout="topleft" - height="26" - name="my_panel"> <avatar_icon enabled="false" follows="left|top" @@ -75,57 +79,92 @@ <output_monitor auto_update="true" draw_border="false" - follows="top|right" + follows="right" height="16" layout="topleft" name="speaking_indicator" - left_pad="5" + right="-1" + top="2" visible="true" width="20" /> - </layout_panel> + </panel> + <layout_stack + border_size="0" + clip="false" + follows="all" + height="28" + layout="topleft" + left="10" + mouse_opaque="false" + name="leave_call_stack" + orientation="horizontal" + top_pad="5" + width="263"> + <layout_panel + auto_resize="true" + follows="left|right" + height="26" + layout="topleft" + min_height="23" + min_width="5" + mouse_opaque="false" + name="left_anchor" + width="80"/> <layout_panel auto_resize="false" - user_resize="false" - follows="top|left" + follows="left|right" height="26" - visible="true" layout="topleft" + mouse_opaque="false" + min_height="24" + min_width="100" name="leave_call_btn_panel" width="100"> <button - follows="right|top" - height="23" - top_pad="0" + follows="left|right" + height="24" label="Leave Call" + left="0" name="leave_call_btn" + top="0" width="100" /> </layout_panel> - <layout_panel - follows="all" - layout="topleft" - left="2" - top_pad="0" - height="205" - name="callers_panel" - user_resize="false" - width="280"> - <avatar_list - follows="all" - height="205" - ignore_online_status="true" - layout="topleft" - multi_select="true" - name="speakers_list" - width="280" /> - <panel - filename="panel_avatar_list_item.xml" - follows="left|right|top" - height="24" + <layout_panel + auto_resize="true" + follows="left|right" + height="26" layout="topleft" - left="0" - name="non_avatar_caller" - top="10" - width="276" /> - </layout_panel> - </layout_stack> + mouse_opaque="false" + min_height="24" + min_width="5" + name="right_anchor" + width="80"/> + </layout_stack> + </panel> + <avatar_list + follows="all" + height="197" + ignore_online_status="true" + layout="topleft" + left="0" + multi_select="true" + name="speakers_list" + width="282" /> + <panel + filename="panel_avatar_list_item.xml" + follows="left|right|top" + height="24" + layout="topleft" + left="0" + name="non_avatar_caller" + top="70" + width="282" /> + <view_border + bevel_style="out" + follows="left|top|right|bottom" + height="206" + layout="topleft" + left="0" + top="63" + width="282" /> </floater> diff --git a/indra/newview/skins/default/xui/en/inspect_toast.xml b/indra/newview/skins/default/xui/en/inspect_toast.xml deleted file mode 100644 index 0221397a8c..0000000000 --- a/indra/newview/skins/default/xui/en/inspect_toast.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<!-- - Not can_close / no title to avoid window chrome - Single instance - only have one at a time, recycle it each spawn ---> -<floater - legacy_header_height="25" - bevel_style="in" - bg_opaque_image="Inspector_Background" - can_close="false" - can_minimize="false" - height="148" - layout="topleft" - name="inspect_toast" - single_instance="true" - sound_flags="0" - visible="true" - width="228"> -</floater> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 45100eb1ff..fa7e3e86a3 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -198,6 +198,40 @@ function="Floater.Toggle" parameter="nearby_media" /> </menu_item_check> + <!--menu_item_check + label="Block List" + layout="topleft" + name="Mute List"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="mute" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="mute" /> + </menu_item_check--> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="(Legacy) Communicate" + layout="topleft" + name="Instant Message" + shortcut="control|T"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="communicate" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="communicate" /> + </menu_item_check> + <menu_item_call + label="(Temp) Media Remote Ctrl" + layout="topleft" + name="Preferences" + shortcut="control|alt|M"> + <menu_item_call.on_click + function="Floater.Toggle" + parameter="media_remote_ctrl" /> + </menu_item_call> </menu> <menu label="World" @@ -249,7 +283,7 @@ </menu_item_call> <menu create_jump_keys="true" - label="Place Profile" + label="About This Place" layout="topleft" name="Land" tear_off="true"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 5ec8018eae..eb82dd4a7f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -246,7 +246,7 @@ Save all changes to clothing/body parts? icon="alertmodal.tga" name="GrantModifyRights" type="alertmodal"> -Granting modify rights to another Resident allows them to change, delete or take ANY objects you may have in-world. Be VERY careful when handing out this permission. +Granting modify rights to another resident allows them to change, delete or take ANY objects you may have in-world. Be VERY careful when handing out this permission. Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? <usetemplate name="okcancelbuttons" @@ -258,7 +258,7 @@ Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? icon="alertmodal.tga" name="GrantModifyRightsMultiple" type="alertmodal"> -Granting modify rights to another Resident allows them to change ANY objects you may have in-world. Be VERY careful when handing out this permission. +Granting modify rights to another resident allows them to change ANY objects you may have in-world. Be VERY careful when handing out this permission. Do you want to grant modify rights for the selected Residents? <usetemplate name="okcancelbuttons" @@ -1597,8 +1597,7 @@ Unable to force land ownership because selection spans multiple regions. Please icon="alertmodal.tga" name="ForceOwnerAuctionWarning" type="alertmodal"> -This parcel is up for auction. Forcing ownership will cancel the auction and potentially make some Residents unhappy if bidding has begun. -Force ownership? +This parcel is up for auction. Forcing ownership will cancel the auction and potentially make some residents unhappy if bidding has begun. Force ownership? <usetemplate name="okcancelbuttons" notext="Cancel" @@ -2916,16 +2915,6 @@ You have reached your maximum number of groups. Please leave another group befor yestext="Join"/> </notification> - <notification - icon="alert.tga" - name="JoinedTooManyGroups" - type="alert"> -You have reached your maximum number of groups. Please leave some group before joining or creating a new one. - <usetemplate - name="okbutton" - yestext="OK"/> - </notification> - <notification icon="alert.tga" name="KickUser" @@ -3564,7 +3553,7 @@ Type a short announcement which will be sent to everyone in this region. The maturity rating for this region has been updated. It may take some time for the change to be reflected on the map. -To enter Adult regions, Residents must be Account Verified, either by age-verification or payment-verification. +To enter Adult regions, residents must be Account Verified, either by age-verification or payment-verification. </notification> <notification @@ -4554,8 +4543,8 @@ Click on any landmark to select it, then click 'Teleport' at the botto icon="notifytip.tga" name="TeleportToPerson" type="notifytip"> -You can contact Residents like '[NAME]' by opening the People panel on the right side of your screen. -Select the Resident from the list, then click 'IM' at the bottom of the panel. +You can contact residents like '[NAME]' by opening the People panel on the right side of your screen. +Select the resident from the list, then click 'IM' at the bottom of the panel. (You can also double-click on their name in the list, or right-click and choose 'IM'). </notification> @@ -4704,7 +4693,7 @@ The objects on the selected parcel of land that is owned by [FIRST] [LAST] have icon="notify.tga" name="OtherObjectsReturned2" type="notify"> -The objects on the selected parcel of land owned by the Resident '[NAME]' have been returned to their owner. +The objects on the selected parcel of land owned by the resident '[NAME]' have been returned to their owner. </notification> <notification @@ -4985,7 +4974,7 @@ No valid parcel could be found. icon="notify.tga" name="ObjectGiveItem" type="offer"> -An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you this [OBJECTTYPE]: +An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you [OBJECTTYPE]: [ITEM_SLURL] <form name="form"> <button @@ -5007,7 +4996,7 @@ An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you this [OBJEC icon="notify.tga" name="ObjectGiveItemUnknownUser" type="offer"> -An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you this [OBJECTTYPE]: +An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you [OBJECTTYPE]: [ITEM_SLURL] <form name="form"> <button @@ -5029,7 +5018,7 @@ An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you th icon="notify.tga" name="UserGiveItem" type="offer"> -[NAME_SLURL] has given you this [OBJECTTYPE]: +[NAME_SLURL] has given you [OBJECTTYPE]: [ITEM_SLURL] <form name="form"> <button @@ -5192,7 +5181,7 @@ An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you th name="OfferCallingCard" type="notify"> [FIRST] [LAST] is offering their calling card. -This will add a bookmark in your inventory so you can quickly IM this Resident. +This will add a bookmark in your inventory so you can quickly IM this resident. <form name="form"> <button index="0" diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml index 28a6995186..6c54532a3a 100644 --- a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml @@ -4,7 +4,7 @@ follows="all" height="215" name="panel_im_control_panel" - width="150"> + width="180"> <layout_stack mouse_opaque="false" border_size="0" @@ -16,16 +16,15 @@ name="vertical_stack" orientation="vertical" top="0" - width="147"> + width="177"> <layout_panel auto_resize="true" follows="top|left" height="130" layout="topleft" - left="0" min_height="0" mouse_opaque="false" - width="147" + width="180" top="0" name="speakers_list_panel" user_resize="false"> @@ -40,7 +39,7 @@ show_info_btn="false" show_profile_btn="false" show_speaking_indicator="false" - width="147" /> + width="180" /> </layout_panel> <layout_panel auto_resize="false" @@ -48,7 +47,7 @@ height="25" layout="topleft" min_height="25" - width="130" + width="160" name="call_btn_panel" user_resize="false" visible="false"> @@ -57,7 +56,7 @@ height="20" label="Call" name="call_btn" - width="130" + width="160" top="5" /> </layout_panel> <layout_panel @@ -66,7 +65,7 @@ height="25" layout="topleft" min_height="25" - width="130" + width="160" name="end_call_btn_panel" user_resize="false" visible="false"> @@ -83,7 +82,7 @@ height="25" layout="topleft" min_height="25" - width="130" + width="160" name="voice_ctrls_btn_panel" user_resize="false" visible="false"> diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index 615ade99a2..45f9d9c7b6 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -58,13 +58,13 @@ top="6" use_ellipses="true" value="Unknown" - width="180" /> + width="182" /> <text follows="right" font="SansSerifSmall" height="15" layout="topleft" - left_pad="5" + left_pad="8" name="last_interaction" text_color="LtGray_50" value="0s" @@ -75,7 +75,7 @@ draw_border="false" height="16" layout="topleft" - left_pad="5" + left_pad="0" mouse_opaque="true" name="speaking_indicator" visible="true" @@ -98,7 +98,6 @@ left_pad="5" right="-3" name="profile_btn" - tool_tip="View profile" top_delta="-2" width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml index 39170b90ca..003e1baa7e 100644 --- a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml @@ -37,7 +37,7 @@ layout="topleft" left="5" name="blocked" - tool_tip="List of currently blocked Residents" + tool_tip="List of currently blocked residents" top="30" width="270" /> <button @@ -47,7 +47,7 @@ layout="topleft" left_delta="0" name="Block resident..." - tool_tip="Pick a Resident to block" + tool_tip="Pick a resident to block" top_pad="4" width="210"> <button.commit_callback @@ -74,7 +74,7 @@ layout="topleft" left_delta="0" name="Unblock" - tool_tip="Remove Resident or object from blocked list" + tool_tip="Remove resident or object from blocked list" top_pad="4" width="210" > <button.commit_callback diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 4b39210f30..aeaa049f1f 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -33,10 +33,10 @@ height="10" image_name="spacer24.tga" layout="topleft" - min_width="2" + min_width="4" left="0" top="0" - width="2" /> + width="4" /> <layout_panel mouse_opaque="false" auto_resize="false" @@ -71,7 +71,7 @@ layout="topleft" left="0" name="talk" - top="5" + top="4" width="100"> <show_button> <show_button.init_callback @@ -103,20 +103,20 @@ min_width="52" name="gesture_panel" user_resize="false"> - <gesture_combo_list + <gesture_combo_box follows="left|right" height="23" label="Gesture" layout="topleft" name="Gesture" left="0" - top="5" + top="4" width="82" tool_tip="Shows/hides gestures"> - <gesture_combo_list.combo_button + <gesture_combo_box.drop_down_button pad_right="10" use_ellipses="true" /> - </gesture_combo_list> + </gesture_combo_box> </layout_panel> <icon auto_resize="false" @@ -153,7 +153,7 @@ layout="topleft" name="movement_btn" tool_tip="Shows/hides movement controls" - top="5" + top="4" width="80"> <button.init_callback function="Button.SetDockableFloaterToggle" @@ -195,7 +195,7 @@ layout="topleft" left="0" tool_tip="Shows/hides camera controls" - top="5" + top="4" name="camera_btn" width="80"> <button.init_callback @@ -235,7 +235,7 @@ layout="topleft" name="snapshots" width="36" - top="5" + top="4" is_toggle="true" image_overlay="Snapshot_Off" tool_tip="Take snapshot"> @@ -338,7 +338,7 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly. layout="topleft" left="0" name="im_well" - top="5" + top="4" width="35"> <!-- Emulate 4 states of button by background images, see details in EXT-3147. The same should be for notification_well button @@ -362,6 +362,8 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well label_color="Black" left="0" name="Unread IM messages" + pad_left="0" + pad_right="0" tool_tip="Conversations" width="35" > <button.init_callback @@ -379,8 +381,8 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well top="0" left_pad="3" name="notification_well_panel" - width="40" - min_width="40" + width="35" + min_width="35" user_resize="false"> <chiclet_notification flash_period="0.25" @@ -390,7 +392,7 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well left="0" max_displayed_count="99" name="notification_well" - top="5" + top="4" width="35"> <button bottom_pad="3" @@ -403,11 +405,11 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well follows="right" flash_color="ChicletFlashColor" label_color="Black" - left="0" + left="5" name="Unread" image_overlay="Notices_Unread" image_overlay_alignment="center" - pad_right="15" + pad_right="5" tool_tip="Notifications" width="35" > <button.init_callback @@ -416,5 +418,16 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well </button> </chiclet_notification> </layout_panel> + <icon + auto_resize="false" + color="0 0 0 0" + follows="left|right" + height="10" + image_name="spacer24.tga" + layout="topleft" + min_width="4" + right="-1" + top="0" + width="4"/> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index 7769189219..d6de5af32d 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -38,27 +38,28 @@ <scroll_container color="DkGray2" follows="all" - height="500" + height="510" layout="topleft" left="10" top_pad="10" name="profile_scroll" + reserve_scroll_corner="false" opaque="true" width="313"> <panel name="scroll_content_panel" - follows="left|top|right" + follows="left|top" min_height="300" layout="topleft" top="0" background_visible="false" - height="500" + height="510" left="0" - width="285"> + width="295"> <texture_picker follows="left|top|right" height="197" - width="280" + width="290" layout="topleft" top="20" left="10" @@ -76,7 +77,7 @@ <text type="string" length="1" - follows="left|top|right" + follows="left|top" height="15" font="SansSerifSmall" font.style="BOLD" @@ -85,7 +86,7 @@ top="215" name="Name:" text_color="white" - width="280"> + width="290"> Title: </text> <line_editor @@ -98,11 +99,11 @@ max_length="63" name="pick_name" text_color="black" - width="280" /> + width="290" /> <text type="string" length="1" - follows="left|top|right" + follows="left|top" height="15" font="SansSerifSmall" font.style="BOLD" @@ -111,13 +112,13 @@ top_pad="20" name="description_label" text_color="white" - width="280"> + width="290"> Description: </text> <text_editor follows="left|top|right" height="100" - width="280" + width="290" hide_scrollbar="false" layout="topleft" left="10" @@ -131,26 +132,27 @@ length="1" font="SansSerifSmall" font.style="BOLD" - follows="left|top|right" + follows="left|top" height="15" layout="topleft" left="10" name="location_label" text_color="white" top_pad="20" - width="280"> + width="290"> Location: </text> <text type="string" length="1" - follows="left|top|right" + follows="left|top" height="50" layout="topleft" left="10" name="pick_location" + right="-10" top_pad="2" - width="280" + width="290" word_wrap="true"> loading... </text> diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index 172cf18fc4..be3c0bbd96 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -301,13 +301,14 @@ left="10" name="partner_data_panel" width="285"> - <name_box + <text follows="left|top|right" height="30" layout="topleft" left="0" name="partner_text" top="0" + value="[FIRST] [LAST]" width="285" word_wrap="true" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_friends.xml b/indra/newview/skins/default/xui/en/panel_friends.xml index c315adb33e..ac731bcdf0 100644 --- a/indra/newview/skins/default/xui/en/panel_friends.xml +++ b/indra/newview/skins/default/xui/en/panel_friends.xml @@ -118,7 +118,7 @@ layout="topleft" left_delta="0" name="add_btn" - tool_tip="Offer friendship to a Resident" + tool_tip="Offer friendship to a resident" top_pad="13" width="80" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml index aa7d621e4c..4073ef158b 100644 --- a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml @@ -4,7 +4,7 @@ follows="all" height="238" name="panel_im_control_panel" - width="150"> + width="180"> <layout_stack mouse_opaque="false" border_size="0" @@ -16,7 +16,7 @@ name="vertical_stack" orientation="vertical" top="0" - width="145"> + width="175"> <layout_panel auto_resize="true" follows="top|left" @@ -24,7 +24,7 @@ layout="topleft" min_height="0" mouse_opaque="false" - width="145" + width="180" top="0" name="speakers_list_panel" user_resize="false"> @@ -39,7 +39,7 @@ show_info_btn="false" show_profile_btn="false" show_speaking_indicator="false" - width="145" /> + width="180" /> </layout_panel> <layout_panel auto_resize="false" @@ -47,7 +47,7 @@ height="28" layout="topleft" min_height="28" - width="130" + width="160" name="group_info_btn_panel" user_resize="false"> <button @@ -57,7 +57,7 @@ name="group_info_btn" use_ellipses="true" top="5" - width="130" /> + width="160" /> </layout_panel> <layout_panel auto_resize="false" @@ -65,7 +65,7 @@ height="28" layout="topleft" min_height="28" - width="130" + width="160" name="call_btn_panel" user_resize="false"> <button @@ -74,7 +74,7 @@ label="Call Group" name="call_btn" use_ellipses="true" - width="130" /> + width="160" /> </layout_panel> <layout_panel auto_resize="false" @@ -82,7 +82,7 @@ height="28" layout="topleft" min_height="28" - width="130" + width="160" name="end_call_btn_panel" user_resize="false" visible="false"> @@ -99,7 +99,7 @@ height="28" layout="topleft" min_height="28" - width="130" + width="160" name="voice_ctrls_btn_panel" user_resize="false" visible="false"> diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index 8188048821..c0db734f8c 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -216,28 +216,12 @@ background_visible="true" visible="false" width="65" />--> <button - follows="bottom|right" - label="Group Chat" - name="btn_chat" - right="-184" - left_pad="2" - height="22" - width="85" /> - <button - follows="bottom|right" - label="Group Call" - name="btn_call" - right="-97" - left_pad="2" - height="22" - width="85" /> - <button height="22" label="Save" label_selected="Save" name="btn_apply" left_pad="10" right="-10" - width="85" /> + width="100" /> </panel> </panel> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_group_invite.xml b/indra/newview/skins/default/xui/en/panel_group_invite.xml index 48083b7677..37578eae70 100644 --- a/indra/newview/skins/default/xui/en/panel_group_invite.xml +++ b/indra/newview/skins/default/xui/en/panel_group_invite.xml @@ -17,7 +17,7 @@ </panel.string> <panel.string name="already_in_group"> - Some Residents you chose are already in the group, and so were not sent an invitation. + Some avatars are already in group and were not invited. </panel.string> <text type="string" @@ -26,10 +26,11 @@ layout="topleft" left="7" name="help_text" - top="28" - word_wrap="true" + top="24" width="200"> - You can select multiple Residents to invite to your group. Click 'Open Resident Chooser' to start. + You can select multiple residents to +invite to your group. Click 'Open +Resident Chooser' to start. </text> <button height="20" @@ -47,7 +48,7 @@ left_delta="0" multi_select="true" name="invitee_list" - tool_tip="Hold the Ctrl key and click Resident names to multi-select" + tool_tip="Hold the Ctrl key and click resident names to multi-select" top_pad="4" width="200" /> <button @@ -56,7 +57,7 @@ layout="topleft" left_delta="0" name="remove_button" - tool_tip="Removes the Residents selected above from the invite list" + tool_tip="Removes residents selected above from the invite list" top_pad="4" width="200" /> <text @@ -67,7 +68,6 @@ left_delta="4" name="role_text" top_pad="5" - word_wrap="true" width="200"> Choose what Role to assign them to: </text> diff --git a/indra/newview/skins/default/xui/en/panel_group_list_item.xml b/indra/newview/skins/default/xui/en/panel_group_list_item.xml index c243d08b97..5f6b911620 100644 --- a/indra/newview/skins/default/xui/en/panel_group_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_group_list_item.xml @@ -65,7 +65,6 @@ left_pad="5" right="-3" name="profile_btn" - tool_tip="View profile" top_delta="-2" width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_notices.xml b/indra/newview/skins/default/xui/en/panel_group_notices.xml index 0d9c2c2162..e096715cee 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notices.xml @@ -136,7 +136,6 @@ Maximum 200 per group daily left_pad="3" max_length="63" name="create_subject" - prevalidate_callback="ascii" width="220" /> <text follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 6b3fb04549..a5bab3232c 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -210,18 +210,6 @@ including the Everyone and Owner Roles. Abilities allow Members in Roles to do specific things in this group. There's a broad variety of Abilities. </panel.string> - <panel.string - name="power_folder_icon"> - Inv_FolderClosed - </panel.string> - <panel.string - name="power_all_have_icon"> - Checkbox_On - </panel.string> - <panel.string - name="power_partial_icon"> - Checkbox_Off - </panel.string> <filter_editor layout="topleft" top="5" @@ -232,32 +220,23 @@ things in this group. There's a broad variety of Abilities. max_length="250" label="Filter Abilities" name="filter_input" /> - - <scroll_list - column_padding="0" - draw_stripes="true" - height="200" - follows="left|top" - layout="topleft" - left="0" - name="action_list" - search_column="2" - tool_tip="Select an Ability to view more details" - top_pad="5" - width="300"> - <scroll_list.columns - label="" - name="icon" - width="2" /> - <scroll_list.columns - label="" - name="checkbox" - width="20" /> - <scroll_list.columns - label="" - name="action" - width="270" /> - </scroll_list> + <scroll_list + column_padding="0" + draw_stripes="false" + follows="left|top" + height="200" + layout="topleft" + left="0" + multi_select="true" + name="action_list" + search_column="1" + tool_tip="Select an Ability to view more details" + top_pad="5" + width="300"> + <scroll_list.columns + name="action" + width="300" /> + </scroll_list> </panel> </tab_container> <panel diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index df942b1a26..e5df37e366 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -186,7 +186,6 @@ height="80"> <text follows="right|bottom" font="SansSerifSmall" -text_color="EmphasisColor" halign="right" height="16" top="12" diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml index 38e8b9844f..5217ab3571 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml @@ -30,7 +30,6 @@ (This page does not pass the specified whitelist) </text> <line_editor - max_length="1024" bottom_delta="-24" enabled="true" follows="left|top" @@ -73,15 +72,13 @@ Current Page: </text> <text - name="current_url" - max_length="1024" - use_ellipses="true" bottom_delta="-20" enabled="false" follows="left|top" font="SansSerif" height="20" left="10" + name="current_url" tool_tip="The current page for this media source" value="" width="340" /> diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index 27c1af1860..8327edfdd0 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -27,9 +27,6 @@ <string name="no_partner_text" value="None" /> - <string - name="no_group_text" - value="None" /> <string name="RegisterDateFormat"> [REG_DATE] ([AGE]) @@ -65,11 +62,10 @@ <panel layout="topleft" follows="left|top|right" - height="505" name="scroll_content_panel" top="0" left="0" - width="297"> + width="303"> <panel follows="left|top|right" height="117" @@ -77,7 +73,7 @@ left="10" name="second_life_image_panel" top="0" - width="297"> + width="300"> <texture_picker allow_no_texture="true" default_image_name="None" @@ -118,7 +114,7 @@ textbox.max_length="512" name="sl_description_edit" top_pad="-3" - width="181" + width="188" expanded_bg_visible="true" expanded_bg_color="DkGray"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. @@ -131,7 +127,7 @@ top_pad="10" left="10" name="first_life_image_panel" - width="297"> + width="300"> <texture_picker allow_no_texture="true" default_image_name="None" @@ -171,7 +167,7 @@ textbox.max_length="512" name="fl_description_edit" top_pad="-3" - width="181" + width="188" expanded_bg_visible="true" expanded_bg_color="DkGray"> Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. @@ -264,14 +260,14 @@ name="partner_data_panel" top_pad="0" width="300"> - <name_box + <text follows="left|top" height="10" layout="topleft" left="0" - link="true" name="partner_text" top="0" + value="[FIRST] [LAST]" width="300" word_wrap="true" /> </panel> @@ -316,7 +312,7 @@ left="0" mouse_opaque="false" name="add_friend" - tool_tip="Offer friendship to the Resident" + tool_tip="Offer friendship to the resident" top="5" width="80" /> <button diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 9ad99b1f13..e2884dbedc 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -47,7 +47,7 @@ left="10" name="back_btn" tool_tip="Go back to previous location" - top="2" + top="3" width="31" /> <button follows="left|top" @@ -92,6 +92,7 @@ width="20" /> --> </location_input> + <!-- <button --> <!-- follows="right|top" --> <!-- height="20" --> @@ -107,6 +108,7 @@ <!-- name="search_bg" --> <!-- top_delta="0" --> <!-- width="168" /> --> + <search_combo_box bevel_style="none" border_style="line" diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 2b361c0628..f09a0e03ed 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -27,7 +27,7 @@ max_length="512" name="chat_box" tool_tip="Press Enter to say, Ctrl+Enter to shout" - top="2" + top="1" width="283" /> <output_monitor auto_update="true" @@ -45,7 +45,7 @@ follows="right" is_toggle="true" width="20" - top="2" + top="1" layout="topleft" left_pad="4" image_disabled="ComboButton_UpOff" diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml index 45b64d5e26..73528b28ad 100644 --- a/indra/newview/skins/default/xui/en/panel_notes.xml +++ b/indra/newview/skins/default/xui/en/panel_notes.xml @@ -120,7 +120,7 @@ left="0" mouse_opaque="false" name="add_friend" - tool_tip="Offer friendship to the Resident" + tool_tip="Offer friendship to the resident" top="5" width="80" /> <button @@ -139,7 +139,7 @@ label="Call" layout="topleft" name="call" - tool_tip="Call this Resident" + tool_tip="Call this resident" left_pad="3" top="5" width="45" /> @@ -150,7 +150,7 @@ label="Map" layout="topleft" name="show_on_map_btn" - tool_tip="Show the Resident on the map" + tool_tip="Show the resident on the map" top="5" left_pad="3" width="45" /> diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 8a02637817..adf22f825f 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -106,7 +106,7 @@ background_visible="true" left_pad="5" name="add_friend_btn" top_delta="0" - tool_tip="Add selected Resident to your friends List" + tool_tip="Add selected resident to your friends List" width="18"> <commit_callback function="People.addFriend" /> @@ -192,7 +192,7 @@ background_visible="true" layout="topleft" left_pad="5" name="add_btn" - tool_tip="Offer friendship to a Resident" + tool_tip="Offer friendship to a resident" top_delta="0" width="18" /> <button @@ -327,7 +327,7 @@ background_visible="true" left_pad="5" name="add_friend_btn" top_delta="0" - tool_tip="Add selected Resident to your friends List" + tool_tip="Add selected resident to your friends List" width="18"> <commit_callback function="People.addFriend" /> @@ -350,7 +350,7 @@ background_visible="true" label="Profile" layout="topleft" name="view_profile_btn" - tool_tip="Show picture, groups, and other Residents information" + tool_tip="Show picture, groups, and other residents information" width="70" /> <button follows="bottom|left" @@ -370,7 +370,7 @@ background_visible="true" label="Call" layout="topleft" name="call_btn" - tool_tip="Call this Resident" + tool_tip="Call this resident" width="50" /> <button follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml index 9c7f38e688..f68202d287 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_info.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml @@ -40,30 +40,31 @@ left="10" top_pad="10" name="profile_scroll" + reserve_scroll_corner="false" width="313"> <panel name="scroll_content_panel" - follows="left|top|right" + follows="left|top" min_height="300" layout="topleft" top="0" background_visible="false" - height="400" + height="470" left="0" - width="285"> + width="295"> <texture_picker enabled="false" - follows="left|top|right" + follows="left|top" height="197" layout="topleft" left="10" name="pick_snapshot" top="20" - width="280" /> + width="290" /> <text follows="left|top|right" height="35" - width="280" + width="290" layout="topleft" font="SansSerifBig" font.style="BOLD" @@ -74,29 +75,23 @@ value="[name]" use_ellipses="true" /> <text - follows="left|top|right" + follows="left|top" height="25" layout="topleft" left="10" name="pick_location" - width="280" + width="290" word_wrap="true" value="[loading...]" /> - <text_editor - bg_readonly_color="DkGray2" - follows="all" - height="100" - width="280" - hide_scrollbar="false" + <text + follows="left|top|right" + height="280" layout="topleft" left="10" - top_pad="2" - max_length="1023" name="pick_desc" - read_only="true" - text_readonly_color="white" + width="290" value="[description]" - wrap="true" /> + word_wrap="true" /> </panel> </scroll_container> <panel diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 1e7acb566f..17651b8caa 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -2,6 +2,7 @@ <panel border="true" + background_visible="true" follows="left|top|right|bottom" height="408" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 22c75a595e..c98555735a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -260,7 +260,7 @@ width="200"> My effects: </text> - <text + <text type="string" length="1" follows="left|top" @@ -270,23 +270,16 @@ name="title_afk_text" width="190"> Away timeout: - </text> + </text> <color_swatch - can_apply_immediately="true" + control_name="EffectColor" follows="left|top" height="50" layout="topleft" left="50" name="effect_color_swatch" tool_tip="Click to open Color Picker" - width="38"> - <color_swatch.init_callback - function="Pref.getUIColor" - parameter="EffectColor" /> - <color_swatch.commit_callback - function="Pref.applyUIColor" - parameter="EffectColor" /> - </color_swatch> + width="38" /> <combo_box height="23" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index a0fcf59fc8..cc00abf5a0 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -378,7 +378,7 @@ layout="topleft" left_delta="250" name="DrawDistanceMeterText2" - top_delta="0" + top_delta="1" width="128"> m </text> @@ -395,7 +395,7 @@ left="216" max_val="8192" name="MaxParticleCount" - top_pad="7" + top_pad="6" width="262" /> <slider control_name="RenderGlowResolutionPow" diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index ab6384203f..075d9232b1 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -321,7 +321,6 @@ min_width="90"> <line_editor name="media_address_url" - max_length="1024" follows="top|left|right" height="22" top="0" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 597b6410cd..43947262ec 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -27,9 +27,6 @@ <string name="no_partner_text" value="None" /> - <string - name="no_group_text" - value="None" /> <string name="RegisterDateFormat"> [REG_DATE] ([AGE]) @@ -65,11 +62,10 @@ <panel layout="topleft" follows="left|top|right" - height="505" name="profile_scroll_panel" top="0" left="0" - width="297"> + width="303"> <panel follows="left|top|right" height="117" @@ -77,7 +73,7 @@ left="10" name="second_life_image_panel" top="0" - width="297"> + width="303"> <texture_picker allow_no_texture="true" default_image_name="None" @@ -121,7 +117,7 @@ top_pad="10" left="10" name="first_life_image_panel" - width="297"> + width="303"> <texture_picker allow_no_texture="true" default_image_name="None" @@ -244,14 +240,14 @@ name="partner_data_panel" top_pad="0" width="300"> - <name_box + <text follows="left|top" height="10" layout="topleft" left="0" - link="true" name="partner_text" top="0" + value="[FIRST] [LAST]" width="300" word_wrap="true" /> </panel> @@ -273,7 +269,7 @@ left="7" name="sl_groups" top_pad="0" - width="290" + width="298" expanded_bg_visible="true" expanded_bg_color="DkGray"> Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. Aenean viverra tulip moosetop. Slan de heelish marfnik tooplod. Sum sum to whop de wompam booster copm. @@ -296,7 +292,7 @@ left="0" mouse_opaque="false" name="add_friend" - tool_tip="Offer friendship to the Resident" + tool_tip="Offer friendship to the resident" top="5" width="80" /> <button @@ -315,7 +311,7 @@ label="Call" layout="topleft" name="call" - tool_tip="Call this Resident" + tool_tip="Call this resident" left_pad="3" top="5" width="45" /> @@ -326,7 +322,7 @@ label="Map" layout="topleft" name="show_on_map_btn" - tool_tip="Show the Resident on the map" + tool_tip="Show the resident on the map" top="5" left_pad="3" width="45" /> @@ -346,7 +342,7 @@ label="▼" layout="topleft" name="overflow_btn" - tool_tip="Pay money to or share inventory with the Resident" + tool_tip="Pay money to or share inventory with the resident" right="-1" top="5" left_pad="3" @@ -379,4 +375,4 @@ </layout_panel> </layout_stack> -</panel> +</panel> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_region_covenant.xml b/indra/newview/skins/default/xui/en/panel_region_covenant.xml index dc8f71c868..ff55090f16 100644 --- a/indra/newview/skins/default/xui/en/panel_region_covenant.xml +++ b/indra/newview/skins/default/xui/en/panel_region_covenant.xml @@ -135,8 +135,7 @@ left="120" name="covenant_help_text" top_pad="10" - word_wrap="true" - width="360"> + width="460"> Changes to the covenant will show on all parcels in the estate. </text> <text @@ -146,10 +145,9 @@ left_delta="0" name="covenant_instructions" top_pad="5" - word_wrap="true" - font.style="ITALIC" - width="360"> - Drag and drop a notecard to change the Covenant for this estate. + width="465"> + Drag and drop a notecard to change + the Covenant for this Estate. </text> <text diff --git a/indra/newview/skins/default/xui/en/panel_region_estate.xml b/indra/newview/skins/default/xui/en/panel_region_estate.xml index 3980eb86d3..ba39e88024 100644 --- a/indra/newview/skins/default/xui/en/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/en/panel_region_estate.xml @@ -19,9 +19,9 @@ left="10" name="estate_help_text" top="14" - word_wrap="true" - width="275"> - Changes to settings on this tab will affect all regions in the estate. + width="313"> + Changes to settings on this tab will affect all +regions in the estate. </text> <text type="string" @@ -138,7 +138,7 @@ name="Only Allow" top="250" width="278"> - Restrict Access to accounts verified by: + Restrict Access to Accounts Verified by: </text> <check_box follows="top|left" @@ -147,7 +147,7 @@ layout="topleft" left_delta="0" name="limit_payment" - tool_tip="Ban unidentified Residents" + tool_tip="Ban unidentified residents" top_pad="2" width="278" /> <check_box @@ -157,7 +157,7 @@ layout="topleft" left_delta="0" name="limit_age_verified" - tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information." + tool_tip="Ban residents who have not verified their age. See the [SUPPORT_SITE] for more information." top_pad="2" width="278" /> <check_box diff --git a/indra/newview/skins/default/xui/en/panel_region_texture.xml b/indra/newview/skins/default/xui/en/panel_region_texture.xml index 04dbf73be9..502a5804c3 100644 --- a/indra/newview/skins/default/xui/en/panel_region_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_region_texture.xml @@ -292,7 +292,7 @@ name="height_text_lbl10" top_delta="30" width="400" - word_wrap="true"> + wrap="true"> These values represent the blend range for the textures above. </text> <text @@ -303,7 +303,7 @@ name="height_text_lbl11" top_delta="32" width="400" - word_wrap="true"> + wrap="true"> Measured in meters, the LOW value is the MAXIMUM height of Texture #1, and the HIGH value is the MINIMUM height of Texture #4. </text> <button diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index bfca2f2e46..00f54feabd 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -42,36 +42,18 @@ <button auto_resize="true" halign="right" - font="SansSerifSmall" - follows="right|top" - image_overlay="" - image_selected="spacer35.tga" - image_unselected="spacer35.tga" - image_pressed="spacer35.tga" - height="16" - right="-228" - label_shadow="false" - name="buycurrency" - tool_tip="My Balance" - top="5" - width="100" /> - <button - auto_resize="true" - halign="right" - font="SansSerifSmall" follows="right|top" image_selected="BuyArrow_Over" image_unselected="BuyArrow_Over" image_pressed="BuyArrow_Press" height="16" - label="Buy L$" - label_color="EmphasisColor" - left_pad="0" + right="-128" + label_color="White" label_shadow="false" - name="buyL" + name="buycurrency" pad_right="20px" - tool_tip="Click to buy more L$" - top="5" + tool_tip="My Balance: Click to buy more L$" + top="3" width="100" /> <text type="string" @@ -80,27 +62,29 @@ follows="right|bottom" halign="right" height="16" - top="7" + top="4" layout="topleft" left_pad="0" name="TimeText" + text_color="TimeTextColor" tool_tip="Current time (Pacific)" width="85"> 12:00 AM </text> <button follows="right|bottom" - height="15" + height="16" image_selected="AudioMute_Off" image_pressed="Audio_Press" image_unselected="Audio_Off" is_toggle="true" left_pad="18" - top="4" + top="1" name="volume_btn" tool_tip="Global Volume Control" width="16" /> <text + enabled="true" follows="right|bottom" halign="center" height="12" diff --git a/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml b/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml deleted file mode 100644 index 60d4a7e00b..0000000000 --- a/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - background_opaque="true" - background_visible="false" - border_visible="false" - border="false" - chrome="true" - follows="bottom" - height="150" - layout="topleft" - name="volumepulldown_floater" - width="32"> - <!-- floater background image --> - <icon - height="150" - image_name="Inspector_Background" - layout="topleft" - left="0" - name="normal_background" - top="0" - width="32" /> - <slider - control_name="AudioLevelMaster" - follows="left|top" - left="0" - top="1" - orientation="vertical" - height="120" - increment="0.05" - initial_value="0.5" - layout="topleft" - name="mastervolume" - show_text="false" - slider_label.halign="right" - top_pad="2" - volume="true"> - <slider.commit_callback - function="Vol.setControlFalse" - parameter="MuteAudio" /> - </slider> - <button - left="7" - top_pad="9" - width="18" - height="12" - follows="top|left" - name="prefs_btn" - image_unselected="Icon_Gear_Foreground" - image_disabled="Icon_Gear_Background" - image_pressed="Icon_Gear_Press" - scale_image="false"> - <button.commit_callback - function="Vol.GoAudioPrefs" /> - </button> -</panel> diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml index 2dfcdf4a4c..d26e855e2f 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml @@ -153,19 +153,28 @@ layout="topleft" left="5" name="CreatorNameLabel" - top_pad="12" + top_pad="10" width="78"> Creator: </text> + <avatar_icon + follows="top|left" + height="20" + default_icon_name="Generic_Person" + layout="topleft" + left_pad="0" + top_delta="-6" + mouse_opaque="true" + width="20" /> <text type="string" - follows="left|right|top" + follows="left|right" font="SansSerifSmall" height="15" layout="topleft" - left_pad="0" + left_pad="5" name="Creator Name" - top_delta="0" + top_delta="6" width="140"> Erica Linden </text> @@ -177,19 +186,28 @@ layout="topleft" left="5" name="Owner:" - top_pad="15" + top_pad="10" width="78"> Owner: </text> + <avatar_icon + follows="top|left" + height="20" + default_icon_name="Generic_Person" + layout="topleft" + left_pad="0" + top_delta="-6" + mouse_opaque="true" + width="20" /> <text type="string" - follows="left|right|top" + follows="left|right" font="SansSerifSmall" height="15" layout="topleft" - left_pad="0" + left_pad="5" name="Owner Name" - top_delta="0" + top_delta="6" width="140"> Erica Linden </text> @@ -201,7 +219,7 @@ layout="topleft" left="5" name="Group_label" - top_pad="15" + top_pad="10" width="78"> Group: </text> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index fbdac7164d..bd868ef61e 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -67,7 +67,7 @@ <!-- tooltips for Urls --> <string name="TooltipHttpUrl">Click to view this web page</string> <string name="TooltipSLURL">Click to view this location's information</string> - <string name="TooltipAgentUrl">Click to view this Resident's profile</string> + <string name="TooltipAgentUrl">Click to view this resident's profile</string> <string name="TooltipGroupUrl">Click to view this group's description</string> <string name="TooltipEventUrl">Click to view this event's description</string> <string name="TooltipClassifiedUrl">Click to view this classified</string> @@ -1609,11 +1609,11 @@ Sends an HTTP request to the specified url with the body of the request and para </string> <string name="LSLTipText_llResetLandBanList" translate="false"> llResetLandBanList() -Removes all Residents from the land ban list +Removes all residents from the land ban list </string> <string name="LSLTipText_llResetLandPassList" translate="false"> llResetLandPassList() -Removes all Residents from the land access/pass list +Removes all residents from the land access/pass list </string> <string name="LSLTipText_llGetObjectPrimCount" translate="false"> integer llGetObjectPrimCount(key object_id) @@ -1621,7 +1621,7 @@ Returns the total number of prims for an object in the region </string> <string name="LSLTipText_llGetParcelPrimOwners" translate="false"> list llGetParcelPrimOwners(vector pos) -Returns a list of all Residents who own objects on the parcel at pos and with individual prim counts. +Returns a list of all residents who own objects on the parcel at pos and with individual prim counts. Requires owner-like permissions for the parcel. </string> <string name="LSLTipText_llGetParcelPrimCount" translate="false"> @@ -1808,7 +1808,7 @@ Clears (deletes) the media and all params from the given face. <!-- inventory --> <string name="InventoryNoMatchingItems">No matching items found in inventory.</string> - <string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string> + <string name="FavoritesNoMatchingItems">Drag and drop a landmark here to add to your favorites.</string> <string name="InventoryNoTexture"> You do not have a copy of this texture in your inventory @@ -2040,7 +2040,7 @@ this texture in your inventory <string name="RegionInfoAllEstatesYouManage"> all estates that you manage for [OWNER] </string> - <string name="RegionInfoAllowedResidents">Allowed Residents: ([ALLOWEDAGENTS], max [MAXACCESS])</string> + <string name="RegionInfoAllowedResidents">Allowed residents: ([ALLOWEDAGENTS], max [MAXACCESS])</string> <string name="RegionInfoAllowedGroups">Allowed groups: ([ALLOWEDGROUPS], max [MAXACCESS])</string> <!-- script limits floater --> @@ -2111,7 +2111,7 @@ this texture in your inventory <!-- Mute --> <string name="MuteByName">(by name)</string> - <string name="MuteAgent">(Resident)</string> + <string name="MuteAgent">(resident)</string> <string name="MuteObject">(object)</string> <string name="MuteGroup">(group)</string> @@ -2938,7 +2938,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Click the [BUTTON NAME] button to accept/connect to this voice chat. </string> <string name="muted_message"> - You have blocked this Resident. Sending a message will automatically unblock them. + You have blocked this resident. Sending a message will automatically unblock them. </string> <!--Some times string name is getting from the body of server response. For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml index 693c43f141..af0d338256 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_im_adhoc + font="SansSerif" height="25" name="im_adhoc_chiclet" show_speaker="false" @@ -11,14 +12,15 @@ left="25" name="speaker" visible="false" - width="20" /> + width="20"/> <chiclet_im_adhoc.avatar_icon follows="left|top|bottom" height="22" mouse_opaque="true" name="adhoc_icon" - width="22" /> + width="22"/> <chiclet_im_adhoc.unread_notifications + font="SansSerif" font_halign="center" height="25" left="25" @@ -27,13 +29,13 @@ text_color="white" v_pad="5" visible="false" - width="20" /> + width="20"/> <chiclet_im_adhoc.new_message_icon - bottom="11" - height="14" - image_name="Unread_Chiclet" - left="12" - name="new_message_icon" - visible="false" - width="14" /> + bottom="12" + height="13" + image_name="Unread_Chiclet" + left="12" + name="new_message_icon" + visible="false" + width="13" /> </chiclet_im_adhoc> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml index f4fc58701c..b1988a2d20 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_im_group + font="SansSerif" height="25" name="im_group_chiclet" show_speaker="false" @@ -11,17 +12,17 @@ left="25" name="speaker" visible="false" - width="20" /> + width="20"/> <chiclet_im_group.group_icon default_icon="Generic_Group" follows="left|top|bottom" - height="18" - bottom_pad="4" + height="22" mouse_opaque="true" name="group_icon" - width="18" /> + width="22"/> <chiclet_im_group.unread_notifications height="25" + font="SansSerif" font_halign="center" left="25" mouse_opaque="false" @@ -31,11 +32,11 @@ visible="false" width="20"/> <chiclet_im_group.new_message_icon -bottom="11" - height="14" - image_name="Unread_Chiclet" - left="12" - name="new_message_icon" - visible="false" - width="14" /> + bottom="12" + height="13" + image_name="Unread_Chiclet" + left="12" + name="new_message_icon" + visible="false" + width="13" /> </chiclet_im_group> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml index 535113f717..52fbce0de7 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_im_p2p + font="SansSerif" height="25" name="im_p2p_chiclet" show_speaker="false" @@ -17,9 +18,10 @@ height="22" mouse_opaque="true" name="avatar_icon" - width="22" /> + width="22"/> <chiclet_im_p2p.unread_notifications height="25" + font="SansSerif" font_halign="center" left="25" mouse_opaque="false" @@ -29,11 +31,11 @@ visible="false" width="20"/> <chiclet_im_p2p.new_message_icon - bottom="11" - height="14" - image_name="Unread_Chiclet" - left="12" - name="new_message_icon" - visible="false" - width="14" /> + bottom="12" + height="13" + image_name="Unread_Chiclet" + left="12" + name="new_message_icon" + visible="false" + width="13" /> </chiclet_im_p2p> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml index 86bea9be50..33f85a964c 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_offer + font="SansSerif" height="25" name="offer_chiclet" width="25"> <chiclet_offer.icon - default_icon="Generic_Object_Small" + default_icon="Generic_Object_Small" follows="all" - height="20" + height="22" mouse_opaque="false" name="chiclet_icon" - bottom_pad="2" - width="20" /> + width="22"/> <chiclet_offer.new_message_icon - bottom="11" - height="14" + bottom="12" + height="13" image_name="Unread_Chiclet" left="12" name="new_message_icon" visible="false" - width="14" /> + width="13" /> </chiclet_offer> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml index b1f9f5b0e8..560c8e6ea5 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_script + font="SansSerif" height="25" name="script_chiclet" width="25"> <chiclet_script.icon follows="all" - height="20" - image_name="Generic_Object_Small" + height="22" + image_name="Generic_Object_Small" mouse_opaque="false" name="chiclet_icon" - width="20" - bottom_pad="2" /> + width="22"/> <chiclet_script.new_message_icon - bottom="11" - height="14" + bottom="12" + height="13" image_name="Unread_Chiclet" left="12" name="new_message_icon" visible="false" - width="14" /> + width="13" /> </chiclet_script> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml new file mode 100644 index 0000000000..4229f34c09 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<gesture_combo_box + label="Gestures" + list_position="below" + max_chars="20" + follows="right|top"> + <gesture_combo_box.combo_button name="Combobox Button" + label="" + hover_glow_amount="0.15" + scale_image="true" + image_unselected="ComboButton_Off" + image_selected="ComboButton_Selected" + image_disabled="ComboButton_Disabled" + image_disabled_selected="ComboButton_Disabled_Selected" /> + <gesture_combo_box.drop_down_button name="Drop Down Button" + label="" + halign="center" + hover_glow_amount="0.15" + scale_image="true" + image_selected="PushButton_Selected_Press" + image_pressed="PushButton_Press" + image_pressed_selected="PushButton_Selected_Press" + image_unselected="PushButton_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Selected_Disabled" /> + <gesture_combo_box.combo_list bg_writeable_color="MenuDefaultBgColor" + scroll_bar_bg_visible="false" /> + <gesture_combo_box.combo_editor name="Combo Text Entry" + select_on_focus="true" /> +</gesture_combo_box> diff --git a/indra/newview/skins/default/xui/en/widgets/gesture_combo_list.xml b/indra/newview/skins/default/xui/en/widgets/gesture_combo_list.xml deleted file mode 100644 index 808683864d..0000000000 --- a/indra/newview/skins/default/xui/en/widgets/gesture_combo_list.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<gesture_combo_list - follows="right|top"> - <gesture_combo_list.combo_button - name="Combolist Button" - label="" - layout="topleft" - halign="center" - hover_glow_amount="0.15" - mouse_opaque="false" - scale_image="true" - image_selected="PushButton_Selected_Press" - image_pressed="PushButton_Press" - image_pressed_selected="PushButton_Selected_Press" - image_unselected="PushButton_Off" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Selected_Disabled" /> - <gesture_combo_list.combo_list - bg_writeable_color="MenuDefaultBgColor" - scroll_bar_bg_visible="false" /> -</gesture_combo_list> diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 1c0a8ba7c5..67bb7c1896 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -96,7 +96,7 @@ name="damage_icon" width="14" height="13" - top="25" + top="22" left="2" follows="right|top" image_name="Parcel_Damage_Dark" @@ -112,19 +112,17 @@ font="SansSerifSmall" text_color="TextFgColor" /> - <combo_button - name="Location History" - label="" - pad_right="0"/> - <combo_list - bg_writeable_color="MenuDefaultBgColor" - page_lines="10" + + <combo_button name="Location History" + label="" + pad_right="0"/> + <combo_list bg_writeable_color="MenuDefaultBgColor" page_lines="10" scroll_bar_bg_visible="true" /> <combo_editor name="Combo Text Entry" - text_pad_left="27" + text_pad_left="22" select_on_focus="false" font="SansSerifSmall" bevel_style="none" border_style="line" - border.border_thickness="0" /> + border.border_thickness="0"/> </location_input> diff --git a/indra/newview/skins/default/xui/es/floater_buy_currency.xml b/indra/newview/skins/default/xui/es/floater_buy_currency.xml index 1ecb813dd1..eb25493adc 100644 --- a/indra/newview/skins/default/xui/es/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/es/floater_buy_currency.xml @@ -52,9 +52,6 @@ <text name="total_amount"> [AMT] L$ </text> - <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=es-ES payment method] | [http://www.secondlife.com/my/account/currency.php?lang=es-ES currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=es-ES exchange rate] - </text> <text name="purchase_warning_repurchase" right="-10"> Confirmando esta compra sólo compra la moneda. Tendrá que intentar de nuevo la operación. diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml index 9a92c446f2..e6a49cbc6f 100644 --- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml @@ -46,12 +46,12 @@ [AMT] L$ </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR payment method] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=fr-FR exchange rate] + [http://www.secondlife.com/ payment method] | [http://www.secondlife.com/ currency] | [http://www.secondlife.com exchange rate] </text> <text name="exchange_rate_note"> Saisissez à nouveau le montant pour voir le taux de change actuel. </text> - <text name="purchase_warning_repurchase"> + <text bottom_delta="-64" height="48" name="purchase_warning_repurchase" right="-10"> La confirmation de cet achat n'achète que des L$, pas l'objet. </text> <text bottom_delta="16" name="purchase_warning_notenough"> diff --git a/indra/newview/skins/default/xui/fr/floater_help_browser.xml b/indra/newview/skins/default/xui/fr/floater_help_browser.xml index 20894d42fc..0eb3ea3d21 100644 --- a/indra/newview/skins/default/xui/fr/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/fr/floater_help_browser.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="floater_help_browser" title="NAVIGATEUR D'AIDE"> <floater.string name="home_page_url"> - http://fr.secondlife.com + http://www.secondlife.com </floater.string> <floater.string name="support_page_url"> - http://fr.secondlife.com/support + http://support.secondlife.com </floater.string> <layout_stack name="stack1"> <layout_panel name="external_controls"> diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 3ff829bfb7..2f0c7038fc 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -166,7 +166,7 @@ <string name="TooltipSLAPP"> Cliquez pour exécuter la commande secondlife:// command </string> - <string name="CurrentURL" value=" URL actuelle : [CurrentURL]"/> + <string name="CurrentURL" value="URL actuelle : [CurrentURL]"/> <string name="SLurlLabelTeleport"> Me téléporter vers </string> @@ -174,7 +174,7 @@ Afficher la carte pour </string> <string name="BUTTON_CLOSE_DARWIN"> - Fermer (⌘W) + Fermer (⌘W) </string> <string name="BUTTON_CLOSE_WIN"> Fermer (Ctrl+W) @@ -821,46 +821,46 @@ <string name="InventoryNoTexture"> Vous n'avez pas de copie de cette texture dans votre inventaire </string> - <string name="no_transfer" value=" (pas de transfert)"/> - <string name="no_modify" value=" (pas de modification)"/> - <string name="no_copy" value=" (pas de copie)"/> - <string name="worn" value=" (porté)"/> - <string name="link" value=" (lien)"/> - <string name="broken_link" value=" (broken_link)"/> + <string name="no_transfer" value="(pas de transfert)"/> + <string name="no_modify" value="(pas de modification)"/> + <string name="no_copy" value="(pas de copie)"/> + <string name="worn" value="(porté)"/> + <string name="link" value="(lien)"/> + <string name="broken_link" value="(broken_link)"/> <string name="LoadingContents"> chargement des contenus en cours... </string> <string name="NoContents"> Aucun contenu </string> - <string name="WornOnAttachmentPoint" value=" (porté sur [ATTACHMENT_POINT])"/> + <string name="WornOnAttachmentPoint" value="(porté sur [ATTACHMENT_POINT])"/> <string name="PermYes"> Oui </string> <string name="PermNo"> Non </string> - <string name="Chat" value=" Chat :"/> - <string name="Sound" value=" Son :"/> - <string name="Wait" value=" --- Attendre :"/> - <string name="AnimFlagStop" value=" Arrêter l'animation :"/> - <string name="AnimFlagStart" value=" Démarrer l'animation :"/> - <string name="Wave" value=" Faire signe"/> - <string name="HelloAvatar" value=" Bonjour, avatar !"/> - <string name="ViewAllGestures" value=" Tout afficher >>"/> - <string name="Animations" value=" Animations,"/> - <string name="Calling Cards" value=" Cartes de visite,"/> - <string name="Clothing" value=" Habits,"/> - <string name="Gestures" value=" Gestes,"/> - <string name="Landmarks" value=" Repères,"/> - <string name="Notecards" value=" Notes,"/> - <string name="Objects" value=" Objets,"/> - <string name="Scripts" value=" Scripts,"/> - <string name="Sounds" value=" Sons,"/> - <string name="Textures" value=" Textures,"/> - <string name="Snapshots" value=" Photos,"/> - <string name="No Filters" value="Non "/> - <string name="Since Logoff" value=" - Depuis la déconnexion"/> + <string name="Chat" value="Chat :"/> + <string name="Sound" value="Son :"/> + <string name="Wait" value="--- Attendre :"/> + <string name="AnimFlagStop" value="Arrêter l'animation :"/> + <string name="AnimFlagStart" value="Démarrer l'animation :"/> + <string name="Wave" value="Faire signe"/> + <string name="HelloAvatar" value="Bonjour, avatar !"/> + <string name="ViewAllGestures" value="Tout afficher >>"/> + <string name="Animations" value="Animations,"/> + <string name="Calling Cards" value="Cartes de visite,"/> + <string name="Clothing" value="Habits,"/> + <string name="Gestures" value="Gestes,"/> + <string name="Landmarks" value="Repères,"/> + <string name="Notecards" value="Notes,"/> + <string name="Objects" value="Objets,"/> + <string name="Scripts" value="Scripts,"/> + <string name="Sounds" value="Sons,"/> + <string name="Textures" value="Textures,"/> + <string name="Snapshots" value="Photos,"/> + <string name="No Filters" value="Non"/> + <string name="Since Logoff" value="- Depuis la déconnexion"/> <string name="InvFolder My Inventory"> Mon inventaire </string> @@ -1239,13 +1239,13 @@ <string name="GroupsNone"> aucun </string> - <string name="Group" value=" (groupe)"/> + <string name="Group" value="(groupe)"/> <string name="Unknown"> (Inconnu) </string> - <string name="SummaryForTheWeek" value="Récapitulatif de la semaine, début le "/> - <string name="NextStipendDay" value="Prochaine prime le "/> - <string name="GroupIndividualShare" value=" Groupe Part individuelle"/> + <string name="SummaryForTheWeek" value="Récapitulatif de la semaine, début le"/> + <string name="NextStipendDay" value="Prochaine prime le"/> + <string name="GroupIndividualShare" value="Groupe Part individuelle"/> <string name="Balance"> Solde </string> @@ -1324,8 +1324,8 @@ <string name="covenant_last_modified"> Dernière modification : </string> - <string name="none_text" value=" (aucun)"/> - <string name="never_text" value=" (jamais)"/> + <string name="none_text" value="(aucun)"/> + <string name="never_text" value="(jamais)"/> <string name="GroupOwned"> Propriété du groupe </string> @@ -1616,7 +1616,7 @@ Si le problème persiste, vous devrez peut-être complètement désinstaller pui Erreur fatale </string> <string name="MBRequiresAltiVec"> - [APP_NAME] nécessite un microprocesseur AltiVec (version G4 ou antérieure). + [APP_NAME] nécessite un microprocesseur AltiVec (version G4 ou antérieure). </string> <string name="MBAlreadyRunning"> [APP_NAME] est déjà en cours d'exécution. diff --git a/indra/newview/skins/default/xui/it/floater_buy_currency.xml b/indra/newview/skins/default/xui/it/floater_buy_currency.xml index 8a59764251..a22850bc4b 100644 --- a/indra/newview/skins/default/xui/it/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/it/floater_buy_currency.xml @@ -52,11 +52,10 @@ <text name="total_amount"> [AMT]L$ </text> - <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=it-IT payment method] | [http://www.secondlife.com/my/account/currency.php?lang=it-IT currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=it-IT exchange rate] - </text> - <text name="purchase_warning_repurchase"> - Confermando questa operazione si acquisterà solo la valuta. Per acquistare il bene, dovrai riprovare l'operazione nuovamente. + <text name="purchase_warning_repurchase" height="48" bottom_delta="-64" right="-10"> + Confermando questa operazione si acquisterà solo +la valuta. Per acquistare il bene, dovrai riprovare +l'operazione nuovamente. </text> <text name="purchase_warning_notenough" bottom_delta="16"> Non stai comprando abbastanza denaro. diff --git a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml index 9d49a38982..03cd0f391a 100644 --- a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP payment method] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=ja-JP exchange rate] + [http://www.secondlife.com/ payment method] | [http://www.secondlife.com/ currency] | [http://www.secondlife.com exchange rate] </text> <text name="exchange_rate_note"> 金額を再入力して最新換算レートを確認します。 diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index b37d97bc5d..4d395b474f 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -166,7 +166,7 @@ <string name="TooltipSLAPP"> クリックして secondlife:// コマンドを出す </string> - <string name="CurrentURL" value=" 現在のURL: [CurrentURL]"/> + <string name="CurrentURL" value="現在のURL: [CurrentURL]"/> <string name="SLurlLabelTeleport"> テレポート </string> @@ -174,7 +174,7 @@ 地図に表示 </string> <string name="BUTTON_CLOSE_DARWIN"> - 閉じる (⌘W) + 閉じる (⌘W) </string> <string name="BUTTON_CLOSE_WIN"> 閉じる (Ctrl+W) @@ -821,33 +821,33 @@ <string name="InventoryNoTexture"> 持ち物内にこのテクスチャのコピーがありません </string> - <string name="no_transfer" value=" (再販/プレゼント不可)"/> - <string name="no_modify" value=" (編集不可)"/> - <string name="no_copy" value=" (コピー不可)"/> - <string name="worn" value=" (着用中)"/> - <string name="link" value=" (リンク)"/> - <string name="broken_link" value=" (壊れたリンク)"/> + <string name="no_transfer" value="(再販/プレゼント不可)"/> + <string name="no_modify" value="(編集不可)"/> + <string name="no_copy" value="(コピー不可)"/> + <string name="worn" value="(着用中)"/> + <string name="link" value="(リンク)"/> + <string name="broken_link" value="(壊れたリンク)"/> <string name="LoadingContents"> コンテンツをロード中です... </string> <string name="NoContents"> コンテンツなし </string> - <string name="WornOnAttachmentPoint" value=" ([ATTACHMENT_POINT] に装着中)"/> + <string name="WornOnAttachmentPoint" value="([ATTACHMENT_POINT] に装着中)"/> <string name="PermYes"> はい </string> <string name="PermNo"> いいえ </string> - <string name="Chat" value=" チャット:"/> - <string name="Sound" value=" サウンド:"/> - <string name="Wait" value=" --- 待機::"/> - <string name="AnimFlagStop" value=" アニメーションを停止:"/> - <string name="AnimFlagStart" value=" アニメーションを開始:"/> - <string name="Wave" value=" 手を振る"/> - <string name="HelloAvatar" value=" やあ、アバター!"/> - <string name="ViewAllGestures" value=" すべて表示 >>"/> + <string name="Chat" value="チャット:"/> + <string name="Sound" value="サウンド:"/> + <string name="Wait" value="--- 待機::"/> + <string name="AnimFlagStop" value="アニメーションを停止:"/> + <string name="AnimFlagStart" value="アニメーションを開始:"/> + <string name="Wave" value="手を振る"/> + <string name="HelloAvatar" value="やあ、アバター!"/> + <string name="ViewAllGestures" value="すべて表示 >>"/> <string name="Animations" value="アニメーション、"/> <string name="Calling Cards" value="コーリングカード、"/> <string name="Clothing" value="衣類、"/> @@ -859,8 +859,8 @@ <string name="Sounds" value="サウンド、"/> <string name="Textures" value="テクスチャ、"/> <string name="Snapshots" value="スナップショット、"/> - <string name="No Filters" value="いいえ "/> - <string name="Since Logoff" value=" - ログオフ以来"/> + <string name="No Filters" value="いいえ"/> + <string name="Since Logoff" value="- ログオフ以来"/> <string name="InvFolder My Inventory"> マイ 持ち物 </string> @@ -1239,13 +1239,13 @@ <string name="GroupsNone"> なし </string> - <string name="Group" value=" (グループ)"/> + <string name="Group" value="(グループ)"/> <string name="Unknown"> (不明) </string> <string name="SummaryForTheWeek" value="今週のまとめ。開始日は"/> <string name="NextStipendDay" value="次回のお小遣い支給日は"/> - <string name="GroupIndividualShare" value=" グループ 個人の割り当て"/> + <string name="GroupIndividualShare" value="グループ 個人の割り当て"/> <string name="Balance"> 残高 </string> @@ -1324,8 +1324,8 @@ <string name="covenant_last_modified"> 最終修正日: </string> - <string name="none_text" value=" (なし)"/> - <string name="never_text" value=" (無)"/> + <string name="none_text" value="(なし)"/> + <string name="never_text" value="(無)"/> <string name="GroupOwned"> グループ所有 </string> @@ -1616,7 +1616,7 @@ 致命的なエラー </string> <string name="MBRequiresAltiVec"> - [APP_NAME] は、AltiVec搭載のプロセッサが必要です。(G4 以降) + [APP_NAME] は、AltiVec搭載のプロセッサが必要です。(G4 以降) </string> <string name="MBAlreadyRunning"> [APP_NAME] はすでに実行中です。 diff --git a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml index f17c069ecf..aac8438fdc 100644 --- a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml @@ -52,9 +52,6 @@ <text name="total_amount"> L$ [AMT] </text> - <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=pt-BR payment method] | [http://www.secondlife.com/my/account/currency.php?lang=pt-BR currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=pt-BR exchange rate] - </text> <text name="purchase_warning_repurchase"> Confirmando esta compra só compra a moeda. Você precisará tentar novamente a operação. diff --git a/install.xml b/install.xml index e912ddfd8b..41f8a28044 100644 --- a/install.xml +++ b/install.xml @@ -1014,23 +1014,23 @@ anguage Infrstructure (CLI) international standard</string> <key>darwin</key> <map> <key>md5sum</key> - <string>2eb58f544c0d912aa382de2c947be7f1</string> + <string>5362a53488693f9bd7d9083758af25eb</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20100104.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20091218.tar.bz2</uri> </map> <key>linux</key> <map> <key>md5sum</key> - <string>c4c40fca14a8bd32096f8a27c75c526f</string> + <string>09674cbae982e7e7f6ebc7e1d06580e8</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-linux-20100105c.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-linux-20091216.tar.bz2</uri> </map> <key>windows</key> <map> <key>md5sum</key> - <string>b50db4fdb833111e1e679188e4cb5815</string> + <string>4dd305f2ce38b2e55a2014ad3a2de34d</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-qt4.6-20100104.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-qt4.6-20091218.tar.bz2</uri> </map> </map> </map> -- cgit v1.2.3 From 1a8008ea150d1eb9a8f4036988ef971fb1901cb3 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 14 Jan 2010 14:44:43 -0800 Subject: Backed out changeset f34a69c2af56 (this backs-out my backout, now that I'm happy the original merge works okay :)) --- indra/llcommon/llfasttimer.h | 163 +++++++------ indra/llplugin/llpluginclassmedia.cpp | 30 ++- indra/llplugin/llpluginclassmedia.h | 12 + indra/llui/llfloater.cpp | 46 ++-- indra/llui/llmenugl.cpp | 2 +- indra/llui/lltexteditor.cpp | 3 +- indra/media_plugins/webkit/media_plugin_webkit.cpp | 1 + indra/newview/CMakeLists.txt | 8 +- indra/newview/app_settings/settings.xml | 13 +- .../darwin/fix_application_icon_position.sh | 14 ++ indra/newview/llagent.cpp | 9 +- indra/newview/llagent.h | 1 + indra/newview/llavatarlist.cpp | 7 +- indra/newview/llavatarlistitem.cpp | 251 ++++++++++++-------- indra/newview/llavatarlistitem.h | 71 ++++-- indra/newview/llbottomtray.cpp | 17 +- indra/newview/llcallfloater.cpp | 12 +- indra/newview/llchathistory.cpp | 49 ++-- indra/newview/llfloaterabout.cpp | 2 +- indra/newview/llfloaterchat.cpp | 15 +- indra/newview/llfloatergesture.cpp | 2 +- indra/newview/llfloatergroups.cpp | 9 +- indra/newview/llfloaterland.cpp | 7 +- indra/newview/llfloaterland.h | 1 - indra/newview/llfloaterpreference.cpp | 2 +- indra/newview/llfloaterregioninfo.cpp | 5 + indra/newview/llgesturemgr.cpp | 10 + indra/newview/llgesturemgr.h | 2 + indra/newview/llgroupactions.cpp | 10 +- indra/newview/llimfloater.cpp | 86 ++++--- indra/newview/llimfloater.h | 5 +- indra/newview/llimfloatercontainer.cpp | 11 + indra/newview/llimfloatercontainer.h | 6 +- indra/newview/llimview.cpp | 19 +- indra/newview/llimview.h | 5 + indra/newview/llinspectavatar.cpp | 1 + indra/newview/llinspecttoast.cpp | 122 ++++++++++ indra/newview/llinspecttoast.h | 40 ++++ indra/newview/llinventorymodel.cpp | 8 +- indra/newview/llinventoryobserver.cpp | 35 ++- indra/newview/llmediactrl.cpp | 45 ++-- indra/newview/llmediactrl.h | 1 - indra/newview/llnamebox.cpp | 24 +- indra/newview/llnamebox.h | 5 + indra/newview/llnearbychat.cpp | 22 +- indra/newview/llnearbychatbar.cpp | 252 +++++++++++++++----- indra/newview/llnearbychatbar.h | 47 ++-- indra/newview/llnearbychathandler.cpp | 25 +- indra/newview/lloutputmonitorctrl.cpp | 65 +++++- indra/newview/lloutputmonitorctrl.h | 29 ++- indra/newview/llpanelavatar.cpp | 18 +- indra/newview/llpanelgroup.cpp | 55 ++++- indra/newview/llpanelgroup.h | 4 + indra/newview/llpanelgroupgeneral.cpp | 11 +- indra/newview/llpanelgrouproles.cpp | 61 ++--- indra/newview/llpanelgrouproles.h | 13 +- indra/newview/llpanelimcontrolpanel.cpp | 2 +- indra/newview/llpanelpeople.cpp | 8 +- indra/newview/llpanelpick.cpp | 80 ++++--- indra/newview/llpanelpick.h | 18 +- indra/newview/llpanelplaces.h | 4 + indra/newview/llpanelteleporthistory.cpp | 2 +- indra/newview/llpanelvolumepulldown.cpp | 154 +++++++++++++ indra/newview/llpanelvolumepulldown.h | 64 ++++++ indra/newview/llparticipantlist.cpp | 8 +- indra/newview/llscreenchannel.cpp | 149 +++--------- indra/newview/llscreenchannel.h | 19 +- indra/newview/llspeakers.cpp | 5 + indra/newview/llspeakers.h | 2 + indra/newview/llspeakingindicatormanager.cpp | 254 +++++++++++++++++++++ indra/newview/llspeakingindicatormanager.h | 67 ++++++ indra/newview/llstatusbar.cpp | 19 +- indra/newview/llstatusbar.h | 2 +- indra/newview/llsyswellitem.cpp | 3 +- indra/newview/llsyswellwindow.cpp | 3 +- indra/newview/llsyswellwindow.h | 3 + indra/newview/llteleporthistorystorage.cpp | 7 - indra/newview/lltoastnotifypanel.cpp | 4 +- indra/newview/llviewerdisplay.cpp | 20 +- indra/newview/llviewerfloaterreg.cpp | 5 +- indra/newview/llviewermessage.cpp | 56 ++--- indra/newview/llviewerwindow.cpp | 34 +-- indra/newview/llvoiceclient.cpp | 11 + indra/newview/llvoiceclient.h | 1 + .../default/textures/bottomtray/Unread_Chiclet.png | Bin 250 -> 328 bytes .../default/textures/bottomtray/WellButton_Lit.png | Bin 553 -> 490 bytes .../bottomtray/WellButton_Lit_Selected.png | Bin 687 -> 302 bytes indra/newview/skins/default/textures/textures.xml | 28 +-- .../skins/default/xui/de/floater_buy_currency.xml | 2 +- .../skins/default/xui/de/floater_help_browser.xml | 4 +- indra/newview/skins/default/xui/de/strings.xml | 72 +++--- .../newview/skins/default/xui/en/floater_about.xml | 2 +- .../skins/default/xui/en/floater_about_land.xml | 8 +- .../skins/default/xui/en/floater_buy_currency.xml | 4 +- .../skins/default/xui/en/floater_customize.xml | 120 +++++----- .../skins/default/xui/en/floater_god_tools.xml | 2 +- indra/newview/skins/default/xui/en/floater_im.xml | 2 +- .../skins/default/xui/en/floater_nearby_chat.xml | 4 +- .../skins/default/xui/en/floater_report_abuse.xml | 4 +- .../skins/default/xui/en/floater_select_key.xml | 8 +- .../skins/default/xui/en/floater_top_objects.xml | 20 +- indra/newview/skins/default/xui/en/floater_tos.xml | 6 +- .../default/xui/en/floater_voice_controls.xml | 143 +++++------- .../newview/skins/default/xui/en/inspect_toast.xml | 19 ++ indra/newview/skins/default/xui/en/menu_viewer.xml | 36 +-- .../newview/skins/default/xui/en/notifications.xml | 33 ++- .../default/xui/en/panel_adhoc_control_panel.xml | 17 +- .../default/xui/en/panel_avatar_list_item.xml | 7 +- .../default/xui/en/panel_block_list_sidetray.xml | 6 +- .../skins/default/xui/en/panel_bottomtray.xml | 45 ++-- .../skins/default/xui/en/panel_edit_pick.xml | 32 ++- .../skins/default/xui/en/panel_edit_profile.xml | 3 +- .../newview/skins/default/xui/en/panel_friends.xml | 2 +- .../default/xui/en/panel_group_control_panel.xml | 20 +- .../default/xui/en/panel_group_info_sidetray.xml | 18 +- .../skins/default/xui/en/panel_group_invite.xml | 14 +- .../skins/default/xui/en/panel_group_list_item.xml | 1 + .../skins/default/xui/en/panel_group_notices.xml | 1 + .../skins/default/xui/en/panel_group_roles.xml | 55 +++-- indra/newview/skins/default/xui/en/panel_login.xml | 1 + .../xui/en/panel_media_settings_general.xml | 5 +- .../skins/default/xui/en/panel_my_profile.xml | 20 +- .../skins/default/xui/en/panel_navigation_bar.xml | 4 +- .../skins/default/xui/en/panel_nearby_chat_bar.xml | 4 +- indra/newview/skins/default/xui/en/panel_notes.xml | 6 +- .../newview/skins/default/xui/en/panel_people.xml | 10 +- .../skins/default/xui/en/panel_pick_info.xml | 33 +-- .../default/xui/en/panel_preferences_advanced.xml | 1 - .../default/xui/en/panel_preferences_general.xml | 15 +- .../default/xui/en/panel_preferences_graphics1.xml | 4 +- .../default/xui/en/panel_prim_media_controls.xml | 1 + .../newview/skins/default/xui/en/panel_profile.xml | 26 ++- .../skins/default/xui/en/panel_region_covenant.xml | 10 +- .../skins/default/xui/en/panel_region_estate.xml | 12 +- .../skins/default/xui/en/panel_region_texture.xml | 4 +- .../skins/default/xui/en/panel_status_bar.xml | 36 ++- .../skins/default/xui/en/panel_volume_pulldown.xml | 55 +++++ .../skins/default/xui/en/sidepanel_task_info.xml | 36 +-- indra/newview/skins/default/xui/en/strings.xml | 16 +- .../default/xui/en/widgets/chiclet_im_adhoc.xml | 22 +- .../default/xui/en/widgets/chiclet_im_group.xml | 23 +- .../default/xui/en/widgets/chiclet_im_p2p.xml | 18 +- .../skins/default/xui/en/widgets/chiclet_offer.xml | 14 +- .../default/xui/en/widgets/chiclet_script.xml | 14 +- .../default/xui/en/widgets/gesture_combo_box.xml | 30 --- .../default/xui/en/widgets/gesture_combo_list.xml | 21 ++ .../default/xui/en/widgets/location_input.xml | 18 +- .../skins/default/xui/es/floater_buy_currency.xml | 3 + .../skins/default/xui/fr/floater_buy_currency.xml | 4 +- .../skins/default/xui/fr/floater_help_browser.xml | 4 +- indra/newview/skins/default/xui/fr/strings.xml | 74 +++--- .../skins/default/xui/it/floater_buy_currency.xml | 9 +- .../skins/default/xui/ja/floater_buy_currency.xml | 2 +- indra/newview/skins/default/xui/ja/strings.xml | 48 ++-- .../skins/default/xui/pt/floater_buy_currency.xml | 3 + install.xml | 12 +- 156 files changed, 2689 insertions(+), 1460 deletions(-) create mode 100644 indra/newview/installers/darwin/fix_application_icon_position.sh create mode 100644 indra/newview/llinspecttoast.cpp create mode 100644 indra/newview/llinspecttoast.h create mode 100644 indra/newview/llpanelvolumepulldown.cpp create mode 100644 indra/newview/llpanelvolumepulldown.h create mode 100644 indra/newview/llspeakingindicatormanager.cpp create mode 100644 indra/newview/llspeakingindicatormanager.h create mode 100644 indra/newview/skins/default/xui/en/inspect_toast.xml create mode 100644 indra/newview/skins/default/xui/en/panel_volume_pulldown.xml delete mode 100644 indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/gesture_combo_list.xml diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index f5c90291b8..5058a2e772 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -39,40 +39,30 @@ #define TIME_FAST_TIMERS 0 #if LL_WINDOWS - +// because MS has different signatures for these functions in winnt.h +// need to rename them to avoid conflicts +#define _interlockedbittestandset _renamed_interlockedbittestandset +#define _interlockedbittestandreset _renamed_interlockedbittestandreset +#include <intrin.h> +#undef _interlockedbittestandset +#undef _interlockedbittestandreset + +#define LL_INLINE __forceinline // shift off lower 8 bits for lower resolution but longer term timing // on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing inline U32 get_cpu_clock_count_32() { - U32 ret_val; - __asm - { - _emit 0x0f - _emit 0x31 - shr eax,8 - shl edx,24 - or eax, edx - mov dword ptr [ret_val], eax - } - return ret_val; + U64 time_stamp = __rdtsc(); + return (U32)(time_stamp >> 8); } // return full timer value, *not* shifted by 8 bits inline U64 get_cpu_clock_count_64() { - U64 ret_val; - __asm - { - _emit 0x0f - _emit 0x31 - mov eax,eax - mov edx,edx - mov dword ptr [ret_val+4], edx - mov dword ptr [ret_val], eax - } - return ret_val; + return __rdtsc(); } - +#else +#define LL_INLINE #endif // LL_WINDOWS #if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) @@ -113,10 +103,25 @@ class LLMutex; #include <queue> #include "llsd.h" - class LL_COMMON_API LLFastTimer { public: + + class NamedTimer; + + struct LL_COMMON_API FrameState + { + FrameState(NamedTimer* timerp); + + U32 mSelfTimeCounter; + U32 mCalls; + FrameState* mParent; // info for caller timer + FrameState* mLastCaller; // used to bootstrap tree construction + NamedTimer* mTimer; + U16 mActiveCount; // number of timers with this ID active on stack + bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame + }; + // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances class LL_COMMON_API NamedTimer : public LLInstanceTracker<NamedTimer> @@ -149,24 +154,10 @@ public: static NamedTimer& getRootNamedTimer(); - struct FrameState - { - FrameState(NamedTimer* timerp); - - U32 mSelfTimeCounter; - U32 mCalls; - FrameState* mParent; // info for caller timer - FrameState* mLastCaller; // used to bootstrap tree construction - NamedTimer* mTimer; - U16 mActiveCount; // number of timers with this ID active on stack - bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame - }; - S32 getFrameStateIndex() const { return mFrameStateIndex; } FrameState& getFrameState() const; - private: friend class LLFastTimer; friend class NamedTimerFactory; @@ -185,7 +176,6 @@ public: static void buildHierarchy(); static void resetFrame(); static void reset(); - // // members @@ -207,58 +197,47 @@ public: std::vector<NamedTimer*> mChildren; bool mCollapsed; // don't show children bool mNeedsSorting; // sort children whenever child added - }; // used to statically declare a new named timer class LL_COMMON_API DeclareTimer : public LLInstanceTracker<DeclareTimer> { + friend class LLFastTimer; public: DeclareTimer(const std::string& name, bool open); DeclareTimer(const std::string& name); static void updateCachedPointers(); - // convertable to NamedTimer::FrameState for convenient usage of LLFastTimer(declared_timer) - operator NamedTimer::FrameState&() { return *mFrameState; } private: - NamedTimer& mTimer; - NamedTimer::FrameState* mFrameState; + NamedTimer& mTimer; + FrameState* mFrameState; }; - public: - static LLMutex* sLogLock; - static std::queue<LLSD> sLogQueue; - static BOOL sLog; - static BOOL sMetricLog; - - typedef std::vector<NamedTimer::FrameState> info_list_t; - static info_list_t& getFrameStateList(); + LLFastTimer(LLFastTimer::FrameState* state); - enum RootTimerMarker { ROOT }; - LLFastTimer(RootTimerMarker); - - LLFastTimer(NamedTimer::FrameState& timer) - : mFrameState(&timer) + LL_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer) + : mFrameState(timer.mFrameState) { #if TIME_FAST_TIMERS U64 timer_start = get_cpu_clock_count_64(); #endif #if FAST_TIMER_ON - NamedTimer::FrameState* frame_state = &timer; - U32 cur_time = get_cpu_clock_count_32(); - mStartSelfTime = cur_time; - mStartTotalTime = cur_time; + LLFastTimer::FrameState* frame_state = mFrameState; + mStartTime = get_cpu_clock_count_32(); frame_state->mActiveCount++; frame_state->mCalls++; // keep current parent as long as it is active when we are frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0); - mLastTimer = sCurTimer; - sCurTimer = this; + LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData; + mLastTimerData = *cur_timer_data; + cur_timer_data->mCurTimer = this; + cur_timer_data->mFrameState = frame_state; + cur_timer_data->mChildTime = 0; #endif #if TIME_FAST_TIMERS U64 timer_end = get_cpu_clock_count_64(); @@ -266,26 +245,26 @@ public: #endif } - ~LLFastTimer() + LL_INLINE ~LLFastTimer() { #if TIME_FAST_TIMERS U64 timer_start = get_cpu_clock_count_64(); #endif #if FAST_TIMER_ON - NamedTimer::FrameState* frame_state = mFrameState; - U32 cur_time = get_cpu_clock_count_32(); - frame_state->mSelfTimeCounter += cur_time - mStartSelfTime; + LLFastTimer::FrameState* frame_state = mFrameState; + U32 total_time = get_cpu_clock_count_32() - mStartTime; + frame_state->mSelfTimeCounter += total_time - LLFastTimer::sCurTimerData.mChildTime; frame_state->mActiveCount--; - LLFastTimer* last_timer = mLastTimer; - sCurTimer = last_timer; // store last caller to bootstrap tree creation - frame_state->mLastCaller = last_timer->mFrameState; + // do this in the destructor in case of recursion to get topmost caller + frame_state->mLastCaller = mLastTimerData.mFrameState; // we are only tracking self time, so subtract our total time delta from parents - U32 total_time = cur_time - mStartTotalTime; - last_timer->mStartSelfTime += total_time; + mLastTimerData.mChildTime += total_time; + + LLFastTimer::sCurTimerData = mLastTimerData; #endif #if TIME_FAST_TIMERS U64 timer_end = get_cpu_clock_count_64(); @@ -294,7 +273,20 @@ public: #endif } +public: + static LLMutex* sLogLock; + static std::queue<LLSD> sLogQueue; + static BOOL sLog; + static BOOL sMetricLog; + static bool sPauseHistory; + static bool sResetHistory; + static U64 sTimerCycles; + static U32 sTimerCalls; + typedef std::vector<FrameState> info_list_t; + static info_list_t& getFrameStateList(); + + // call this once a frame to reset timers static void nextFrame(); @@ -312,23 +304,26 @@ public: static void writeLog(std::ostream& os); static const NamedTimer* getTimerByName(const std::string& name); -public: - static bool sPauseHistory; - static bool sResetHistory; - static U64 sTimerCycles; - static U32 sTimerCalls; - + struct CurTimerData + { + LLFastTimer* mCurTimer; + FrameState* mFrameState; + U32 mChildTime; + }; + static CurTimerData sCurTimerData; + private: - static LLFastTimer* sCurTimer; static S32 sCurFrameIndex; static S32 sLastFrameIndex; static U64 sLastFrameTime; static info_list_t* sTimerInfos; - U32 mStartSelfTime; // start time + time of all child timers - U32 mStartTotalTime; // start time + time of all child timers - NamedTimer::FrameState* mFrameState; - LLFastTimer* mLastTimer; + U32 mStartTime; + LLFastTimer::FrameState* mFrameState; + LLFastTimer::CurTimerData mLastTimerData; + }; +typedef class LLFastTimer LLFastTimer; + #endif // LL_LLFASTTIMER_H diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index ed8d10a88c..3d2eaed5c5 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -37,6 +37,8 @@ #include "llpluginclassmedia.h" #include "llpluginmessageclasses.h" +#include "llqtwebkit.h" + static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256; static int nextPowerOf2( int value ) @@ -124,7 +126,7 @@ void LLPluginClassMedia::reset() mCanPaste = false; mMediaName.clear(); mMediaDescription.clear(); - mBackgroundColor = LLColor4::white; + mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f); // media_browser class mNavigateURI.clear(); @@ -134,6 +136,9 @@ void LLPluginClassMedia::reset() mHistoryForwardAvailable = false; mStatusText.clear(); mProgressPercent = 0; + mClickURL.clear(); + mClickTarget.clear(); + mClickTargetType = TARGET_NONE; // media_time class mCurrentTime = 0.0f; @@ -669,6 +674,26 @@ void LLPluginClassMedia::paste() sendMessage(message); } +LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type) +{ + // convert a LinkTargetType value from llqtwebkit to an ETargetType + // so that we don't expose the llqtwebkit header in viewer code + switch (target_type) + { + case LinkTargetType::LTT_TARGET_NONE: + return LLPluginClassMedia::TARGET_NONE; + + case LinkTargetType::LTT_TARGET_BLANK: + return LLPluginClassMedia::TARGET_BLANK; + + case LinkTargetType::LTT_TARGET_EXTERNAL: + return LLPluginClassMedia::TARGET_EXTERNAL; + + default: + return LLPluginClassMedia::TARGET_OTHER; + } +} + /* virtual */ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { @@ -921,12 +946,15 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { mClickURL = message.getValue("uri"); mClickTarget = message.getValue("target"); + U32 target_type = message.getValueU32("target_type"); + mClickTargetType = ::getTargetTypeFromLLQtWebkit(target_type); mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF); } else if(message_name == "click_nofollow") { mClickURL = message.getValue("uri"); mClickTarget.clear(); + mClickTargetType = TARGET_NONE; mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW); } else diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 5a1928ab1d..ebb9099576 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -214,6 +214,17 @@ public: // This is valid after MEDIA_EVENT_CLICK_LINK_HREF std::string getClickTarget() const { return mClickTarget; }; + typedef enum + { + TARGET_NONE, // empty href target string + TARGET_BLANK, // target to open link in user's preferred browser + TARGET_EXTERNAL, // target to open link in external browser + TARGET_OTHER // nonempty and unsupported target type + }ETargetType; + + // This is valid after MEDIA_EVENT_CLICK_LINK_HREF + ETargetType getClickTargetType() const { return mClickTargetType; }; + std::string getMediaName() const { return mMediaName; }; std::string getMediaDescription() const { return mMediaDescription; }; @@ -344,6 +355,7 @@ protected: std::string mLocation; std::string mClickURL; std::string mClickTarget; + ETargetType mClickTargetType; ///////////////////////////////////////// // media_time class diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 845203b420..a17e306325 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -878,9 +878,11 @@ void LLFloater::setSnappedTo(const LLView* snap_view) else { //RN: assume it's a floater as it must be a sibling to our parent floater - LLFloater* floaterp = (LLFloater*)snap_view; - - setSnapTarget(floaterp->getHandle()); + const LLFloater* floaterp = dynamic_cast<const LLFloater*>(snap_view); + if (floaterp) + { + setSnapTarget(floaterp->getHandle()); + } } } @@ -1065,10 +1067,6 @@ void LLFloater::setMinimized(BOOL minimize) reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE ); } - // don't show the help button while minimized - it's - // not very useful when minimized and uses up space - mButtonsEnabled[BUTTON_HELP] = !minimize; - applyTitle (); make_ui_sound("UISndWindowClose"); @@ -1741,14 +1739,32 @@ void LLFloater::updateButtons() S32 button_count = 0; for (S32 i = 0; i < BUTTON_COUNT; i++) { - if(!mButtons[i]) continue; - mButtons[i]->setEnabled(mButtonsEnabled[i]); + if (!mButtons[i]) + { + continue; + } - if (mButtonsEnabled[i] - //*HACK: always render close button for hosted floaters - // so that users don't accidentally hit the button when closing multiple windows - // in the chatterbox - || (i == BUTTON_CLOSE && mButtonScale != 1.f)) + bool enabled = mButtonsEnabled[i]; + if (i == BUTTON_HELP) + { + // don't show the help button if the floater is minimized + // or if it is a tear-off hosted floater + if (isMinimized() || mButtonsEnabled[BUTTON_TEAR_OFF]) + { + enabled = false; + } + } + if (i == BUTTON_CLOSE && mButtonScale != 1.f) + { + //*HACK: always render close button for hosted floaters so + //that users don't accidentally hit the button when + //closing multiple windows in the chatterbox + enabled = true; + } + + mButtons[i]->setEnabled(enabled); + + if (enabled) { button_count++; @@ -1775,7 +1791,7 @@ void LLFloater::updateButtons() // the restore button should have a tab stop so that it takes action when you Ctrl-Tab to a minimized floater mButtons[i]->setTabStop(i == BUTTON_RESTORE); } - else if (mButtons[i]) + else { mButtons[i]->setVisible(FALSE); } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index bd67949c2a..21f3f15739 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2966,7 +2966,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y); LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y); - const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect(); + const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect(); const S32 HPAD = 2; LLRect rect = menu->getRect(); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index e8fc9475a5..f2c3879a6c 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -308,7 +308,8 @@ LLTextEditor::~LLTextEditor() // Scrollbar is deleted by LLView std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); - delete mContextMenu; + // context menu is owned by menu holder, not us + //delete mContextMenu; } //////////////////////////////////////////////////////////// diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index a0336f6156..084cdd9561 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -429,6 +429,7 @@ private: LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); message.setValue("uri", event.getStringValue()); message.setValue("target", event.getStringValue2()); + message.setValueU32("target_type", event.getLinkType()); sendMessage(message); } diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 32761dbf27..5b4edefbc1 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -218,7 +218,6 @@ set(viewer_SOURCE_FILES llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp - llfloatervolumepulldown.cpp llfloaterwater.cpp llfloaterwhitelistentry.cpp llfloaterwindlight.cpp @@ -256,6 +255,7 @@ set(viewer_SOURCE_FILES llinspectgroup.cpp llinspectobject.cpp llinspectremoteobject.cpp + llinspecttoast.cpp llinventorybridge.cpp llinventoryclipboard.cpp llinventoryfilter.cpp @@ -355,6 +355,7 @@ set(viewer_SOURCE_FILES llpanelshower.cpp llpanelteleporthistory.cpp llpanelvolume.cpp + llpanelvolumepulldown.cpp llparcelselection.cpp llparticipantlist.cpp llpatchvertexarray.cpp @@ -393,6 +394,7 @@ set(viewer_SOURCE_FILES llspatialpartition.cpp llspeakbutton.cpp llspeakers.cpp + llspeakingindicatormanager.cpp llsplitbutton.cpp llsprite.cpp llstartup.cpp @@ -765,6 +767,7 @@ set(viewer_HEADER_FILES llinspectgroup.h llinspectobject.h llinspectremoteobject.h + llinspecttoast.h llinventorybridge.h llinventoryclipboard.h llinventoryfilter.h @@ -860,6 +863,7 @@ set(viewer_HEADER_FILES llpanelshower.h llpanelteleporthistory.h llpanelvolume.h + llpanelvolumepulldown.h llparcelselection.h llparticipantlist.h llpatchvertexarray.h @@ -900,6 +904,7 @@ set(viewer_HEADER_FILES llspatialpartition.h llspeakbutton.h llspeakers.h + llspeakingindicatormanager.h llsplitbutton.h llsprite.h llstartup.h @@ -1770,6 +1775,7 @@ if (INSTALL) endif (INSTALL) if (LL_TESTS) +else (LL_TESTS) # To add a viewer unit test, just add the test .cpp file below # This creates a separate test project per file listed. include(LLAddBuildTest) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4bfc6f9e4f..db759f052a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1141,7 +1141,18 @@ <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> + <key>Value</key> + <integer>5</integer> + </map> + <key>CallFloaterMaxItems</key> + <map> + <key>Comment</key> + <string>Max number of visible participants in voice controls window</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> <key>Value</key> <integer>1</integer> </map> diff --git a/indra/newview/installers/darwin/fix_application_icon_position.sh b/indra/newview/installers/darwin/fix_application_icon_position.sh new file mode 100644 index 0000000000..a0b72a89f2 --- /dev/null +++ b/indra/newview/installers/darwin/fix_application_icon_position.sh @@ -0,0 +1,14 @@ +# just run this script each time after you change the installer's name to fix the icon misalignment +#!/bin/bash +cp -r ./../../../build-darwin-i386/newview/*.dmg ~/Desktop/TempBuild.dmg +hdid ~/Desktop/TempBuild.dmg +open -a finder /Volumes/Second\ Life\ Installer +osascript dmg-cleanup.applescript +cp /Volumes/Second\ Life\ Installer/.DS_Store ~/Desktop/_DS_Store +chflags nohidden ~/Desktop/_DS_Store +cp ~/Desktop/_DS_Store ./firstlook-dmg/_DS_Store +cp ~/Desktop/_DS_Store ./publicnightly-dmg/_DS_Store +cp ~/Desktop/_DS_Store ./release-dmg/_DS_Store +cp ~/Desktop/_DS_Store ./releasecandidate-dmg/_DS_Store +umount /Volumes/Second\ Life\ Installer/ +rm ~/Desktop/_DS_Store ~/Desktop/TempBuild.dmg diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 5e2e374df6..5ea253709c 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -514,6 +514,8 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) } setFocusOnAvatar(TRUE, ANIMATE); + + mCameraFOVZoomFactor = 0.f; } mHUDTargetZoom = 1.f; @@ -3584,7 +3586,7 @@ F32 LLAgent::calcCameraFOVZoomFactor() { return 0.f; } - else if (mFocusObject.notNull() && !mFocusObject->isAvatar()) + else if (mFocusObject.notNull() && !mFocusObject->isAvatar() && !mFocusOnAvatar) { // don't FOV zoom on mostly transparent objects LLVector3 focus_offset = mFocusObjectOffset; @@ -5157,6 +5159,11 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO return FALSE; } +BOOL LLAgent::canJoinGroups() const +{ + return mGroups.count() < MAX_AGENT_GROUPS; +} + LLQuaternion LLAgent::getHeadRotation() { if (mAvatarObject.isNull() || !mAvatarObject->mPelvisp || !mAvatarObject->mHeadp) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 2e95dc72be..beede7fbe3 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -972,6 +972,7 @@ public: BOOL setGroupContribution(const LLUUID& group_id, S32 contribution); BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile); const std::string &getGroupName() const { return mGroupName; } + BOOL canJoinGroups() const; private: std::string mGroupName; LLUUID mGroupID; diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 5df73a994e..19e9e52ddf 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -82,7 +82,7 @@ void LLAvatarList::setSpeakingIndicatorsVisible(bool visible) getItems(items); for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) { - static_cast<LLAvatarListItem*>(*it)->setSpeakingIndicatorVisible(mShowSpeakingIndicator); + static_cast<LLAvatarListItem*>(*it)->showSpeakingIndicator(mShowSpeakingIndicator); } } @@ -323,18 +323,15 @@ boost::signals2::connection LLAvatarList::setRefreshCompleteCallback(const commi void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); - item->showInfoBtn(true); - item->showSpeakingIndicator(true); item->setName(name); item->setAvatarId(id, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); - item->childSetVisible("info_btn", false); item->setAvatarIconVisible(mShowIcons); item->setShowInfoBtn(mShowInfoBtn); item->setShowProfileBtn(mShowProfileBtn); - item->setSpeakingIndicatorVisible(mShowSpeakingIndicator); + item->showSpeakingIndicator(mShowSpeakingIndicator); addItem(item, id, pos); } diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 6945ac6932..1043858373 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -44,10 +44,10 @@ #include "llbutton.h" bool LLAvatarListItem::sStaticInitialized = false; -S32 LLAvatarListItem::sIconWidth = 0; -S32 LLAvatarListItem::sInfoBtnWidth = 0; -S32 LLAvatarListItem::sProfileBtnWidth = 0; -S32 LLAvatarListItem::sSpeakingIndicatorWidth = 0; +S32 LLAvatarListItem::sLeftPadding = 0; +S32 LLAvatarListItem::sRightNamePadding = 0; +S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT]; + LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), @@ -91,43 +91,25 @@ BOOL LLAvatarListItem::postBuild() mProfileBtn->setVisible(false); mProfileBtn->setClickedCallback(boost::bind(&LLAvatarListItem::onProfileBtnClick, this)); - // Remember avatar icon width including its padding from the name text box, - // so that we can hide and show the icon again later. if (!sStaticInitialized) { - sIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; - sInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; - sProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; - sSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + // Remember children widths including their padding from the next sibling, + // so that we can hide and show them again later. + initChildrenWidths(this); sStaticInitialized = true; } -/* - if(!p.buttons.profile) - { - delete mProfile; - mProfile = NULL; - - LLRect rect; - - rect.setLeftTopAndSize(mName->getRect().mLeft, mName->getRect().mTop, mName->getRect().getWidth() + 30, mName->getRect().getHeight()); - mName->setRect(rect); - - if(mLocator) - { - rect.setLeftTopAndSize(mLocator->getRect().mLeft + 30, mLocator->getRect().mTop, mLocator->getRect().getWidth(), mLocator->getRect().getHeight()); - mLocator->setRect(rect); - } + return TRUE; +} - if(mInfo) - { - rect.setLeftTopAndSize(mInfo->getRect().mLeft + 30, mInfo->getRect().mTop, mInfo->getRect().getWidth(), mInfo->getRect().getHeight()); - mInfo->setRect(rect); - } +S32 LLAvatarListItem::notifyParent(const LLSD& info) +{ + if (info.has("visibility_changed")) + { + updateChildren(); } -*/ - return TRUE; + return 0; } void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) @@ -137,6 +119,8 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) mProfileBtn->setVisible(mShowProfileBtn); LLPanel::onMouseEnter(x, y, mask); + + updateChildren(); } void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) @@ -146,6 +130,8 @@ void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) mProfileBtn->setVisible(false); LLPanel::onMouseLeave(x, y, mask); + + updateChildren(); } // virtual, called by LLAvatarTracker @@ -215,12 +201,8 @@ void LLAvatarListItem::showLastInteractionTime(bool show) if (show) return; - LLRect name_rect = mAvatarName->getRect(); - LLRect time_rect = mLastInteractionTime->getRect(); - mLastInteractionTime->setVisible(false); - name_rect.mRight += (time_rect.mRight - name_rect.mRight); - mAvatarName->setRect(name_rect); + updateChildren(); } void LLAvatarListItem::setLastInteractionTime(U32 secs_since) @@ -234,12 +216,6 @@ void LLAvatarListItem::setShowInfoBtn(bool show) if(mShowInfoBtn == show) return; mShowInfoBtn = show; - S32 width_delta = show ? - sInfoBtnWidth : sInfoBtnWidth; - - //Translating speaking indicator - mSpeakingIndicator->translate(width_delta, 0); - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } void LLAvatarListItem::setShowProfileBtn(bool show) @@ -248,24 +224,17 @@ void LLAvatarListItem::setShowProfileBtn(bool show) if(mShowProfileBtn == show) return; mShowProfileBtn = show; - S32 width_delta = show ? - sProfileBtnWidth : sProfileBtnWidth; - - //Translating speaking indicator - mSpeakingIndicator->translate(width_delta, 0); - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } -void LLAvatarListItem::setSpeakingIndicatorVisible(bool visible) +void LLAvatarListItem::showSpeakingIndicator(bool visible) { // Already done? Then do nothing. if (mSpeakingIndicator->getVisible() == (BOOL)visible) return; - mSpeakingIndicator->setVisible(visible); - S32 width_delta = visible ? - sSpeakingIndicatorWidth : sSpeakingIndicatorWidth; - - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); +// Disabled to not contradict with SpeakingIndicatorManager functionality. EXT-3976 +// probably this method should be totally removed. +// mSpeakingIndicator->setVisible(visible); +// updateChildren(); } void LLAvatarListItem::setAvatarIconVisible(bool visible) @@ -276,36 +245,12 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible) // Show/hide avatar icon. mAvatarIcon->setVisible(visible); - - // Move the avatar name horizontally by icon size + its distance from the avatar name. - LLRect name_rect = mAvatarName->getRect(); - name_rect.mLeft += visible ? sIconWidth : -sIconWidth; - mAvatarName->setRect(name_rect); + updateChildren(); } void LLAvatarListItem::onInfoBtnClick() { LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); - - /* TODO fix positioning of inspector - localPointToScreen(mXPos, mYPos, &mXPos, &mYPos); - - - LLRect rect; - - // *TODO Vadim: rewrite this. "+= -" looks weird. - S32 delta = mYPos - inspector->getRect().getHeight(); - if(delta < 0) - { - mYPos += -delta; - } - - rect.setLeftTopAndSize(mXPos, mYPos, - inspector->getRect().getWidth(), inspector->getRect().getHeight()); - inspector->setRect(rect); - inspector->setFrontmost(true); - inspector->setVisible(true); - */ } void LLAvatarListItem::onProfileBtnClick() @@ -344,21 +289,6 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str setName(name); } -void LLAvatarListItem::reshapeAvatarName() -{ - S32 width_delta = 0; - width_delta += mShowProfileBtn ? sProfileBtnWidth : 0; - width_delta += mSpeakingIndicator->getVisible() ? sSpeakingIndicatorWidth : 0; - width_delta += mAvatarIcon->getVisible() ? sIconWidth : 0; - width_delta += mShowInfoBtn ? sInfoBtnWidth : 0; - width_delta += mLastInteractionTime->getVisible() ? mLastInteractionTime->getRect().getWidth() : 0; - - S32 height = mAvatarName->getRect().getHeight(); - S32 width = getRect().getWidth() - width_delta; - - mAvatarName->reshape(width, height); -} - // Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", // taking i18n into account. The format string to use is taken from the panel XML. std::string LLAvatarListItem::formatSeconds(U32 secs) @@ -492,4 +422,133 @@ LLAvatarListItem::icon_color_map_t& LLAvatarListItem::getItemIconColorMap() return item_icon_color_map; } +// static +void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) +{ + //profile btn width + padding + S32 profile_btn_width = avatar_item->getRect().getWidth() - avatar_item->mProfileBtn->getRect().mLeft; + + //info btn width + padding + S32 info_btn_width = avatar_item->mProfileBtn->getRect().mLeft - avatar_item->mInfoBtn->getRect().mLeft; + + //speaking indicator width + padding + S32 speaking_indicator_width = avatar_item->mInfoBtn->getRect().mLeft - avatar_item->mSpeakingIndicator->getRect().mLeft; + + // last interaction time textbox width + padding + S32 last_interaction_time_width = avatar_item->mSpeakingIndicator->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft; + + // icon width + padding + S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft; + + sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft; + sRightNamePadding = avatar_item->mLastInteractionTime->getRect().mLeft - avatar_item->mAvatarName->getRect().mRight; + + S32 index = ALIC_COUNT; + sChildrenWidths[--index] = icon_width; + sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space" + sChildrenWidths[--index] = last_interaction_time_width; + sChildrenWidths[--index] = speaking_indicator_width; + sChildrenWidths[--index] = info_btn_width; + sChildrenWidths[--index] = profile_btn_width; +} + +void LLAvatarListItem::updateChildren() +{ + LL_DEBUGS("AvatarItemReshape") << LL_ENDL; + LL_DEBUGS("AvatarItemReshape") << "Updating for: " << getAvatarName() << LL_ENDL; + + S32 name_new_width = getRect().getWidth(); + S32 ctrl_new_left = name_new_width; + S32 name_new_left = sLeftPadding; + + // iterate through all children and set them into correct position depend on each child visibility + // assume that child indexes are in back order: the first in Enum is the last (right) in the item + // iterate & set child views starting from right to left + for (S32 i = 0; i < ALIC_COUNT; ++i) + { + // skip "name" textbox, it will be processed out of loop later + if (ALIC_NAME == i) continue; + + LLView* control = getItemChildView((EAvatarListItemChildIndex)i); + + LL_DEBUGS("AvatarItemReshape") << "Processing control: " << control->getName() << LL_ENDL; + // skip invisible views + if (!control->getVisible()) continue; + + S32 ctrl_width = sChildrenWidths[i]; // including space between current & left controls + + // decrease available for + name_new_width -= ctrl_width; + LL_DEBUGS("AvatarItemReshape") << "width: " << ctrl_width << ", name_new_width: " << name_new_width << LL_ENDL; + + LLRect control_rect = control->getRect(); + LL_DEBUGS("AvatarItemReshape") << "rect before: " << control_rect << LL_ENDL; + + if (ALIC_ICON == i) + { + // assume that this is the last iteration, + // so it is not necessary to save "ctrl_new_left" value calculated on previous iterations + ctrl_new_left = sLeftPadding; + name_new_left = ctrl_new_left + ctrl_width; + } + else + { + ctrl_new_left -= ctrl_width; + } + + LL_DEBUGS("AvatarItemReshape") << "ctrl_new_left: " << ctrl_new_left << LL_ENDL; + + control_rect.setLeftTopAndSize( + ctrl_new_left, + control_rect.mTop, + control_rect.getWidth(), + control_rect.getHeight()); + + LL_DEBUGS("AvatarItemReshape") << "rect after: " << control_rect << LL_ENDL; + control->setShape(control_rect); + } + + // set size and position of the "name" child + LLView* name_view = getItemChildView(ALIC_NAME); + LLRect name_view_rect = name_view->getRect(); + LL_DEBUGS("AvatarItemReshape") << "name rect before: " << name_view_rect << LL_ENDL; + + // apply paddings + name_new_width -= sLeftPadding; + name_new_width -= sRightNamePadding; + + name_view_rect.setLeftTopAndSize( + name_new_left, + name_view_rect.mTop, + name_new_width, + name_view_rect.getHeight()); + + name_view->setShape(name_view_rect); + + LL_DEBUGS("AvatarItemReshape") << "name rect after: " << name_view_rect << LL_ENDL; +} + +LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index) +{ + LLView* child_view = mAvatarName; + if (child_view_index < 0 || ALIC_COUNT <= child_view_index) + { + LL_WARNS("AvatarItemReshape") << "Child view index is out of range: " << child_view_index << LL_ENDL; + return child_view; + } + switch (child_view_index) + { + case ALIC_ICON: child_view = mAvatarIcon; break; + case ALIC_NAME: child_view = mAvatarName; break; + case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break; + case ALIC_SPEAKER_INDICATOR: child_view = mSpeakingIndicator; break; + case ALIC_INFO_BUTTON: child_view = mInfoBtn; break; + case ALIC_PROFILE_BUTTON: child_view = mProfileBtn; break; + default: + LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL; + } + + return child_view; +} + // EOF diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 96097bc9b5..f76ffb391d 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -74,6 +74,11 @@ public: virtual ~LLAvatarListItem(); virtual BOOL postBuild(); + + /** + * Processes notification from speaker indicator to update children when indicator's visibility is changed. + */ + virtual S32 notifyParent(const LLSD& info); virtual void onMouseLeave(S32 x, S32 y, MASK mask); virtual void onMouseEnter(S32 x, S32 y, MASK mask); virtual void setValue(const LLSD& value); @@ -88,7 +93,8 @@ public: //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); void setShowInfoBtn(bool show); - void setSpeakingIndicatorVisible(bool visible); + void showSpeakingIndicator(bool show); + void showLastInteractionTime(bool show); void setAvatarIconVisible(bool visible); const LLUUID& getAvatarId() const; @@ -97,17 +103,6 @@ public: void onInfoBtnClick(); void onProfileBtnClick(); - void showSpeakingIndicator(bool show) { mSpeakingIndicator->setVisible(show); } - void showInfoBtn(bool show_info_btn) {mInfoBtn->setVisible(show_info_btn); } - void showLastInteractionTime(bool show); - - /** - * This method was added to fix EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label) - * But this is a *HACK. The real reason of it was in incorrect logic while hiding profile/info/speaker buttons - * *TODO: new reshape method should be provided in lieu of this one to be called when visibility if those buttons is changed - */ - void reshapeAvatarName(); - protected: /** * Contains indicator to show voice activity. @@ -124,6 +119,23 @@ private: E_UNKNOWN, } EOnlineStatus; + /** + * Enumeration of item elements in order from right to left. + * + * updateChildren() assumes that indexes are in the such order to process avatar icon easier. + * + * @see updateChildren() + */ + typedef enum e_avatar_item_child { + ALIC_PROFILE_BUTTON, + ALIC_INFO_BUTTON, + ALIC_SPEAKER_INDICATOR, + ALIC_INTERACTION_TIME, + ALIC_NAME, + ALIC_ICON, + ALIC_COUNT, + } EAvatarListItemChildIndex; + void setNameInternal(const std::string& name, const std::string& highlight); void onNameCache(const std::string& first_name, const std::string& last_name); @@ -135,6 +147,26 @@ private: typedef std::map<EItemState, LLColor4> icon_color_map_t; static icon_color_map_t& getItemIconColorMap(); + /** + * Initializes widths of all children to use them while changing visibility of any of them. + * + * @see updateChildren() + */ + static void initChildrenWidths(LLAvatarListItem* self); + + /** + * Updates position and rectangle of visible children to fit all available item's width. + */ + void updateChildren(); + + /** + * Gets child view specified by index. + * + * This method implemented via switch by all EAvatarListItemChildIndex values. + * It is used to not store children in array or vector to avoid of increasing memory usage. + */ + LLView* getItemChildView(EAvatarListItemChildIndex child_index); + LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; LLStyle::Params mAvatarNameStyle; @@ -151,10 +183,17 @@ private: bool mShowProfileBtn; static bool sStaticInitialized; // this variable is introduced to improve code readability - static S32 sIconWidth; // icon width + padding - static S32 sInfoBtnWidth; //info btn width + padding - static S32 sProfileBtnWidth; //profile btn width + padding - static S32 sSpeakingIndicatorWidth; //speaking indicator width + padding + static S32 sLeftPadding; // padding to first left visible child (icon or name) + static S32 sRightNamePadding; // right padding from name to next visible child + + /** + * Contains widths of each child specified by EAvatarListItemChildIndex + * including padding to the next right one. + * + * @see initChildrenWidths() + */ + static S32 sChildrenWidths[ALIC_COUNT]; + }; #endif //LL_LLAVATARLISTITEM_H diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 976b312509..beccefa430 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -161,6 +161,9 @@ void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& nam { chiclet->setIMSessionName(name); chiclet->setOtherParticipantId(other_participant_id); + + LLIMFloater::onIMChicletCreated(session_id); + } else { @@ -251,14 +254,24 @@ void LLBottomTray::setVisible(BOOL visible) { LLView* viewp = *child_it; std::string name = viewp->getName(); - - if ("chat_bar" == name || "movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name || "gesture_panel" == name) + + // Chat bar and gesture button are shown even in mouselook mode. But the move, camera and snapshot buttons shouldn't be displayed. See EXT-3988. + if ("chat_bar" == name || "gesture_panel" == name || (visibility && ("movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name))) continue; else { viewp->setVisible(visibility); } } + + // Apply the saved settings when we are not in mouselook mode, see EXT-3988. + if (visibility) + { + showCameraButton(gSavedSettings.getBOOL("ShowCameraButton")); + showSnapshotButton(gSavedSettings.getBOOL("ShowSnapshotButton")); + showMoveButton(gSavedSettings.getBOOL("ShowMoveButton")); + showGestureButton(gSavedSettings.getBOOL("ShowGestureButton")); + } } } diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 1468f6d584..c0efb85b51 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -51,6 +51,7 @@ #include "lltransientfloatermgr.h" #include "llviewerwindow.h" #include "llvoicechannel.h" +#include "lllayoutstack.h" static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids); @@ -314,7 +315,7 @@ void LLCallFloater::updateSession() //hide "Leave Call" button for nearby chat bool is_local_chat = mVoiceType == VC_LOCAL_CHAT; - childSetVisible("leave_call_btn", !is_local_chat); + childSetVisible("leave_call_btn_panel", !is_local_chat); refreshParticipantList(); updateAgentModeratorState(); @@ -818,8 +819,8 @@ void reshape_floater(LLCallFloater* floater, S32 delta_height) } } - floater->reshape(floater_rect.getWidth(), floater_rect.getHeight()); - floater->setRect(floater_rect); + floater->setShape(floater_rect); + floater->getChild<LLLayoutStack>("my_call_stack")->updateLayout(FALSE); } void LLCallFloater::reshapeToFitContent() @@ -864,9 +865,8 @@ S32 LLCallFloater::getParticipantItemHeight() S32 LLCallFloater::getMaxVisibleItems() { - S32 value = 5; // default value, in case convertToS32() fails. - LLStringUtil::convertToS32(getString("max_visible_items"), value); - return value; + static LLCachedControl<S32> max_visible_items(*LLUI::sSettingGroups["config"],"CallFloaterMaxItems"); + return max_visible_items; } //EOF diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cda3e3a419..2fc83c7e54 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -499,7 +499,24 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ style_params.font.name(font_name); style_params.font.size(font_size); style_params.font.style(input_append_params.font.style); - + + std::string prefix = chat.mText.substr(0, 4); + + //IRC styled /me messages. + bool irc_me = prefix == "/me " || prefix == "/me'"; + + // Delimiter after a name in header copy/past and in plain text mode + std::string delimiter = (chat.mChatType != CHAT_TYPE_SHOUT && chat.mChatType != CHAT_TYPE_WHISPER) + ? ": " + : " "; + + // Don't add any delimiter after name in irc styled messages + if (irc_me || chat.mChatStyle == CHAT_STYLE_IRC) + { + delimiter = LLStringUtil::null; + style_params.font.style = "ITALIC"; + } + if (use_plain_text_chat_history) { mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, style_params); @@ -512,11 +529,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ LLStyle::Params link_params(style_params); link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); // Convert the name to a hotlink and add to message. - mEditor->appendText(chat.mFromName + ": ", false, link_params); + mEditor->appendText(chat.mFromName + delimiter, false, link_params); } else { - mEditor->appendText(chat.mFromName + ": ", false, style_params); + mEditor->appendText(chat.mFromName + delimiter, false, style_params); } } } @@ -562,36 +579,22 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ std::string header_text = "[" + chat.mTimeStr + "] "; if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - header_text += chat.mFromName + ": "; + header_text += chat.mFromName + delimiter; mEditor->appendWidget(p, header_text, false); mLastFromName = chat.mFromName; mLastFromID = chat.mFromID; mLastMessageTime = new_message_time; } - //Handle IRC styled /me messages. - std::string prefix = chat.mText.substr(0, 4); - if (prefix == "/me " || prefix == "/me'") - { - style_params.font.style = "ITALIC"; - if (chat.mFromName.size() > 0) - mEditor->appendText(chat.mFromName, TRUE, style_params); + std::string message = irc_me ? chat.mText.substr(3) : chat.mText; + if ( message.size() > 0 && !LLStringOps::isSpace(message[message.size() - 1]) ) + { // Ensure that message ends with NewLine, to avoid losing of new lines // while copy/paste from text chat. See EXT-3263. - mEditor->appendText(chat.mText.substr(3) + NEW_LINE, FALSE, style_params); - } - else - { - std::string message(chat.mText); - if ( message.size() > 0 && !LLStringOps::isSpace(message[message.size() - 1]) ) - { - // Ensure that message ends with NewLine, to avoid losing of new lines - // while copy/paste from text chat. See EXT-3263. - message += NEW_LINE; - } - mEditor->appendText(message, FALSE, style_params); + message += NEW_LINE; } + mEditor->appendText(message, FALSE, style_params); mEditor->blockUndo(); // automatically scroll to end when receiving chat from myself diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index aa343b2f69..ef69f39ad2 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -269,7 +269,7 @@ LLSD LLFloaterAbout::getInfo() info["VIVOX_VERSION"] = gVoiceClient ? gVoiceClient->getAPIVersion() : LLTrans::getString("NotConnected"); // TODO: Implement media plugin version query - info["QT_WEBKIT_VERSION"] = "4.5.2 (version number hard-coded)"; + info["QT_WEBKIT_VERSION"] = "4.6 (version number hard-coded)"; if (gPacketsIn > 0) { diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index b9e0f928f1..18b9f0484f 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -190,7 +190,14 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) { if (log_to_file && (gSavedPerAccountSettings.getBOOL("LogChat"))) { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); + if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT) + { + LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); + } + else + { + LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText); + } } LLColor4 color = get_text_color(chat); @@ -311,8 +318,10 @@ void LLFloaterChat::addChat(const LLChat& chat, BOOL from_instant_message, BOOL triggerAlerts(chat.mText); // Add the sender to the list of people with which we've recently interacted. - if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) - LLRecentPeople::instance().add(chat.mFromID); + // this is not the best place to add _all_ messages to recent list + // comment this for now, may remove later on code cleanup + //if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) + // LLRecentPeople::instance().add(chat.mFromID); bool add_chat = true; bool log_chat = true; diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 5072bc8c82..6a9c602db2 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -415,7 +415,7 @@ void LLFloaterGesture::onClickPlay() LL_DEBUGS("Gesture")<<" Trying to play gesture id: "<< item_id <<LL_ENDL; if(!LLGestureManager::instance().isGestureActive(item_id)) { - // we need to inform server about gesture activating to be consistent with LLPreviewGesture and LLGestureComboBox. + // we need to inform server about gesture activating to be consistent with LLPreviewGesture and LLGestureComboList. BOOL inform_server = TRUE; BOOL deactivate_similar = FALSE; LLGestureManager::instance().setGestureLoadedCallback(item_id, boost::bind(&LLFloaterGesture::playGesture, this, item_id)); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 7cb925bc0b..29f415bd43 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -247,14 +247,7 @@ void LLPanelGroups::enableButtons() childDisable("IM"); childDisable("Leave"); } - if(gAgent.mGroups.count() < MAX_AGENT_GROUPS) - { - childEnable("Create"); - } - else - { - childDisable("Create"); - } + childSetEnabled("Create", gAgent.canJoinGroups()); } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 598a13de15..42c961a956 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -276,6 +276,7 @@ void LLFloaterLand::refresh() mPanelAudio->refresh(); mPanelMedia->refresh(); mPanelAccess->refresh(); + mPanelCovenant->refresh(); } @@ -2795,12 +2796,6 @@ LLPanelLandCovenant::~LLPanelLandCovenant() { } -BOOL LLPanelLandCovenant::postBuild() -{ - refresh(); - return TRUE; -} - // virtual void LLPanelLandCovenant::refresh() { diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index d7d02ba1a3..a4785e8f5b 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -391,7 +391,6 @@ class LLPanelLandCovenant public: LLPanelLandCovenant(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandCovenant(); - virtual BOOL postBuild(); void refresh(); static void updateCovenantText(const std::string& string); static void updateEstateName(const std::string& name); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d0716f67b8..9af37e8174 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -602,8 +602,8 @@ void LLFloaterPreference::onBtnOK() apply(); closeFloater(false); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); LLUIColorTable::instance().saveUserSettings(); + gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); // save all settings, even if equals defaults gCrashSettings.saveToFile(crash_settings_filename, FALSE); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index c4b87c1b2d..0402ba20e2 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -406,6 +406,11 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region) { + if (!region) + { + return; + } + // call refresh from region on all panels std::for_each( mInfoPanels.begin(), diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index df7aa9eabf..82293b4aa0 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -417,6 +417,16 @@ BOOL LLGestureManager::isGesturePlaying(const LLUUID& item_id) return gesture->mPlaying; } +BOOL LLGestureManager::isGesturePlaying(LLMultiGesture* gesture) +{ + if(!gesture) + { + return FALSE; + } + + return gesture->mPlaying; +} + void LLGestureManager::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_gesture, const LLUUID& asset_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index e80eea9ae9..c562587c6f 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -103,6 +103,8 @@ public: BOOL isGesturePlaying(const LLUUID& item_id); + BOOL isGesturePlaying(LLMultiGesture* gesture); + const item_map_t& getActiveGestures() const { return mActive; } // Force a gesture to be played, for example, if it is being // previewed. diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 7dd8ea694e..d6e2bb0445 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -146,6 +146,12 @@ void LLGroupActions::startCall(const LLUUID& group_id) // static void LLGroupActions::join(const LLUUID& group_id) { + if (!gAgent.canJoinGroups()) + { + LLNotificationsUtil::add("JoinedTooManyGroups"); + return; + } + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); @@ -226,7 +232,9 @@ void LLGroupActions::activate(const LLUUID& group_id) static bool isGroupUIVisible() { - LLPanel* panel = LLSideTray::getInstance()->findChild<LLPanel>("panel_group_info_sidetray"); + static LLPanel* panel = 0; + if(!panel) + panel = LLSideTray::getInstance()->findChild<LLPanel>("panel_group_info_sidetray"); if(!panel) return false; return panel->isInVisibleChain(); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b05568f353..aee34eb0af 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -361,35 +361,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { if (!gIMMgr->hasSession(session_id)) return NULL; - // we should make sure all related chiclets are in place when the session is a voice call - // chiclets come firts, then comes IM window - if (gIMMgr->isVoiceCall(session_id)) - { - LLIMModel* im_model = LLIMModel::getInstance(); - LLBottomTray* b_tray = LLBottomTray::getInstance(); - - //*TODO hide that into Bottom tray - if (!b_tray->getChicletPanel()->findChiclet<LLChiclet>(session_id)) - { - LLIMChiclet* chiclet = b_tray->createIMChiclet(session_id); - if(chiclet) - { - chiclet->setIMSessionName(im_model->getName(session_id)); - chiclet->setOtherParticipantId(im_model->getOtherParticipantID(session_id)); - } - } - - LLIMWellWindow::getInstance()->addIMRow(session_id); - } - - bool not_existed = true; - - if(isChatMultiTab()) - { - LLIMFloater* target_floater = findInstance(session_id); - not_existed = NULL == target_floater; - } - else + if(!isChatMultiTab()) { //hide all LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); @@ -404,19 +376,33 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) } } - LLIMFloater* floater = LLFloaterReg::showTypedInstance<LLIMFloater>("impanel", session_id); + bool exist = findInstance(session_id); + + LLIMFloater* floater = getInstance(session_id); + if (!floater) return NULL; if(isChatMultiTab()) { + LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); + // do not add existed floaters to avoid adding torn off instances - if (not_existed) + if (!exist) { // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; + + if (floater_container) + { + floater_container->addFloater(floater, TRUE, i_pt); + } + } - LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance<LLIMFloaterContainer>("im_container"); - floater_container->addFloater(floater, TRUE, i_pt); + if (floater_container) + { + //selecting the panel resets a chiclet's counter + floater_container->selectFloater(floater); + floater_container->setVisible(TRUE); } } else @@ -443,8 +429,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) } // window is positioned, now we can show it. - floater->setVisible(true); } + floater->setVisible(TRUE); return floater; } @@ -484,16 +470,6 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) } } -void LLIMFloater::setTornOff(bool torn_off) -{ - // When IM Floater isn't torn off, "close" button should be hidden. - // This call will just disables it, since there is a hack in LLFloater::updateButton, - // which prevents hiding of close button in that case. - setCanClose(torn_off); - - LLTransientDockableFloater::setTornOff(torn_off); -} - void LLIMFloater::setVisible(BOOL visible) { LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*> @@ -548,6 +524,11 @@ LLIMFloater* LLIMFloater::findInstance(const LLUUID& session_id) return LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id); } +LLIMFloater* LLIMFloater::getInstance(const LLUUID& session_id) +{ + return LLFloaterReg::getTypedInstance<LLIMFloater>("impanel", session_id); +} + void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) { mSessionInitialized = true; @@ -1026,3 +1007,20 @@ void LLIMFloater::sRemoveTypingIndicator(const LLSD& data) floater->removeTypingIndicator(); } + +void LLIMFloater::onIMChicletCreated( const LLUUID& session_id ) +{ + + if (isChatMultiTab()) + { + LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance(); + if (!im_box) return; + + if (LLIMFloater::findInstance(session_id)) return; + + LLIMFloater* new_tab = LLIMFloater::getInstance(session_id); + + im_box->addFloater(new_tab, FALSE, LLTabContainer::END); + } + +} diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index bc7a43e852..d9db385d06 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -64,7 +64,6 @@ public: // LLFloater overrides /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); - /*virtual*/ void setTornOff(bool torn_off); // Make IM conversion visible and update the message history static LLIMFloater* show(const LLUUID& session_id); @@ -75,6 +74,8 @@ public: static LLIMFloater* findInstance(const LLUUID& session_id); + static LLIMFloater* getInstance(const LLUUID& session_id); + void sessionInitReplyReceived(const LLUUID& im_session_id); // get new messages from LLIMModel @@ -113,6 +114,8 @@ public: //used as a callback on receiving new IM message static void sRemoveTypingIndicator(const LLSD& data); + static void onIMChicletCreated(const LLUUID& session_id); + private: // process focus events to set a currently active session /* virtual */ void onFocusLost(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 2d7333f7e4..6cc985aef4 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -34,6 +34,7 @@ #include "llviewerprecompiledheaders.h" #include "llimfloatercontainer.h" +#include "llfloaterreg.h" // // LLIMFloaterContainer @@ -93,4 +94,14 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, } } +LLIMFloaterContainer* LLIMFloaterContainer::findInstance() +{ + return LLFloaterReg::findTypedInstance<LLIMFloaterContainer>("im_container"); +} + +LLIMFloaterContainer* LLIMFloaterContainer::getInstance() +{ + return LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container"); +} + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index ead7cf4730..d4a542dfc2 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -52,7 +52,11 @@ public: LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); static LLFloater* getCurrentVoiceFloater(); - + + static LLIMFloaterContainer* findInstance(); + + static LLIMFloaterContainer* getInstance(); + protected: LLFloater* mActiveVoiceFloater; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index daabf1f717..e9661003ea 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -382,10 +382,6 @@ void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& f mSpeakers->speakerChatted(from_id); mSpeakers->setSpeakerTyping(from_id, FALSE); } - - if( mSessionType == P2P_SESSION || - mSessionType == ADHOC_SESSION) - LLRecentPeople::instance().add(from_id); } void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& history) @@ -684,6 +680,12 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co LLIMSession* session = addMessageSilently(session_id, from, from_id, utf8_text, log2file); if (!session) return false; + //good place to add some1 to recent list + //other places may be called from message history. + if( !from_id.isNull() && + ( session->isP2PSessionType() || session->isAdHocSessionType() ) ) + LLRecentPeople::instance().add(from_id); + // notify listeners LLSD arg; arg["session_id"] = session_id; @@ -1377,7 +1379,7 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) } sSession = session; - sSession->mVoiceChannel->setStateChangedCallback(LLCallDialogManager::onVoiceChannelStateChanged); + sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3)); if(sCurrentSessionlName != session->mName) { sPreviousSessionlName = sCurrentSessionlName; @@ -1601,7 +1603,12 @@ void LLOutgoingCallDialog::show(const LLSD& key) if (!mPayload["disconnected_channel_name"].asString().empty()) { - childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); + std::string channel_name = mPayload["disconnected_channel_name"].asString(); + if (LLIMModel::LLIMSession::AVALINE_SESSION == mPayload["session_type"].asInteger()) + { + channel_name = LLTextUtil::formatPhoneNumber(channel_name); + } + childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", channel_name); childSetTextArg("nearby_P2P", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 20d8e28392..e72bda6c2b 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -78,6 +78,11 @@ public: bool isP2P(); bool isOtherParticipantAvaline(); + bool isP2PSessionType() const { return mSessionType == P2P_SESSION;} + bool isAdHocSessionType() const { return mSessionType == ADHOC_SESSION;} + bool isGroupSessionType() const { return mSessionType == GROUP_SESSION;} + bool isAvalineSessionType() const { return mSessionType == AVALINE_SESSION;} + LLUUID mSessionID; std::string mName; EInstantMessage mType; diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 8f4fba244d..0374a1d25b 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -418,6 +418,7 @@ void LLInspectAvatar::updateModeratorPanel() LLPointer<LLSpeaker> selected_speakerp = speaker_mgr->findSpeaker(mAvatarID); if(speaker_mgr->isVoiceActive() && selected_speakerp && + selected_speakerp->isInVoiceChannel() && ((self_speakerp && self_speakerp->mIsModerator) || gAgent.isGodlike())) { getChild<LLUICtrl>("enable_voice")->setVisible(selected_speakerp->mModeratorMutedVoice); diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp new file mode 100644 index 0000000000..3ca8fa2f56 --- /dev/null +++ b/indra/newview/llinspecttoast.cpp @@ -0,0 +1,122 @@ +/** + * @file llinspecttoast.cpp + * @brief Toast inspector implementation. + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + * + * Copyright (c) 2003-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" // must be first include + +#include "llinspecttoast.h" +#include "llinspect.h" +#include "llfloaterreg.h" +#include "llscreenchannel.h" +#include "llchannelmanager.h" +#include "lltransientfloatermgr.h" + +using namespace LLNotificationsUI; + +/** + * Represents inspectable toast . + */ +class LLInspectToast: public LLInspect +{ +public: + + LLInspectToast(const LLSD& notification_idl); + virtual ~LLInspectToast(); + + /*virtual*/ void onOpen(const LLSD& notification_id); +private: + void onToastDestroy(LLToast * toast); + +private: + LLPanel* mPanel; + LLScreenChannel* mScreenChannel; +}; + +LLInspectToast::LLInspectToast(const LLSD& notification_id) : + LLInspect(LLSD()), mPanel(NULL) +{ + LLScreenChannelBase* channel = LLChannelManager::getInstance()->findChannelByID( + LLUUID(gSavedSettings.getString("NotificationChannelUUID"))); + mScreenChannel = dynamic_cast<LLScreenChannel*>(channel); + if(NULL == mScreenChannel) + { + llwarns << "Could not get requested screen channel." << llendl; + return; + } + + LLTransientFloaterMgr::getInstance()->addControlView(this); +} +LLInspectToast::~LLInspectToast() +{ + LLTransientFloaterMgr::getInstance()->removeControlView(this); +} + +void LLInspectToast::onOpen(const LLSD& notification_id) +{ + LLInspect::onOpen(notification_id); + LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id); + if (toast == NULL) + { + llwarns << "Could not get requested toast from screen channel." << llendl; + return; + } + toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1)); + + LLPanel * panel = toast->getPanel(); + panel->setVisible(TRUE); + panel->setMouseOpaque(FALSE); + if(mPanel != NULL && mPanel->getParent() == this) + { + removeChild(mPanel); + } + addChild(panel); + panel->setFocus(TRUE); + mPanel = panel; + + + LLRect panel_rect; + panel_rect = panel->getRect(); + reshape(panel_rect.getWidth(), panel_rect.getHeight()); + + LLUI::positionViewNearMouse(this); +} + +void LLInspectToast::onToastDestroy(LLToast * toast) +{ + closeFloater(false); +} + +void LLNotificationsUI::registerFloater() +{ + LLFloaterReg::add("inspect_toast", "inspect_toast.xml", + &LLFloaterReg::build<LLInspectToast>); +} + diff --git a/indra/newview/llinspecttoast.h b/indra/newview/llinspecttoast.h new file mode 100644 index 0000000000..ff547154b8 --- /dev/null +++ b/indra/newview/llinspecttoast.h @@ -0,0 +1,40 @@ +/** + * @file llinspecttoast.h + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + * + * Copyright (c) 2003-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLINSPECTTOAST_H +#define LL_LLINSPECTTOAST_H + +namespace LLNotificationsUI +{ +void registerFloater(); +} + +#endif diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 711114173c..a468a9a95c 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2001,14 +2001,16 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const } if(!accounted) { - lldebugs << "No accounting for: '" << cat->getName() << "' " + // Error condition, this means that the category did not register that + // it got new descendents (perhaps because it is still being loaded) + // which means its descendent count will be wrong. + llwarns << "Accounting failed for '" << cat->getName() << "' version:" << version << llendl; } } else { - llwarns << "No category found for update " << update.mCategoryID - << llendl; + llwarns << "No category found for update " << update.mCategoryID << llendl; } } diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 2d9ea21b5f..2fb8aea4e9 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -311,10 +311,10 @@ bool LLInventoryFetchDescendentsObserver::isEverythingComplete() const bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* cat) { - S32 version = cat->getVersion(); - S32 descendents = cat->getDescendentCount(); - if((LLViewerInventoryCategory::VERSION_UNKNOWN == version) - || (LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN == descendents)) + const S32 version = cat->getVersion(); + const S32 expected_num_descendents = cat->getDescendentCount(); + if ((version == LLViewerInventoryCategory::VERSION_UNKNOWN) || + (expected_num_descendents == LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN)) { return false; } @@ -325,15 +325,28 @@ bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* gInventory.getDirectDescendentsOf(cat->getUUID(), cats, items); if(!cats || !items) { - // bit of a hack - pretend we're done if they are gone or - // incomplete. should never know, but it would suck if this - // kept tight looping because of a corrupt memory state. + llwarns << "Category '" << cat->getName() << "' descendents corrupted, fetch failed." << llendl; + // NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean + // that the cat just doesn't have any items or subfolders). + // Unrecoverable, so just return done so that this observer can be cleared + // from memory. return true; } - S32 known = cats->count() + items->count(); - if(descendents == known) + const S32 current_num_known_descendents = cats->count() + items->count(); + + // Got the number of descendents that we were expecting, so we're done. + if (current_num_known_descendents == expected_num_descendents) + { + return true; + } + + // Error condition, but recoverable. This happens if something was added to the + // category before it was initialized, so accountForUpdate didn't update descendent + // count and thus the category thinks it has fewer descendents than it actually has. + if (current_num_known_descendents >= expected_num_descendents) { - // hey - we're done. + llwarns << "Category '" << cat->getName() << "' expected descendentcount:" << expected_num_descendents << " descendents but got descendentcount:" << current_num_known_descendents << llendl; + cat->setDescendentCount(current_num_known_descendents); return true; } return false; @@ -352,7 +365,7 @@ void LLInventoryFetchComboObserver::changed(U32 mask) continue; } if(item->isComplete()) - { + { mCompleteItems.push_back(*it); it = mIncompleteItems.erase(it); continue; diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 6b0f9b709d..87ebce1d34 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -84,7 +84,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mHomePageUrl( "" ), mIgnoreUIScale( true ), mAlwaysRefresh( false ), - mExternalUrl( "" ), mMediaSource( 0 ), mTakeFocusOnClick( true ), mCurrentNavUrl( "" ), @@ -877,9 +876,27 @@ bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( 0 == option ) { - // open in external browser because we don't support - // creation of our own secondary browser windows - LLWeb::loadURLExternal( notification["payload"]["external_url"].asString() ); + LLSD payload = notification["payload"]; + std::string url = payload["url"].asString(); + S32 target_type = payload["target_type"].asInteger(); + + switch (target_type) + { + case LLPluginClassMedia::TARGET_EXTERNAL: + // load target in an external browser + LLWeb::loadURLExternal(url); + break; + + case LLPluginClassMedia::TARGET_BLANK: + // load target in the user's preferred browser + LLWeb::loadURL(url); + break; + + default: + // unsupported link target - shouldn't happen + LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL; + break; + } } return false; } @@ -993,20 +1010,18 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) { // retrieve the event parameters - std::string target = self->getClickTarget(); std::string url = self->getClickURL(); + U32 target_type = self->getClickTargetType(); - // if there is a value for the target - if ( !target.empty() ) + // is there is a target specified for the link? + if (target_type == LLPluginClassMedia::TARGET_EXTERNAL || + target_type == LLPluginClassMedia::TARGET_BLANK) { - if ( target == "_external" ) - { - mExternalUrl = url; - LLSD payload; - payload["external_url"] = mExternalUrl; - LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); - return; - } + LLSD payload; + payload["url"] = url; + payload["target_type"] = LLSD::Integer(target_type); + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); + return; } const std::string protocol1( "http://" ); diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 8f9e6e7179..b0aca3cfa4 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -182,7 +182,6 @@ public: bool mOpenLinksInInternalBrowser; bool mTrusted; std::string mHomePageUrl; - std::string mExternalUrl; std::string mCurrentNavUrl; bool mIgnoreUIScale; bool mAlwaysRefresh; diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 2f4a266198..d434017804 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -52,6 +52,7 @@ LLNameBox::LLNameBox(const Params& p) : LLTextBox(p) { mNameID = LLUUID::null; + mLink = p.link; LLNameBox::sInstances.insert(this); setText(LLStringUtil::null); } @@ -76,7 +77,7 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group) gCacheName->getGroupName(name_id, name); } - setText(name); + setName(name, is_group); } void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, @@ -93,7 +94,7 @@ void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, { name = firstname; } - setText(name); + setName(name, is_group); } } @@ -109,3 +110,22 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, box->refresh(id, firstname, lastname, is_group); } } + +void LLNameBox::setName(const std::string& name, BOOL is_group) +{ + if (mLink) + { + std::string url; + + if (is_group) + url = "[secondlife:///app/group/" + LLURI::escape(name) + "/about " + name + "]"; + else + url = "[secondlife:///app/agent/" + mNameID.asString() + "/about " + name + "]"; + + setText(url); + } + else + { + setText(name); + } +} diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index 3edb36883f..0109525e85 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -47,9 +47,11 @@ public: struct Params : public LLInitParam::Block<Params, LLTextBox::Params> { Optional<bool> is_group; + Optional<bool> link; Params() : is_group("is_group", false) + , link("link", false) {} }; @@ -67,10 +69,13 @@ protected: friend class LLUICtrlFactory; private: + void setName(const std::string& name, BOOL is_group); + static std::set<LLNameBox*> sInstances; private: LLUUID mNameID; + BOOL mLink; }; diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index fc0e51b76d..a7c1e73328 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -179,27 +179,7 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive) if (!chat.mMuted) { tmp_chat.mFromName = chat.mFromName; - - if (chat.mChatStyle == CHAT_STYLE_IRC) - { - LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); - LLViewerChat::getChatColor(chat,txt_color); - LLFontGL* fontp = LLViewerChat::getChatFont(); - std::string font_name = LLFontGL::nameFromFont(fontp); - std::string font_size = LLFontGL::sizeFromFont(fontp); - LLStyle::Params append_style_params; - append_style_params.color(txt_color); - append_style_params.readonly_color(txt_color); - append_style_params.font.name(font_name); - append_style_params.font.size(font_size); - append_style_params.font.style = "ITALIC"; - - mChatHistory->appendMessage(chat, use_plain_text_chat_history, append_style_params); - } - else - { - mChatHistory->appendMessage(chat, use_plain_text_chat_history); - } + mChatHistory->appendMessage(chat, use_plain_text_chat_history); } if(archive) diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 8dbaa5ac53..6cf8bcb417 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -48,13 +48,16 @@ #include "llcommandhandler.h" #include "llviewercontrol.h" #include "llnavigationbar.h" +#include "llwindow.h" +#include "llviewerwindow.h" +#include "llrootview.h" S32 LLNearbyChatBar::sLastSpecialChatChannel = 0; // legacy callback glue void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); -static LLDefaultChildRegistry::Register<LLGestureComboBox> r("gesture_combo_box"); +static LLDefaultChildRegistry::Register<LLGestureComboList> r("gesture_combo_list"); struct LLChatTypeTrigger { std::string name; @@ -66,13 +69,42 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { { "/shout" , CHAT_TYPE_SHOUT} }; -LLGestureComboBox::LLGestureComboBox(const LLGestureComboBox::Params& p) - : LLComboBox(p) - , mGestureLabelTimer() +LLGestureComboList::Params::Params() +: combo_button("combo_button"), + combo_list("combo_list") +{ +} + +LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) +: LLUICtrl(p) , mLabel(p.label) , mViewAllItemIndex(0) { - setCommitCallback(boost::bind(&LLGestureComboBox::onCommitGesture, this)); + LLButton::Params button_params = p.combo_button; + button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT); + + mButton = LLUICtrlFactory::create<LLButton>(button_params); + mButton->reshape(getRect().getWidth(),getRect().getHeight()); + mButton->setCommitCallback(boost::bind(&LLGestureComboList::onButtonCommit, this)); + + addChild(mButton); + + LLScrollListCtrl::Params params = p.combo_list; + params.name("GestureComboList"); + params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2)); + params.visible(false); + params.commit_on_keyboard_movement(false); + + mList = LLUICtrlFactory::create<LLScrollListCtrl>(params); + + // *HACK: adding list as a child to NonSideTrayView to make it fully visible without + // making it top control (because it would cause problems). + gViewerWindow->getNonSideTrayView()->addChild(mList); + mList->setVisible(FALSE); + + //****************************Gesture Part********************************/ + + setCommitCallback(boost::bind(&LLGestureComboList::onCommitGesture, this)); // now register us as observer since we have a place to put the results LLGestureManager::instance().addObserver(this); @@ -80,23 +112,139 @@ LLGestureComboBox::LLGestureComboBox(const LLGestureComboBox::Params& p) // refresh list from current active gestures refreshGestures(); - // This forces using of halign from xml, since LLComboBox - // sets it to LLFontGL::LEFT, if text entry is disabled - mButton->setHAlign(p.drop_down_button.font_halign); + setFocusLostCallback(boost::bind(&LLGestureComboList::hideList, this)); } -LLGestureComboBox::~LLGestureComboBox() +BOOL LLGestureComboList::handleKey(KEY key, MASK mask, BOOL called_from_parent) { - LLGestureManager::instance().removeObserver(this); + BOOL handled = FALSE; + + if (key == KEY_ESCAPE && mask == MASK_NONE ) + { + hideList(); + handled = TRUE; + } + else + { + handled = mList->handleKey(key, mask, called_from_parent); + } + + return handled; +} + +void LLGestureComboList::showList() +{ + LLRect rect = mList->getRect(); + LLRect screen; + mButton->localRectToScreen(getRect(), &screen); + + // Calculating amount of space between the navigation bar and gestures combo + LLNavigationBar* nb = LLNavigationBar::getInstance(); + + S32 x, nb_bottom; + nb->localPointToScreen(0, 0, &x, &nb_bottom); + + S32 max_height = nb_bottom - screen.mTop; + mList->calcColumnWidths(); + rect.setOriginAndSize(screen.mLeft, screen.mTop, llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); + + mList->setRect(rect); + mList->fitContents( llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); + + gFocusMgr.setKeyboardFocus(this); + + // Show the list and push the button down + mButton->setToggleState(TRUE); + mList->setVisible(TRUE); +} + +void LLGestureComboList::onButtonCommit() +{ + if (!mList->getVisible()) + { + // highlight the last selected item from the original selection before potentially selecting a new item + // as visual cue to original value of combo box + LLScrollListItem* last_selected_item = mList->getLastSelectedItem(); + if (last_selected_item) + { + mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item)); + } + + if (mList->getItemCount() != 0) + { + showList(); + } + } + else + { + hideList(); + } +} + +void LLGestureComboList::hideList() +{ + if (mList->getVisible()) + { + mButton->setToggleState(FALSE); + mList->setVisible(FALSE); + mList->mouseOverHighlightNthItem(-1); + gFocusMgr.setKeyboardFocus(NULL); + } +} + +S32 LLGestureComboList::getCurrentIndex() const +{ + LLScrollListItem* item = mList->getFirstSelected(); + if( item ) + { + return mList->getItemIndex( item ); + } + return -1; +} + +void LLGestureComboList::onItemSelected(const LLSD& data) +{ + const std::string name = mList->getSelectedItemLabel(); + + S32 cur_id = getCurrentIndex(); + mLastSelectedIndex = cur_id; + if (cur_id != mList->getItemCount()-1 && cur_id != -1) + { + mButton->setLabel(name); + } + + // hiding the list reasserts the old value stored in the text editor/dropdown button + hideList(); + + // commit does the reverse, asserting the value in the list + onCommit(); +} + +void LLGestureComboList::sortByName(bool ascending) +{ + mList->sortOnce(0, ascending); +} + +LLSD LLGestureComboList::getValue() const +{ + LLScrollListItem* item = mList->getFirstSelected(); + if( item ) + { + return item->getValue(); + } + else + { + return LLSD(); + } } -void LLGestureComboBox::refreshGestures() +void LLGestureComboList::refreshGestures() { //store current selection so we can maintain it LLSD cur_gesture = getValue(); - selectFirstItem(); - // clear - clearRows(); + + mList->selectFirstItem(); + mList->clearRows(); mGestures.clear(); LLGestureManager::item_map_t::const_iterator it; @@ -107,7 +255,7 @@ void LLGestureComboBox::refreshGestures() LLMultiGesture* gesture = (*it).second; if (gesture) { - addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx)); + mList->addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx)); mGestures.push_back(gesture); idx++; } @@ -117,23 +265,42 @@ void LLGestureComboBox::refreshGestures() // store index followed by the last added Gesture and add View All item at bottom mViewAllItemIndex = idx; - addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); + + mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); // Insert label after sorting, at top, with separator below it - addSeparator(ADD_TOP); - addSimpleElement(mLabel, ADD_TOP); + mList->addSeparator(ADD_TOP); + mList->addSimpleElement(mLabel, ADD_TOP); if (cur_gesture.isDefined()) { - selectByValue(cur_gesture); + mList->selectByValue(cur_gesture); + } else { - selectFirstItem(); + mList->selectFirstItem(); } + + LLCtrlListInterface* gestures = getListInterface(); + LLMultiGesture* gesture = NULL; + + if (gestures) + { + S32 index = gestures->getSelectedValue().asInteger(); + if(index > 0) + gesture = mGestures.at(index); + } + + if(gesture && LLGestureManager::instance().isGesturePlaying(gesture)) + { + return; + } + + mButton->setLabel(mLabel); } -void LLGestureComboBox::onCommitGesture() +void LLGestureComboList::onCommitGesture() { LLCtrlListInterface* gestures = getListInterface(); if (gestures) @@ -164,50 +331,11 @@ void LLGestureComboBox::onCommitGesture() } } } - - mGestureLabelTimer.start(); - // free focus back to chat bar - setFocus(FALSE); } -//virtual -void LLGestureComboBox::draw() +LLGestureComboList::~LLGestureComboList() { - // HACK: Leave the name of the gesture in place for a few seconds. - const F32 SHOW_GESTURE_NAME_TIME = 2.f; - if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) - { - LLCtrlListInterface* gestures = getListInterface(); - if (gestures) gestures->selectFirstItem(); - mGestureLabelTimer.stop(); - } - - LLComboBox::draw(); -} - -//virtual -void LLGestureComboBox::showList() -{ - LLComboBox::showList(); - - // Calculating amount of space between the navigation bar and gestures combo - LLNavigationBar* nb = LLNavigationBar::getInstance(); - S32 x, nb_bottom; - nb->localPointToScreen(0, 0, &x, &nb_bottom); - - S32 list_bottom; - mList->localPointToScreen(0, 0, &x, &list_bottom); - - S32 max_height = nb_bottom - list_bottom; - - LLRect rect = mList->getRect(); - // List overlapped navigation bar, downsize it - if (rect.getHeight() > max_height) - { - rect.setOriginAndSize(rect.mLeft, rect.mBottom, rect.getWidth(), max_height); - mList->setRect(rect); - mList->reshape(rect.getWidth(), rect.getHeight()); - } + LLGestureManager::instance().removeObserver(this); } LLNearbyChatBar::LLNearbyChatBar() diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 224118e088..d9a7403611 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -42,33 +42,52 @@ #include "llspeakers.h" -class LLGestureComboBox - : public LLComboBox - , public LLGestureManagerObserver +class LLGestureComboList + : public LLGestureManagerObserver + , public LLUICtrl { public: - struct Params : public LLInitParam::Block<Params, LLComboBox::Params> { }; + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<LLButton::Params> combo_button; + Optional<LLScrollListCtrl::Params> combo_list; + + Params(); + }; + protected: - LLGestureComboBox(const Params&); + friend class LLUICtrlFactory; + LLGestureComboList(const Params&); + std::vector<LLMultiGesture*> mGestures; + std::string mLabel; + LLSD::Integer mViewAllItemIndex; + public: - ~LLGestureComboBox(); + ~LLGestureComboList(); + + LLCtrlListInterface* getListInterface() { return (LLCtrlListInterface*)mList; }; + virtual void showList(); + virtual void hideList(); + virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + + S32 getCurrentIndex() const; + void onItemSelected(const LLSD& data); + void sortByName(bool ascending = true); void refreshGestures(); void onCommitGesture(); - virtual void draw(); + void onButtonCommit(); + virtual LLSD getValue() const; // LLGestureManagerObserver trigger virtual void changed() { refreshGestures(); } -protected: - - virtual void showList(); +private: - LLFrameTimer mGestureLabelTimer; - std::vector<LLMultiGesture*> mGestures; - std::string mLabel; - LLSD::Integer mViewAllItemIndex; + LLButton* mButton; + LLScrollListCtrl* mList; + S32 mLastSelectedIndex; }; class LLNearbyChatBar diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 9e13a626b4..96442fafcc 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -180,6 +180,11 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) if(panel && panel->messageID() == fromID && panel->canAddText()) { + if (CHAT_STYLE_IRC == notification["chat_style"].asInteger()) + { + notification["message"] = notification["from"].asString() + notification["message"].asString(); + } + panel->addMessage(notification); toast->reshapeToPanel(); toast->resetTimer(); @@ -302,7 +307,6 @@ LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& i channel->setCreatePanelCallback(callback); mChannel = LLChannelManager::getInstance()->addChannel(channel); - mChannel->setOverflowFormatString("You have %d unread nearby chat messages"); } LLNearbyChatHandler::~LLNearbyChatHandler() @@ -332,25 +336,22 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) LLChat& tmp_chat = const_cast<LLChat&>(chat_msg); - if (tmp_chat.mChatStyle == CHAT_STYLE_IRC) - { - if(!tmp_chat.mFromName.empty()) - tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3); - else - tmp_chat.mText = tmp_chat.mText.substr(3); - } - + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); { //sometimes its usefull to have no name at all... //if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null) // tmp_chat.mFromName = tmp_chat.mFromID.asString(); } - - LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); nearby_chat->addMessage(chat_msg); if(nearby_chat->getVisible()) return;//no need in toast if chat is visible - + + // Handle irc styled messages for toast panel + if (tmp_chat.mChatStyle == CHAT_STYLE_IRC) + { + tmp_chat.mText = tmp_chat.mText.substr(3); + } + // arrange a channel on a screen if(!mChannel->getVisible()) { diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 63803469dd..f816dc589d 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -77,7 +77,9 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mImageLevel3(p.image_level_3), mAutoUpdate(p.auto_update), mSpeakerId(p.speaker_id), - mIsAgentControl(false) + mIsAgentControl(false), + mIsSwitchDirty(false), + mShouldSwitchOn(false) { //static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); //static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); @@ -108,6 +110,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) LLOutputMonitorCtrl::~LLOutputMonitorCtrl() { LLMuteList::getInstance()->removeObserver(this); + LLSpeakingIndicatorManager::unregisterSpeakingIndicator(mSpeakerId, this); } void LLOutputMonitorCtrl::setPower(F32 val) @@ -117,6 +120,26 @@ void LLOutputMonitorCtrl::setPower(F32 val) void LLOutputMonitorCtrl::draw() { + // see also switchIndicator() + if (mIsSwitchDirty) + { + mIsSwitchDirty = false; + if (mShouldSwitchOn) + { + // just notify parent visibility may have changed + notifyParentVisibilityChanged(); + } + else + { + // make itself invisible and notify parent about this + setVisible(FALSE); + notifyParentVisibilityChanged(); + + // no needs to render for invisible element + return; + } + } + // Copied from llmediaremotectrl.cpp // *TODO: Give the LLOutputMonitorCtrl an agent-id to monitor, then // call directly into gVoiceClient to ask if that agent-id is muted, is @@ -229,6 +252,7 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id) if (speaker_id.isNull() || speaker_id == mSpeakerId) return; mSpeakerId = speaker_id; + LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this); //mute management if (mAutoUpdate) @@ -251,3 +275,42 @@ void LLOutputMonitorCtrl::onChange() // check only blocking on voice. EXT-3542 setIsMuted(LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat)); } + +// virtual +void LLOutputMonitorCtrl::switchIndicator(bool switch_on) +{ + // ensure indicator is visible in case it is not in visible chain + // to be called when parent became visible next time to notify parent that visibility is changed. + setVisible(TRUE); + + // if parent is in visible chain apply switch_on state and notify it immediately + if (getParent() && getParent()->isInVisibleChain()) + { + LL_DEBUGS("SpeakingIndicator") << "Indicator is in visible chain, notifying parent: " << mSpeakerId << LL_ENDL; + setVisible((BOOL)switch_on); + notifyParentVisibilityChanged(); + } + + // otherwise remember necessary state and mark itself as dirty. + // State will be applied i next draw when parents chain became visible. + else + { + LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL; + mIsSwitchDirty = true; + mShouldSwitchOn = switch_on; + } +} + +////////////////////////////////////////////////////////////////////////// +// PRIVATE SECTION +////////////////////////////////////////////////////////////////////////// +void LLOutputMonitorCtrl::notifyParentVisibilityChanged() +{ + LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << " ,new_visibility: " << getVisible() << LL_ENDL; + + LLSD params = LLSD().with("visibility_changed", getVisible()); + + notifyParent(params); +} + +// EOF diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index 85ea552a57..2bbfa251e9 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -36,6 +36,7 @@ #include "v4color.h" #include "llview.h" #include "llmutelist.h" +#include "llspeakingindicatormanager.h" class LLTextBox; class LLUICtrlFactory; @@ -45,7 +46,7 @@ class LLUICtrlFactory; // class LLOutputMonitorCtrl -: public LLView, LLMuteListObserver +: public LLView, public LLSpeakingIndicator, LLMuteListObserver { public: struct Params : public LLInitParam::Block<Params, LLView::Params> @@ -90,7 +91,29 @@ public: //called by mute list virtual void onChange(); + /** + * Implementation of LLSpeakingIndicator interface. + * Behavior is implemented via changing visibility. + * + * If instance is in visible chain now (all parents are visible) it changes visibility + * and notify parent about this. + * + * Otherwise it marks an instance as dirty and stores necessary visibility. + * It will be applied in next draw and parent will be notified. + */ + virtual void switchIndicator(bool switch_on); + private: + + /** + * Notifies parent about changed visibility. + * + * Passes LLSD with "visibility_changed" => <current visibility> value. + * For now it is processed by LLAvatarListItem to update (reshape) its children. + * Implemented fo complete EXT-3976 + */ + void notifyParentVisibilityChanged(); + //static LLColor4 sColorMuted; //static LLColor4 sColorNormal; //static LLColor4 sColorOverdriven; @@ -117,6 +140,10 @@ private: /** uuid of a speaker being monitored */ LLUUID mSpeakerId; + + /** indicates if the instance is dirty and should notify parent */ + bool mIsSwitchDirty; + bool mShouldSwitchOn; }; #endif diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index fb898f7cdf..85e95ca1d6 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -52,6 +52,7 @@ #include "llfloaterreg.h" #include "llnotificationsutil.h" #include "llvoiceclient.h" +#include "llnamebox.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLDropTarget @@ -595,7 +596,10 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g groups += ", "; std::string group_name = LLURI::escape(it->first); - std::string group_url="[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]"; + std::string group_url= it->second.notNull() + ? "[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]" + : getString("no_group_text"); + groups += group_url; } @@ -621,19 +625,15 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data) { + LLNameBox* name_box = getChild<LLNameBox>("partner_text"); if (avatar_data->partner_id.notNull()) { - std::string first, last; - BOOL found = gCacheName->getName(avatar_data->partner_id, first, last); - if (found) - { - childSetTextArg("partner_text", "[FIRST]", first); - childSetTextArg("partner_text", "[LAST]", last); - } + name_box->setNameID(avatar_data->partner_id, FALSE); } else { - childSetTextArg("partner_text", "[FIRST]", getString("no_partner_text")); + name_box->setNameID(LLUUID::null, FALSE); + name_box->setText(getString("no_partner_text")); } } diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 94de17c17d..daec793d75 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -151,6 +151,11 @@ BOOL LLPanelGroup::postBuild() button->setVisible(true); button->setEnabled(false); + button = getChild<LLButton>("btn_call"); + button->setClickedCallback(onBtnGroupCallClicked, this); + + button = getChild<LLButton>("btn_chat"); + button->setClickedCallback(onBtnGroupChatClicked, this); button = getChild<LLButton>("btn_join"); button->setVisible(false); @@ -215,6 +220,8 @@ void LLPanelGroup::reposButtons() reposButton("btn_create"); reposButton("btn_refresh"); reposButton("btn_cancel"); + reposButton("btn_chat"); + reposButton("btn_call"); } void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent ) @@ -262,6 +269,18 @@ void LLPanelGroup::onBtnApply(void* user_data) self->apply(); } +void LLPanelGroup::onBtnGroupCallClicked(void* user_data) +{ + LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); + self->callGroup(); +} + +void LLPanelGroup::onBtnGroupChatClicked(void* user_data) +{ + LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); + self->chatGroup(); +} + void LLPanelGroup::onBtnJoin() { lldebugs << "joining group: " << mID << llendl; @@ -349,6 +368,8 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) LLButton* button_create = findChild<LLButton>("btn_create"); LLButton* button_join = findChild<LLButton>("btn_join"); LLButton* button_cancel = findChild<LLButton>("btn_cancel"); + LLButton* button_call = findChild<LLButton>("btn_call"); + LLButton* button_chat = findChild<LLButton>("btn_chat"); bool is_null_group_id = group_id == LLUUID::null; @@ -362,6 +383,11 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) if(button_cancel) button_cancel->setVisible(!is_null_group_id); + if(button_call) + button_call->setVisible(!is_null_group_id); + if(button_chat) + button_chat->setVisible(!is_null_group_id); + getChild<LLUICtrl>("prepend_founded_by")->setVisible(!is_null_group_id); LLAccordionCtrl* tab_ctrl = findChild<LLAccordionCtrl>("group_accordion"); @@ -423,12 +449,15 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) getChild<LLUICtrl>("group_name")->setVisible(true); getChild<LLUICtrl>("group_name_editor")->setVisible(false); + + if(button_apply) + button_apply->setVisible(is_member); } reposButtons(); } -bool LLPanelGroup::apply(LLPanelGroupTab* tab) +bool LLPanelGroup::apply(LLPanelGroupTab* tab) { if(!tab) return false; @@ -471,12 +500,17 @@ void LLPanelGroup::draw() childEnable("btn_refresh"); } - bool enable = false; - std::string mesg; - for(std::vector<LLPanelGroupTab* >::iterator it = mTabs.begin();it!=mTabs.end();++it) - enable = enable || (*it)->needsApply(mesg); + LLButton* button_apply = findChild<LLButton>("btn_apply"); + + if(button_apply && button_apply->getVisible()) + { + bool enable = false; + std::string mesg; + for(std::vector<LLPanelGroupTab* >::iterator it = mTabs.begin();it!=mTabs.end();++it) + enable = enable || (*it)->needsApply(mesg); - childSetEnabled("btn_apply", enable); + childSetEnabled("btn_apply", enable); + } } void LLPanelGroup::refreshData() @@ -491,6 +525,15 @@ void LLPanelGroup::refreshData() mRefreshTimer.setTimerExpirySec(5); } +void LLPanelGroup::callGroup() +{ + LLGroupActions::startCall(getID()); +} + +void LLPanelGroup::chatGroup() +{ + LLGroupActions::startIM(getID()); +} void LLPanelGroup::showNotice(const std::string& subject, const std::string& message, diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index f6aefdb676..7ea5e67b44 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -74,6 +74,8 @@ public: bool apply(); void refreshData(); + void callGroup(); + void chatGroup(); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -103,6 +105,8 @@ protected: static void onBtnApply(void*); static void onBtnRefresh(void*); + static void onBtnGroupCallClicked(void*); + static void onBtnGroupChatClicked(void*); void reposButton(const std::string& name); void reposButtons(); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 31dfdde887..21b253223f 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -580,7 +580,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } } - mComboActiveTitle->resetDirty(); } // If this was just a titles update, we are done. @@ -595,8 +594,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlShowInGroupList->set(gdatap->mShowInList); mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident); - mCtrlShowInGroupList->resetDirty(); - } if (mComboMature) { @@ -610,19 +607,16 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } mComboMature->setEnabled(mAllowEdit && can_change_ident); mComboMature->setVisible( !gAgent.isTeen() ); - mComboMature->resetDirty(); } if (mCtrlOpenEnrollment) { mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment); mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts); - mCtrlOpenEnrollment->resetDirty(); } if (mCtrlEnrollmentFee) { mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0); mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts); - mCtrlEnrollmentFee->resetDirty(); } if (mSpinEnrollmentFee) @@ -632,7 +626,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mSpinEnrollmentFee->setEnabled( mAllowEdit && (fee > 0) && can_change_member_opts); - mSpinEnrollmentFee->resetDirty(); } if (mCtrlReceiveNotices) { @@ -641,7 +634,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlReceiveNotices->setEnabled(mAllowEdit); } - mCtrlReceiveNotices->resetDirty(); } @@ -665,7 +657,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mEditCharter) { mEditCharter->setText(gdatap->mCharter); - mEditCharter->resetDirty(); } if (mListVisibleMembers) @@ -693,6 +684,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mListVisibleMembers->addElement(row); } } + + resetDirty(); } void LLPanelGroupGeneral::updateMembers() diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 29b647415c..0e55ff3214 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -460,17 +460,8 @@ LLPanelGroupSubTab::~LLPanelGroupSubTab() { } -BOOL LLPanelGroupSubTab::postBuild() -{ - // Hook up the search widgets. - bool recurse = true; - mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse); - - if (!mSearchEditor) - return FALSE; - - mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); - +BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root) +{ // Get icons for later use. mActionIcons.clear(); @@ -488,6 +479,19 @@ BOOL LLPanelGroupSubTab::postBuild() { mActionIcons["partial"] = getString("power_partial_icon"); } + return TRUE; +} + +BOOL LLPanelGroupSubTab::postBuild() +{ + // Hook up the search widgets. + bool recurse = true; + mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse); + + if (!mSearchEditor) + return FALSE; + + mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); return LLPanelGroupTab::postBuild(); } @@ -567,7 +571,6 @@ bool LLPanelGroupSubTab::matchesActionSearchFilter(std::string action) void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, - icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -588,7 +591,6 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, allowed_by_some, allowed_by_all, (*ras_it), - icons, commit_callback, show_all, filter, @@ -600,7 +602,6 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, LLRoleActionSet* action_set, - icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -614,26 +615,26 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, LLSD row; row["columns"][0]["column"] = "icon"; - icon_map_t::iterator iter = icons.find("folder"); - if (iter != icons.end()) + row["columns"][0]["type"] = "icon"; + + icon_map_t::iterator iter = mActionIcons.find("folder"); + if (iter != mActionIcons.end()) { - row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = (*iter).second; } row["columns"][1]["column"] = "action"; + row["columns"][1]["type"] = "text"; row["columns"][1]["value"] = action_set->mActionSetData->mName; row["columns"][1]["font"]["name"] = "SANSSERIF_SMALL"; - row["columns"][1]["font"]["style"] = "BOLD"; + LLScrollListItem* title_row = ctrl->addElement(row, ADD_BOTTOM, action_set->mActionSetData); - LLScrollListText* name_textp = dynamic_cast<LLScrollListText*>(title_row->getColumn(1)); + LLScrollListText* name_textp = dynamic_cast<LLScrollListText*>(title_row->getColumn(2)); //?? I have no idea fix getColumn(1) return column spacer... if (name_textp) name_textp->setFontStyle(LLFontGL::BOLD); - - bool category_matches_filter = (filter) ? matchesActionSearchFilter(action_set->mActionSetData->mName) : true; std::vector<LLRoleAction*>::iterator ra_it = action_set->mActions.begin(); @@ -686,8 +687,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, { if (show_full_strength) { - icon_map_t::iterator iter = icons.find("full"); - if (iter != icons.end()) + icon_map_t::iterator iter = mActionIcons.find("full"); + if (iter != mActionIcons.end()) { row["columns"][column_index]["column"] = "checkbox"; row["columns"][column_index]["type"] = "icon"; @@ -697,8 +698,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, } else { - icon_map_t::iterator iter = icons.find("partial"); - if (iter != icons.end()) + icon_map_t::iterator iter = mActionIcons.find("partial"); + if (iter != mActionIcons.end()) { row["columns"][column_index]["column"] = "checkbox"; row["columns"][column_index]["type"] = "icon"; @@ -792,6 +793,8 @@ LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab() BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) { + LLPanelGroupSubTab::postBuildSubTab(root); + // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -888,7 +891,6 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() buildActionsList(mAllowedActionsList, allowed_by_some, allowed_by_all, - mActionIcons, NULL, FALSE, FALSE, @@ -1211,7 +1213,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, buildActionsList(mAllowedActionsList, powers_some_have, powers_all_have, - mActionIcons, NULL, FALSE, FALSE, @@ -1684,6 +1685,8 @@ LLPanelGroupRolesSubTab::~LLPanelGroupRolesSubTab() BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) { + LLPanelGroupSubTab::postBuildSubTab(root); + // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -1994,7 +1997,6 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() buildActionsList(mAllowedActionsList, rd.mRolePowers, 0LL, - mActionIcons, boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false), TRUE, FALSE, @@ -2381,6 +2383,8 @@ LLPanelGroupActionsSubTab::~LLPanelGroupActionsSubTab() BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) { + LLPanelGroupSubTab::postBuildSubTab(root); + // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -2448,7 +2452,6 @@ void LLPanelGroupActionsSubTab::update(LLGroupChange gc) buildActionsList(mActionList, GP_ALL_POWERS, GP_ALL_POWERS, - mActionIcons, NULL, FALSE, TRUE, diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index bb3c9096cf..2f81900e60 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -108,7 +108,7 @@ public: virtual BOOL postBuild(); // This allows sub-tabs to collect child widgets from a higher level in the view hierarchy. - virtual BOOL postBuildSubTab(LLView* root) { return TRUE; } + virtual BOOL postBuildSubTab(LLView* root); virtual void setSearchFilter( const std::string& filter ); @@ -117,10 +117,15 @@ public: // Helper functions bool matchesActionSearchFilter(std::string action); + + + void setFooterEnabled(BOOL enable); + + virtual void setGroupID(const LLUUID& id); +protected: void buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, - icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -129,15 +134,11 @@ public: U64 allowed_by_some, U64 allowed_by_all, LLRoleActionSet* action_set, - icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, BOOL is_owner_role); - void setFooterEnabled(BOOL enable); - - virtual void setGroupID(const LLUUID& id); protected: LLPanel* mHeader; LLPanel* mFooter; diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index b547997e7a..0cfe501fab 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -302,7 +302,7 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) { LLPanelChatControlPanel::setSessionId(session_id); - mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); + mGroupID = session_id; // for group and Ad-hoc chat we need to include agent into list if(!mParticipantList) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e14a5778ad..03cc870a59 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -35,6 +35,7 @@ // libs #include "llfloaterreg.h" #include "llmenugl.h" +#include "llnotificationsutil.h" #include "llfiltereditor.h" #include "lltabcontainer.h" #include "lluictrlfactory.h" @@ -750,7 +751,6 @@ void LLPanelPeople::updateButtons() LLPanel* groups_panel = mTabContainer->getCurrentPanel(); groups_panel->childSetEnabled("activate_btn", item_selected && !cur_group_active); // "none" or a non-active group selected - groups_panel->childSetEnabled("plus_btn", item_selected); groups_panel->childSetEnabled("minus_btn", item_selected && selected_id.notNull()); } else @@ -1138,6 +1138,12 @@ void LLPanelPeople::onAvatarPicked( void LLPanelPeople::onGroupPlusButtonClicked() { + if (!gAgent.canJoinGroups()) + { + LLNotificationsUtil::add("JoinedTooManyGroups"); + return; + } + LLMenuGL* plus_menu = (LLMenuGL*)mGroupPlusMenuHandle.get(); if (!plus_menu) return; diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 7a4dd3569d..e7615929c8 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -35,24 +35,30 @@ // profile. #include "llviewerprecompiledheaders.h" -#include "llpanel.h" + +#include "llpanelpick.h" + #include "message.h" -#include "llagent.h" -#include "llagentpicksinfo.h" + +#include "llparcel.h" + #include "llbutton.h" +#include "llfloaterreg.h" #include "lliconctrl.h" #include "lllineeditor.h" -#include "llparcel.h" -#include "llviewerparcelmgr.h" +#include "llpanel.h" +#include "llscrollcontainer.h" #include "lltexteditor.h" + +#include "llagent.h" +#include "llagentpicksinfo.h" +#include "llavatarpropertiesprocessor.h" +#include "llfloaterworldmap.h" #include "lltexturectrl.h" #include "lluiconstants.h" +#include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llworldmap.h" -#include "llfloaterworldmap.h" -#include "llfloaterreg.h" -#include "llavatarpropertiesprocessor.h" -#include "llpanelpick.h" #define XML_PANEL_EDIT_PICK "panel_edit_pick.xml" @@ -93,6 +99,10 @@ LLPanelPickInfo::LLPanelPickInfo() , mPickId(LLUUID::null) , mParcelId(LLUUID::null) , mRequestedId(LLUUID::null) + , mScrollingPanelMinHeight(0) + , mScrollingPanelWidth(0) + , mScrollingPanel(NULL) + , mScrollContainer(NULL) { } @@ -146,9 +156,35 @@ BOOL LLPanelPickInfo::postBuild() childSetAction("show_on_map_btn", boost::bind(&LLPanelPickInfo::onClickMap, this)); childSetAction("back_btn", boost::bind(&LLPanelPickInfo::onClickBack, this)); + mScrollingPanel = getChild<LLPanel>("scroll_content_panel"); + mScrollContainer = getChild<LLScrollContainer>("profile_scroll"); + + mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); + mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); + return TRUE; } +void LLPanelPickInfo::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + LLPanel::reshape(width, height, called_from_parent); + + if (!mScrollContainer || !mScrollingPanel) + return; + + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); + + S32 scroll_height = mScrollContainer->getRect().getHeight(); + if (mScrollingPanelMinHeight >= scroll_height) + { + mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight); + } + else + { + mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height); + } +} + void LLPanelPickInfo::processProperties(void* data, EAvatarProcessorType type) { if(APT_PICK_INFO != type) @@ -284,7 +320,6 @@ void LLPanelPickInfo::setPickName(const std::string& name) void LLPanelPickInfo::setPickDesc(const std::string& desc) { childSetValue(XML_DESC, desc); - updateContentPanelRect(); } void LLPanelPickInfo::setPickLocation(const std::string& location) @@ -292,31 +327,6 @@ void LLPanelPickInfo::setPickLocation(const std::string& location) childSetValue(XML_LOCATION, location); } -void LLPanelPickInfo::updateContentPanelRect() -{ - LLTextBox* desc = getChild<LLTextBox>(XML_DESC); - - S32 text_height = desc->getTextPixelHeight(); - LLRect text_rect = desc->getRect(); - - // let text-box height fit text height - text_rect.set(text_rect.mLeft, text_rect.mTop, text_rect.mRight, text_rect.mTop - text_height); - desc->setRect(text_rect); - desc->reshape(text_rect.getWidth(), text_rect.getHeight()); - // force reflow - desc->setText(desc->getText()); - - // bottom of description text-box will be bottom of content panel - desc->localRectToOtherView(desc->getLocalRect(), &text_rect, getChild<LLView>("profile_scroll")); - - LLPanel* content_panel = getChild<LLPanel>("scroll_content_panel"); - LLRect content_rect = content_panel->getRect(); - content_rect.set(content_rect.mLeft, content_rect.mTop, content_rect.mRight, text_rect.mBottom); - // Somehow setRect moves all elements down. - // Single reshape() updates rect and does not move anything. - content_panel->reshape(content_rect.getWidth(), content_rect.getHeight()); -} - void LLPanelPickInfo::onClickMap() { LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal()); diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 12b5a116b4..62c3b20c0d 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -43,6 +43,7 @@ class LLIconCtrl; class LLTextureCtrl; +class LLScrollContainer; class LLMessageSystem; class LLAvatarPropertiesObserver; @@ -69,6 +70,8 @@ public: /*virtual*/ BOOL postBuild(); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); /** @@ -139,15 +142,6 @@ protected: virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } virtual LLVector3d& getPosGlobal() { return mPosGlobal; } - /** - * Reshapes content panel to fit all elements. - * - * Assume that description text-box is the last element of panel. - * Reshape text-box to fit text height and then reshape content panel to fit - * text-box bottom. EXT-1326 - */ - void updateContentPanelRect(); - /** * Callback for "Map" button, opens Map */ @@ -162,7 +156,11 @@ protected: protected: - LLTextureCtrl* mSnapshotCtrl; + S32 mScrollingPanelMinHeight; + S32 mScrollingPanelWidth; + LLScrollContainer* mScrollContainer; + LLPanel* mScrollingPanel; + LLTextureCtrl* mSnapshotCtrl; LLUUID mAvatarId; LLVector3d mPosGlobal; diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 5ee8704992..b134cf0cba 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -71,6 +71,10 @@ public: void setItem(LLInventoryItem* item); + LLInventoryItem* getItem() { return mItem; } + + std::string getPlaceInfoType() { return mPlaceInfoType; } + private: void onLandmarkLoaded(LLLandmark* landmark); void onFilterEdit(const std::string& search_string, bool force_filter); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 65a3d9d41b..0a2217fc51 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -550,7 +550,7 @@ void LLTeleportHistoryPanel::updateVerbs() LLTeleportHistoryFlatItem* itemp = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem()); - mTeleportBtn->setEnabled(NULL != itemp && itemp->getIndex() < (S32)mTeleportHistory->getItems().size() - 1); + mTeleportBtn->setEnabled(NULL != itemp); mShowOnMapBtn->setEnabled(NULL != itemp); } diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp new file mode 100644 index 0000000000..74e37efe4e --- /dev/null +++ b/indra/newview/llpanelvolumepulldown.cpp @@ -0,0 +1,154 @@ +/** + * @file llpanelvolumepulldown.cpp + * @author Tofu Linden + * @brief A floater showing the master volume pull-down + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelvolumepulldown.h" + +// Viewer libs +#include "llviewercontrol.h" +#include "llstatusbar.h" + +// Linden libs +#include "llbutton.h" +#include "lltabcontainer.h" +#include "llfloaterreg.h" +#include "llfloaterpreference.h" +#include "llslider.h" + +/* static */ const F32 LLPanelVolumePulldown::sAutoCloseFadeStartTimeSec = 4.0f; +/* static */ const F32 LLPanelVolumePulldown::sAutoCloseTotalTimeSec = 5.0f; + +///---------------------------------------------------------------------------- +/// Class LLPanelVolumePulldown +///---------------------------------------------------------------------------- + +// Default constructor +LLPanelVolumePulldown::LLPanelVolumePulldown() +{ + mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2)); + mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2)); + LLUICtrlFactory::instance().buildPanel(this, "panel_volume_pulldown.xml"); +} + +BOOL LLPanelVolumePulldown::postBuild() +{ + // set the initial volume-slider's position to reflect reality + LLSlider* volslider = getChild<LLSlider>( "mastervolume" ); + volslider->setValue(gSavedSettings.getF32("AudioLevelMaster")); + + return LLPanel::postBuild(); +} + +/*virtual*/ +void LLPanelVolumePulldown::onMouseEnter(S32 x, S32 y, MASK mask) +{ + mHoverTimer.stop(); + LLPanel::onMouseEnter(x,y,mask); +} + + +/*virtual*/ +void LLPanelVolumePulldown::onMouseLeave(S32 x, S32 y, MASK mask) +{ + mHoverTimer.start(); + LLPanel::onMouseLeave(x,y,mask); +} + +/*virtual*/ +void LLPanelVolumePulldown::handleVisibilityChange ( BOOL new_visibility ) +{ + if (new_visibility) + { + mHoverTimer.start(); // timer will be stopped when mouse hovers over panel + gFocusMgr.setTopCtrl(this); + } + else + { + mHoverTimer.stop(); + gFocusMgr.setTopCtrl(NULL); + } +} + +/*virtual*/ +void LLPanelVolumePulldown::onTopLost() +{ + setVisible(FALSE); +} + +void LLPanelVolumePulldown::onAdvancedButtonClick(const LLSD& user_data) +{ + // close the global volume minicontrol, we're bringing up the big one + setVisible(FALSE); + + // bring up the prefs floater + LLFloaterPreference* prefsfloater = dynamic_cast<LLFloaterPreference*> + (LLFloaterReg::showInstance("preferences")); + if (prefsfloater) + { + // grab the 'audio' panel from the preferences floater and + // bring it the front! + LLTabContainer* tabcontainer = prefsfloater->getChild<LLTabContainer>("pref core"); + LLPanel* audiopanel = prefsfloater->getChild<LLPanel>("audio"); + if (tabcontainer && audiopanel) + { + tabcontainer->selectTabPanel(audiopanel); + } + } +} + +void LLPanelVolumePulldown::setControlFalse(const LLSD& user_data) +{ + std::string control_name = user_data.asString(); + LLControlVariable* control = findControl(control_name); + + if (control) + control->set(LLSD(FALSE)); +} + +//virtual +void LLPanelVolumePulldown::draw() +{ + F32 alpha = mHoverTimer.getStarted() + ? clamp_rescale(mHoverTimer.getElapsedTimeF32(), sAutoCloseFadeStartTimeSec, sAutoCloseTotalTimeSec, 1.f, 0.f) + : 1.0f; + LLViewDrawContext context(alpha); + + LLPanel::draw(); + + if (alpha == 0.f) + { + setVisible(FALSE); + } +} + diff --git a/indra/newview/llpanelvolumepulldown.h b/indra/newview/llpanelvolumepulldown.h new file mode 100644 index 0000000000..9f20caa1a8 --- /dev/null +++ b/indra/newview/llpanelvolumepulldown.h @@ -0,0 +1,64 @@ +/** + * @file llpanelvolumepulldown.h + * @author Tofu Linden + * @brief A panel showing the master volume pull-down + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELVOLUMEPULLDOWN_H +#define LL_LLPANELVOLUMEPULLDOWN_H + +#include "linden_common.h" + +#include "llpanel.h" + +class LLFrameTimer; + +class LLPanelVolumePulldown : public LLPanel +{ + public: + LLPanelVolumePulldown(); + /*virtual*/ void draw(); + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + /*virtual*/ void handleVisibilityChange ( BOOL new_visibility ); + /*virtual*/ void onTopLost(); + /*virtual*/ BOOL postBuild(); + + private: + void setControlFalse(const LLSD& user_data); + void onAdvancedButtonClick(const LLSD& user_data); + + LLFrameTimer mHoverTimer; + static const F32 sAutoCloseFadeStartTimeSec; + static const F32 sAutoCloseTotalTimeSec; +}; + + +#endif // LL_LLPANELVOLUMEPULLDOWN_H diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index e2da4c4475..b6f78d08f1 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -166,7 +166,6 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) { name.erase(found, moderator_indicator_len); item->setName(name); - item->reshapeAvatarName(); } } } @@ -188,7 +187,6 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) name += " "; name += moderator_indicator; item->setName(name); - item->reshapeAvatarName(); } } } @@ -279,6 +277,9 @@ bool LLParticipantList::onModeratorUpdateEvent(LLPointer<LLOldEvents::LLEvent> e mModeratorList.erase(id); } } + + // apply changes immediately + onAvatarListRefreshed(mAvatarList, LLSD()); } } return true; @@ -592,8 +593,7 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& if (speakerp.notNull()) { // not in voice participants can not be moderated - return speakerp->mStatus == LLSpeaker::STATUS_VOICE_ACTIVE - || speakerp->mStatus == LLSpeaker::STATUS_MUTED; + return speakerp->isInVoiceChannel(); } } return false; diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index da3f1543dd..027f3daffb 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -59,17 +59,14 @@ bool LLScreenChannel::mWasStartUpToastShown = false; // LLScreenChannelBase ////////////////////// LLScreenChannelBase::LLScreenChannelBase(const LLUUID& id) : - mOverflowToastPanel(NULL) - ,mToastAlignment(NA_BOTTOM) + mToastAlignment(NA_BOTTOM) ,mCanStoreToasts(true) ,mHiddenToastsNum(0) - ,mOverflowToastHidden(false) ,mHoveredToast(NULL) ,mControlHovering(false) ,mShowToasts(true) { mID = id; - mOverflowFormatString = LLTrans::getString("OverflowInfoChannelString"); mWorldViewRectConnection = gViewerWindow->setOnWorldViewRectUpdated(boost::bind(&LLScreenChannelBase::updatePositionAndSize, this, _1, _2)); setMouseOpaque( false ); setVisible(FALSE); @@ -217,11 +214,6 @@ void LLScreenChannel::addToast(const LLToast::Params& p) ToastElem new_toast_elem(p); - // reset HIDDEN flags for the Overflow Toast - mOverflowToastHidden = false; - if(mOverflowToastPanel) - mOverflowToastPanel->setIsHidden(false); - new_toast_elem.toast->setOnFadeCallback(boost::bind(&LLScreenChannel::onToastFade, this, _1)); new_toast_elem.toast->setOnToastDestroyedCallback(boost::bind(&LLScreenChannel::onToastDestroyed, this, _1)); if(mControlHovering) @@ -322,8 +314,6 @@ void LLScreenChannel::loadStoredToastsToChannel() if(mStoredToastList.size() == 0) return; - - mOverflowToastHidden = false; for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it) { @@ -344,8 +334,6 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) if( it == mStoredToastList.end() ) return; - mOverflowToastHidden = false; - LLToast* toast = (*it).toast; if(toast->getVisible()) @@ -357,7 +345,6 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) toast->setIsHidden(false); toast->resetTimer(); mToastList.push_back((*it)); - mStoredToastList.erase(it); redrawToasts(); } @@ -491,7 +478,7 @@ void LLScreenChannel::showToastsBottom() if(floater && floater->overlapsScreenChannel()) { LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); - if(toast_rect.mTop + getOverflowToastHeight() + toast_margin > world_rect.mTop) + if(toast_rect.mTop > world_rect.mTop) { break; } @@ -527,7 +514,7 @@ void LLScreenChannel::showToastsBottom() } } - if(it != mToastList.rend() && !mOverflowToastHidden) + if(it != mToastList.rend()) { mHiddenToastsNum = 0; for(; it != mToastList.rend(); it++) @@ -536,7 +523,6 @@ void LLScreenChannel::showToastsBottom() (*it).toast->setVisible(FALSE); mHiddenToastsNum++; } - createOverflowToast(bottom, gSavedSettings.getS32("NotificationTipToastLifeTime")); } else { @@ -566,94 +552,6 @@ void LLScreenChannel::showToastsTop() { } -//-------------------------------------------------------------------------- -void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer) -{ - LLRect toast_rect; - LLToast::Params p; - p.lifetime_secs = timer; - - if(!mOverflowToastPanel) - mOverflowToastPanel = new LLToast(p); - - if(!mOverflowToastPanel) - return; - - mOverflowToastPanel->startFading(); - mOverflowToastPanel->setOnFadeCallback(boost::bind(&LLScreenChannel::onOverflowToastHide, this)); - - LLTextBox* text_box = mOverflowToastPanel->getChild<LLTextBox>("toast_text"); - std::string text = llformat(mOverflowFormatString.c_str(),mHiddenToastsNum); - if(mHiddenToastsNum == 1) - { - text += "."; - } - else - { - text += "s."; - } - - toast_rect = mOverflowToastPanel->getRect(); - mOverflowToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true); - toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight()); - mOverflowToastPanel->setRect(toast_rect); - - // don't show overflow toast if there is not enough space for it. - LLDockableFloater* floater = dynamic_cast<LLDockableFloater*>(LLDockableFloater::getInstanceHandle().get()); - if(floater && floater->overlapsScreenChannel()) - { - LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); - if(toast_rect.mTop > world_rect.mTop) - { - closeOverflowToastPanel(); - return; - } - } - - text_box->setValue(text); - text_box->setVisible(TRUE); - - mOverflowToastPanel->setVisible(TRUE); -} - -//-------------------------------------------------------------------------- -void LLScreenChannel::onOverflowToastHide() -{ - mOverflowToastHidden = true; - - // remove all hidden toasts from channel and save interactive notifications - for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end();) - { - if(!(*it).toast->getVisible()) - { - if((*it).toast->getCanBeStored()) - { - storeToast((*it)); - } - else - { - deleteToast((*it).toast); - } - - it = mToastList.erase(it); - } - else - { - ++it; - } - } -} - -//-------------------------------------------------------------------------- -void LLScreenChannel::closeOverflowToastPanel() -{ - if(mOverflowToastPanel != NULL) - { - mOverflowToastPanel->setVisible(FALSE); - mOverflowToastPanel->stopFading(); - } -} - //-------------------------------------------------------------------------- void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) { @@ -699,24 +597,6 @@ F32 LLScreenChannel::getHeightRatio() return ratio; } -S32 LLScreenChannel::getOverflowToastHeight() -{ - if(mOverflowToastPanel) - { - return mOverflowToastPanel->getRect().getHeight(); - } - - static S32 height = 0; - if(0 == height) - { - LLToast::Params p; - LLToast* toast = new LLToast(p); - height = toast->getRect().getHeight(); - delete toast; - } - return height; -} - //-------------------------------------------------------------------------- void LLScreenChannel::updateStartUpString(S32 num) { @@ -778,6 +658,19 @@ void LLScreenChannel::hideToastsFromScreen() (*it).toast->setVisible(FALSE); } +//-------------------------------------------------------------------------- +void LLScreenChannel::hideToast(const LLUUID& notification_id) +{ + std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), notification_id); + if(mToastList.end() != it) + { + ToastElem te = *it; + te.toast->setVisible(FALSE); + te.toast->stopTimer(); + mToastList.erase(it); + } +} + //-------------------------------------------------------------------------- void LLScreenChannel::removeToastsFromChannel() { @@ -896,3 +789,13 @@ void LLScreenChannel::updateShowToastsState() //-------------------------------------------------------------------------- +LLToast* LLScreenChannel::getToastByNotificationID(LLUUID id) +{ + std::vector<ToastElem>::iterator it = find(mStoredToastList.begin(), + mStoredToastList.end(), id); + + if (it == mStoredToastList.end()) + return NULL; + + return it->toast; +} diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 38f27f756b..88053d87d9 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -72,8 +72,7 @@ public: virtual void setToastAlignment(EToastAlignment align) {mToastAlignment = align;} virtual void setChannelAlignment(EChannelAlignment align) {mChannelAlignment = align;} - virtual void setOverflowFormatString ( const std::string& str) { mOverflowFormatString = str; } - + // kill or modify a toast by its ID virtual void killToastByNotificationID(LLUUID id) {}; virtual void modifyToastNotificationByID(LLUUID id, LLSD data) {}; @@ -121,17 +120,13 @@ protected: LLToast* mHoveredToast; bool mCanStoreToasts; bool mDisplayToastsAlways; - bool mOverflowToastHidden; // controls whether a channel shows toasts or not bool mShowToasts; // EToastAlignment mToastAlignment; EChannelAlignment mChannelAlignment; - // attributes for the Overflow Toast S32 mHiddenToastsNum; - LLToast* mOverflowToastPanel; - std::string mOverflowFormatString; // channel's ID LLUUID mID; @@ -176,6 +171,8 @@ public: void modifyToastByNotificationID(LLUUID id, LLPanel* panel); // hide all toasts from screen, but not remove them from a channel void hideToastsFromScreen(); + // hide toast by notification id + void hideToast(const LLUUID& notification_id); // removes all toasts from a channel void removeToastsFromChannel(); // show all toasts in a channel @@ -190,8 +187,6 @@ public: void removeToastsBySessionID(LLUUID id); // remove all storable toasts from screen and store them void removeAndStoreAllStorableToasts(); - // close the Overflow Toast - void closeOverflowToastPanel(); // close the StartUp Toast void closeStartUpToast(); @@ -214,6 +209,8 @@ public: // update number of notifications in the StartUp Toast void updateStartUpString(S32 num); + LLToast* getToastByNotificationID(LLUUID id); + // Channel's signals // signal on storing of faded toasts event typedef boost::function<void (LLPanel* info_panel, const LLUUID id)> store_tost_callback_t; @@ -257,7 +254,6 @@ private: void onToastHover(LLToast* toast, bool mouse_enter); void onToastFade(LLToast* toast); void onToastDestroyed(LLToast* toast); - void onOverflowToastHide(); void onStartUpToastHide(); // @@ -270,9 +266,6 @@ private: void showToastsCentre(); void showToastsTop(); - // create the Overflow Toast - void createOverflowToast(S32 bottom, F32 timer); - // create the StartUp Toast void createStartUpToast(S32 notif_num, F32 timer); @@ -281,8 +274,6 @@ private: */ static F32 getHeightRatio(); - S32 getOverflowToastHeight(); - // Channel's flags static bool mWasStartUpToastShown; diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 010dfd1b33..0dd9203c6d 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -88,6 +88,11 @@ void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, c mDisplayName = first + " " + last; } +bool LLSpeaker::isInVoiceChannel() +{ + return mStatus == LLSpeaker::STATUS_VOICE_ACTIVE || mStatus == LLSpeaker::STATUS_MUTED; +} + LLSpeakerUpdateModeratorEvent::LLSpeakerUpdateModeratorEvent(LLSpeaker* source) : LLEvent(source, "Speaker add moderator event"), mSpeakerID (source->mID), diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 1a8c23f56a..da8dfdf548 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -67,6 +67,8 @@ public: void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + bool isInVoiceChannel(); + ESpeakerStatus mStatus; // current activity status in speech group F32 mLastSpokeTime; // timestamp when this speaker last spoke F32 mSpeechVolume; // current speech amplitude (timea average rms amplitude?) diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp new file mode 100644 index 0000000000..42db6bf9c3 --- /dev/null +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -0,0 +1,254 @@ +/** + * @file llspeakingindicatormanager.cpp + * @author Mike Antipov + * @brief Implementation of SpeackerIndicatorManager class to process registered LLSpeackerIndicator + * depend on avatars are in the same voice channel. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llspeakingindicatormanager.h" + + +#include "llagentdata.h" +#include "llvoicechannel.h" +#include "llvoiceclient.h" + +/** + * This class intended to control visibility of avatar speaking indicators depend on whether avatars + * are in the same voice channel. + * + * Speaking indicator should be visible for avatars in the same voice channel. See EXT-3976. + * + * It stores passed instances of LLOutputMonitorCtrl in a multimap by avatar LLUUID. + * It observes changing of voice channel and changing of participant list in voice channel. + * When voice channel or voice participant list is changed it updates visibility of an appropriate + * speaking indicator. + * + * Several indicators can be registered for the same avatar. + */ +class SpeakingIndicatorManager : public LLSingleton<SpeakingIndicatorManager>, LLVoiceClientParticipantObserver +{ + LOG_CLASS(SpeakingIndicatorManager); +public: + + /** + * Stores passed speaking indicator to control its visibility. + * + * Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent. + * It ignores instances of Agent's indicator. + * + * @param speaker_id LLUUID of an avatar whose speaking indicator is registered. + * @param speaking_indicator instance of the speaking indicator to be registered. + */ + void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator); + + /** + * Removes passed speaking indicator from observing. + * + * @param speaker_id LLUUID of an avatar whose speaking indicator should be unregistered. + * @param speaking_indicator instance of the speaking indicator to be unregistered. + */ + void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator); + +private: + typedef std::set<LLUUID> speaker_ids_t; + typedef std::multimap<LLUUID, LLSpeakingIndicator*> speaking_indicators_mmap_t; + typedef speaking_indicators_mmap_t::value_type speaking_indicator_value_t; + typedef speaking_indicators_mmap_t::const_iterator indicator_const_iterator; + typedef std::pair<indicator_const_iterator, indicator_const_iterator> indicator_range_t; + + friend class LLSingleton<SpeakingIndicatorManager>; + SpeakingIndicatorManager(); + ~SpeakingIndicatorManager(); + + /** + * Callback to determine when voice channel is changed. + * + * It switches all registered speaking indicators off. + * To reduce overheads only switched on indicators are processed. + */ + void sOnCurrentChannelChanged(const LLUUID& session_id); + + /** + * Callback of changing voice participant list (from LLVoiceClientParticipantObserver). + * + * Switches off indicators had been switched on and switches on indicators of current participants list. + * There is only a few indicators in lists should be switched off/on. + * So, method does not calculate difference between these list it only switches off already + * switched on indicators and switches on indicators of voice channel participants + */ + void onChange(); + + /** + * Changes state of indicators specified by LLUUIDs + * + * @param speakers_uuids - avatars' LLUUIDs whose speaking indicators should be switched + * @param switch_on - if TRUE specified indicator will be switched on, off otherwise. + */ + void switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on); + + /** + * Multimap with all registered speaking indicators + */ + speaking_indicators_mmap_t mSpeakingIndicators; + + /** + * LUUIDs of avatar for which we have speaking indicators switched on. + * + * Is used to switch off all previously ON indicators when voice participant list is changed. + * + * @see onChange() + */ + speaker_ids_t mSwitchedIndicatorsOn; +}; + +////////////////////////////////////////////////////////////////////////// +// PUBLIC SECTION +////////////////////////////////////////////////////////////////////////// +void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator) +{ + if (speaker_id == gAgentID) return; + + LL_DEBUGS("SpeakingIndicator") << "Registering indicator: " << speaker_id << LL_ENDL; + speaking_indicator_value_t value_type(speaker_id, speaking_indicator); + mSpeakingIndicators.insert(value_type); + + speaker_ids_t speakers_uuids; + BOOL is_in_same_voice = LLVoiceClient::getInstance()->findParticipantByID(speaker_id) != NULL; + + speakers_uuids.insert(speaker_id); + switchSpeakerIndicators(speakers_uuids, is_in_same_voice); +} + +void SpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator) +{ + speaking_indicators_mmap_t::iterator it; + it = mSpeakingIndicators.find(speaker_id); + for (;it != mSpeakingIndicators.end(); ++it) + { + if (it->second == speaking_indicator) + { + mSpeakingIndicators.erase(it); + break; + } + } +} + +////////////////////////////////////////////////////////////////////////// +// PRIVATE SECTION +////////////////////////////////////////////////////////////////////////// +SpeakingIndicatorManager::SpeakingIndicatorManager() +{ + LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&SpeakingIndicatorManager::sOnCurrentChannelChanged, this, _1)); + LLVoiceClient::getInstance()->addObserver(this); +} + +SpeakingIndicatorManager::~SpeakingIndicatorManager() +{ + // Don't use LLVoiceClient::getInstance() here without check + // singleton MAY have already been destroyed. + if(LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->removeObserver(this); + } +} + +void SpeakingIndicatorManager::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) +{ + switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE); + mSwitchedIndicatorsOn.clear(); +} + +void SpeakingIndicatorManager::onChange() +{ + LL_DEBUGS("SpeakingIndicator") << "Voice participant list was changed, updating indicators" << LL_ENDL; + + speaker_ids_t speakers_uuids; + LLVoiceClient::getInstance()->getParticipantsUUIDSet(speakers_uuids); + + LL_DEBUGS("SpeakingIndicator") << "Switching all OFF, count: " << mSwitchedIndicatorsOn.size() << LL_ENDL; + // switch all indicators off + switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE); + mSwitchedIndicatorsOn.clear(); + + LL_DEBUGS("SpeakingIndicator") << "Switching all ON, count: " << speakers_uuids.size() << LL_ENDL; + // then switch current voice participants indicators on + switchSpeakerIndicators(speakers_uuids, TRUE); +} + +void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on) +{ + speaker_ids_t::const_iterator it_uuid = speakers_uuids.begin(); + for (; it_uuid != speakers_uuids.end(); ++it_uuid) + { + LL_DEBUGS("SpeakingIndicator") << "Looking for indicator: " << *it_uuid << LL_ENDL; + indicator_range_t it_range = mSpeakingIndicators.equal_range(*it_uuid); + indicator_const_iterator it_indicator = it_range.first; + bool was_found = false; + for (; it_indicator != it_range.second; ++it_indicator) + { + was_found = true; + LLSpeakingIndicator* indicator = (*it_indicator).second; + indicator->switchIndicator(switch_on); + } + + if (was_found) + { + LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL; + + if (switch_on) + { + // store switched on indicator to be able switch it off + mSwitchedIndicatorsOn.insert(*it_uuid); + } + } + else + { + LL_WARNS("SpeakingIndicator") << "indicator was not found among registered: " << *it_uuid << LL_ENDL; + } + } +} + +/************************************************************************/ +/* LLSpeakingIndicatorManager namespace implementation */ +/************************************************************************/ + +void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator) +{ + SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator); +} + +void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator) +{ + SpeakingIndicatorManager::instance().unregisterSpeakingIndicator(speaker_id, speaking_indicator); +} + +// EOF + diff --git a/indra/newview/llspeakingindicatormanager.h b/indra/newview/llspeakingindicatormanager.h new file mode 100644 index 0000000000..ce0158f7d8 --- /dev/null +++ b/indra/newview/llspeakingindicatormanager.h @@ -0,0 +1,67 @@ +/** + * @file llspeakingindicatormanager.h + * @author Mike Antipov + * @brief Interfeace of LLSpeackerIndicator class to be processed depend on avatars are in the same voice channel. + * Also register/unregister methods for this class are declared + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSPEAKINGINDICATORMANAGER_H +#define LL_LLSPEAKINGINDICATORMANAGER_H + +class LLSpeakingIndicator +{ +public: + virtual void switchIndicator(bool switch_on) = 0; +}; + +// See EXT-3976. +namespace LLSpeakingIndicatorManager +{ + /** + * Stores passed speaking indicator to control its visibility. + * + * Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent. + * It ignores instances of Agent's indicator. + * + * @param speaker_id LLUUID of an avatar whose speaker indicator is registered. + * @param speaking_indicator instance of the speaker indicator to be registered. + */ + void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator); + + /** + * Removes passed speaking indicator from observing. + * + * @param speaker_id LLUUID of an avatar whose speaker indicator should be unregistered. + * @param speaking_indicator instance of the speaker indicator to be unregistered. + */ + void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator); +} + +#endif // LL_LLSPEAKINGINDICATORMANAGER_H diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 5ce3bbb9f6..b3b2b9ee5d 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -42,7 +42,7 @@ #include "llfloaterbuycurrency.h" #include "llfloaterchat.h" #include "llfloaterlagmeter.h" -#include "llfloatervolumepulldown.h" +#include "llpanelvolumepulldown.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" #include "llhudicon.h" @@ -204,6 +204,21 @@ LLStatusBar::LLStatusBar(const LLRect& rect) addChild(mSGPacketLoss); childSetActionTextbox("stat_btn", onClickStatGraph); + + mPanelVolumePulldown = new LLPanelVolumePulldown(); + addChild(mPanelVolumePulldown); + + LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); + LLButton* volbtn = getChild<LLButton>( "volume_btn" ); + volume_pulldown_rect.setLeftTopAndSize(volbtn->getRect().mLeft - + (volume_pulldown_rect.getWidth() - volbtn->getRect().getWidth())/2, + volbtn->calcScreenRect().mBottom, + volume_pulldown_rect.getWidth(), + volume_pulldown_rect.getHeight()); + + mPanelVolumePulldown->setShape(volume_pulldown_rect); + mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); + mPanelVolumePulldown->setVisible(FALSE); } LLStatusBar::~LLStatusBar() @@ -501,7 +516,7 @@ static void onClickScriptDebug(void*) void LLStatusBar::onMouseEnterVolume(LLUICtrl* ctrl) { // show the master volume pull-down - LLFloaterReg::showInstance("volume_pulldown"); + gStatusBar->mPanelVolumePulldown->setVisible(TRUE); } static void onClickVolume(void* data) diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index f77cc1acb8..0e98da0fe4 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -112,7 +112,7 @@ private: S32 mSquareMetersCommitted; LLFrameTimer* mBalanceTimer; LLFrameTimer* mHealthTimer; - + LLPanelVolumePulldown* mPanelVolumePulldown; static std::vector<std::string> sDays; static std::vector<std::string> sMonths; static const U32 MAX_DATE_STRING_LENGTH; diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp index eef8435006..0cfcfdc634 100644 --- a/indra/newview/llsyswellitem.cpp +++ b/indra/newview/llsyswellitem.cpp @@ -77,10 +77,11 @@ void LLSysWellItem::onClickCloseBtn() //--------------------------------------------------------------------------------- BOOL LLSysWellItem::handleMouseDown(S32 x, S32 y, MASK mask) { + BOOL res = LLPanel::handleMouseDown(x, y, mask); if(!mCloseBtn->getRect().pointInRect(x, y)) mOnItemClick(this); - return LLPanel::handleMouseDown(x, y, mask); + return res; } //--------------------------------------------------------------------------------- diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 44cf82540a..ba15053381 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -700,8 +700,7 @@ void LLNotificationWellWindow::connectListUpdaterToSignal(std::string notificati void LLNotificationWellWindow::onItemClick(LLSysWellItem* item) { LLUUID id = item->getID(); - if(mChannel) - mChannel->loadStoredToastByNotificationIDToChannel(id); + LLFloaterReg::showInstance("inspect_toast", id); } void LLNotificationWellWindow::onItemClose(LLSysWellItem* item) diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index ded3abcbf4..0c81d1f369 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -162,6 +162,9 @@ private: void onItemClick(LLSysWellItem* item); void onItemClose(LLSysWellItem* item); + // ID of a toast loaded by user (by clicking notification well item) + LLUUID mLoadedToastId; + }; /** diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index d3bbda1c72..c635f91423 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -246,13 +246,6 @@ void LLTeleportHistoryStorage::goToItem(S32 idx) dump(); return; } - - if (idx == (S32)mItems.size() - 1) - { - llwarns << "Will not teleport to the same location." << llendl; - dump(); - return; - } // Attempt to teleport to the requested item. gAgent.teleportViaLocation(mItems[idx].mGlobalPos); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 766cf83a01..d0c125eb77 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -179,7 +179,9 @@ void LLToastNotifyPanel::adjustPanelForScriptNotice(const LLNotificationFormPtr //adjust layout LLRect button_rect = mControlPanel->getRect(); reshape(getRect().getWidth(), mInfoPanel->getRect().getHeight() + button_panel_height); + button_rect.set(0, button_rect.mBottom + button_panel_height, button_rect.getWidth(), button_rect.mBottom); mControlPanel->reshape(button_rect.getWidth(), button_panel_height); + mControlPanel->setRect(button_rect); } // static @@ -217,7 +219,7 @@ LLButton* LLToastNotifyPanel::addButton(const std::string& name, const std::stri S32 ignore_pad = 0; S32 button_index = mNumButtons; S32 index = button_index; - S32 x = (HPAD * 4) + 32; + S32 x = HPAD * 2; // *2 - to make a nice offset if (mIsScriptDialog) { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 66451f47a3..b16134cc28 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1005,7 +1005,7 @@ void render_hud_attachments() LLRect get_whole_screen_region() { - LLRect whole_screen = gViewerWindow->getWindowRectScaled(); + LLRect whole_screen = gViewerWindow->getWorldViewRectScaled(); // apply camera zoom transform (for high res screenshots) F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor(); @@ -1013,13 +1013,13 @@ LLRect get_whole_screen_region() if (zoom_factor > 1.f) { S32 num_horizontal_tiles = llceil(zoom_factor); - S32 tile_width = llround((F32)gViewerWindow->getWindowWidthScaled() / zoom_factor); - S32 tile_height = llround((F32)gViewerWindow->getWindowHeightScaled() / zoom_factor); + S32 tile_width = llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); + S32 tile_height = llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); int tile_y = sub_region / num_horizontal_tiles; int tile_x = sub_region - (tile_y * num_horizontal_tiles); glh::matrix4f mat; - whole_screen.setLeftTopAndSize(tile_x * tile_width, gViewerWindow->getWindowHeightScaled() - (tile_y * tile_height), tile_width, tile_height); + whole_screen.setLeftTopAndSize(tile_x * tile_width, gViewerWindow->getWorldViewHeightScaled() - (tile_y * tile_height), tile_width, tile_height); } return whole_screen; } @@ -1039,12 +1039,12 @@ bool get_hud_matrices(const LLRect& screen_region, glh::matrix4f &proj, glh::mat F32 aspect_ratio = LLViewerCamera::getInstance()->getAspect(); glh::matrix4f mat; - F32 scale_x = (F32)gViewerWindow->getWindowWidthScaled() / (F32)screen_region.getWidth(); - F32 scale_y = (F32)gViewerWindow->getWindowHeightScaled() / (F32)screen_region.getHeight(); + F32 scale_x = (F32)gViewerWindow->getWorldViewWidthScaled() / (F32)screen_region.getWidth(); + F32 scale_y = (F32)gViewerWindow->getWorldViewHeightScaled() / (F32)screen_region.getHeight(); mat.set_scale(glh::vec3f(scale_x, scale_y, 1.f)); mat.set_translate( - glh::vec3f(clamp_rescale((F32)screen_region.getCenterX(), 0.f, (F32)gViewerWindow->getWindowWidthScaled(), 0.5f * scale_x * aspect_ratio, -0.5f * scale_x * aspect_ratio), - clamp_rescale((F32)screen_region.getCenterY(), 0.f, (F32)gViewerWindow->getWindowHeightScaled(), 0.5f * scale_y, -0.5f * scale_y), + glh::vec3f(clamp_rescale((F32)screen_region.getCenterX(), 0.f, (F32)gViewerWindow->getWorldViewWidthScaled(), 0.5f * scale_x * aspect_ratio, -0.5f * scale_x * aspect_ratio), + clamp_rescale((F32)screen_region.getCenterY(), 0.f, (F32)gViewerWindow->getWorldViewHeightScaled(), 0.5f * scale_y, -0.5f * scale_y), 0.f)); proj *= mat; @@ -1294,8 +1294,8 @@ void render_ui_2d() if (gAgent.getAvatarObject() && gAgent.mHUDCurZoom < 0.98f) { glPushMatrix(); - S32 half_width = (gViewerWindow->getWindowWidthScaled() / 2); - S32 half_height = (gViewerWindow->getWindowHeightScaled() / 2); + S32 half_width = (gViewerWindow->getWorldViewWidthScaled() / 2); + S32 half_height = (gViewerWindow->getWorldViewHeightScaled() / 2); glScalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f); glTranslatef((F32)half_width, (F32)half_height, 0.f); F32 zoom = gAgent.mHUDCurZoom; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 801c2d0fd2..0edd4ac025 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -107,7 +107,6 @@ #include "llfloateruipreview.h" #include "llfloaterurldisplay.h" #include "llfloatervoicedevicesettings.h" -#include "llfloatervolumepulldown.h" #include "llfloaterwater.h" #include "llfloaterwhitelistentry.h" #include "llfloaterwindlight.h" @@ -118,6 +117,7 @@ #include "llinspectgroup.h" #include "llinspectobject.h" #include "llinspectremoteobject.h" +#include "llinspecttoast.h" #include "llmediaremotectrl.h" #include "llmoveview.h" #include "llnearbychat.h" @@ -189,6 +189,7 @@ void LLViewerFloaterReg::registerFloaters() LLInspectGroupUtil::registerFloater(); LLInspectObjectUtil::registerFloater(); LLInspectRemoteObjectUtil::registerFloater(); + LLNotificationsUI::registerFloater(); LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLagMeter>); LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>); @@ -260,7 +261,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImagePreview>, "upload"); LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload"); LLFloaterReg::add("upload_model", "floater_model_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelPreview>, "upload"); - LLFloaterReg::add("volume_pulldown", "floater_volume_pulldown.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVolumePulldown>); + LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 42c45589c0..43c7574830 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -904,7 +904,19 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f LLPanelPlaces *places_panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); if (places_panel) { - places_panel->setItem(item); + // we are creating a landmark + if("create_landmark" == places_panel->getPlaceInfoType() && !places_panel->getItem()) + { + places_panel->setItem(item); + } + // we are opening a group notice attachment + else + { + LLSD args; + args["type"] = "landmark"; + args["id"] = item_id; + LLSideTray::getInstance()->showPanel("panel_places", args); + } } } } @@ -1098,28 +1110,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this)); } - // *NOTE dzaporozhan - // Restored from viewer-1-23 to fix EXT-3520 - // Saves Group Notice Attachments to inventory. - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_ImprovedInstantMessage); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_MessageBlock); - msg->addBOOLFast(_PREHASH_FromGroup, FALSE); - msg->addUUIDFast(_PREHASH_ToAgentID, mFromID); - msg->addU8Fast(_PREHASH_Offline, IM_ONLINE); - msg->addUUIDFast(_PREHASH_ID, mTransactionID); - msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary - std::string name; - LLAgentUI::buildFullname(name); - msg->addStringFast(_PREHASH_FromAgentName, name); - msg->addStringFast(_PREHASH_Message, ""); - msg->addU32Fast(_PREHASH_ParentEstateID, 0); - msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); - msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); - std::string from_string; // Used in the pop-up. std::string chatHistory_string; // Used in chat history. @@ -1155,8 +1145,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& } } break; - case IM_TASK_INVENTORY_OFFERED: case IM_GROUP_NOTICE: + send_auto_receive_response(); + break; + case IM_TASK_INVENTORY_OFFERED: case IM_GROUP_NOTICE_REQUESTED: // This is an offer from a task or group. // We don't use a new instance of an opener @@ -1171,10 +1163,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // end switch (mIM) case IOR_ACCEPT: - msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1)); - msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData), sizeof(mFolderID.mData)); - msg->sendReliable(mHost); - //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { @@ -1197,7 +1185,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& { chat.mMuted = TRUE; } - LLFloaterChat::addChatHistory(chat); + + // *NOTE dzaporozhan + // Disabled logging to old chat floater to fix crash in group notices - EXT-4149 + // LLFloaterChat::addChatHistory(chat); LLInventoryFetchComboObserver::folder_ref_t folders; LLInventoryFetchComboObserver::item_ref_t items; @@ -1768,10 +1759,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else if (from_id.isNull()) { - // Messages from "Second Life" ID don't go to IM history - // messages which should be routed to IM window come from a user ID with name=SYSTEM_NAME - chat.mText = name + ": " + message; - LLFloaterChat::addChat(chat, FALSE, FALSE); + LLSD args; + args["MESSAGE"] = message; + LLNotificationsUtil::add("SystemMessage", args); } else if (to_id.isNull()) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9285ab94dc..33bfee798a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -604,7 +604,6 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK { const char* buttonname = ""; const char* buttonstatestr = ""; - BOOL handled = FALSE; S32 x = pos.mX; S32 y = pos.mY; x = llround((F32)x / mDisplayScale.mV[VX]); @@ -699,7 +698,10 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK } else { - handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask); + if (top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask)) + { + return TRUE; + } } } @@ -717,34 +719,12 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl; } - if (down) + // Do not allow tool manager to handle mouseclicks if we have disconnected + if(!gDisconnected && LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) { - if (gDisconnected) - { - return FALSE; - } - - if(LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) - { - return TRUE; - } + return TRUE; } - else - { - if( !handled ) - { - handled = mRootView->handleAnyMouseClick(x, y, mask, clicktype, down); - } - if( !handled ) - { - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - if (tool) - { - handled = tool->handleAnyMouseClick(x, y, mask, clicktype, down); - } - } - } // If we got this far on a down-click, it wasn't handled. // Up-clicks, though, are always handled as far as the OS is concerned. diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 423c46e14c..42b8a1c2b6 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5004,6 +5004,17 @@ LLVoiceClient::participantMap *LLVoiceClient::getParticipantList(void) return result; } +void LLVoiceClient::getParticipantsUUIDSet(std::set<LLUUID>& participant_uuids) +{ + if (NULL == mAudioSession) return; + + participantUUIDMap::const_iterator it = mAudioSession->mParticipantsByUUID.begin(), + it_end = mAudioSession->mParticipantsByUUID.end(); + for (; it != it_end; ++it) + { + participant_uuids.insert((*(*it).first)); + } +} LLVoiceClient::participantState *LLVoiceClient::sessionState::findParticipant(const std::string &uri) { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 724179847d..6231c6ba29 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -354,6 +354,7 @@ static void updatePosition(void); participantState *findParticipantByID(const LLUUID& id); participantMap *getParticipantList(void); + void getParticipantsUUIDSet(std::set<LLUUID>& participant_uuids); typedef std::map<const std::string*, sessionState*, stringMapComparitor> sessionMap; typedef std::set<sessionState*> sessionSet; diff --git a/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png b/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png index 447e0af0be..6343ddf035 100644 Binary files a/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png and b/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png differ diff --git a/indra/newview/skins/default/textures/bottomtray/WellButton_Lit.png b/indra/newview/skins/default/textures/bottomtray/WellButton_Lit.png index dd9133bcc4..661d1c5611 100644 Binary files a/indra/newview/skins/default/textures/bottomtray/WellButton_Lit.png and b/indra/newview/skins/default/textures/bottomtray/WellButton_Lit.png differ diff --git a/indra/newview/skins/default/textures/bottomtray/WellButton_Lit_Selected.png b/indra/newview/skins/default/textures/bottomtray/WellButton_Lit_Selected.png index 0080e71f41..f927fd3989 100644 Binary files a/indra/newview/skins/default/textures/bottomtray/WellButton_Lit_Selected.png and b/indra/newview/skins/default/textures/bottomtray/WellButton_Lit_Selected.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index db60b90a93..cfa7479fa9 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -224,7 +224,7 @@ with the same filename but different name scale.left="4" scale.top="28" scale.right="60" scale.bottom="4" /> <texture name="Inspector_Hover" file_name="windows/Inspector_Hover.png" preload="false" /> <texture name="Inspector_I" file_name="windows/Inspector_I.png" preload="false" /> - + <texture name="Inv_Acessories" file_name="icons/Inv_Accessories.png" preload="false" /> <texture name="Inv_Alpha" file_name="icons/Inv_Alpha.png" preload="false" /> <texture name="Inv_Animation" file_name="icons/Inv_Animation.png" preload="false" /> @@ -650,6 +650,12 @@ with the same filename but different name <texture name="PowerOff_Over" file_name="icons/PowerOff_Over.png" preload="false" /> <texture name="PowerOff_Press" file_name="icons/PowerOff_Press.png" preload="false" /> + <texture name="pixiesmall.j2c" use_mips="true" /> + <texture name="script_error.j2c" use_mips="true" /> + <texture name="silhouette.j2c" use_mips="true" /> + <texture name="foot_shadow.j2c" use_mips="true" /> + <texture name="cloud-particle.j2c" use_mips="true" /> + <!--WARNING OLD ART BELOW *do not use*--> <texture name="icn_chatbar.tga" /> <texture name="icn_media_web.tga" preload="true" /> @@ -678,8 +684,6 @@ with the same filename but different name <texture name="toggle_button_off" file_name="toggle_button_off.png" preload="true" /> <texture name="toggle_button_selected" file_name="toggle_button_selected.png" preload="true" /> - - <texture name="sm_rounded_corners_simple.tga" scale.left="4" scale.top="4" scale.bottom="4" scale.right="4" /> <texture name="color_swatch_alpha.tga" preload="true" /> <texture name="button_anim_pause.tga" /> @@ -698,7 +702,6 @@ with the same filename but different name <texture name="icon_event_mature.tga" /> <texture name="icon_for_sale.tga" /> <texture name="icon_place_for_sale.tga" /> - <texture name="icon_popular.tga" /> <texture name="icon_top_pick.tga" /> <texture name="inv_folder_mesh.tga"/> @@ -719,27 +722,10 @@ with the same filename but different name <texture name="map_telehub.tga" /> <texture name="map_track_16.tga" /> - <texture name="media_icon.tga" file_name="icn_label_media.tga" /> - <texture name="music_icon.tga" file_name="icn_label_music.tga" /> - - <texture name="notify_tip_icon.tga" /> <texture name="notify_caution_icon.tga" /> <texture name="notify_next.png" preload="true" /> <texture name="notify_box_icon.tga" /> - <texture name="pixiesmall.j2c" use_mips="true" /> - <texture name="script_error.j2c" use_mips="true" /> - <texture name="silhouette.j2c" use_mips="true" /> - <texture name="foot_shadow.j2c" use_mips="true" /> - <texture name="cloud-particle.j2c" use_mips="true" /> - - <texture name="status_no_build.tga" /> - <texture name="status_voice.tga" /> - <texture name="status_no_fly.tga" /> - <texture name="status_health.tga" /> - <texture name="status_no_push.tga" /> - <texture name="status_no_scripts.tga" /> - <texture name="icn_active-speakers-dot-lvl0.tga" /> <texture name="icn_active-speakers-dot-lvl1.tga" /> <texture name="icn_active-speakers-dot-lvl2.tga" /> diff --git a/indra/newview/skins/default/xui/de/floater_buy_currency.xml b/indra/newview/skins/default/xui/de/floater_buy_currency.xml index 3c336cc40b..c320e796c2 100644 --- a/indra/newview/skins/default/xui/de/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/de/floater_buy_currency.xml @@ -46,7 +46,7 @@ [AMT] L$ </text> <text name="currency_links"> - [http://www.secondlife.com/ payment method] | [http://www.secondlife.com/ currency] | [http://www.secondlife.com exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE payment method] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=de-DE exchange rate] </text> <text name="exchange_rate_note"> Geben Sie den Betrag erneut ein, um die aktuellste Umtauschrate anzuzeigen. diff --git a/indra/newview/skins/default/xui/de/floater_help_browser.xml b/indra/newview/skins/default/xui/de/floater_help_browser.xml index 53bddcced1..2344d6f412 100644 --- a/indra/newview/skins/default/xui/de/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/de/floater_help_browser.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="floater_help_browser" title="HILFE-BROWSER"> <floater.string name="home_page_url"> - http://www.secondlife.com + http://de.secondlife.com </floater.string> <floater.string name="support_page_url"> - http://support.secondlife.com + http://de.secondlife.com/support </floater.string> <layout_stack name="stack1"> <layout_panel name="external_controls"> diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index 809ac33e15..e93a38f187 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -166,7 +166,7 @@ <string name="TooltipSLAPP"> Anklicken, um Befehl secondlife:// auszuführen </string> - <string name="CurrentURL" value="CurrentURL: [CurrentURL]"/> + <string name="CurrentURL" value=" CurrentURL: [CurrentURL]"/> <string name="SLurlLabelTeleport"> Teleportieren nach </string> @@ -821,46 +821,46 @@ <string name="InventoryNoTexture"> Sie haben keine Kopie dieser Textur in Ihrem Inventar. </string> - <string name="no_transfer" value="(kein Transferieren)"/> - <string name="no_modify" value="(kein Bearbeiten)"/> - <string name="no_copy" value="(kein Kopieren)"/> - <string name="worn" value="(getragen)"/> - <string name="link" value="(Link)"/> - <string name="broken_link" value="(unvollständiger_Link)"/> + <string name="no_transfer" value=" (kein Transferieren)"/> + <string name="no_modify" value=" (kein Bearbeiten)"/> + <string name="no_copy" value=" (kein Kopieren)"/> + <string name="worn" value=" (getragen)"/> + <string name="link" value=" (Link)"/> + <string name="broken_link" value=" (unvollständiger_Link)"/> <string name="LoadingContents"> Inhalte werden geladen... </string> <string name="NoContents"> Keine Inhalte </string> - <string name="WornOnAttachmentPoint" value="(getragen am [ATTACHMENT_POINT])"/> + <string name="WornOnAttachmentPoint" value=" (getragen am [ATTACHMENT_POINT])"/> <string name="PermYes"> Ja </string> <string name="PermNo"> Nein </string> - <string name="Chat" value="Chat:"/> - <string name="Sound" value="Sound:"/> - <string name="Wait" value="--- Warten:"/> - <string name="AnimFlagStop" value="Animation stoppen:"/> - <string name="AnimFlagStart" value="Animation starten:"/> - <string name="Wave" value="Winken"/> - <string name="HelloAvatar" value="Hallo Avatar!"/> - <string name="ViewAllGestures" value="Alle anzeigen >>"/> - <string name="Animations" value="Animationen,"/> - <string name="Calling Cards" value="Visitenkarten,"/> - <string name="Clothing" value="Kleidung,"/> - <string name="Gestures" value="Gesten,"/> - <string name="Landmarks" value="Landmarken,"/> - <string name="Notecards" value="Notizkarten,"/> - <string name="Objects" value="Objekte,"/> - <string name="Scripts" value="Skripts,"/> - <string name="Sounds" value="Sounds,"/> - <string name="Textures" value="Texturen,"/> - <string name="Snapshots" value="Fotos,"/> - <string name="No Filters" value="Nein"/> - <string name="Since Logoff" value="- Seit Abmeldung"/> + <string name="Chat" value=" Chat:"/> + <string name="Sound" value=" Sound:"/> + <string name="Wait" value=" --- Warten:"/> + <string name="AnimFlagStop" value=" Animation stoppen:"/> + <string name="AnimFlagStart" value=" Animation starten:"/> + <string name="Wave" value=" Winken"/> + <string name="HelloAvatar" value=" Hallo Avatar!"/> + <string name="ViewAllGestures" value=" Alle anzeigen >>"/> + <string name="Animations" value=" Animationen,"/> + <string name="Calling Cards" value=" Visitenkarten,"/> + <string name="Clothing" value=" Kleidung,"/> + <string name="Gestures" value=" Gesten,"/> + <string name="Landmarks" value=" Landmarken,"/> + <string name="Notecards" value=" Notizkarten,"/> + <string name="Objects" value=" Objekte,"/> + <string name="Scripts" value=" Skripts,"/> + <string name="Sounds" value=" Sounds,"/> + <string name="Textures" value=" Texturen,"/> + <string name="Snapshots" value=" Fotos,"/> + <string name="No Filters" value="Nein "/> + <string name="Since Logoff" value=" - Seit Abmeldung"/> <string name="InvFolder My Inventory"> Mein Inventar </string> @@ -1239,13 +1239,13 @@ <string name="GroupsNone"> keine </string> - <string name="Group" value="(Gruppe)"/> + <string name="Group" value=" (Gruppe)"/> <string name="Unknown"> (unbekannt) </string> - <string name="SummaryForTheWeek" value="Zusammenfassung für diese Woche, beginnend am"/> - <string name="NextStipendDay" value="Der nächste Stipendium-Tag ist"/> - <string name="GroupIndividualShare" value="Gruppenanteil Einzelanteil"/> + <string name="SummaryForTheWeek" value="Zusammenfassung für diese Woche, beginnend am "/> + <string name="NextStipendDay" value="Der nächste Stipendium-Tag ist "/> + <string name="GroupIndividualShare" value=" Gruppenanteil Einzelanteil"/> <string name="Balance"> Kontostand </string> @@ -1324,8 +1324,8 @@ <string name="covenant_last_modified"> Zuletzt geändert: </string> - <string name="none_text" value="(keiner)"/> - <string name="never_text" value="(nie)"/> + <string name="none_text" value=" (keiner)"/> + <string name="never_text" value=" (nie)"/> <string name="GroupOwned"> In Gruppenbesitz </string> @@ -1616,7 +1616,7 @@ Falls der Fehler dann weiterhin auftritt, müssen Sie [APP_NAME] von Ihrem Syste Unbehebbarer Fehler </string> <string name="MBRequiresAltiVec"> - [APP_NAME] erfordert einen Prozessor mit AltiVec (G4 oder später). + [APP_NAME] erfordert einen Prozessor mit AltiVec (G4 oder später). </string> <string name="MBAlreadyRunning"> [APP_NAME] läuft bereits. diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 82ed1a7d7f..9806f45bc4 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -112,7 +112,7 @@ Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number word_wrap="true"> Second Life is brought to you by Philip, Tessa, Andrew, Cory, James, Ben, Char, Charlie, Colin, Dan, Daniel, Doug, Eric, Hamlet, Haney, Eve, Hunter, Ian, Jeff, Jennifer, Jim, John, Lee, Mark, Peter, Phoenix, Richard, Robin, Xenon, Steve, Tanya, Eddie, Avi, Frank, Bruce, Aaron, Alice, Bob, Debra, Eileen, Helen, Janet, Louie, Leviathania, Stefan, Ray, Kevin, Tom, Mikeb, MikeT, Burgess, Elena, Tracy, Bill, Todd, Ryan, Zach, Sarah, Nova, Tim, Stephanie, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Magellan, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Ventrella, Jack, Vektor, Iris, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Altruima, Jesse, Teeny, Monroe, Icculus, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Satoko, Yuko, Makiko, Thomas, Harry, Seth, Alexei, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, beez, Milo, Hermia, Red, Thrax, Joe, Sally, Magenta, Mogura, Paul, Jose, Rejean, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Jean, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, dustin, George, Del, Matthew, Cat, Jacqui, Lightfoot, Adrian, Viola, Alfred, Noel, Irfan, Sunil, Yool, Rika, Jane, Xtreme, Frontier, a2, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Gulliver, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Anthony, Jeremy, JP, Jake, Maurice, Madhavi, Leopard, Kyle, Joon, Kari, Bert, Belinda, Jon, Kristi, Bridie, Pramod, KJ, Socrates, Maria, Ivan, Aric, Yamasaki, Adreanne, Jay, MitchK, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Rohn, Colossus, Zen, BigPapi, Brad, Pastrami, Kurz, Mani, Neuro, Jaime, MJ, Rowan, Sgt, Elvis, Gecko, Samuel, Sardonyx, Leo, Bryan, Niko, Soft, Poppy, Rachel, Aki, Angelo, Banzai, Alexa, Sue, CeeLo, Bender, CG, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Heidy, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Winnie, Stella, Milton, Rothman, Niall, Marin, Allison, Katie, Dawn, Katt, Dusty, Kalpana, Judy, Andrea, Ambroff, Infinity, Gail, Rico, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Vidtuts, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Austin, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Yang, T, Simone, Maestro, Scott, Charlene, Quixote, Amanda, Susan, Zed, Anne, Enkidu, Esbee, Joroan, Katelin, Roxie, Tay, Scarlet, Kevin, Johnny, Wolfgang, Andren, Bob, Howard, Merov, Rand, Ray, Michon, Newell, Galen, Dessie, Les and many others. -Thank you to the following residents for helping to ensure that this is the best version yet: (in progress) +Thank you to the following Residents for helping to ensure that this is the best version yet: (in progress) diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 33fdd923ad..900f4c5956 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1036,7 +1036,7 @@ Leyla Linden </text> name="Autoreturn" top="164" width="294"> - Autoreturn other residents' objects (minutes, 0 for off): + Autoreturn other Residents' objects (minutes, 0 for off): </text> <line_editor border_style="line" @@ -1175,7 +1175,7 @@ Only large parcels can be listed in search. name="allow_label" top="10" width="278"> - Allow other residents to: + Allow other Residents to: </text> <check_box height="16" @@ -1917,7 +1917,7 @@ Only large parcels can be listed in search. layout="topleft" left_delta="0" name="limit_payment" - tool_tip="Ban unidentified residents." + tool_tip="Ban unidentified Residents." top_pad="4" width="278" /> <check_box @@ -1927,7 +1927,7 @@ Only large parcels can be listed in search. layout="topleft" left_delta="0" name="limit_age_verified" - tool_tip="Ban residents who have not verified their age. See the [SUPPORT_SITE] for more information." + tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information." top_pad="4" width="278" /> <check_box diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index 86229c6691..d202bf1b9f 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -107,7 +107,7 @@ height="16" layout="topleft" top_delta="0" - left="242" + left="217" name="currency_label" width="15"> L$ @@ -123,7 +123,7 @@ label="L$" left_pad="3" name="currency_amt" - width="60"> + width="85"> 1234 </line_editor> <text diff --git a/indra/newview/skins/default/xui/en/floater_customize.xml b/indra/newview/skins/default/xui/en/floater_customize.xml index 0dc7d62b19..ddc0d9af72 100644 --- a/indra/newview/skins/default/xui/en/floater_customize.xml +++ b/indra/newview/skins/default/xui/en/floater_customize.xml @@ -260,10 +260,9 @@ left="10" name="not worn instructions" top="31" + word_wrap="true" width="373"> - Put on a new shape by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new shape by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -274,6 +273,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -300,7 +300,7 @@ scratch and wear it. left="10" name="Create New" top="104" - width="140" /> + width="160" /> <button follows="right|bottom" height="23" @@ -463,10 +463,9 @@ scratch and wear it. left="10" name="not worn instructions" top="31" + word_wrap="true" width="373"> - Put on a new skin by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new skin by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -477,6 +476,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -542,7 +542,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-249" - width="120" /> + width="160" /> <button follows="right|bottom" height="23" @@ -713,10 +713,9 @@ scratch and wear it. left="10" name="not worn instructions" top="31" + word_wrap="true" width="373"> - Put on a new hair by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new hair by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -727,6 +726,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -765,7 +765,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-89" - width="120" /> + width="160" /> <button follows="right|bottom" height="23" @@ -898,10 +898,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new eyes by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new set of eyes by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -912,6 +911,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -950,7 +950,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="39" - width="120" /> + width="160" /> <button follows="right|bottom" height="23" @@ -1056,7 +1056,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-41" - width="120" /> + width="160" /> <button follows="left|top" height="23" @@ -1170,10 +1170,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new shirt by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new shirt by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -1184,6 +1183,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1262,7 +1262,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-41" - width="120" /> + width="160" /> <button follows="left|top" height="23" @@ -1376,10 +1376,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new pants by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on new pants by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -1390,6 +1389,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1509,10 +1509,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new shoes by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new pair of shoes by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -1523,6 +1522,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1572,7 +1572,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-41" - width="120" /> + width="160" /> <button follows="left|top" height="23" @@ -1715,10 +1715,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new socks by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on new socks by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -1729,6 +1728,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1778,7 +1778,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-41" - width="120" /> + width="160" /> <button follows="left|top" height="23" @@ -1921,10 +1921,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new jacket by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new jacket by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -1935,6 +1934,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -1996,7 +1996,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-121" - width="140" /> + width="160" /> <button follows="left|top" height="23" @@ -2139,10 +2139,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new gloves by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on new gloves by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -2153,6 +2152,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -2202,7 +2202,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-41" - width="130" /> + width="160" /> <button follows="left|top" height="23" @@ -2345,10 +2345,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new undershirt by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new undershirt by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -2359,6 +2358,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -2551,10 +2551,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new underpants by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on new underpants by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -2565,6 +2564,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -2757,10 +2757,9 @@ scratch and wear it. left_delta="0" name="not worn instructions" top_pad="8" + word_wrap="true" width="373"> - Put on a new skirt by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new skirt by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -2771,6 +2770,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -2820,7 +2820,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-41" - width="120" /> + width="160" /> <button follows="left|top" height="23" @@ -2962,11 +2962,10 @@ scratch and wear it. layout="topleft" left_delta="-2" name="not worn instructions" - top_delta="2" + top_pad="8" + word_wrap="true" width="373"> - Put on a new alpha mask by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new alpha mask by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -2977,6 +2976,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -3108,7 +3108,7 @@ scratch and wear it. left="8" name="Create New" top="104" - width="120" /> + width="160" /> <button follows="left|top" height="23" @@ -3250,11 +3250,10 @@ scratch and wear it. layout="topleft" left_delta="-2" name="not worn instructions" - top_delta="2" + top_pad="8" + word_wrap="true" width="373"> - Put on a new tattoo by dragging one from your inventory -to your avatar. Alternately, you create a new one from -scratch and wear it. + Put on a new tattoo by dragging one from your inventory to your avatar. Alternately, you create a new one from scratch and wear it. </text> <text type="string" @@ -3265,6 +3264,7 @@ scratch and wear it. left_delta="0" name="no modify instructions" top_delta="0" + word_wrap="true" width="373"> You do not have permission to modify this wearable. </text> @@ -3327,7 +3327,7 @@ scratch and wear it. left_delta="0" name="Create New" top_delta="-121" - width="120" /> + width="160" /> <button follows="left|top" height="23" diff --git a/indra/newview/skins/default/xui/en/floater_god_tools.xml b/indra/newview/skins/default/xui/en/floater_god_tools.xml index b01c0edc8b..0fac6cd5f1 100644 --- a/indra/newview/skins/default/xui/en/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_god_tools.xml @@ -123,7 +123,7 @@ layout="topleft" left_delta="0" name="check reset home" - tool_tip="When resident teleports out, reset their home to the destination position." + tool_tip="When Resident teleports out, reset their home to the destination position." top_pad="4" width="180"> <check_box.commit_callback diff --git a/indra/newview/skins/default/xui/en/floater_im.xml b/indra/newview/skins/default/xui/en/floater_im.xml index 92a6111759..a21242ffe1 100644 --- a/indra/newview/skins/default/xui/en/floater_im.xml +++ b/indra/newview/skins/default/xui/en/floater_im.xml @@ -26,7 +26,7 @@ </multi_floater.string> <multi_floater.string name="muted_message"> - You have blocked this resident. Sending a message will automatically unblock them. + You have blocked this Resident. Sending a message will automatically unblock them. </multi_floater.string> <multi_floater.string name="generic_request_error"> diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml index 920f0c909a..ae686d9ab7 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -4,8 +4,8 @@ border_drop_shadow_visible="false" drop_shadow_visible="false" border="false" - bg_opaque_image="Inspector_Background" - bg_alpha_image="Toast_Background" + bg_opaque_image="Window_Foreground" + bg_alpha_image="Window_Background" bg_alpha_color="0 0 0 0" legacy_header_height="18" can_minimize="true" diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index f1a75bfcb4..aa219b9615 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -201,11 +201,11 @@ name="Age__Age_play" value="31" /> <combo_box.item - label="Age > Adult resident on Teen Second Life" + label="Age > Adult Resident on Teen Second Life" name="Age__Adult_resident_on_Teen_Second_Life" value="32" /> <combo_box.item - label="Age > Underage resident outside of Teen Second Life" + label="Age > Underage Resident outside of Teen Second Life" name="Age__Underage_resident_outside_of_Teen_Second_Life" value="33" /> <combo_box.item diff --git a/indra/newview/skins/default/xui/en/floater_select_key.xml b/indra/newview/skins/default/xui/en/floater_select_key.xml index 93aa1f0e31..4e89df5a73 100644 --- a/indra/newview/skins/default/xui/en/floater_select_key.xml +++ b/indra/newview/skins/default/xui/en/floater_select_key.xml @@ -15,13 +15,12 @@ follows="left|top" height="30" layout="topleft" - left="10" + left="30" name="Save item as:" top="25" word_wrap="true" - width="220"> - Press a key to set your -Speak button trigger. + width="180"> + Press a key to set your Speak button trigger. </text> <button height="23" @@ -30,5 +29,6 @@ Speak button trigger. layout="topleft" right="-10" name="Cancel" + top_pad="8" width="100" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_top_objects.xml b/indra/newview/skins/default/xui/en/floater_top_objects.xml index 68bb500c78..b06c6dc215 100644 --- a/indra/newview/skins/default/xui/en/floater_top_objects.xml +++ b/indra/newview/skins/default/xui/en/floater_top_objects.xml @@ -9,7 +9,7 @@ name="top_objects" help_topic="top_objects" title="Top Objects" - width="550"> + width="800"> <floater.string name="top_scripts_title"> Top Scripts @@ -64,7 +64,7 @@ multi_select="true" name="objects_list" top_delta="17" - width="530"> + width="780"> <scroll_list.columns label="Score" name="score" @@ -84,11 +84,15 @@ <scroll_list.columns label="Time" name="time" - width="100" /> + width="150" /> <scroll_list.columns label="Mono Time" name="mono_time" - width="55" /> + width="100" /> + <scroll_list.columns + label="URLs" + name="URLs" + width="100" /> <scroll_list.commit_callback function="TopObjects.CommitObjectsList" /> </scroll_list> @@ -112,7 +116,7 @@ left_pad="3" name="id_editor" top_delta="-3" - width="325" /> + width="575" /> <button follows="bottom|right" height="23" @@ -144,7 +148,7 @@ left_pad="3" name="object_name_editor" top_delta="-3" - width="325" /> + width="575" /> <button follows="bottom|right" height="23" @@ -176,7 +180,7 @@ left_pad="3" name="owner_name_editor" top_delta="-3" - width="325" /> + width="575" /> <button follows="bottom|right" height="23" @@ -190,7 +194,7 @@ function="TopObjects.GetByOwnerName" /> </button> <button - follows="top|left" + follows="bottom|right" height="22" image_overlay="Refresh_Off" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml index 1adb824e2a..5e168fe4aa 100644 --- a/indra/newview/skins/default/xui/en/floater_tos.xml +++ b/indra/newview/skins/default/xui/en/floater_tos.xml @@ -49,9 +49,9 @@ left_delta="0" name="tos_heading" top_delta="-399" + word_wrap="true" width="552"> - Please read the following Terms of Service carefully. To continue logging in to [SECOND_LIFE], -you must accept the agreement. + Please read the following Terms of Service carefully. To continue logging in to [SECOND_LIFE], you must accept the agreement. </text> <web_browser follows="left|top" @@ -60,6 +60,6 @@ you must accept the agreement. left_delta="0" name="tos_html" start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody text=%22000000%22%3E%3Ch2%3E Loading %3Ca%20target%3D%22_external%22%20href%3D%22http%3A//secondlife.com/app/tos/%22%3ETerms%20of%20Service%3C/a%3E...%3C/h2%3E %3C/body%3E %3C/html%3E" - top_delta="0" + top_delta="40" width="568" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index b9649e9c57..ae198d69a3 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -3,9 +3,9 @@ can_resize="true" can_minimize="true" can_close="false" - height="270" + height="275" layout="topleft" - min_height="122" + min_height="100" min_width="190" name="floater_voice_controls" help_topic="floater_voice_controls" @@ -33,27 +33,23 @@ name="no_one_near"> No one near has voice enabled </string> - <string - name="max_visible_items"> - 5 - </string> - <panel - bevel_style="out" - border="true" - follows="left|right|top" - height="62" - layout="topleft" - left="0" - name="control_panel" - top="0" - width="282"> - <panel - height="18" - follows="top|left|right" + <layout_stack + clip="false" + follows="all" + height="262" layout="topleft" left="10" - name="my_panel" + mouse_opaque="false" + name="my_call_stack" + orientation="vertical" width="263"> + <layout_panel + follows="top|left|right" + user_resize="false" + auto_resize="false" + layout="topleft" + height="26" + name="my_panel"> <avatar_icon enabled="false" follows="left|top" @@ -79,92 +75,57 @@ <output_monitor auto_update="true" draw_border="false" - follows="right" + follows="top|right" height="16" layout="topleft" name="speaking_indicator" - right="-1" - top="2" + left_pad="5" visible="true" width="20" /> - </panel> - <layout_stack - border_size="0" - clip="false" - follows="all" - height="28" - layout="topleft" - left="10" - mouse_opaque="false" - name="leave_call_stack" - orientation="horizontal" - top_pad="5" - width="263"> - <layout_panel - auto_resize="true" - follows="left|right" - height="26" - layout="topleft" - min_height="23" - min_width="5" - mouse_opaque="false" - name="left_anchor" - width="80"/> + </layout_panel> <layout_panel auto_resize="false" - follows="left|right" + user_resize="false" + follows="top|left" height="26" + visible="true" layout="topleft" - mouse_opaque="false" - min_height="24" - min_width="100" name="leave_call_btn_panel" width="100"> <button - follows="left|right" - height="24" + follows="right|top" + height="23" + top_pad="0" label="Leave Call" - left="0" name="leave_call_btn" - top="0" width="100" /> </layout_panel> - <layout_panel - auto_resize="true" - follows="left|right" - height="26" + <layout_panel + follows="all" + layout="topleft" + left="2" + top_pad="0" + height="205" + name="callers_panel" + user_resize="false" + width="280"> + <avatar_list + follows="all" + height="205" + ignore_online_status="true" layout="topleft" - mouse_opaque="false" - min_height="24" - min_width="5" - name="right_anchor" - width="80"/> - </layout_stack> - </panel> - <avatar_list - follows="all" - height="197" - ignore_online_status="true" - layout="topleft" - left="0" - multi_select="true" - name="speakers_list" - width="282" /> - <panel - filename="panel_avatar_list_item.xml" - follows="left|right|top" - height="24" - layout="topleft" - left="0" - name="non_avatar_caller" - top="70" - width="282" /> - <view_border - bevel_style="out" - follows="left|top|right|bottom" - height="206" - layout="topleft" - left="0" - top="63" - width="282" /> + multi_select="true" + name="speakers_list" + width="280" /> + <panel + filename="panel_avatar_list_item.xml" + follows="left|right|top" + height="24" + layout="topleft" + left="0" + name="non_avatar_caller" + top="10" + width="276" /> + </layout_panel> + </layout_stack> </floater> diff --git a/indra/newview/skins/default/xui/en/inspect_toast.xml b/indra/newview/skins/default/xui/en/inspect_toast.xml new file mode 100644 index 0000000000..0221397a8c --- /dev/null +++ b/indra/newview/skins/default/xui/en/inspect_toast.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- + Not can_close / no title to avoid window chrome + Single instance - only have one at a time, recycle it each spawn +--> +<floater + legacy_header_height="25" + bevel_style="in" + bg_opaque_image="Inspector_Background" + can_close="false" + can_minimize="false" + height="148" + layout="topleft" + name="inspect_toast" + single_instance="true" + sound_flags="0" + visible="true" + width="228"> +</floater> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index fa7e3e86a3..45100eb1ff 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -198,40 +198,6 @@ function="Floater.Toggle" parameter="nearby_media" /> </menu_item_check> - <!--menu_item_check - label="Block List" - layout="topleft" - name="Mute List"> - <menu_item_check.on_check - function="Floater.Visible" - parameter="mute" /> - <menu_item_check.on_click - function="Floater.Toggle" - parameter="mute" /> - </menu_item_check--> - <menu_item_separator - layout="topleft" /> - <menu_item_check - label="(Legacy) Communicate" - layout="topleft" - name="Instant Message" - shortcut="control|T"> - <menu_item_check.on_check - function="Floater.Visible" - parameter="communicate" /> - <menu_item_check.on_click - function="Floater.Toggle" - parameter="communicate" /> - </menu_item_check> - <menu_item_call - label="(Temp) Media Remote Ctrl" - layout="topleft" - name="Preferences" - shortcut="control|alt|M"> - <menu_item_call.on_click - function="Floater.Toggle" - parameter="media_remote_ctrl" /> - </menu_item_call> </menu> <menu label="World" @@ -283,7 +249,7 @@ </menu_item_call> <menu create_jump_keys="true" - label="About This Place" + label="Place Profile" layout="topleft" name="Land" tear_off="true"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index eb82dd4a7f..5ec8018eae 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -246,7 +246,7 @@ Save all changes to clothing/body parts? icon="alertmodal.tga" name="GrantModifyRights" type="alertmodal"> -Granting modify rights to another resident allows them to change, delete or take ANY objects you may have in-world. Be VERY careful when handing out this permission. +Granting modify rights to another Resident allows them to change, delete or take ANY objects you may have in-world. Be VERY careful when handing out this permission. Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? <usetemplate name="okcancelbuttons" @@ -258,7 +258,7 @@ Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? icon="alertmodal.tga" name="GrantModifyRightsMultiple" type="alertmodal"> -Granting modify rights to another resident allows them to change ANY objects you may have in-world. Be VERY careful when handing out this permission. +Granting modify rights to another Resident allows them to change ANY objects you may have in-world. Be VERY careful when handing out this permission. Do you want to grant modify rights for the selected Residents? <usetemplate name="okcancelbuttons" @@ -1597,7 +1597,8 @@ Unable to force land ownership because selection spans multiple regions. Please icon="alertmodal.tga" name="ForceOwnerAuctionWarning" type="alertmodal"> -This parcel is up for auction. Forcing ownership will cancel the auction and potentially make some residents unhappy if bidding has begun. Force ownership? +This parcel is up for auction. Forcing ownership will cancel the auction and potentially make some Residents unhappy if bidding has begun. +Force ownership? <usetemplate name="okcancelbuttons" notext="Cancel" @@ -2915,6 +2916,16 @@ You have reached your maximum number of groups. Please leave another group befor yestext="Join"/> </notification> + <notification + icon="alert.tga" + name="JoinedTooManyGroups" + type="alert"> +You have reached your maximum number of groups. Please leave some group before joining or creating a new one. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + <notification icon="alert.tga" name="KickUser" @@ -3553,7 +3564,7 @@ Type a short announcement which will be sent to everyone in this region. The maturity rating for this region has been updated. It may take some time for the change to be reflected on the map. -To enter Adult regions, residents must be Account Verified, either by age-verification or payment-verification. +To enter Adult regions, Residents must be Account Verified, either by age-verification or payment-verification. </notification> <notification @@ -4543,8 +4554,8 @@ Click on any landmark to select it, then click 'Teleport' at the botto icon="notifytip.tga" name="TeleportToPerson" type="notifytip"> -You can contact residents like '[NAME]' by opening the People panel on the right side of your screen. -Select the resident from the list, then click 'IM' at the bottom of the panel. +You can contact Residents like '[NAME]' by opening the People panel on the right side of your screen. +Select the Resident from the list, then click 'IM' at the bottom of the panel. (You can also double-click on their name in the list, or right-click and choose 'IM'). </notification> @@ -4693,7 +4704,7 @@ The objects on the selected parcel of land that is owned by [FIRST] [LAST] have icon="notify.tga" name="OtherObjectsReturned2" type="notify"> -The objects on the selected parcel of land owned by the resident '[NAME]' have been returned to their owner. +The objects on the selected parcel of land owned by the Resident '[NAME]' have been returned to their owner. </notification> <notification @@ -4974,7 +4985,7 @@ No valid parcel could be found. icon="notify.tga" name="ObjectGiveItem" type="offer"> -An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you [OBJECTTYPE]: +An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you this [OBJECTTYPE]: [ITEM_SLURL] <form name="form"> <button @@ -4996,7 +5007,7 @@ An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you [OBJECTTYPE icon="notify.tga" name="ObjectGiveItemUnknownUser" type="offer"> -An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you [OBJECTTYPE]: +An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you this [OBJECTTYPE]: [ITEM_SLURL] <form name="form"> <button @@ -5018,7 +5029,7 @@ An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you [O icon="notify.tga" name="UserGiveItem" type="offer"> -[NAME_SLURL] has given you [OBJECTTYPE]: +[NAME_SLURL] has given you this [OBJECTTYPE]: [ITEM_SLURL] <form name="form"> <button @@ -5181,7 +5192,7 @@ An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you [O name="OfferCallingCard" type="notify"> [FIRST] [LAST] is offering their calling card. -This will add a bookmark in your inventory so you can quickly IM this resident. +This will add a bookmark in your inventory so you can quickly IM this Resident. <form name="form"> <button index="0" diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml index 6c54532a3a..28a6995186 100644 --- a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml @@ -4,7 +4,7 @@ follows="all" height="215" name="panel_im_control_panel" - width="180"> + width="150"> <layout_stack mouse_opaque="false" border_size="0" @@ -16,15 +16,16 @@ name="vertical_stack" orientation="vertical" top="0" - width="177"> + width="147"> <layout_panel auto_resize="true" follows="top|left" height="130" layout="topleft" + left="0" min_height="0" mouse_opaque="false" - width="180" + width="147" top="0" name="speakers_list_panel" user_resize="false"> @@ -39,7 +40,7 @@ show_info_btn="false" show_profile_btn="false" show_speaking_indicator="false" - width="180" /> + width="147" /> </layout_panel> <layout_panel auto_resize="false" @@ -47,7 +48,7 @@ height="25" layout="topleft" min_height="25" - width="160" + width="130" name="call_btn_panel" user_resize="false" visible="false"> @@ -56,7 +57,7 @@ height="20" label="Call" name="call_btn" - width="160" + width="130" top="5" /> </layout_panel> <layout_panel @@ -65,7 +66,7 @@ height="25" layout="topleft" min_height="25" - width="160" + width="130" name="end_call_btn_panel" user_resize="false" visible="false"> @@ -82,7 +83,7 @@ height="25" layout="topleft" min_height="25" - width="160" + width="130" name="voice_ctrls_btn_panel" user_resize="false" visible="false"> diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index 45f9d9c7b6..615ade99a2 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -58,13 +58,13 @@ top="6" use_ellipses="true" value="Unknown" - width="182" /> + width="180" /> <text follows="right" font="SansSerifSmall" height="15" layout="topleft" - left_pad="8" + left_pad="5" name="last_interaction" text_color="LtGray_50" value="0s" @@ -75,7 +75,7 @@ draw_border="false" height="16" layout="topleft" - left_pad="0" + left_pad="5" mouse_opaque="true" name="speaking_indicator" visible="true" @@ -98,6 +98,7 @@ left_pad="5" right="-3" name="profile_btn" + tool_tip="View profile" top_delta="-2" width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml index 003e1baa7e..39170b90ca 100644 --- a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml @@ -37,7 +37,7 @@ layout="topleft" left="5" name="blocked" - tool_tip="List of currently blocked residents" + tool_tip="List of currently blocked Residents" top="30" width="270" /> <button @@ -47,7 +47,7 @@ layout="topleft" left_delta="0" name="Block resident..." - tool_tip="Pick a resident to block" + tool_tip="Pick a Resident to block" top_pad="4" width="210"> <button.commit_callback @@ -74,7 +74,7 @@ layout="topleft" left_delta="0" name="Unblock" - tool_tip="Remove resident or object from blocked list" + tool_tip="Remove Resident or object from blocked list" top_pad="4" width="210" > <button.commit_callback diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index aeaa049f1f..4b39210f30 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -33,10 +33,10 @@ height="10" image_name="spacer24.tga" layout="topleft" - min_width="4" + min_width="2" left="0" top="0" - width="4" /> + width="2" /> <layout_panel mouse_opaque="false" auto_resize="false" @@ -71,7 +71,7 @@ layout="topleft" left="0" name="talk" - top="4" + top="5" width="100"> <show_button> <show_button.init_callback @@ -103,20 +103,20 @@ min_width="52" name="gesture_panel" user_resize="false"> - <gesture_combo_box + <gesture_combo_list follows="left|right" height="23" label="Gesture" layout="topleft" name="Gesture" left="0" - top="4" + top="5" width="82" tool_tip="Shows/hides gestures"> - <gesture_combo_box.drop_down_button + <gesture_combo_list.combo_button pad_right="10" use_ellipses="true" /> - </gesture_combo_box> + </gesture_combo_list> </layout_panel> <icon auto_resize="false" @@ -153,7 +153,7 @@ layout="topleft" name="movement_btn" tool_tip="Shows/hides movement controls" - top="4" + top="5" width="80"> <button.init_callback function="Button.SetDockableFloaterToggle" @@ -195,7 +195,7 @@ layout="topleft" left="0" tool_tip="Shows/hides camera controls" - top="4" + top="5" name="camera_btn" width="80"> <button.init_callback @@ -235,7 +235,7 @@ layout="topleft" name="snapshots" width="36" - top="4" + top="5" is_toggle="true" image_overlay="Snapshot_Off" tool_tip="Take snapshot"> @@ -338,7 +338,7 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly. layout="topleft" left="0" name="im_well" - top="4" + top="5" width="35"> <!-- Emulate 4 states of button by background images, see details in EXT-3147. The same should be for notification_well button @@ -362,8 +362,6 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well label_color="Black" left="0" name="Unread IM messages" - pad_left="0" - pad_right="0" tool_tip="Conversations" width="35" > <button.init_callback @@ -381,8 +379,8 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well top="0" left_pad="3" name="notification_well_panel" - width="35" - min_width="35" + width="40" + min_width="40" user_resize="false"> <chiclet_notification flash_period="0.25" @@ -392,7 +390,7 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well left="0" max_displayed_count="99" name="notification_well" - top="4" + top="5" width="35"> <button bottom_pad="3" @@ -405,11 +403,11 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well follows="right" flash_color="ChicletFlashColor" label_color="Black" - left="5" + left="0" name="Unread" image_overlay="Notices_Unread" image_overlay_alignment="center" - pad_right="5" + pad_right="15" tool_tip="Notifications" width="35" > <button.init_callback @@ -418,16 +416,5 @@ image_pressed_selected "Lit" + "Selected" - there are new messages and the Well </button> </chiclet_notification> </layout_panel> - <icon - auto_resize="false" - color="0 0 0 0" - follows="left|right" - height="10" - image_name="spacer24.tga" - layout="topleft" - min_width="4" - right="-1" - top="0" - width="4"/> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index d6de5af32d..7769189219 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -38,28 +38,27 @@ <scroll_container color="DkGray2" follows="all" - height="510" + height="500" layout="topleft" left="10" top_pad="10" name="profile_scroll" - reserve_scroll_corner="false" opaque="true" width="313"> <panel name="scroll_content_panel" - follows="left|top" + follows="left|top|right" min_height="300" layout="topleft" top="0" background_visible="false" - height="510" + height="500" left="0" - width="295"> + width="285"> <texture_picker follows="left|top|right" height="197" - width="290" + width="280" layout="topleft" top="20" left="10" @@ -77,7 +76,7 @@ <text type="string" length="1" - follows="left|top" + follows="left|top|right" height="15" font="SansSerifSmall" font.style="BOLD" @@ -86,7 +85,7 @@ top="215" name="Name:" text_color="white" - width="290"> + width="280"> Title: </text> <line_editor @@ -99,11 +98,11 @@ max_length="63" name="pick_name" text_color="black" - width="290" /> + width="280" /> <text type="string" length="1" - follows="left|top" + follows="left|top|right" height="15" font="SansSerifSmall" font.style="BOLD" @@ -112,13 +111,13 @@ top_pad="20" name="description_label" text_color="white" - width="290"> + width="280"> Description: </text> <text_editor follows="left|top|right" height="100" - width="290" + width="280" hide_scrollbar="false" layout="topleft" left="10" @@ -132,27 +131,26 @@ length="1" font="SansSerifSmall" font.style="BOLD" - follows="left|top" + follows="left|top|right" height="15" layout="topleft" left="10" name="location_label" text_color="white" top_pad="20" - width="290"> + width="280"> Location: </text> <text type="string" length="1" - follows="left|top" + follows="left|top|right" height="50" layout="topleft" left="10" name="pick_location" - right="-10" top_pad="2" - width="290" + width="280" word_wrap="true"> loading... </text> diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index be3c0bbd96..172cf18fc4 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -301,14 +301,13 @@ left="10" name="partner_data_panel" width="285"> - <text + <name_box follows="left|top|right" height="30" layout="topleft" left="0" name="partner_text" top="0" - value="[FIRST] [LAST]" width="285" word_wrap="true" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_friends.xml b/indra/newview/skins/default/xui/en/panel_friends.xml index ac731bcdf0..c315adb33e 100644 --- a/indra/newview/skins/default/xui/en/panel_friends.xml +++ b/indra/newview/skins/default/xui/en/panel_friends.xml @@ -118,7 +118,7 @@ layout="topleft" left_delta="0" name="add_btn" - tool_tip="Offer friendship to a resident" + tool_tip="Offer friendship to a Resident" top_pad="13" width="80" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml index 4073ef158b..aa7d621e4c 100644 --- a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml @@ -4,7 +4,7 @@ follows="all" height="238" name="panel_im_control_panel" - width="180"> + width="150"> <layout_stack mouse_opaque="false" border_size="0" @@ -16,7 +16,7 @@ name="vertical_stack" orientation="vertical" top="0" - width="175"> + width="145"> <layout_panel auto_resize="true" follows="top|left" @@ -24,7 +24,7 @@ layout="topleft" min_height="0" mouse_opaque="false" - width="180" + width="145" top="0" name="speakers_list_panel" user_resize="false"> @@ -39,7 +39,7 @@ show_info_btn="false" show_profile_btn="false" show_speaking_indicator="false" - width="180" /> + width="145" /> </layout_panel> <layout_panel auto_resize="false" @@ -47,7 +47,7 @@ height="28" layout="topleft" min_height="28" - width="160" + width="130" name="group_info_btn_panel" user_resize="false"> <button @@ -57,7 +57,7 @@ name="group_info_btn" use_ellipses="true" top="5" - width="160" /> + width="130" /> </layout_panel> <layout_panel auto_resize="false" @@ -65,7 +65,7 @@ height="28" layout="topleft" min_height="28" - width="160" + width="130" name="call_btn_panel" user_resize="false"> <button @@ -74,7 +74,7 @@ label="Call Group" name="call_btn" use_ellipses="true" - width="160" /> + width="130" /> </layout_panel> <layout_panel auto_resize="false" @@ -82,7 +82,7 @@ height="28" layout="topleft" min_height="28" - width="160" + width="130" name="end_call_btn_panel" user_resize="false" visible="false"> @@ -99,7 +99,7 @@ height="28" layout="topleft" min_height="28" - width="160" + width="130" name="voice_ctrls_btn_panel" user_resize="false" visible="false"> diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index c0db734f8c..8188048821 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -216,12 +216,28 @@ background_visible="true" visible="false" width="65" />--> <button + follows="bottom|right" + label="Group Chat" + name="btn_chat" + right="-184" + left_pad="2" + height="22" + width="85" /> + <button + follows="bottom|right" + label="Group Call" + name="btn_call" + right="-97" + left_pad="2" + height="22" + width="85" /> + <button height="22" label="Save" label_selected="Save" name="btn_apply" left_pad="10" right="-10" - width="100" /> + width="85" /> </panel> </panel> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_group_invite.xml b/indra/newview/skins/default/xui/en/panel_group_invite.xml index 37578eae70..48083b7677 100644 --- a/indra/newview/skins/default/xui/en/panel_group_invite.xml +++ b/indra/newview/skins/default/xui/en/panel_group_invite.xml @@ -17,7 +17,7 @@ </panel.string> <panel.string name="already_in_group"> - Some avatars are already in group and were not invited. + Some Residents you chose are already in the group, and so were not sent an invitation. </panel.string> <text type="string" @@ -26,11 +26,10 @@ layout="topleft" left="7" name="help_text" - top="24" + top="28" + word_wrap="true" width="200"> - You can select multiple residents to -invite to your group. Click 'Open -Resident Chooser' to start. + You can select multiple Residents to invite to your group. Click 'Open Resident Chooser' to start. </text> <button height="20" @@ -48,7 +47,7 @@ Resident Chooser' to start. left_delta="0" multi_select="true" name="invitee_list" - tool_tip="Hold the Ctrl key and click resident names to multi-select" + tool_tip="Hold the Ctrl key and click Resident names to multi-select" top_pad="4" width="200" /> <button @@ -57,7 +56,7 @@ Resident Chooser' to start. layout="topleft" left_delta="0" name="remove_button" - tool_tip="Removes residents selected above from the invite list" + tool_tip="Removes the Residents selected above from the invite list" top_pad="4" width="200" /> <text @@ -68,6 +67,7 @@ Resident Chooser' to start. left_delta="4" name="role_text" top_pad="5" + word_wrap="true" width="200"> Choose what Role to assign them to: </text> diff --git a/indra/newview/skins/default/xui/en/panel_group_list_item.xml b/indra/newview/skins/default/xui/en/panel_group_list_item.xml index 5f6b911620..c243d08b97 100644 --- a/indra/newview/skins/default/xui/en/panel_group_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_group_list_item.xml @@ -65,6 +65,7 @@ left_pad="5" right="-3" name="profile_btn" + tool_tip="View profile" top_delta="-2" width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_notices.xml b/indra/newview/skins/default/xui/en/panel_group_notices.xml index e096715cee..0d9c2c2162 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notices.xml @@ -136,6 +136,7 @@ Maximum 200 per group daily left_pad="3" max_length="63" name="create_subject" + prevalidate_callback="ascii" width="220" /> <text follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index a5bab3232c..6b3fb04549 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -210,6 +210,18 @@ including the Everyone and Owner Roles. Abilities allow Members in Roles to do specific things in this group. There's a broad variety of Abilities. </panel.string> + <panel.string + name="power_folder_icon"> + Inv_FolderClosed + </panel.string> + <panel.string + name="power_all_have_icon"> + Checkbox_On + </panel.string> + <panel.string + name="power_partial_icon"> + Checkbox_Off + </panel.string> <filter_editor layout="topleft" top="5" @@ -220,23 +232,32 @@ things in this group. There's a broad variety of Abilities. max_length="250" label="Filter Abilities" name="filter_input" /> - <scroll_list - column_padding="0" - draw_stripes="false" - follows="left|top" - height="200" - layout="topleft" - left="0" - multi_select="true" - name="action_list" - search_column="1" - tool_tip="Select an Ability to view more details" - top_pad="5" - width="300"> - <scroll_list.columns - name="action" - width="300" /> - </scroll_list> + + <scroll_list + column_padding="0" + draw_stripes="true" + height="200" + follows="left|top" + layout="topleft" + left="0" + name="action_list" + search_column="2" + tool_tip="Select an Ability to view more details" + top_pad="5" + width="300"> + <scroll_list.columns + label="" + name="icon" + width="2" /> + <scroll_list.columns + label="" + name="checkbox" + width="20" /> + <scroll_list.columns + label="" + name="action" + width="270" /> + </scroll_list> </panel> </tab_container> <panel diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index e5df37e366..df942b1a26 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -186,6 +186,7 @@ height="80"> <text follows="right|bottom" font="SansSerifSmall" +text_color="EmphasisColor" halign="right" height="16" top="12" diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml index 5217ab3571..38e8b9844f 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml @@ -30,6 +30,7 @@ (This page does not pass the specified whitelist) </text> <line_editor + max_length="1024" bottom_delta="-24" enabled="true" follows="left|top" @@ -72,13 +73,15 @@ Current Page: </text> <text + name="current_url" + max_length="1024" + use_ellipses="true" bottom_delta="-20" enabled="false" follows="left|top" font="SansSerif" height="20" left="10" - name="current_url" tool_tip="The current page for this media source" value="" width="340" /> diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index 8327edfdd0..27c1af1860 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -27,6 +27,9 @@ <string name="no_partner_text" value="None" /> + <string + name="no_group_text" + value="None" /> <string name="RegisterDateFormat"> [REG_DATE] ([AGE]) @@ -62,10 +65,11 @@ <panel layout="topleft" follows="left|top|right" + height="505" name="scroll_content_panel" top="0" left="0" - width="303"> + width="297"> <panel follows="left|top|right" height="117" @@ -73,7 +77,7 @@ left="10" name="second_life_image_panel" top="0" - width="300"> + width="297"> <texture_picker allow_no_texture="true" default_image_name="None" @@ -114,7 +118,7 @@ textbox.max_length="512" name="sl_description_edit" top_pad="-3" - width="188" + width="181" expanded_bg_visible="true" expanded_bg_color="DkGray"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. @@ -127,7 +131,7 @@ top_pad="10" left="10" name="first_life_image_panel" - width="300"> + width="297"> <texture_picker allow_no_texture="true" default_image_name="None" @@ -167,7 +171,7 @@ textbox.max_length="512" name="fl_description_edit" top_pad="-3" - width="188" + width="181" expanded_bg_visible="true" expanded_bg_color="DkGray"> Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. @@ -260,14 +264,14 @@ name="partner_data_panel" top_pad="0" width="300"> - <text + <name_box follows="left|top" height="10" layout="topleft" left="0" + link="true" name="partner_text" top="0" - value="[FIRST] [LAST]" width="300" word_wrap="true" /> </panel> @@ -312,7 +316,7 @@ left="0" mouse_opaque="false" name="add_friend" - tool_tip="Offer friendship to the resident" + tool_tip="Offer friendship to the Resident" top="5" width="80" /> <button diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index e2884dbedc..9ad99b1f13 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -47,7 +47,7 @@ left="10" name="back_btn" tool_tip="Go back to previous location" - top="3" + top="2" width="31" /> <button follows="left|top" @@ -92,7 +92,6 @@ width="20" /> --> </location_input> - <!-- <button --> <!-- follows="right|top" --> <!-- height="20" --> @@ -108,7 +107,6 @@ <!-- name="search_bg" --> <!-- top_delta="0" --> <!-- width="168" /> --> - <search_combo_box bevel_style="none" border_style="line" diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index f09a0e03ed..2b361c0628 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -27,7 +27,7 @@ max_length="512" name="chat_box" tool_tip="Press Enter to say, Ctrl+Enter to shout" - top="1" + top="2" width="283" /> <output_monitor auto_update="true" @@ -45,7 +45,7 @@ follows="right" is_toggle="true" width="20" - top="1" + top="2" layout="topleft" left_pad="4" image_disabled="ComboButton_UpOff" diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml index 73528b28ad..45b64d5e26 100644 --- a/indra/newview/skins/default/xui/en/panel_notes.xml +++ b/indra/newview/skins/default/xui/en/panel_notes.xml @@ -120,7 +120,7 @@ left="0" mouse_opaque="false" name="add_friend" - tool_tip="Offer friendship to the resident" + tool_tip="Offer friendship to the Resident" top="5" width="80" /> <button @@ -139,7 +139,7 @@ label="Call" layout="topleft" name="call" - tool_tip="Call this resident" + tool_tip="Call this Resident" left_pad="3" top="5" width="45" /> @@ -150,7 +150,7 @@ label="Map" layout="topleft" name="show_on_map_btn" - tool_tip="Show the resident on the map" + tool_tip="Show the Resident on the map" top="5" left_pad="3" width="45" /> diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index adf22f825f..8a02637817 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -106,7 +106,7 @@ background_visible="true" left_pad="5" name="add_friend_btn" top_delta="0" - tool_tip="Add selected resident to your friends List" + tool_tip="Add selected Resident to your friends List" width="18"> <commit_callback function="People.addFriend" /> @@ -192,7 +192,7 @@ background_visible="true" layout="topleft" left_pad="5" name="add_btn" - tool_tip="Offer friendship to a resident" + tool_tip="Offer friendship to a Resident" top_delta="0" width="18" /> <button @@ -327,7 +327,7 @@ background_visible="true" left_pad="5" name="add_friend_btn" top_delta="0" - tool_tip="Add selected resident to your friends List" + tool_tip="Add selected Resident to your friends List" width="18"> <commit_callback function="People.addFriend" /> @@ -350,7 +350,7 @@ background_visible="true" label="Profile" layout="topleft" name="view_profile_btn" - tool_tip="Show picture, groups, and other residents information" + tool_tip="Show picture, groups, and other Residents information" width="70" /> <button follows="bottom|left" @@ -370,7 +370,7 @@ background_visible="true" label="Call" layout="topleft" name="call_btn" - tool_tip="Call this resident" + tool_tip="Call this Resident" width="50" /> <button follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml index f68202d287..9c7f38e688 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_info.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml @@ -40,31 +40,30 @@ left="10" top_pad="10" name="profile_scroll" - reserve_scroll_corner="false" width="313"> <panel name="scroll_content_panel" - follows="left|top" + follows="left|top|right" min_height="300" layout="topleft" top="0" background_visible="false" - height="470" + height="400" left="0" - width="295"> + width="285"> <texture_picker enabled="false" - follows="left|top" + follows="left|top|right" height="197" layout="topleft" left="10" name="pick_snapshot" top="20" - width="290" /> + width="280" /> <text follows="left|top|right" height="35" - width="290" + width="280" layout="topleft" font="SansSerifBig" font.style="BOLD" @@ -75,23 +74,29 @@ value="[name]" use_ellipses="true" /> <text - follows="left|top" + follows="left|top|right" height="25" layout="topleft" left="10" name="pick_location" - width="290" + width="280" word_wrap="true" value="[loading...]" /> - <text - follows="left|top|right" - height="280" + <text_editor + bg_readonly_color="DkGray2" + follows="all" + height="100" + width="280" + hide_scrollbar="false" layout="topleft" left="10" + top_pad="2" + max_length="1023" name="pick_desc" - width="290" + read_only="true" + text_readonly_color="white" value="[description]" - word_wrap="true" /> + wrap="true" /> </panel> </scroll_container> <panel diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 17651b8caa..1e7acb566f 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -2,7 +2,6 @@ <panel border="true" - background_visible="true" follows="left|top|right|bottom" height="408" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index c98555735a..22c75a595e 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -260,7 +260,7 @@ width="200"> My effects: </text> - <text + <text type="string" length="1" follows="left|top" @@ -270,16 +270,23 @@ name="title_afk_text" width="190"> Away timeout: - </text> + </text> <color_swatch - control_name="EffectColor" + can_apply_immediately="true" follows="left|top" height="50" layout="topleft" left="50" name="effect_color_swatch" tool_tip="Click to open Color Picker" - width="38" /> + width="38"> + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="EffectColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="EffectColor" /> + </color_swatch> <combo_box height="23" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index cc00abf5a0..a0fcf59fc8 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -378,7 +378,7 @@ layout="topleft" left_delta="250" name="DrawDistanceMeterText2" - top_delta="1" + top_delta="0" width="128"> m </text> @@ -395,7 +395,7 @@ left="216" max_val="8192" name="MaxParticleCount" - top_pad="6" + top_pad="7" width="262" /> <slider control_name="RenderGlowResolutionPow" diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index 075d9232b1..ab6384203f 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -321,6 +321,7 @@ min_width="90"> <line_editor name="media_address_url" + max_length="1024" follows="top|left|right" height="22" top="0" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 43947262ec..597b6410cd 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -27,6 +27,9 @@ <string name="no_partner_text" value="None" /> + <string + name="no_group_text" + value="None" /> <string name="RegisterDateFormat"> [REG_DATE] ([AGE]) @@ -62,10 +65,11 @@ <panel layout="topleft" follows="left|top|right" + height="505" name="profile_scroll_panel" top="0" left="0" - width="303"> + width="297"> <panel follows="left|top|right" height="117" @@ -73,7 +77,7 @@ left="10" name="second_life_image_panel" top="0" - width="303"> + width="297"> <texture_picker allow_no_texture="true" default_image_name="None" @@ -117,7 +121,7 @@ top_pad="10" left="10" name="first_life_image_panel" - width="303"> + width="297"> <texture_picker allow_no_texture="true" default_image_name="None" @@ -240,14 +244,14 @@ name="partner_data_panel" top_pad="0" width="300"> - <text + <name_box follows="left|top" height="10" layout="topleft" left="0" + link="true" name="partner_text" top="0" - value="[FIRST] [LAST]" width="300" word_wrap="true" /> </panel> @@ -269,7 +273,7 @@ left="7" name="sl_groups" top_pad="0" - width="298" + width="290" expanded_bg_visible="true" expanded_bg_color="DkGray"> Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. Aenean viverra tulip moosetop. Slan de heelish marfnik tooplod. Sum sum to whop de wompam booster copm. @@ -292,7 +296,7 @@ left="0" mouse_opaque="false" name="add_friend" - tool_tip="Offer friendship to the resident" + tool_tip="Offer friendship to the Resident" top="5" width="80" /> <button @@ -311,7 +315,7 @@ label="Call" layout="topleft" name="call" - tool_tip="Call this resident" + tool_tip="Call this Resident" left_pad="3" top="5" width="45" /> @@ -322,7 +326,7 @@ label="Map" layout="topleft" name="show_on_map_btn" - tool_tip="Show the resident on the map" + tool_tip="Show the Resident on the map" top="5" left_pad="3" width="45" /> @@ -342,7 +346,7 @@ label="▼" layout="topleft" name="overflow_btn" - tool_tip="Pay money to or share inventory with the resident" + tool_tip="Pay money to or share inventory with the Resident" right="-1" top="5" left_pad="3" @@ -375,4 +379,4 @@ </layout_panel> </layout_stack> -</panel> \ No newline at end of file +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_covenant.xml b/indra/newview/skins/default/xui/en/panel_region_covenant.xml index ff55090f16..dc8f71c868 100644 --- a/indra/newview/skins/default/xui/en/panel_region_covenant.xml +++ b/indra/newview/skins/default/xui/en/panel_region_covenant.xml @@ -135,7 +135,8 @@ left="120" name="covenant_help_text" top_pad="10" - width="460"> + word_wrap="true" + width="360"> Changes to the covenant will show on all parcels in the estate. </text> <text @@ -145,9 +146,10 @@ left_delta="0" name="covenant_instructions" top_pad="5" - width="465"> - Drag and drop a notecard to change - the Covenant for this Estate. + word_wrap="true" + font.style="ITALIC" + width="360"> + Drag and drop a notecard to change the Covenant for this estate. </text> <text diff --git a/indra/newview/skins/default/xui/en/panel_region_estate.xml b/indra/newview/skins/default/xui/en/panel_region_estate.xml index ba39e88024..3980eb86d3 100644 --- a/indra/newview/skins/default/xui/en/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/en/panel_region_estate.xml @@ -19,9 +19,9 @@ left="10" name="estate_help_text" top="14" - width="313"> - Changes to settings on this tab will affect all -regions in the estate. + word_wrap="true" + width="275"> + Changes to settings on this tab will affect all regions in the estate. </text> <text type="string" @@ -138,7 +138,7 @@ regions in the estate. name="Only Allow" top="250" width="278"> - Restrict Access to Accounts Verified by: + Restrict Access to accounts verified by: </text> <check_box follows="top|left" @@ -147,7 +147,7 @@ regions in the estate. layout="topleft" left_delta="0" name="limit_payment" - tool_tip="Ban unidentified residents" + tool_tip="Ban unidentified Residents" top_pad="2" width="278" /> <check_box @@ -157,7 +157,7 @@ regions in the estate. layout="topleft" left_delta="0" name="limit_age_verified" - tool_tip="Ban residents who have not verified their age. See the [SUPPORT_SITE] for more information." + tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information." top_pad="2" width="278" /> <check_box diff --git a/indra/newview/skins/default/xui/en/panel_region_texture.xml b/indra/newview/skins/default/xui/en/panel_region_texture.xml index 502a5804c3..04dbf73be9 100644 --- a/indra/newview/skins/default/xui/en/panel_region_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_region_texture.xml @@ -292,7 +292,7 @@ name="height_text_lbl10" top_delta="30" width="400" - wrap="true"> + word_wrap="true"> These values represent the blend range for the textures above. </text> <text @@ -303,7 +303,7 @@ name="height_text_lbl11" top_delta="32" width="400" - wrap="true"> + word_wrap="true"> Measured in meters, the LOW value is the MAXIMUM height of Texture #1, and the HIGH value is the MINIMUM height of Texture #4. </text> <button diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 00f54feabd..bfca2f2e46 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -42,18 +42,36 @@ <button auto_resize="true" halign="right" + font="SansSerifSmall" + follows="right|top" + image_overlay="" + image_selected="spacer35.tga" + image_unselected="spacer35.tga" + image_pressed="spacer35.tga" + height="16" + right="-228" + label_shadow="false" + name="buycurrency" + tool_tip="My Balance" + top="5" + width="100" /> + <button + auto_resize="true" + halign="right" + font="SansSerifSmall" follows="right|top" image_selected="BuyArrow_Over" image_unselected="BuyArrow_Over" image_pressed="BuyArrow_Press" height="16" - right="-128" - label_color="White" + label="Buy L$" + label_color="EmphasisColor" + left_pad="0" label_shadow="false" - name="buycurrency" + name="buyL" pad_right="20px" - tool_tip="My Balance: Click to buy more L$" - top="3" + tool_tip="Click to buy more L$" + top="5" width="100" /> <text type="string" @@ -62,29 +80,27 @@ follows="right|bottom" halign="right" height="16" - top="4" + top="7" layout="topleft" left_pad="0" name="TimeText" - text_color="TimeTextColor" tool_tip="Current time (Pacific)" width="85"> 12:00 AM </text> <button follows="right|bottom" - height="16" + height="15" image_selected="AudioMute_Off" image_pressed="Audio_Press" image_unselected="Audio_Off" is_toggle="true" left_pad="18" - top="1" + top="4" name="volume_btn" tool_tip="Global Volume Control" width="16" /> <text - enabled="true" follows="right|bottom" halign="center" height="12" diff --git a/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml b/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml new file mode 100644 index 0000000000..60d4a7e00b --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_opaque="true" + background_visible="false" + border_visible="false" + border="false" + chrome="true" + follows="bottom" + height="150" + layout="topleft" + name="volumepulldown_floater" + width="32"> + <!-- floater background image --> + <icon + height="150" + image_name="Inspector_Background" + layout="topleft" + left="0" + name="normal_background" + top="0" + width="32" /> + <slider + control_name="AudioLevelMaster" + follows="left|top" + left="0" + top="1" + orientation="vertical" + height="120" + increment="0.05" + initial_value="0.5" + layout="topleft" + name="mastervolume" + show_text="false" + slider_label.halign="right" + top_pad="2" + volume="true"> + <slider.commit_callback + function="Vol.setControlFalse" + parameter="MuteAudio" /> + </slider> + <button + left="7" + top_pad="9" + width="18" + height="12" + follows="top|left" + name="prefs_btn" + image_unselected="Icon_Gear_Foreground" + image_disabled="Icon_Gear_Background" + image_pressed="Icon_Gear_Press" + scale_image="false"> + <button.commit_callback + function="Vol.GoAudioPrefs" /> + </button> +</panel> diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml index d26e855e2f..2dfcdf4a4c 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml @@ -153,28 +153,19 @@ layout="topleft" left="5" name="CreatorNameLabel" - top_pad="10" + top_pad="12" width="78"> Creator: </text> - <avatar_icon - follows="top|left" - height="20" - default_icon_name="Generic_Person" - layout="topleft" - left_pad="0" - top_delta="-6" - mouse_opaque="true" - width="20" /> <text type="string" - follows="left|right" + follows="left|right|top" font="SansSerifSmall" height="15" layout="topleft" - left_pad="5" + left_pad="0" name="Creator Name" - top_delta="6" + top_delta="0" width="140"> Erica Linden </text> @@ -186,28 +177,19 @@ layout="topleft" left="5" name="Owner:" - top_pad="10" + top_pad="15" width="78"> Owner: </text> - <avatar_icon - follows="top|left" - height="20" - default_icon_name="Generic_Person" - layout="topleft" - left_pad="0" - top_delta="-6" - mouse_opaque="true" - width="20" /> <text type="string" - follows="left|right" + follows="left|right|top" font="SansSerifSmall" height="15" layout="topleft" - left_pad="5" + left_pad="0" name="Owner Name" - top_delta="6" + top_delta="0" width="140"> Erica Linden </text> @@ -219,7 +201,7 @@ layout="topleft" left="5" name="Group_label" - top_pad="10" + top_pad="15" width="78"> Group: </text> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index bd868ef61e..fbdac7164d 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -67,7 +67,7 @@ <!-- tooltips for Urls --> <string name="TooltipHttpUrl">Click to view this web page</string> <string name="TooltipSLURL">Click to view this location's information</string> - <string name="TooltipAgentUrl">Click to view this resident's profile</string> + <string name="TooltipAgentUrl">Click to view this Resident's profile</string> <string name="TooltipGroupUrl">Click to view this group's description</string> <string name="TooltipEventUrl">Click to view this event's description</string> <string name="TooltipClassifiedUrl">Click to view this classified</string> @@ -1609,11 +1609,11 @@ Sends an HTTP request to the specified url with the body of the request and para </string> <string name="LSLTipText_llResetLandBanList" translate="false"> llResetLandBanList() -Removes all residents from the land ban list +Removes all Residents from the land ban list </string> <string name="LSLTipText_llResetLandPassList" translate="false"> llResetLandPassList() -Removes all residents from the land access/pass list +Removes all Residents from the land access/pass list </string> <string name="LSLTipText_llGetObjectPrimCount" translate="false"> integer llGetObjectPrimCount(key object_id) @@ -1621,7 +1621,7 @@ Returns the total number of prims for an object in the region </string> <string name="LSLTipText_llGetParcelPrimOwners" translate="false"> list llGetParcelPrimOwners(vector pos) -Returns a list of all residents who own objects on the parcel at pos and with individual prim counts. +Returns a list of all Residents who own objects on the parcel at pos and with individual prim counts. Requires owner-like permissions for the parcel. </string> <string name="LSLTipText_llGetParcelPrimCount" translate="false"> @@ -1808,7 +1808,7 @@ Clears (deletes) the media and all params from the given face. <!-- inventory --> <string name="InventoryNoMatchingItems">No matching items found in inventory.</string> - <string name="FavoritesNoMatchingItems">Drag and drop a landmark here to add to your favorites.</string> + <string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string> <string name="InventoryNoTexture"> You do not have a copy of this texture in your inventory @@ -2040,7 +2040,7 @@ this texture in your inventory <string name="RegionInfoAllEstatesYouManage"> all estates that you manage for [OWNER] </string> - <string name="RegionInfoAllowedResidents">Allowed residents: ([ALLOWEDAGENTS], max [MAXACCESS])</string> + <string name="RegionInfoAllowedResidents">Allowed Residents: ([ALLOWEDAGENTS], max [MAXACCESS])</string> <string name="RegionInfoAllowedGroups">Allowed groups: ([ALLOWEDGROUPS], max [MAXACCESS])</string> <!-- script limits floater --> @@ -2111,7 +2111,7 @@ this texture in your inventory <!-- Mute --> <string name="MuteByName">(by name)</string> - <string name="MuteAgent">(resident)</string> + <string name="MuteAgent">(Resident)</string> <string name="MuteObject">(object)</string> <string name="MuteGroup">(group)</string> @@ -2938,7 +2938,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Click the [BUTTON NAME] button to accept/connect to this voice chat. </string> <string name="muted_message"> - You have blocked this resident. Sending a message will automatically unblock them. + You have blocked this Resident. Sending a message will automatically unblock them. </string> <!--Some times string name is getting from the body of server response. For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml index af0d338256..693c43f141 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_im_adhoc - font="SansSerif" height="25" name="im_adhoc_chiclet" show_speaker="false" @@ -12,15 +11,14 @@ left="25" name="speaker" visible="false" - width="20"/> + width="20" /> <chiclet_im_adhoc.avatar_icon follows="left|top|bottom" height="22" mouse_opaque="true" name="adhoc_icon" - width="22"/> + width="22" /> <chiclet_im_adhoc.unread_notifications - font="SansSerif" font_halign="center" height="25" left="25" @@ -29,13 +27,13 @@ text_color="white" v_pad="5" visible="false" - width="20"/> + width="20" /> <chiclet_im_adhoc.new_message_icon - bottom="12" - height="13" - image_name="Unread_Chiclet" - left="12" - name="new_message_icon" - visible="false" - width="13" /> + bottom="11" + height="14" + image_name="Unread_Chiclet" + left="12" + name="new_message_icon" + visible="false" + width="14" /> </chiclet_im_adhoc> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml index b1988a2d20..f4fc58701c 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_im_group - font="SansSerif" height="25" name="im_group_chiclet" show_speaker="false" @@ -12,17 +11,17 @@ left="25" name="speaker" visible="false" - width="20"/> + width="20" /> <chiclet_im_group.group_icon default_icon="Generic_Group" follows="left|top|bottom" - height="22" + height="18" + bottom_pad="4" mouse_opaque="true" name="group_icon" - width="22"/> + width="18" /> <chiclet_im_group.unread_notifications height="25" - font="SansSerif" font_halign="center" left="25" mouse_opaque="false" @@ -32,11 +31,11 @@ visible="false" width="20"/> <chiclet_im_group.new_message_icon - bottom="12" - height="13" - image_name="Unread_Chiclet" - left="12" - name="new_message_icon" - visible="false" - width="13" /> +bottom="11" + height="14" + image_name="Unread_Chiclet" + left="12" + name="new_message_icon" + visible="false" + width="14" /> </chiclet_im_group> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml index 52fbce0de7..535113f717 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_im_p2p - font="SansSerif" height="25" name="im_p2p_chiclet" show_speaker="false" @@ -18,10 +17,9 @@ height="22" mouse_opaque="true" name="avatar_icon" - width="22"/> + width="22" /> <chiclet_im_p2p.unread_notifications height="25" - font="SansSerif" font_halign="center" left="25" mouse_opaque="false" @@ -31,11 +29,11 @@ visible="false" width="20"/> <chiclet_im_p2p.new_message_icon - bottom="12" - height="13" - image_name="Unread_Chiclet" - left="12" - name="new_message_icon" - visible="false" - width="13" /> + bottom="11" + height="14" + image_name="Unread_Chiclet" + left="12" + name="new_message_icon" + visible="false" + width="14" /> </chiclet_im_p2p> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml index 33f85a964c..86bea9be50 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_offer - font="SansSerif" height="25" name="offer_chiclet" width="25"> <chiclet_offer.icon - default_icon="Generic_Object_Small" + default_icon="Generic_Object_Small" follows="all" - height="22" + height="20" mouse_opaque="false" name="chiclet_icon" - width="22"/> + bottom_pad="2" + width="20" /> <chiclet_offer.new_message_icon - bottom="12" - height="13" + bottom="11" + height="14" image_name="Unread_Chiclet" left="12" name="new_message_icon" visible="false" - width="13" /> + width="14" /> </chiclet_offer> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml index 560c8e6ea5..b1f9f5b0e8 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <chiclet_script - font="SansSerif" height="25" name="script_chiclet" width="25"> <chiclet_script.icon follows="all" - height="22" - image_name="Generic_Object_Small" + height="20" + image_name="Generic_Object_Small" mouse_opaque="false" name="chiclet_icon" - width="22"/> + width="20" + bottom_pad="2" /> <chiclet_script.new_message_icon - bottom="12" - height="13" + bottom="11" + height="14" image_name="Unread_Chiclet" left="12" name="new_message_icon" visible="false" - width="13" /> + width="14" /> </chiclet_script> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml deleted file mode 100644 index 4229f34c09..0000000000 --- a/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<gesture_combo_box - label="Gestures" - list_position="below" - max_chars="20" - follows="right|top"> - <gesture_combo_box.combo_button name="Combobox Button" - label="" - hover_glow_amount="0.15" - scale_image="true" - image_unselected="ComboButton_Off" - image_selected="ComboButton_Selected" - image_disabled="ComboButton_Disabled" - image_disabled_selected="ComboButton_Disabled_Selected" /> - <gesture_combo_box.drop_down_button name="Drop Down Button" - label="" - halign="center" - hover_glow_amount="0.15" - scale_image="true" - image_selected="PushButton_Selected_Press" - image_pressed="PushButton_Press" - image_pressed_selected="PushButton_Selected_Press" - image_unselected="PushButton_Off" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Selected_Disabled" /> - <gesture_combo_box.combo_list bg_writeable_color="MenuDefaultBgColor" - scroll_bar_bg_visible="false" /> - <gesture_combo_box.combo_editor name="Combo Text Entry" - select_on_focus="true" /> -</gesture_combo_box> diff --git a/indra/newview/skins/default/xui/en/widgets/gesture_combo_list.xml b/indra/newview/skins/default/xui/en/widgets/gesture_combo_list.xml new file mode 100644 index 0000000000..808683864d --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/gesture_combo_list.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<gesture_combo_list + follows="right|top"> + <gesture_combo_list.combo_button + name="Combolist Button" + label="" + layout="topleft" + halign="center" + hover_glow_amount="0.15" + mouse_opaque="false" + scale_image="true" + image_selected="PushButton_Selected_Press" + image_pressed="PushButton_Press" + image_pressed_selected="PushButton_Selected_Press" + image_unselected="PushButton_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Selected_Disabled" /> + <gesture_combo_list.combo_list + bg_writeable_color="MenuDefaultBgColor" + scroll_bar_bg_visible="false" /> +</gesture_combo_list> diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 67bb7c1896..1c0a8ba7c5 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -96,7 +96,7 @@ name="damage_icon" width="14" height="13" - top="22" + top="25" left="2" follows="right|top" image_name="Parcel_Damage_Dark" @@ -112,17 +112,19 @@ font="SansSerifSmall" text_color="TextFgColor" /> - - <combo_button name="Location History" - label="" - pad_right="0"/> - <combo_list bg_writeable_color="MenuDefaultBgColor" page_lines="10" + <combo_button + name="Location History" + label="" + pad_right="0"/> + <combo_list + bg_writeable_color="MenuDefaultBgColor" + page_lines="10" scroll_bar_bg_visible="true" /> <combo_editor name="Combo Text Entry" - text_pad_left="22" + text_pad_left="27" select_on_focus="false" font="SansSerifSmall" bevel_style="none" border_style="line" - border.border_thickness="0"/> + border.border_thickness="0" /> </location_input> diff --git a/indra/newview/skins/default/xui/es/floater_buy_currency.xml b/indra/newview/skins/default/xui/es/floater_buy_currency.xml index eb25493adc..1ecb813dd1 100644 --- a/indra/newview/skins/default/xui/es/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/es/floater_buy_currency.xml @@ -52,6 +52,9 @@ <text name="total_amount"> [AMT] L$ </text> + <text name="currency_links"> + [http://www.secondlife.com/my/account/payment_method_management.php?lang=es-ES payment method] | [http://www.secondlife.com/my/account/currency.php?lang=es-ES currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=es-ES exchange rate] + </text> <text name="purchase_warning_repurchase" right="-10"> Confirmando esta compra sólo compra la moneda. Tendrá que intentar de nuevo la operación. diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml index e6a49cbc6f..9a92c446f2 100644 --- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml @@ -46,12 +46,12 @@ [AMT] L$ </text> <text name="currency_links"> - [http://www.secondlife.com/ payment method] | [http://www.secondlife.com/ currency] | [http://www.secondlife.com exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR payment method] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=fr-FR exchange rate] </text> <text name="exchange_rate_note"> Saisissez à nouveau le montant pour voir le taux de change actuel. </text> - <text bottom_delta="-64" height="48" name="purchase_warning_repurchase" right="-10"> + <text name="purchase_warning_repurchase"> La confirmation de cet achat n'achète que des L$, pas l'objet. </text> <text bottom_delta="16" name="purchase_warning_notenough"> diff --git a/indra/newview/skins/default/xui/fr/floater_help_browser.xml b/indra/newview/skins/default/xui/fr/floater_help_browser.xml index 0eb3ea3d21..20894d42fc 100644 --- a/indra/newview/skins/default/xui/fr/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/fr/floater_help_browser.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="floater_help_browser" title="NAVIGATEUR D'AIDE"> <floater.string name="home_page_url"> - http://www.secondlife.com + http://fr.secondlife.com </floater.string> <floater.string name="support_page_url"> - http://support.secondlife.com + http://fr.secondlife.com/support </floater.string> <layout_stack name="stack1"> <layout_panel name="external_controls"> diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 2f0c7038fc..3ff829bfb7 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -166,7 +166,7 @@ <string name="TooltipSLAPP"> Cliquez pour exécuter la commande secondlife:// command </string> - <string name="CurrentURL" value="URL actuelle : [CurrentURL]"/> + <string name="CurrentURL" value=" URL actuelle : [CurrentURL]"/> <string name="SLurlLabelTeleport"> Me téléporter vers </string> @@ -174,7 +174,7 @@ Afficher la carte pour </string> <string name="BUTTON_CLOSE_DARWIN"> - Fermer (⌘W) + Fermer (⌘W) </string> <string name="BUTTON_CLOSE_WIN"> Fermer (Ctrl+W) @@ -821,46 +821,46 @@ <string name="InventoryNoTexture"> Vous n'avez pas de copie de cette texture dans votre inventaire </string> - <string name="no_transfer" value="(pas de transfert)"/> - <string name="no_modify" value="(pas de modification)"/> - <string name="no_copy" value="(pas de copie)"/> - <string name="worn" value="(porté)"/> - <string name="link" value="(lien)"/> - <string name="broken_link" value="(broken_link)"/> + <string name="no_transfer" value=" (pas de transfert)"/> + <string name="no_modify" value=" (pas de modification)"/> + <string name="no_copy" value=" (pas de copie)"/> + <string name="worn" value=" (porté)"/> + <string name="link" value=" (lien)"/> + <string name="broken_link" value=" (broken_link)"/> <string name="LoadingContents"> chargement des contenus en cours... </string> <string name="NoContents"> Aucun contenu </string> - <string name="WornOnAttachmentPoint" value="(porté sur [ATTACHMENT_POINT])"/> + <string name="WornOnAttachmentPoint" value=" (porté sur [ATTACHMENT_POINT])"/> <string name="PermYes"> Oui </string> <string name="PermNo"> Non </string> - <string name="Chat" value="Chat :"/> - <string name="Sound" value="Son :"/> - <string name="Wait" value="--- Attendre :"/> - <string name="AnimFlagStop" value="Arrêter l'animation :"/> - <string name="AnimFlagStart" value="Démarrer l'animation :"/> - <string name="Wave" value="Faire signe"/> - <string name="HelloAvatar" value="Bonjour, avatar !"/> - <string name="ViewAllGestures" value="Tout afficher >>"/> - <string name="Animations" value="Animations,"/> - <string name="Calling Cards" value="Cartes de visite,"/> - <string name="Clothing" value="Habits,"/> - <string name="Gestures" value="Gestes,"/> - <string name="Landmarks" value="Repères,"/> - <string name="Notecards" value="Notes,"/> - <string name="Objects" value="Objets,"/> - <string name="Scripts" value="Scripts,"/> - <string name="Sounds" value="Sons,"/> - <string name="Textures" value="Textures,"/> - <string name="Snapshots" value="Photos,"/> - <string name="No Filters" value="Non"/> - <string name="Since Logoff" value="- Depuis la déconnexion"/> + <string name="Chat" value=" Chat :"/> + <string name="Sound" value=" Son :"/> + <string name="Wait" value=" --- Attendre :"/> + <string name="AnimFlagStop" value=" Arrêter l'animation :"/> + <string name="AnimFlagStart" value=" Démarrer l'animation :"/> + <string name="Wave" value=" Faire signe"/> + <string name="HelloAvatar" value=" Bonjour, avatar !"/> + <string name="ViewAllGestures" value=" Tout afficher >>"/> + <string name="Animations" value=" Animations,"/> + <string name="Calling Cards" value=" Cartes de visite,"/> + <string name="Clothing" value=" Habits,"/> + <string name="Gestures" value=" Gestes,"/> + <string name="Landmarks" value=" Repères,"/> + <string name="Notecards" value=" Notes,"/> + <string name="Objects" value=" Objets,"/> + <string name="Scripts" value=" Scripts,"/> + <string name="Sounds" value=" Sons,"/> + <string name="Textures" value=" Textures,"/> + <string name="Snapshots" value=" Photos,"/> + <string name="No Filters" value="Non "/> + <string name="Since Logoff" value=" - Depuis la déconnexion"/> <string name="InvFolder My Inventory"> Mon inventaire </string> @@ -1239,13 +1239,13 @@ <string name="GroupsNone"> aucun </string> - <string name="Group" value="(groupe)"/> + <string name="Group" value=" (groupe)"/> <string name="Unknown"> (Inconnu) </string> - <string name="SummaryForTheWeek" value="Récapitulatif de la semaine, début le"/> - <string name="NextStipendDay" value="Prochaine prime le"/> - <string name="GroupIndividualShare" value="Groupe Part individuelle"/> + <string name="SummaryForTheWeek" value="Récapitulatif de la semaine, début le "/> + <string name="NextStipendDay" value="Prochaine prime le "/> + <string name="GroupIndividualShare" value=" Groupe Part individuelle"/> <string name="Balance"> Solde </string> @@ -1324,8 +1324,8 @@ <string name="covenant_last_modified"> Dernière modification : </string> - <string name="none_text" value="(aucun)"/> - <string name="never_text" value="(jamais)"/> + <string name="none_text" value=" (aucun)"/> + <string name="never_text" value=" (jamais)"/> <string name="GroupOwned"> Propriété du groupe </string> @@ -1616,7 +1616,7 @@ Si le problème persiste, vous devrez peut-être complètement désinstaller pui Erreur fatale </string> <string name="MBRequiresAltiVec"> - [APP_NAME] nécessite un microprocesseur AltiVec (version G4 ou antérieure). + [APP_NAME] nécessite un microprocesseur AltiVec (version G4 ou antérieure). </string> <string name="MBAlreadyRunning"> [APP_NAME] est déjà en cours d'exécution. diff --git a/indra/newview/skins/default/xui/it/floater_buy_currency.xml b/indra/newview/skins/default/xui/it/floater_buy_currency.xml index a22850bc4b..8a59764251 100644 --- a/indra/newview/skins/default/xui/it/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/it/floater_buy_currency.xml @@ -52,10 +52,11 @@ <text name="total_amount"> [AMT]L$ </text> - <text name="purchase_warning_repurchase" height="48" bottom_delta="-64" right="-10"> - Confermando questa operazione si acquisterà solo -la valuta. Per acquistare il bene, dovrai riprovare -l'operazione nuovamente. + <text name="currency_links"> + [http://www.secondlife.com/my/account/payment_method_management.php?lang=it-IT payment method] | [http://www.secondlife.com/my/account/currency.php?lang=it-IT currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=it-IT exchange rate] + </text> + <text name="purchase_warning_repurchase"> + Confermando questa operazione si acquisterà solo la valuta. Per acquistare il bene, dovrai riprovare l'operazione nuovamente. </text> <text name="purchase_warning_notenough" bottom_delta="16"> Non stai comprando abbastanza denaro. diff --git a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml index 03cd0f391a..9d49a38982 100644 --- a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/ payment method] | [http://www.secondlife.com/ currency] | [http://www.secondlife.com exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP payment method] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=ja-JP exchange rate] </text> <text name="exchange_rate_note"> 金額を再入力して最新換算レートを確認します。 diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index 4d395b474f..b37d97bc5d 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -166,7 +166,7 @@ <string name="TooltipSLAPP"> クリックして secondlife:// コマンドを出す </string> - <string name="CurrentURL" value="現在のURL: [CurrentURL]"/> + <string name="CurrentURL" value=" 現在のURL: [CurrentURL]"/> <string name="SLurlLabelTeleport"> テレポート </string> @@ -174,7 +174,7 @@ 地図に表示 </string> <string name="BUTTON_CLOSE_DARWIN"> - 閉じる (⌘W) + 閉じる (⌘W) </string> <string name="BUTTON_CLOSE_WIN"> 閉じる (Ctrl+W) @@ -821,33 +821,33 @@ <string name="InventoryNoTexture"> 持ち物内にこのテクスチャのコピーがありません </string> - <string name="no_transfer" value="(再販/プレゼント不可)"/> - <string name="no_modify" value="(編集不可)"/> - <string name="no_copy" value="(コピー不可)"/> - <string name="worn" value="(着用中)"/> - <string name="link" value="(リンク)"/> - <string name="broken_link" value="(壊れたリンク)"/> + <string name="no_transfer" value=" (再販/プレゼント不可)"/> + <string name="no_modify" value=" (編集不可)"/> + <string name="no_copy" value=" (コピー不可)"/> + <string name="worn" value=" (着用中)"/> + <string name="link" value=" (リンク)"/> + <string name="broken_link" value=" (壊れたリンク)"/> <string name="LoadingContents"> コンテンツをロード中です... </string> <string name="NoContents"> コンテンツなし </string> - <string name="WornOnAttachmentPoint" value="([ATTACHMENT_POINT] に装着中)"/> + <string name="WornOnAttachmentPoint" value=" ([ATTACHMENT_POINT] に装着中)"/> <string name="PermYes"> はい </string> <string name="PermNo"> いいえ </string> - <string name="Chat" value="チャット:"/> - <string name="Sound" value="サウンド:"/> - <string name="Wait" value="--- 待機::"/> - <string name="AnimFlagStop" value="アニメーションを停止:"/> - <string name="AnimFlagStart" value="アニメーションを開始:"/> - <string name="Wave" value="手を振る"/> - <string name="HelloAvatar" value="やあ、アバター!"/> - <string name="ViewAllGestures" value="すべて表示 >>"/> + <string name="Chat" value=" チャット:"/> + <string name="Sound" value=" サウンド:"/> + <string name="Wait" value=" --- 待機::"/> + <string name="AnimFlagStop" value=" アニメーションを停止:"/> + <string name="AnimFlagStart" value=" アニメーションを開始:"/> + <string name="Wave" value=" 手を振る"/> + <string name="HelloAvatar" value=" やあ、アバター!"/> + <string name="ViewAllGestures" value=" すべて表示 >>"/> <string name="Animations" value="アニメーション、"/> <string name="Calling Cards" value="コーリングカード、"/> <string name="Clothing" value="衣類、"/> @@ -859,8 +859,8 @@ <string name="Sounds" value="サウンド、"/> <string name="Textures" value="テクスチャ、"/> <string name="Snapshots" value="スナップショット、"/> - <string name="No Filters" value="いいえ"/> - <string name="Since Logoff" value="- ログオフ以来"/> + <string name="No Filters" value="いいえ "/> + <string name="Since Logoff" value=" - ログオフ以来"/> <string name="InvFolder My Inventory"> マイ 持ち物 </string> @@ -1239,13 +1239,13 @@ <string name="GroupsNone"> なし </string> - <string name="Group" value="(グループ)"/> + <string name="Group" value=" (グループ)"/> <string name="Unknown"> (不明) </string> <string name="SummaryForTheWeek" value="今週のまとめ。開始日は"/> <string name="NextStipendDay" value="次回のお小遣い支給日は"/> - <string name="GroupIndividualShare" value="グループ 個人の割り当て"/> + <string name="GroupIndividualShare" value=" グループ 個人の割り当て"/> <string name="Balance"> 残高 </string> @@ -1324,8 +1324,8 @@ <string name="covenant_last_modified"> 最終修正日: </string> - <string name="none_text" value="(なし)"/> - <string name="never_text" value="(無)"/> + <string name="none_text" value=" (なし)"/> + <string name="never_text" value=" (無)"/> <string name="GroupOwned"> グループ所有 </string> @@ -1616,7 +1616,7 @@ 致命的なエラー </string> <string name="MBRequiresAltiVec"> - [APP_NAME] は、AltiVec搭載のプロセッサが必要です。(G4 以降) + [APP_NAME] は、AltiVec搭載のプロセッサが必要です。(G4 以降) </string> <string name="MBAlreadyRunning"> [APP_NAME] はすでに実行中です。 diff --git a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml index aac8438fdc..f17c069ecf 100644 --- a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml @@ -52,6 +52,9 @@ <text name="total_amount"> L$ [AMT] </text> + <text name="currency_links"> + [http://www.secondlife.com/my/account/payment_method_management.php?lang=pt-BR payment method] | [http://www.secondlife.com/my/account/currency.php?lang=pt-BR currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=pt-BR exchange rate] + </text> <text name="purchase_warning_repurchase"> Confirmando esta compra só compra a moeda. Você precisará tentar novamente a operação. diff --git a/install.xml b/install.xml index 41f8a28044..e912ddfd8b 100644 --- a/install.xml +++ b/install.xml @@ -1014,23 +1014,23 @@ anguage Infrstructure (CLI) international standard</string> <key>darwin</key> <map> <key>md5sum</key> - <string>5362a53488693f9bd7d9083758af25eb</string> + <string>2eb58f544c0d912aa382de2c947be7f1</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20091218.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20100104.tar.bz2</uri> </map> <key>linux</key> <map> <key>md5sum</key> - <string>09674cbae982e7e7f6ebc7e1d06580e8</string> + <string>c4c40fca14a8bd32096f8a27c75c526f</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-linux-20091216.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-linux-20100105c.tar.bz2</uri> </map> <key>windows</key> <map> <key>md5sum</key> - <string>4dd305f2ce38b2e55a2014ad3a2de34d</string> + <string>b50db4fdb833111e1e679188e4cb5815</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-qt4.6-20091218.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-qt4.6-20100104.tar.bz2</uri> </map> </map> </map> -- cgit v1.2.3 From d3e84ea77baa7d60fe225f7b440297e9a49318a6 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 20 Jan 2010 15:08:29 -0600 Subject: First stab at making model importer act more like scene importer. Upload button still doesn't work. --- indra/llmath/m4math.cpp | 17 +++++++++++++++++ indra/llmath/m4math.h | 1 + 2 files changed, 18 insertions(+) diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index 7c7f60154d..3700142982 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -785,6 +785,23 @@ bool operator!=(const LLMatrix4 &a, const LLMatrix4 &b) return FALSE; } +bool operator<(const LLMatrix4& a, const LLMatrix4 &b) +{ + U32 i, j; + for (i = 0; i < NUM_VALUES_IN_MAT4; i++) + { + for (j = 0; j < NUM_VALUES_IN_MAT4; j++) + { + if (a.mMatrix[i][j] != b.mMatrix[i][j]) + { + return a.mMatrix[i][j] < b.mMatrix[i][j]; + } + } + } + + return false; +} + const LLMatrix4& operator*=(LLMatrix4 &a, F32 k) { U32 i, j; diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h index de981b7646..6007b96bd9 100644 --- a/indra/llmath/m4math.h +++ b/indra/llmath/m4math.h @@ -237,6 +237,7 @@ public: friend bool operator==(const LLMatrix4 &a, const LLMatrix4 &b); // Return a == b friend bool operator!=(const LLMatrix4 &a, const LLMatrix4 &b); // Return a != b + friend bool operator<(const LLMatrix4 &a, const LLMatrix4& b); // Return a < b friend const LLMatrix4& operator+=(LLMatrix4 &a, const LLMatrix4 &b); // Return a + b friend const LLMatrix4& operator-=(LLMatrix4 &a, const LLMatrix4 &b); // Return a - b -- cgit v1.2.3 From f4b2de0d058d691afbb45315604c39dc05686586 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 20 Jan 2010 15:20:57 -0800 Subject: curse of the random coding policy hook. --- scripts/template_verifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py index d5fc119270..adcfcbcae6 100755 --- a/scripts/template_verifier.py +++ b/scripts/template_verifier.py @@ -103,7 +103,7 @@ MESSAGE_TEMPLATE = 'message_template.msg' PRODUCTION_ACCEPTABLE = (compatibility.Same, compatibility.Newer) DEVELOPMENT_ACCEPTABLE = ( compatibility.Same, compatibility.Newer, - compatibility.Older, compatibility.Mixed) + compatibility.Older, compatibility.Mixed) MAX_MASTER_AGE = 60 * 60 * 4 # refresh master cache every 4 hours -- cgit v1.2.3 From c3b37faba3cba425d749345a978ddec16bbd1338 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 28 Jan 2010 16:20:06 -0800 Subject: first dribble of directional lights for shaderless path. --- indra/newview/pipeline.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d66662ed49..bced8a8e07 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4596,8 +4596,22 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_LINEAR_ATTENUATION, atten); glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); - glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); - glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + if (light->getLightTexture()) // directional (spot-)light + { + LLVector3 spotparams = light->getSpotLightParams(); + LLQuaternion quat = light->getRenderRotation(); + LLVector3 at_axis(0,0,-1); // todo: verify against deferred + at_axis *= quat; + llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; + glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); + glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); // fixme - focus + glLightf (gllight, GL_SPOT_CUTOFF, 22.0f); // fixme - fov + } + else // omnidirectional (point) light + { + glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); + glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + } cur_light++; if (cur_light >= 8) { @@ -4613,7 +4627,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); } - if (gAgent.getAvatarObject() && gAgent.getAvatarObject()->mSpecialRenderMode == 3) { -- cgit v1.2.3 From 73c98e1c1e3899aaae1de6bac51f9e21ea6432a1 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 28 Jan 2010 18:01:12 -0800 Subject: enable basic directional lighting for basic/atmospheric shaders - yay. next, needs the non-shader GL lighting model to be equally dumb (it's too smart - kill the spot angle. --- .../shaders/class1/lighting/lightFuncV.glsl | 21 +++++++++++++++++++++ .../shaders/class2/lighting/sumLightsV.glsl | 8 +++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 3e8fdfb3e4..211de830fa 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -28,7 +28,28 @@ float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) //angular attenuation da *= calcDirectionalLight(n, lv); + + return da; +} + + +float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la) +{ + //get light vector + vec3 lv = lp.xyz-v; + //get distance + float d = length(lv); + + //normalize light vector + lv *= 1.0/d; + + //distance attenuation + float da = clamp(1.0/(la * d), 0.0, 1.0); + + //angular attenuation + da *= dot(lv, -ln) * calcDirectionalLight(n, lv); + return da; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index f4c59734a4..fd264b9e74 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -7,6 +7,7 @@ float calcDirectionalLight(vec3 n, vec3 l); float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -18,9 +19,10 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); + + col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation); + col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation); + //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation); col.rgb = scaleDownLight(col.rgb); // Add windlight lights -- cgit v1.2.3 From cf3df7968ef654ba7cafeafd463e7107b80ca07f Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 28 Jan 2010 18:21:33 -0800 Subject: woo, dumb GL lights now match up to our dumb shader model pretty well. next: shader model needs to grok point vs directional, shader model needs to resurrect ambient which I seem to have broken --- indra/newview/pipeline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bced8a8e07..71f9ce7eb2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4284,7 +4284,7 @@ void LLPipeline::setupAvatarLights(BOOL for_edit) glLightf (GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.0f); glLightf (GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.0f); glLightf (GL_LIGHT1, GL_SPOT_EXPONENT, 0.0f); - glLightf (GL_LIGHT1, GL_SPOT_CUTOFF, 180.0f); + glLightf (GL_LIGHT1, GL_SPOT_CUTOFF, 180.0f); } else if (gAvatarBacklight) // Always true (unless overridden in a devs .ini) { @@ -4600,12 +4600,12 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) { LLVector3 spotparams = light->getSpotLightParams(); LLQuaternion quat = light->getRenderRotation(); - LLVector3 at_axis(0,0,-1); // todo: verify against deferred + LLVector3 at_axis(0,0,-1); // this matches deferred rendering's object light direction at_axis *= quat; llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); - glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); // fixme - focus - glLightf (gllight, GL_SPOT_CUTOFF, 22.0f); // fixme - fov + glLightf (gllight, GL_SPOT_EXPONENT, 1.0f); // 1.0 = good old dot product + glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere } else // omnidirectional (point) light { -- cgit v1.2.3 From c413a0e096f8897ddc4ee5b5a627e6bf6cce39bb Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 28 Jan 2010 18:36:04 -0800 Subject: fix the shader dp light going negative! --- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 211de830fa..0f03e336be 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -48,7 +48,7 @@ float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la) float da = clamp(1.0/(la * d), 0.0, 1.0); //angular attenuation - da *= dot(lv, -ln) * calcDirectionalLight(n, lv); + da *= calcDirectionalLight(-ln, lv) * calcDirectionalLight(n, lv); return da; } -- cgit v1.2.3 From f773b6ef9669bab6765678f8b07831144dd44a5e Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 28 Jan 2010 18:50:10 -0800 Subject: cheaply resurrect the difference between spotlight and omnidirectional, as far as the shader is concerned. not complete. --- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 4 ++-- indra/newview/pipeline.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 0f03e336be..b2d6d23b1e 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -33,7 +33,7 @@ float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) } -float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la) +float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnidirectional) { //get light vector vec3 lv = lp.xyz-v; @@ -48,7 +48,7 @@ float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la) float da = clamp(1.0/(la * d), 0.0, 1.0); //angular attenuation - da *= calcDirectionalLight(-ln, lv) * calcDirectionalLight(n, lv); + da *= clamp(dot(-ln, lv)+is_omnidirectional, 0.0, 1.0) * calcDirectionalLight(n, lv); return da; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 71f9ce7eb2..6cd8b94405 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4592,7 +4592,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_DIFFUSE, light_color.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); - glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_LINEAR_ATTENUATION, atten); glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); @@ -4606,11 +4605,16 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); glLightf (gllight, GL_SPOT_EXPONENT, 1.0f); // 1.0 = good old dot product glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere + glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); } else // omnidirectional (point) light { glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + + // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight + const float specular = {0.f, 0.f, 0.f, 1.f}, + glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); } cur_light++; if (cur_light >= 8) -- cgit v1.2.3 From bc0a9fd5fe0675d7327ee182ff4ac20c39e76305 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 28 Jan 2010 21:48:22 -0800 Subject: getting closer to point/spot interchangability --- indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl | 6 +++--- indra/newview/pipeline.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index fd264b9e74..e5bf76db55 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -20,9 +20,9 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); col.rgb = scaleDownLight(col.rgb); // Add windlight lights diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6cd8b94405..e12412c58c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4613,8 +4613,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight - const float specular = {0.f, 0.f, 0.f, 1.f}, - glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); + const float specular[] = {0.f, 0.f, 0.f, 1.f}; + glLightfv(gllight, GL_SPECULAR, specular); } cur_light++; if (cur_light >= 8) -- cgit v1.2.3 From 1237c123873b98f2987d8d9fb573f6f88f8eebc2 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 28 Jan 2010 21:49:31 -0800 Subject: cheaper, cuter way to deal with spot vs point in the shader --- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index b2d6d23b1e..4525bf80b2 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -48,7 +48,7 @@ float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnid float da = clamp(1.0/(la * d), 0.0, 1.0); //angular attenuation - da *= clamp(dot(-ln, lv)+is_omnidirectional, 0.0, 1.0) * calcDirectionalLight(n, lv); + da *= max(dot(-ln, lv),is_omnidirectional) * calcDirectionalLight(n, lv); return da; } -- cgit v1.2.3 From fcaca49a9496154419a8f44c17cba16b028d3518 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 28 Jan 2010 23:58:50 -0800 Subject: cheap no-branch goodness for rendering both spotlights and pointlights with the same shader code. kill already-nerfed quadratic attenuation which it seems we won't be supporting any decade soon. --- .../shaders/class1/lighting/lightFuncV.glsl | 6 +++- .../shaders/class2/lighting/sumLightsV.glsl | 2 +- indra/newview/pipeline.cpp | 42 ++++++++-------------- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 4525bf80b2..2e41f24afe 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -47,8 +47,12 @@ float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnid //distance attenuation float da = clamp(1.0/(la * d), 0.0, 1.0); + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_omnidirectional); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + //angular attenuation - da *= max(dot(-ln, lv),is_omnidirectional) * calcDirectionalLight(n, lv); + da *= calcDirectionalLight(n, lv); return da; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index e5bf76db55..4577b4be55 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -7,7 +7,7 @@ float calcDirectionalLight(vec3 n, vec3 l); float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); -float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la); +float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnidirectional); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e12412c58c..2ad0bad11f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4572,40 +4572,30 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = llmax(light->getLightRadius(), 0.001f); - F32 atten, quad; -#if 0 //1.9.1 - if (pool->getVertexShaderLevel() > 0) - { - atten = light_radius; - quad = llmax(light->getLightFalloff(), 0.0001f); - } - else -#endif - { - F32 x = (3.f * (1.f + light->getLightFalloff())); - atten = x / (light_radius); // % of brightness at radius - quad = 0.0f; - } + F32 x = (3.f * (1.f + light->getLightFalloff())); + float linatten = x / (light_radius); // % of brightness at radius + mHWLightColors[cur_light] = light_color; S32 gllight = GL_LIGHT0+cur_light; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_DIFFUSE, light_color.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, atten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); + glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); if (light->getLightTexture()) // directional (spot-)light { LLVector3 spotparams = light->getSpotLightParams(); LLQuaternion quat = light->getRenderRotation(); LLVector3 at_axis(0,0,-1); // this matches deferred rendering's object light direction at_axis *= quat; - llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; + //llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); - glLightf (gllight, GL_SPOT_EXPONENT, 1.0f); // 1.0 = good old dot product + glLightf (gllight, GL_SPOT_EXPONENT, 2.0f); // 2.0 = good old dot product ^ 2 glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere - glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); + const float specular[] = {0.f, 0.f, 0.f, 0.f}; + glLightfv(gllight, GL_SPECULAR, specular); } else // omnidirectional (point) light { @@ -4615,6 +4605,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight const float specular[] = {0.f, 0.f, 0.f, 1.f}; glLightfv(gllight, GL_SPECULAR, specular); + //llinfos << "boring light" << llendl; } cur_light++; if (cur_light >= 8) @@ -4641,13 +4632,10 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = 16.f; - F32 atten, quad; - { - F32 x = 3.f; - atten = x / (light_radius); // % of brightness at radius - quad = 0.0f; - } + F32 x = 3.f; + float linatten = x / (light_radius); // % of brightness at radius + mHWLightColors[2] = light_color; S32 gllight = GL_LIGHT2; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); @@ -4655,8 +4643,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, atten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); + glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); } -- cgit v1.2.3 From d0cf5b03f4fec29db367d8f1f387f2b0996f67e6 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 29 Jan 2010 00:22:13 -0800 Subject: spot-aware light func usage in ALL shaders. --- .../shaders/class1/deferred/alphaV.glsl | 14 +++++++------- .../shaders/class1/deferred/avatarAlphaV.glsl | 14 +++++++------- .../shaders/class1/lighting/lightFuncV.glsl | 22 +--------------------- .../shaders/class2/deferred/alphaV.glsl | 14 +++++++------- .../shaders/class2/deferred/avatarAlphaV.glsl | 14 +++++++------- .../shaders/class2/lighting/sumLightsV.glsl | 9 ++++----- .../shaders/class3/lighting/sumLightsV.glsl | 15 ++++++++------- 7 files changed, 41 insertions(+), 61 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 1a7d58b07b..91793a29d3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -9,7 +9,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -49,12 +49,12 @@ void main() col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index c1988d3c78..e36564df10 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -10,7 +10,7 @@ mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -55,12 +55,12 @@ void main() col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 2e41f24afe..d0f58cc1a4 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -12,28 +12,8 @@ float calcDirectionalLight(vec3 n, vec3 l) return a; } -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = length(lv); - - //normalize light vector - lv *= 1.0/d; - - //distance attenuation - float da = clamp(1.0/(la * d), 0.0, 1.0); - - //angular attenuation - da *= calcDirectionalLight(n, lv); - - return da; -} - -float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnidirectional) +float calcPointlightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 5991e1f3b5..eec655e3df 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -9,7 +9,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -50,12 +50,12 @@ void main() col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index a939499b17..488bd677e1 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -10,7 +10,7 @@ mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -61,12 +61,12 @@ void main() col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index 4577b4be55..19800d96dc 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -6,8 +6,7 @@ */ float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); -float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnidirectional); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -20,9 +19,9 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); col.rgb = scaleDownLight(col.rgb); // Add windlight lights diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index 1c5234c450..0fdfdf2dde 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -6,7 +6,7 @@ */ float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -24,12 +24,13 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); -- cgit v1.2.3 From 71b35bd63daecfe6ca60560a13f72990afae81ac Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 29 Jan 2010 00:31:39 -0800 Subject: Don't scale windlight lights up just to scale them down again later. avoid this with rearrangement. not tested. --- .../app_settings/shaders/class1/deferred/alphaV.glsl | 10 ++++------ .../app_settings/shaders/class1/deferred/avatarAlphaV.glsl | 10 ++++------ .../app_settings/shaders/class2/deferred/alphaV.glsl | 10 ++++------ .../app_settings/shaders/class2/deferred/avatarAlphaV.glsl | 10 ++++------ .../app_settings/shaders/class3/lighting/sumLightsV.glsl | 14 +++++--------- 5 files changed, 21 insertions(+), 33 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 91793a29d3..cb0d7b797b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -41,12 +41,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -58,6 +53,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index e36564df10..e34f6ba552 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -47,12 +47,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -64,6 +59,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index eec655e3df..05a32578c1 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -42,12 +42,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -59,6 +54,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 488bd677e1..d63baeb913 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -53,12 +53,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -70,6 +65,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index 0fdfdf2dde..371d6b526c 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -15,16 +15,9 @@ vec3 scaleUpLight(vec3 light); vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { - vec4 col; - col.a = color.a; + vec4 col(0.0, 0.0, 0.0, color.a); - // Add windlight lights - col.rgb = atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); - col.rgb += atmosAmbient(baseLight.rgb); - col.rgb = scaleUpLight(col.rgb); - // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); @@ -33,7 +26,10 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); - + + // Add windlight lights + col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); + col.rgb += atmosAmbient(baseLight.rgb); col.rgb = min(col.rgb*color.rgb, 1.0); -- cgit v1.2.3 From 6df5cd7a18187c83b84915c8fa0d4c32f1282264 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 29 Jan 2010 00:57:28 -0800 Subject: duh, use the proper param name. --- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index d0f58cc1a4..2b7e8b125b 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -28,7 +28,7 @@ float calcPointlightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa float da = clamp(1.0/(la * d), 0.0, 1.0); // spotlight coefficient. - float spot = max(dot(-ln, lv), is_omnidirectional); + float spot = max(dot(-ln, lv), is_pointlight); da *= spot*spot; // GL_SPOT_EXPONENT=2 //angular attenuation -- cgit v1.2.3 From aaae230bb135b9e57edb12a7374c711fd7e4adb4 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 29 Jan 2010 01:45:13 -0800 Subject: fix a variety of shader errors, mostly due to my confusing glsl with C++... again --- indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | 3 ++- indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl | 3 ++- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl | 3 ++- indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index cb0d7b797b..04e556c11a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -41,7 +41,8 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col(0.0, 0.0, 0.0, gl_Color.a); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index e34f6ba552..650fbcc3f5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -47,7 +47,8 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col(0.0, 0.0, 0.0, gl_Color.a); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 2b7e8b125b..da49e59b89 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -13,7 +13,7 @@ float calcDirectionalLight(vec3 n, vec3 l) } -float calcPointlightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight) +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 05a32578c1..1fae8c4da3 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -42,7 +42,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col(0.0, 0.0, 0.0, gl_Color.a); + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index d63baeb913..f8dd1b7431 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -53,7 +53,8 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col(0.0, 0.0, 0.0, gl_Color.a); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index 371d6b526c..f129a1517b 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -15,7 +15,7 @@ vec3 scaleUpLight(vec3 light); vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { - vec4 col(0.0, 0.0, 0.0, color.a); + vec4 col = vec4(0.0, 0.0, 0.0, color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); -- cgit v1.2.3 From 024c0ebe19588f8452bae7ea01756fd7b4b30540 Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Fri, 29 Jan 2010 14:33:04 -0600 Subject: enable mirror and invert flags for meshes. --- indra/llmath/llvolume.cpp | 59 +++++++++++++++++++++++++++++++++++++++++--- indra/llmath/llvolume.h | 7 +++--- indra/newview/llvovolume.cpp | 7 +++--- 3 files changed, 62 insertions(+), 11 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index de32070da1..0328c09c9a 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1694,7 +1694,7 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge generate(); - if (mParams.getSculptID().isNull() && params.getSculptType() == LL_SCULPT_TYPE_NONE) + if (mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE) { createVolumeFaces(); } @@ -2142,6 +2142,59 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) (F32) t[1] / 65535.f * tc_range.mV[1] + min_tc.mV[1]); } + + // modifier flags? + BOOL do_mirror = (mParams.getSculptType() & LL_SCULPT_FLAG_MIRROR); + BOOL do_invert = (mParams.getSculptType() &LL_SCULPT_FLAG_INVERT); + + + // translate to actions: + BOOL do_reflect_x = FALSE; + BOOL do_reverse_triangles = FALSE; + BOOL do_invert_normals = FALSE; + + if (do_mirror) + { + do_reflect_x = TRUE; + do_reverse_triangles = !do_reverse_triangles; + } + + if (do_invert) + { + do_invert_normals = TRUE; + do_reverse_triangles = !do_reverse_triangles; + } + + // now do the work + + if (do_reflect_x) + { + for (S32 i = 0; i < face.mVertices.size(); i++) + { + face.mVertices[i].mPosition.mV[VX] *= -1.0f; + face.mVertices[i].mNormal.mV[VX] *= -1.0f; + } + } + + if (do_invert_normals) + { + for (S32 i = 0; i < face.mVertices.size(); i++) + { + face.mVertices[i].mNormal *= -1.0f; + } + } + + if (do_reverse_triangles) + { + for (U32 j = 0; j < face.mIndices.size(); j += 3) + { + // swap the 2nd and 3rd index + S32 swap = face.mIndices[j+1]; + face.mIndices[j+1] = face.mIndices[j+2]; + face.mIndices[j+2] = swap; + } + } + } } @@ -3838,7 +3891,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices, normals.clear(); segments.clear(); - if (mParams.getSculptType() == LL_SCULPT_TYPE_MESH) + if ((mParams.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) { return; } @@ -5500,7 +5553,7 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) { mIndices.resize(num_indices); - if (volume->getParams().getSculptType() != LL_SCULPT_TYPE_MESH) + if ((volume->getParams().getSculptType() & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH) { mEdge.resize(num_indices); } diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index e3ab648fe3..0bc64f4487 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -183,12 +183,11 @@ const U8 LL_SCULPT_TYPE_SPHERE = 1; const U8 LL_SCULPT_TYPE_TORUS = 2; const U8 LL_SCULPT_TYPE_PLANE = 3; const U8 LL_SCULPT_TYPE_CYLINDER = 4; - -const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE | LL_SCULPT_TYPE_CYLINDER; - -// need to change this (these) names const U8 LL_SCULPT_TYPE_MESH = 5; +const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE | + LL_SCULPT_TYPE_CYLINDER | LL_SCULPT_TYPE_MESH; + const U8 LL_SCULPT_FLAG_INVERT = 64; const U8 LL_SCULPT_FLAG_MIRROR = 128; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4acf3cb6fb..3f1ddc0ee7 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -905,14 +905,13 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool // if it's a mesh if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) { //meshes might not have all LODs, get the force detail to best existing LOD + LLUUID mesh_id = params.getSculptID(); //profile and path params don't matter for meshes - volume_params = LLVolumeParams(); volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE); - volume_params.setSculptID(mesh_id, LL_SCULPT_TYPE_MESH); - lod = gMeshRepo.getActualMeshLOD(mesh_id, lod); + lod = gMeshRepo.getActualMeshLOD(volume_params, lod); } } @@ -963,7 +962,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool { //load request not yet issued, request pipeline load this mesh LLUUID asset_id = volume_params.getSculptID(); - S32 available_lod = gMeshRepo.loadMesh(this, asset_id, lod); + S32 available_lod = gMeshRepo.loadMesh(this, volume_params, lod); if (available_lod != lod) { LLPrimitive::setVolume(volume_params, available_lod); -- cgit v1.2.3 From c504c40a754a79baf0e4b1d1c10ca44197d577df Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Fri, 29 Jan 2010 15:04:14 -0800 Subject: Added glod.txt and libraries no longer unzipped into newview --- indra/cmake/Copy3rdPartyLibs.cmake | 4 ++++ indra/newview/viewer_manifest.py | 11 +++++------ install.xml | 8 ++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index faf9da8b14..9a54c7a2e8 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -38,6 +38,8 @@ if(WINDOWS) libapr-1.dll libaprutil-1.dll libapriconv-1.dll + libcollada14dom21.dll + glod.dll ) # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables @@ -48,6 +50,8 @@ if(WINDOWS) libapr-1.dll libaprutil-1.dll libapriconv-1.dll + libcollada14dom21.dll + glod.dll ) if(USE_GOOGLE_PERFTOOLS) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 37c2102e8f..595afd86e0 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -268,12 +268,17 @@ class WindowsManifest(ViewerManifest): self.path('libapr-1.dll') self.path('libaprutil-1.dll') self.path('libapriconv-1.dll') + except RuntimeError, err: print err.message print "Skipping llcommon.dll (assuming llcommon was linked statically)" self.disable_manifest_check() + # Mesh 3rd party libs needed for auto LOD and collada reading + self.path("libcollada14dom21.dll") + self.path("glod.dll") + # For textures if self.args['configuration'].lower() == 'debug': self.path("openjpegd.dll") @@ -320,12 +325,6 @@ class WindowsManifest(ViewerManifest): # For using FMOD for sound... DJS self.path("fmod.dll") - # For automatic level of detail generation in mesh importer - self.path("glod.dll") - - # For reading collada files - self.path("libcollada14dom21.dll") - self.enable_no_crt_manifest_check() # Media plugins - QuickTime diff --git a/install.xml b/install.xml index 91276ca498..c4c2904471 100644 --- a/install.xml +++ b/install.xml @@ -70,9 +70,9 @@ <key>windows</key> <map> <key>md5sum</key> - <string>b97aa644a548310ca3c916518bb07b7e</string> + <string>39fae44d406aa56a0b3d00f5433bbf15</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/GLOD-windows-20090915.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/GLOD-1.0pre4-windows-20100129.tar.bz2</uri> </map> </map> </map> @@ -280,9 +280,9 @@ <key>windows</key> <map> <key>md5sum</key> - <string>c239ce23ed3f0dbbe58a1ddba05aee0b</string> + <string>6c2267ba2735bb5bc6229bc4366fce86</string> <key>url</key> - <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-windows-20091103.tar.bz2</uri> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/colladadom-2.1.1-windows-20100129.tar.bz2</uri> </map> </map> </map> -- cgit v1.2.3 From f5f20a7851ddfa5f2b5d24c5a392acf9c0a745b5 Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Fri, 29 Jan 2010 15:06:55 -0800 Subject: got rid of tab --- indra/cmake/Copy3rdPartyLibs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 9a54c7a2e8..c9dc301b8b 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -19,7 +19,7 @@ if(WINDOWS) set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") set(vivox_files SLVoice.exe - libsndfile-1.dll + libsndfile-1.dll vivoxplatform.dll vivoxsdk.dll ortp.dll -- cgit v1.2.3 From e8899c4f4c2ae95f108b9bbf543e401debc9c588 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 1 Feb 2010 17:29:08 +0000 Subject: start to abstract-out the 'is a spotlight' question so one day we can perhaps make the UI hurt less. --- indra/llprimitive/llprimitive.h | 1 + indra/newview/llpanelvolume.cpp | 4 ++-- indra/newview/llvovolume.cpp | 7 +++++++ indra/newview/llvovolume.h | 1 + indra/newview/pipeline.cpp | 6 +++--- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 4db7aa7261..c25f9cf4a8 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -286,6 +286,7 @@ public: void setLightTexture(const LLUUID& id) { mLightTexture = id; } LLUUID getLightTexture() const { return mLightTexture; } + bool isLightSpotlight() const { return !mLightTexture.isNull(); } void setParams(const LLVector3& params) { mParams = params; } LLVector3 getParams() const { return mParams; } diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index fbe68b4d92..8b01637239 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -574,7 +574,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLUUID id = LightTextureCtrl->getImageAssetID(); if (id.notNull()) { - if (volobjp->getLightTextureID().isNull()) + if (!volobjp->isLightSpotlight()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); @@ -591,7 +591,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) volobjp->setSpotLightParams(spot_params); } } - else if (volobjp->getLightTextureID().notNull()) + else if (volobjp->isLightSpotlight()) { //no longer a spot light volobjp->setLightTextureID(id); //self->childDisable("Light FOV"); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3f1ddc0ee7..305c0a19d6 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2462,6 +2462,13 @@ void LLVOVolume::updateSpotLightPriority() } +bool LLVOVolume::isLightSpotlight() +{ + LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + return params->isLightSpotlight(); +} + + LLViewerTexture* LLVOVolume::getLightTexture() { LLUUID id = getLightTextureID(); diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index e414d9da4d..280ffea76d 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -218,6 +218,7 @@ public: LLColor3 getLightBaseColor() const; // not scaled by intensity LLColor3 getLightColor() const; // scaled by intensity LLUUID getLightTextureID() const; + bool isLightSpotlight() const; LLVector3 getSpotLightParams() const; void updateSpotLightPriority(); F32 getSpotLightPriority() const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2ad0bad11f..cb0baf77f1 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4584,7 +4584,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); - if (light->getLightTexture()) // directional (spot-)light + if (light->isLightSpotlight()) // directional (spot-)light { LLVector3 spotparams = light->getSpotLightParams(); LLQuaternion quat = light->getRenderRotation(); @@ -6693,7 +6693,7 @@ void LLPipeline::renderDeferredLighting() { //draw box if camera is outside box if (render_local) { - if (volume->getLightTexture()) + if (volume->isLightSpotlight()) { drawablep->getVOVolume()->updateSpotLightPriority(); spot_lights.push_back(drawablep); @@ -6710,7 +6710,7 @@ void LLPipeline::renderDeferredLighting() } else if (render_fullscreen) { - if (volume->getLightTexture()) + if (volume->isLightSpotlight()) { drawablep->getVOVolume()->updateSpotLightPriority(); fullscreen_spot_lights.push_back(drawablep); -- cgit v1.2.3 From 3dc32880ae0f2f0f5499a7f271df666759fc220a Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 1 Feb 2010 17:50:55 +0000 Subject: const fix. --- indra/newview/llvovolume.cpp | 2 +- indra/newview/pipeline.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 305c0a19d6..a6caa2362b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2462,7 +2462,7 @@ void LLVOVolume::updateSpotLightPriority() } -bool LLVOVolume::isLightSpotlight() +bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); return params->isLightSpotlight(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index cb0baf77f1..b25c7c9212 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4573,7 +4573,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) F32 light_radius = llmax(light->getLightRadius(), 0.001f); - F32 x = (3.f * (1.f + light->getLightFalloff())); + F32 x = (3.f * (1.f + light->getLightFalloff())); // why this magic? probably trying to match a historic behavior. float linatten = x / (light_radius); // % of brightness at radius mHWLightColors[cur_light] = light_color; -- cgit v1.2.3 From 56bd8e1f4de45c63b896908c601aac13ffc57235 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 2 Feb 2010 22:38:39 +0000 Subject: Trying to resolve a strange crash in LLUUID::isNull()... by avoiding it for now. --- indra/llprimitive/llprimitive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index c25f9cf4a8..a44b9a6c1f 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -286,7 +286,7 @@ public: void setLightTexture(const LLUUID& id) { mLightTexture = id; } LLUUID getLightTexture() const { return mLightTexture; } - bool isLightSpotlight() const { return !mLightTexture.isNull(); } + bool isLightSpotlight() const { return mLightTexture.notNull(); } void setParams(const LLVector3& params) { mParams = params; } LLVector3 getParams() const { return mParams; } -- cgit v1.2.3 From cc5920bed7790db49a062fb98ce54191f06ed98c Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 2 Feb 2010 22:45:30 +0000 Subject: Probably the real fix for isLightSpotlight() - PARAMS_LIGHT_IMAGE isn't guaranteed, duh. --- indra/newview/llvovolume.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a6caa2362b..be2744aede 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2465,7 +2465,11 @@ void LLVOVolume::updateSpotLightPriority() bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - return params->isLightSpotlight(); + if (params) + { + return params->isLightSpotlight(); + } + return false; } -- cgit v1.2.3 From 011b0b0e5e72800d2b3f0fb08d820cc7e23fcb61 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 3 Feb 2010 17:00:33 +0000 Subject: Fix silent merge conflict.... AFAICT. --- .../skins/default/xui/en/floater_inventory.xml | 21 --------------------- .../skins/default/xui/en/menu_inventory_add.xml | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index 6d4620f9ab..e187eabd3a 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -41,25 +41,4 @@ name="Inventory Panel" top="15" width="467" /> - <menu_item_call - label="Model (L$[COST])..." - layout="topleft" - name="Upload Model"> - <menu_item_call.on_click - function="File.UploadModel" - parameter="" /> - <menu_item_call.on_enable - function="File.EnableUpload" /> - </menu_item_call> - <menu_item_call - label="Scene..." - layout="topleft" - name="Upload Scene"> - <menu_item_call.on_click - function="File.UploadScene" - parameter="" /> - <menu_item_call.on_enable - function="File.EnableUpload" /> - </menu_item_call> - <menu_item_call </floater> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index 5ad099e2d9..0d974075f5 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -42,6 +42,26 @@ <menu_item_call.on_enable function="File.EnableUpload" /> </menu_item_call> + <menu_item_call + label="Model (L$[COST])..." + layout="topleft" + name="Upload Model"> + <menu_item_call.on_click + function="File.UploadModel" + parameter="" /> + <menu_item_call.on_enable + function="File.EnableUpload" /> + </menu_item_call> + <menu_item_call + label="Scene..." + layout="topleft" + name="Upload Scene"> + <menu_item_call.on_click + function="File.UploadScene" + parameter="" /> + <menu_item_call.on_enable + function="File.EnableUpload" /> + </menu_item_call> <menu_item_call label="Bulk (L$[COST] per file)..." layout="topleft" @@ -226,4 +246,4 @@ parameter="eyes" /> </menu_item_call> </menu> -</menu> \ No newline at end of file +</menu> -- cgit v1.2.3 From 1805369b58d98677c726bb0bcb52618bd66e8fdd Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Wed, 3 Feb 2010 18:08:19 -0600 Subject: handle reflected geometry in scene import implement determinant for 4x4 matrices fix materials for collada <polygon> --- indra/llmath/m4math.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index 3700142982..5c112b52b2 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -221,8 +221,33 @@ const LLMatrix4& LLMatrix4::transpose() F32 LLMatrix4::determinant() const { - llerrs << "Not implemented!" << llendl; - return 0.f; + F32 value = + mMatrix[0][3] * mMatrix[1][2] * mMatrix[2][1] * mMatrix[3][0] - + mMatrix[0][2] * mMatrix[1][3] * mMatrix[2][1] * mMatrix[3][0] - + mMatrix[0][3] * mMatrix[1][1] * mMatrix[2][2] * mMatrix[3][0] + + mMatrix[0][1] * mMatrix[1][3] * mMatrix[2][2] * mMatrix[3][0] + + mMatrix[0][2] * mMatrix[1][1] * mMatrix[2][3] * mMatrix[3][0] - + mMatrix[0][1] * mMatrix[1][2] * mMatrix[2][3] * mMatrix[3][0] - + mMatrix[0][3] * mMatrix[1][2] * mMatrix[2][0] * mMatrix[3][1] + + mMatrix[0][2] * mMatrix[1][3] * mMatrix[2][0] * mMatrix[3][1] + + mMatrix[0][3] * mMatrix[1][0] * mMatrix[2][2] * mMatrix[3][1] - + mMatrix[0][0] * mMatrix[1][3] * mMatrix[2][2] * mMatrix[3][1] - + mMatrix[0][2] * mMatrix[1][0] * mMatrix[2][3] * mMatrix[3][1] + + mMatrix[0][0] * mMatrix[1][2] * mMatrix[2][3] * mMatrix[3][1] + + mMatrix[0][3] * mMatrix[1][1] * mMatrix[2][0] * mMatrix[3][2] - + mMatrix[0][1] * mMatrix[1][3] * mMatrix[2][0] * mMatrix[3][2] - + mMatrix[0][3] * mMatrix[1][0] * mMatrix[2][1] * mMatrix[3][2] + + mMatrix[0][0] * mMatrix[1][3] * mMatrix[2][1] * mMatrix[3][2] + + mMatrix[0][1] * mMatrix[1][0] * mMatrix[2][3] * mMatrix[3][2] - + mMatrix[0][0] * mMatrix[1][1] * mMatrix[2][3] * mMatrix[3][2] - + mMatrix[0][2] * mMatrix[1][1] * mMatrix[2][0] * mMatrix[3][3] + + mMatrix[0][1] * mMatrix[1][2] * mMatrix[2][0] * mMatrix[3][3] + + mMatrix[0][2] * mMatrix[1][0] * mMatrix[2][1] * mMatrix[3][3] - + mMatrix[0][0] * mMatrix[1][2] * mMatrix[2][1] * mMatrix[3][3] - + mMatrix[0][1] * mMatrix[1][0] * mMatrix[2][2] * mMatrix[3][3] + + mMatrix[0][0] * mMatrix[1][1] * mMatrix[2][2] * mMatrix[3][3]; + + return value; } // Only works for pure orthonormal, homogeneous transform matrices. -- cgit v1.2.3 From 62f0f426532808755f6d97f34fd2d8c9e5d2fa6a Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 5 Feb 2010 09:12:13 +0000 Subject: repair meshfu for inventory API change --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6aecc4af4d..366fb091e4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5046,7 +5046,7 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) std::vector<std::string> items; std::vector<std::string> disabled_items; - if(isInTrash()) + if(isItemInTrash()) { items.push_back(std::string("Purge Item")); if (!isItemRemovable()) -- cgit v1.2.3 From 095a5e84408b47ef3c5610e111aefe51d77633ca Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 6 Feb 2010 17:33:12 -0600 Subject: Draw prims using triangle strips instead of triangle lists. --- indra/llmath/llvolume.cpp | 201 +++++++++++++++++++++++++------- indra/llmath/llvolume.h | 4 +- indra/newview/app_settings/settings.xml | 11 ++ indra/newview/lldrawpool.cpp | 4 +- indra/newview/lldrawpoolalpha.cpp | 8 +- indra/newview/lldrawpoolbump.cpp | 8 +- indra/newview/lldrawpooltree.cpp | 4 +- indra/newview/llface.cpp | 25 +++- indra/newview/llspatialpartition.cpp | 3 +- indra/newview/llspatialpartition.h | 1 + indra/newview/llviewercontrol.cpp | 1 + indra/newview/llviewerjointmesh.cpp | 2 +- indra/newview/llvotree.cpp | 6 +- indra/newview/llvovolume.cpp | 16 ++- indra/newview/llvowlsky.cpp | 2 +- indra/newview/pipeline.cpp | 15 ++- indra/newview/pipeline.h | 4 +- 17 files changed, 242 insertions(+), 73 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index df4c618ac1..cd7d7a12e3 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4520,15 +4520,65 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) if (!partial_build) { - int idxs[] = {0,1,(grid_size+1)+1,(grid_size+1)+1,(grid_size+1),0}; - for(int gx = 0;gx<grid_size;gx++){ - for(int gy = 0;gy<grid_size;gy++){ - if (mTypeMask & TOP_MASK){ - for(int i=5;i>=0;i--)mIndices.push_back(vtop+(gy*(grid_size+1))+gx+idxs[i]); - }else{ - for(int i=0;i<6;i++)mIndices.push_back(vtop+(gy*(grid_size+1))+gx+idxs[i]); + mTriStrip.clear(); + S32 idxs[] = {0,1,(grid_size+1)+1,(grid_size+1)+1,(grid_size+1),0}; + for(S32 gx = 0;gx<grid_size;gx++) + { + + for(S32 gy = 0;gy<grid_size;gy++) + { + if (mTypeMask & TOP_MASK) + { + for(S32 i=5;i>=0;i--) + { + mIndices.push_back(vtop+(gy*(grid_size+1))+gx+idxs[i]); + } + + if (gy == 0) + { + mTriStrip.push_back((gx+1)*(grid_size+1)); + mTriStrip.push_back((gx+1)*(grid_size+1)); + mTriStrip.push_back(gx*(grid_size+1)); + } + + mTriStrip.push_back(gy+1+(gx+1)*(grid_size+1)); + mTriStrip.push_back(gy+1+gx*(grid_size+1)); + + + if (gy == grid_size-1) + { + mTriStrip.push_back(gy+1+gx*(grid_size+1)); + } + } + else + { + for(S32 i=0;i<6;i++) + { + mIndices.push_back(vtop+(gy*(grid_size+1))+gx+idxs[i]); + } + + if (gy == 0) + { + mTriStrip.push_back(gx*(grid_size+1)); + mTriStrip.push_back(gx*(grid_size+1)); + mTriStrip.push_back((gx+1)*(grid_size+1)); + } + + mTriStrip.push_back(gy+1+gx*(grid_size+1)); + mTriStrip.push_back(gy+1+(gx+1)*(grid_size+1)); + + if (gy == grid_size-1) + { + mTriStrip.push_back(gy+1+(gx+1)*(grid_size+1)); + } } } + + } + + if (mTriStrip.size()%2 == 1) + { + mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } } @@ -4770,6 +4820,8 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) pt2--; } } + + makeTriStrip(); } else { @@ -4874,67 +4926,108 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) pt2--; } } + + makeTriStrip(); } } else { // Not hollow, generate the triangle fan. + U16 v1 = 2; + U16 v2 = 1; + if (mTypeMask & TOP_MASK) { - if (mTypeMask & OPEN_MASK) - { - // SOLID OPEN TOP - // Generate indices - // This is a tri-fan, so we reuse the same first point for all triangles. - for (S32 i = 0; i < (num_vertices - 2); i++) - { - mIndices[3*i] = num_vertices - 1; - mIndices[3*i+1] = i; - mIndices[3*i+2] = i + 1; - } - } - else - { - // SOLID CLOSED TOP - for (S32 i = 0; i < (num_vertices - 2); i++) - { - //MSMSM fix these caps but only for the un-cut case - mIndices[3*i] = num_vertices - 1; - mIndices[3*i+1] = i; - mIndices[3*i+2] = i + 1; - } - } + v1 = 1; + v2 = 2; + } + + for (S32 i = 0; i < (num_vertices - 2); i++) + { + mIndices[3*i] = num_vertices - 1; + mIndices[3*i+v1] = i; + mIndices[3*i+v2] = i + 1; + } + + //make tri strip + if (mTypeMask & OPEN_MASK) + { + makeTriStrip(); } else { - if (mTypeMask & OPEN_MASK) + S32 j = num_vertices-2; + if (mTypeMask & TOP_MASK) { - // SOLID OPEN BOTTOM - // Generate indices - // This is a tri-fan, so we reuse the same first point for all triangles. - for (S32 i = 0; i < (num_vertices - 2); i++) + mTriStrip.push_back(0); + for (S32 i = 1; i <= j; ++i) { - mIndices[3*i] = num_vertices - 1; - mIndices[3*i+1] = i + 1; - mIndices[3*i+2] = i; + mTriStrip.push_back(i); + if (i != j) + { + mTriStrip.push_back(j); + } + --j; } } else { - // SOLID CLOSED BOTTOM - for (S32 i = 0; i < (num_vertices - 2); i++) + mTriStrip.push_back(j); + for (S32 i = 1; i <= j; ++i) { - //MSMSM fix these caps but only for the un-cut case - mIndices[3*i] = num_vertices - 1; - mIndices[3*i+1] = i + 1; - mIndices[3*i+2] = i; + if (i != j) + { + mTriStrip.push_back(j); + } + mTriStrip.push_back(i); + --j; } } + + mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); + + if (mTriStrip.size()%2 == 1) + { + mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); + } } } + return TRUE; } +void LLVolumeFace::makeTriStrip() +{ + for (U32 i = 0; i < mIndices.size(); i+=3) + { + U16 i0 = mIndices[i]; + U16 i1 = mIndices[i+1]; + U16 i2 = mIndices[i+2]; + + if ((i/3)%2 == 1) + { + mTriStrip.push_back(i0); + mTriStrip.push_back(i0); + mTriStrip.push_back(i1); + mTriStrip.push_back(i2); + mTriStrip.push_back(i2); + } + else + { + mTriStrip.push_back(i2); + mTriStrip.push_back(i2); + mTriStrip.push_back(i1); + mTriStrip.push_back(i0); + mTriStrip.push_back(i0); + } + } + + if (mTriStrip.size()%2 == 1) + { + mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); + } +} + void LLVolumeFace::createBinormals() { LLMemType m1(LLMemType::MTYPE_VOLUME); @@ -5135,9 +5228,14 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) if (!partial_build) { + mTriStrip.clear(); + // Now we generate the indices. for (t = 0; t < (mNumT-1); t++) { + //prepend terminating index to strip + mTriStrip.push_back(mNumS*t); + for (s = 0; s < (mNumS-1); s++) { mIndices[cur_index++] = s + mNumS*t; //bottom left @@ -5147,6 +5245,14 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mIndices[cur_index++] = s+1 + mNumS*t; //bottom right mIndices[cur_index++] = s+1 + mNumS*(t+1); //top right + if (s == 0) + { + mTriStrip.push_back(s+mNumS*t); + mTriStrip.push_back(s+mNumS*(t+1)); + } + mTriStrip.push_back(s+1+mNumS*t); + mTriStrip.push_back(s+1+mNumS*(t+1)); + mEdge[cur_edge++] = (mNumS-1)*2*t+s*2+1; //bottom left/top right neighbor face if (t < mNumT-2) { //top right/top left neighbor face mEdge[cur_edge++] = (mNumS-1)*2*(t+1)+s*2+1; @@ -5187,6 +5293,13 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } mEdge[cur_edge++] = (mNumS-1)*2*t+s*2; //top right/bottom left neighbor face } + //append terminating vertex to strip + mTriStrip.push_back(mNumS-1+mNumS*(t+1)); + } + + if (mTriStrip.size()%2 == 1) + { + mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } } diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 871b334452..d9f80f0e30 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -798,7 +798,8 @@ public: BOOL create(LLVolume* volume, BOOL partial_build = FALSE); void createBinormals(); - + void makeTriStrip(); + class VertexData { public: @@ -839,6 +840,7 @@ public: std::vector<VertexData> mVertices; std::vector<U16> mIndices; + std::vector<U16> mTriStrip; std::vector<S32> mEdge; private: diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8a447502b0..ce19dda9a5 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7386,6 +7386,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>RenderUseTriStrips</key> + <map> + <key>Comment</key> + <string>Use triangle strips for rendering prims.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>RenderUseFarClip</key> <map> <key>Comment</key> diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 95ddacb722..ef946ac49e 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -496,8 +496,8 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) params.mGroup->rebuildMesh(); } params.mVertexBuffer->setBuffer(mask); - params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); - gPipeline.addTrianglesDrawn(params.mCount/3); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); } if (params.mTextureMatrix && texture && params.mTexture.notNull()) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 6d77361414..0e02bc4b01 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -250,8 +250,8 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask) params.mGroup->rebuildMesh(); } params.mVertexBuffer->setBuffer(mask); - params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); - gPipeline.addTrianglesDrawn(params.mCount/3); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); } } } @@ -380,8 +380,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } params.mVertexBuffer->setBuffer(mask); - params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); - gPipeline.addTrianglesDrawn(params.mCount/3); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); if (params.mTextureMatrix && params.mTexture.notNull()) { diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 03a8b108e2..d09d4a412f 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -560,8 +560,8 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL params.mGroup->rebuildMesh(); } params.mVertexBuffer->setBuffer(mask); - params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); - gPipeline.addTrianglesDrawn(params.mCount/3); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); } } @@ -1231,8 +1231,8 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) params.mGroup->rebuildMesh(); } params.mVertexBuffer->setBuffer(mask); - params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); - gPipeline.addTrianglesDrawn(params.mCount/3); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); if (params.mTextureMatrix) { if (mShiny) diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 5521fb05a8..1a5d55d793 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -115,7 +115,7 @@ void LLDrawPoolTree::render(S32 pass) LLFace *face = *iter; face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0); - gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices()/3); + gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices()); } } } @@ -237,7 +237,7 @@ void LLDrawPoolTree::renderForSelect() face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0); - gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices()/3); + gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices()); } } } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 965ac1cad0..93840e077c 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -868,7 +868,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, llpushcallstacks ; const LLVolumeFace &vf = volume.getVolumeFace(f); S32 num_vertices = (S32)vf.mVertices.size(); - S32 num_indices = (S32)vf.mIndices.size(); + S32 num_indices = LLPipeline::sUseTriStrips ? (S32)vf.mTriStrip.size() : (S32) vf.mIndices.size(); if (mVertexBuffer.notNull()) { @@ -1058,9 +1058,19 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (full_rebuild) { mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex); - for (U16 i = 0; i < num_indices; i++) + if (LLPipeline::sUseTriStrips) { - *indicesp++ = vf.mIndices[i] + index_offset; + for (U16 i = 0; i < num_indices; i++) + { + *indicesp++ = vf.mTriStrip[i] + index_offset; + } + } + else + { + for (U16 i = 0; i < num_indices; i++) + { + *indicesp++ = vf.mIndices[i] + index_offset; + } } } @@ -1572,8 +1582,13 @@ S32 LLFace::pushVertices(const U16* index_array) const { if (mIndicesCount) { - mVertexBuffer->drawRange(LLRender::TRIANGLES, mGeomIndex, mGeomIndex+mGeomCount-1, mIndicesCount, mIndicesIndex); - gPipeline.addTrianglesDrawn(mIndicesCount/3); + U32 render_type = LLRender::TRIANGLES; + if (mDrawInfo) + { + render_type = mDrawInfo->mDrawMode; + } + mVertexBuffer->drawRange(render_type, mGeomIndex, mGeomIndex+mGeomCount-1, mIndicesCount, mIndicesIndex); + gPipeline.addTrianglesDrawn(mIndicesCount, render_type); } return mIndicesCount; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 2a57d48f16..d6e9256fee 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3380,7 +3380,8 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mVSize(0.f), mGroup(NULL), mFace(NULL), - mDistance(0.f) + mDistance(0.f), + mDrawMode(LLRender::TRIANGLES) { mDebugColor = (rand() << 16) + rand(); if (mStart >= mVertexBuffer->getRequestedVerts() || diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 64c2a9acbc..7896488379 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -93,6 +93,7 @@ public: LLFace* mFace; //associated face F32 mDistance; LLVector3 mExtents[2]; + U32 mDrawMode; struct CompareTexture { diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 827d34138f..0b7f6900ed 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -510,6 +510,7 @@ void settings_setup_listeners() gSavedSettings.getControl("FirstPersonAvatarVisible")->getSignal()->connect(boost::bind(&handleRenderAvatarMouselookChanged, _2)); gSavedSettings.getControl("RenderFarClip")->getSignal()->connect(boost::bind(&handleRenderFarClipChanged, _2)); gSavedSettings.getControl("RenderTerrainDetail")->getSignal()->connect(boost::bind(&handleTerrainDetailChanged, _2)); + gSavedSettings.getControl("RenderUseTriStrips")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 1a67fc0966..7225aa1523 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -626,7 +626,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) mFace->mVertexBuffer->drawRange(LLRender::TRIANGLES, start, end, count, offset); glPopMatrix(); } - gPipeline.addTrianglesDrawn(count/3); + gPipeline.addTrianglesDrawn(count); triangle_count += count; diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 24f1c4bd24..55e2c58a52 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -1141,7 +1141,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD glLoadMatrixf((F32*) scale_mat.mMatrix); glDrawElements(GL_TRIANGLES, sLODIndexCount[trunk_LOD], GL_UNSIGNED_SHORT, indicesp + sLODIndexOffset[trunk_LOD]); - gPipeline.addTrianglesDrawn(LEAF_INDICES/3); + gPipeline.addTrianglesDrawn(LEAF_INDICES); stop_glerror(); ret += sLODIndexCount[trunk_LOD]; } @@ -1191,7 +1191,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD glLoadMatrixf((F32*) scale_mat.mMatrix); glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp); - gPipeline.addTrianglesDrawn(LEAF_INDICES/3); + gPipeline.addTrianglesDrawn(LEAF_INDICES); stop_glerror(); ret += LEAF_INDICES; } @@ -1216,7 +1216,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD glLoadMatrixf((F32*) scale_mat.mMatrix); glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp); - gPipeline.addTrianglesDrawn(LEAF_INDICES/3); + gPipeline.addTrianglesDrawn(LEAF_INDICES); stop_glerror(); ret += LEAF_INDICES; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 25ed931fb5..b87ad7fc47 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1514,7 +1514,14 @@ void LLVOVolume::updateFaceSize(S32 idx) else { const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx); - facep->setSize(vol_face.mVertices.size(), vol_face.mIndices.size()); + if (LLPipeline::sUseTriStrips) + { + facep->setSize(vol_face.mVertices.size(), vol_face.mTriStrip.size()); + } + else + { + facep->setSize(vol_face.mVertices.size(), vol_face.mIndices.size()); + } } } @@ -3264,6 +3271,11 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, draw_info->mExtents[0] = facep->mExtents[0]; draw_info->mExtents[1] = facep->mExtents[1]; validate_draw_info(*draw_info); + + if (LLPipeline::sUseTriStrips) + { + draw_info->mDrawMode = LLRender::TRIANGLE_STRIP; + } } } @@ -3348,7 +3360,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->updateFaceSize(i); LLFace* facep = drawablep->getFace(i); - if (cur_total > max_total) + if (cur_total > max_total || facep->getIndicesCount() <= 0 || facep->getGeomCount() <= 0) { facep->mVertexBuffer = NULL; facep->mLastVertexBuffer = NULL; diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index 0272a2ab34..1749ccef94 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -519,7 +519,7 @@ void LLVOWLSky::drawDome(void) LLRender::TRIANGLE_STRIP, 0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(), 0); - gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices() - 2); + gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices(), LLRender::TRIANGLE_STRIP); } #else diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d5f87b73fe..91da9e39e0 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -270,6 +270,7 @@ BOOL LLPipeline::sDelayVBUpdate = TRUE; BOOL LLPipeline::sFastAlpha = TRUE; BOOL LLPipeline::sDisableShaders = FALSE; BOOL LLPipeline::sRenderBump = TRUE; +BOOL LLPipeline::sUseTriStrips = TRUE; BOOL LLPipeline::sUseFarClip = TRUE; BOOL LLPipeline::sShadowRender = FALSE; BOOL LLPipeline::sWaterReflections = FALSE; @@ -358,6 +359,7 @@ void LLPipeline::init() sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD"); sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); + sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); @@ -3495,9 +3497,19 @@ void LLPipeline::renderGeomShadow(LLCamera& camera) } -void LLPipeline::addTrianglesDrawn(S32 count) +void LLPipeline::addTrianglesDrawn(S32 index_count, U32 render_type) { assertInitialized(); + S32 count = 0; + if (render_type == LLRender::TRIANGLE_STRIP) + { + count = index_count-2; + } + else + { + count = index_count/3; + } + mTrianglesDrawn += count; mBatchCount++; mMaxBatchSize = llmax(mMaxBatchSize, count); @@ -5349,6 +5361,7 @@ void LLPipeline::resetVertexBuffers(LLDrawable* drawable) void LLPipeline::resetVertexBuffers() { sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); + sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c5285943e8..1bf2ee941b 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -277,7 +277,7 @@ public: LLCullResult::sg_list_t::iterator beginAlphaGroups(); LLCullResult::sg_list_t::iterator endAlphaGroups(); - void addTrianglesDrawn(S32 count); + void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES); BOOL hasRenderType(const U32 type) const { return (type && (mRenderTypeMask & (1<<type))) ? TRUE : FALSE; } BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } BOOL hasRenderDebugMask(const U32 mask) const { return (mRenderDebugMask & mask) ? TRUE : FALSE; } @@ -447,7 +447,7 @@ public: static BOOL sFastAlpha; static BOOL sDisableShaders; // if TRUE, rendering will be done without shaders static BOOL sRenderBump; - static BOOL sUseFBO; + static BOOL sUseTriStrips; static BOOL sUseFarClip; static BOOL sShadowRender; static BOOL sWaterReflections; -- cgit v1.2.3 From ce504224de16776ade2a01adfbd5410fae6942cc Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 6 Feb 2010 20:50:49 -0600 Subject: Fix for bad GL blend function caching. --- indra/llrender/llrender.cpp | 33 ++++++++++++++++----------------- indra/llrender/llrender.h | 3 ++- indra/newview/llselectmgr.cpp | 19 +++++++++++++------ 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index d2dc1104a8..c11675fa48 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -763,7 +763,8 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; - mCurrSceneBlendType = BT_ALPHA; + mCurrBlendSFactor = BF_SOURCE_ALPHA; + mCurrBlendDFactor = BF_ONE_MINUS_SOURCE_ALPHA; } LLRender::~LLRender() @@ -922,40 +923,33 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB void LLRender::setSceneBlendType(eBlendType type) { - if (mCurrSceneBlendType == type) - { - return; - } - - flush(); switch (type) { case BT_ALPHA: - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + blendFunc(BF_SOURCE_ALPHA, BF_ONE_MINUS_SOURCE_ALPHA); break; case BT_ADD: - glBlendFunc(GL_ONE, GL_ONE); + blendFunc(BF_ONE, BF_ONE); break; case BT_ADD_WITH_ALPHA: - glBlendFunc(GL_SRC_ALPHA, GL_ONE); + blendFunc(BF_SOURCE_ALPHA, BF_ONE); break; case BT_MULT: - glBlendFunc(GL_DST_COLOR, GL_ZERO); + blendFunc(BF_DEST_COLOR, BF_ZERO); break; case BT_MULT_ALPHA: - glBlendFunc(GL_DST_ALPHA, GL_ZERO); + blendFunc(BF_DEST_ALPHA, BF_ZERO); break; case BT_MULT_X2: - glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); + blendFunc(BF_DEST_COLOR, BF_SOURCE_COLOR); break; case BT_REPLACE: - glBlendFunc(GL_ONE, GL_ZERO); + blendFunc(BF_ONE, BF_ZERO); break; default: llerrs << "Unknown Scene Blend Type: " << type << llendl; break; } - mCurrSceneBlendType = type; } void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) @@ -976,8 +970,13 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor) { - flush(); - glBlendFunc(sGLBlendFactor[sfactor], sGLBlendFactor[dfactor]); + if (mCurrBlendSFactor != sfactor || mCurrBlendDFactor != dfactor) + { + mCurrBlendSFactor = sfactor; + mCurrBlendDFactor = dfactor; + flush(); + glBlendFunc(sGLBlendFactor[sfactor], sGLBlendFactor[dfactor]); + } } LLTexUnit* LLRender::getTexUnit(U32 index) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 6e38fac67b..a70ccf4d80 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -360,7 +360,8 @@ private: std::vector<LLTexUnit*> mTexUnits; LLTexUnit* mDummyTexUnit; - U32 mCurrSceneBlendType; + U32 mCurrBlendSFactor; + U32 mCurrBlendDFactor; F32 mMaxAnisotropy; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9540894646..d733574a9d 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4919,13 +4919,15 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) // set up transform to encompass bounding box of HUD glMatrixMode(GL_PROJECTION); - glPushMatrix(); + gGL.pushMatrix(); glLoadIdentity(); F32 depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f); glOrtho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth); glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.pushMatrix(); + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); glLoadIdentity(); glLoadMatrixf(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); @@ -5022,10 +5024,11 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) if (for_hud && avatar) { glMatrixMode(GL_PROJECTION); - glPopMatrix(); + gGL.popMatrix(); glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.popMatrix(); + gGL.popUIMatrix(); stop_glerror(); } @@ -5374,7 +5377,10 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) } glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.pushMatrix(); + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); + if (!is_hud_object) { glLoadIdentity(); @@ -5493,7 +5499,8 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.end(); gGL.flush(); } - glPopMatrix(); + gGL.popMatrix(); + gGL.popUIMatrix(); } // -- cgit v1.2.3 From 4d9bcc2c8f303464c3664a0a7304a1bc2d658e2e Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 8 Feb 2010 13:47:14 +0000 Subject: Fix a crash in the LLModelPreview floater. This is just some sloppy generosity in data acceptance - the probable 'real' fix has been sent to qarl+davep for comment. --- indra/llui/llview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index f1b08c380b..63e627ceb5 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1720,6 +1720,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) { LLView* childp = *child_it; + llassert(childp); if (childp->getName() == name) { return childp; @@ -1731,6 +1732,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) { LLView* childp = *child_it; + llassert(childp); LLView* viewp = childp->findChildView(name, recurse); if ( viewp ) { -- cgit v1.2.3 From 42df75bafeab49b408f23d79feb4f2213d2560eb Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 8 Feb 2010 10:14:11 -0600 Subject: Enable FBO multisampling for OSX. Fix bad triangle in prim caps. --- indra/llmath/llvolume.cpp | 4 ++-- indra/llrender/llrendertarget.cpp | 11 ----------- indra/newview/llviewerdisplay.cpp | 4 ++++ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index cd7d7a12e3..ae5c9bc8cf 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4960,7 +4960,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) if (mTypeMask & TOP_MASK) { mTriStrip.push_back(0); - for (S32 i = 1; i <= j; ++i) + for (S32 i = 0; i <= j; ++i) { mTriStrip.push_back(i); if (i != j) @@ -4973,7 +4973,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) else { mTriStrip.push_back(j); - for (S32 i = 1; i <= j; ++i) + for (S32 i = 0; i <= j; ++i) { if (i != j) { diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index d9520b3bf6..3f2558f1f5 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -390,8 +390,6 @@ void LLRenderTarget::flush(BOOL fetch_depth) } else { -#if !LL_DARWIN - stop_glerror(); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); @@ -435,7 +433,6 @@ void LLRenderTarget::flush(BOOL fetch_depth) } } } -#endif glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); } @@ -444,7 +441,6 @@ void LLRenderTarget::flush(BOOL fetch_depth) void LLRenderTarget::copyContents(LLRenderTarget& source, S32 srcX0, S32 srcY0, S32 srcX1, S32 srcY1, S32 dstX0, S32 dstY0, S32 dstX1, S32 dstY1, U32 mask, U32 filter) { -#if !LL_DARWIN gGL.flush(); if (!source.mFBO || !mFBO) { @@ -483,14 +479,12 @@ void LLRenderTarget::copyContents(LLRenderTarget& source, S32 srcX0, S32 srcY0, stop_glerror(); } } -#endif } //static void LLRenderTarget::copyContentsToFramebuffer(LLRenderTarget& source, S32 srcX0, S32 srcY0, S32 srcX1, S32 srcY1, S32 dstX0, S32 dstY0, S32 dstX1, S32 dstY1, U32 mask, U32 filter) { -#if !LL_DARWIN if (!source.mFBO) { llerrs << "Cannot copy framebuffer contents for non FBO render targets." << llendl; @@ -507,7 +501,6 @@ void LLRenderTarget::copyContentsToFramebuffer(LLRenderTarget& source, S32 srcX0 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); stop_glerror(); } -#endif } BOOL LLRenderTarget::isComplete() const @@ -652,7 +645,6 @@ void LLMultisampleBuffer::allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth void LLMultisampleBuffer::addColorAttachment(U32 color_fmt) { -#if !LL_DARWIN if (color_fmt == 0) { return; @@ -693,12 +685,10 @@ void LLMultisampleBuffer::addColorAttachment(U32 color_fmt) } mTex.push_back(tex); -#endif } void LLMultisampleBuffer::allocateDepth() { -#if !LL_DARWIN glGenRenderbuffersEXT(1, (GLuint* ) &mDepth); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mDepth); if (mStencil) @@ -709,6 +699,5 @@ void LLMultisampleBuffer::allocateDepth() { glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, mSamples, GL_DEPTH_COMPONENT16_ARB, mResX, mResY); } -#endif } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index ba256d70e8..64b3bccd4c 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -862,10 +862,14 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { gPipeline.mDeferredScreen.flush(); + LLRenderTarget::copyContentsToFramebuffer(gPipeline.mDeferredScreen, 0, 0, gPipeline.mDeferredScreen.getWidth(), gPipeline.mDeferredScreen.getHeight(), + 0, 0, gPipeline.mDeferredScreen.getWidth(), gPipeline.mDeferredScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); } else { gPipeline.mScreen.flush(); + LLRenderTarget::copyContentsToFramebuffer(gPipeline.mScreen, 0, 0, gPipeline.mScreen.getWidth(), gPipeline.mScreen.getHeight(), + 0, 0, gPipeline.mScreen.getWidth(), gPipeline.mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); } } -- cgit v1.2.3 From e0c9ee3275e19decfa8c5179da5e9335bbd70fc7 Mon Sep 17 00:00:00 2001 From: Palmer Truelson <palmer@lindenlab.com> Date: Mon, 8 Feb 2010 16:11:16 -0800 Subject: Fix to build dave's changes on mac. Reviewed by davep --- indra/llui/llui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 852a19660a..22d3af3e6b 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -710,19 +710,19 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre v = LLVector3(offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2f(v.mV[0], v.mV[1] ); v = LLVector3(-offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2f(v.mV[0], v.mV[1] ); v = LLVector3(-offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2f(v.mV[0], v.mV[1] ); v = LLVector3(offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2f(v.mV[0], v.mV[1] ); } gGL.end(); gGL.popUIMatrix(); -- cgit v1.2.3 From cf9972b97151422f80746dec2ebc57aa758228c3 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 8 Feb 2010 19:15:43 -0600 Subject: Fix for blend func being screwed up at init. Fix for avatar appearance editor drawing hair in the background. --- indra/llrender/llrender.cpp | 4 ++-- indra/llui/llui.cpp | 8 ++++---- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfloaterimagepreview.cpp | 5 +++++ indra/newview/lltoolmorph.cpp | 12 ++++++++---- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index c11675fa48..55c5b4531b 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -763,8 +763,8 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; - mCurrBlendSFactor = BF_SOURCE_ALPHA; - mCurrBlendDFactor = BF_ONE_MINUS_SOURCE_ALPHA; + mCurrBlendSFactor = BF_ONE; + mCurrBlendDFactor = BF_ZERO; } LLRender::~LLRender() diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 852a19660a..22d3af3e6b 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -710,19 +710,19 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre v = LLVector3(offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2f(v.mV[0], v.mV[1] ); v = LLVector3(-offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2f(v.mV[0], v.mV[1] ); v = LLVector3(-offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2f(v.mV[0], v.mV[1] ); v = LLVector3(offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2f(v.mV[0], v.mV[1] ); } gGL.end(); gGL.popUIMatrix(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5e5917add9..93165cf5ed 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7395,7 +7395,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> <key>RenderUseFarClip</key> <map> diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 61568df12e..9917593c91 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -688,6 +688,9 @@ BOOL LLImagePreviewAvatar::render() mNeedsUpdate = FALSE; LLVOAvatar* avatarp = mDummyAvatar; + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); + glMatrixMode(GL_PROJECTION); gGL.pushMatrix(); glLoadIdentity(); @@ -696,6 +699,7 @@ BOOL LLImagePreviewAvatar::render() glMatrixMode(GL_MODELVIEW); gGL.pushMatrix(); glLoadIdentity(); + LLGLSUIDefault def; gGL.color4f(0.15f, 0.2f, 0.3f, 1.f); @@ -741,6 +745,7 @@ BOOL LLImagePreviewAvatar::render() avatarPoolp->renderAvatars(avatarp); // renders only one avatar } + gGL.popUIMatrix(); gGL.color4f(1,1,1,1); return TRUE; } diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 4fb75f7a49..5f825b461e 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -167,13 +167,16 @@ BOOL LLVisualParamHint::render() LLVisualParamReset::sDirty = TRUE; LLVOAvatar* avatarp = gAgent.getAvatarObject(); + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); + glMatrixMode(GL_PROJECTION); - glPushMatrix(); + gGL.pushMatrix(); glLoadIdentity(); glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.pushMatrix(); glLoadIdentity(); LLGLSUIDefault gls_ui; @@ -181,10 +184,10 @@ BOOL LLVisualParamHint::render() mBackgroundp->draw(0, 0, mFullWidth, mFullHeight); glMatrixMode(GL_PROJECTION); - glPopMatrix(); + gGL.popMatrix(); glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.popMatrix(); mNeedsUpdate = FALSE; mIsVisible = TRUE; @@ -247,6 +250,7 @@ BOOL LLVisualParamHint::render() mVisualParam->setWeight(mLastParamWeight, FALSE); gGL.color4f(1,1,1,1); mGLTexturep->setGLTextureCreated(true); + gGL.popUIMatrix(); return TRUE; } -- cgit v1.2.3 From bc7f2e41fd268895774f9ddffd45be318662dcaa Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 8 Feb 2010 20:03:02 -0600 Subject: Switching to 10.5 SDK --- indra/cmake/Variables.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index db0b44eb8f..9b1f7024bf 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -79,7 +79,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # NOTE: wont have a distributable build unless you add this on the configure line with: # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc' #set(CMAKE_OSX_ARCHITECTURES i386;ppc) - set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk) + set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") set(ARCH universal) else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") -- cgit v1.2.3 From 2cb5b0b66ec9633d4c6563acf5ff9d0f7bc7cbf7 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 9 Feb 2010 12:26:09 -0600 Subject: consolidate button work in progress --- indra/llmath/llvolume.cpp | 19 +++++++++++++++++++ indra/llmath/llvolume.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index de32070da1..596c5fe231 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5468,6 +5468,25 @@ void LLVolumeFace::createBinormals() } } +void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& norm_transform) +{ + for (U32 i = 0; i < face.mVertices.size(); ++i) + { + VertexData v = face.mVertices[i]; + v.mPosition *= mat; + v.mNormal *= norm_transform; + + + mVertices.push_back(v); + } + + U16 offset = mIndices.size(); + for (U32 i = 0; i < face.mIndices.size(); ++i) + { + mIndices.push_back(face.mIndices[i]+offset); + } +} + BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) { LLMemType m1(LLMemType::MTYPE_VOLUME); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index e3ab648fe3..1bf6fac305 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -805,6 +805,8 @@ public: BOOL create(LLVolume* volume, BOOL partial_build = FALSE); void createBinormals(); + void appendFace(const LLVolumeFace& face); + class VertexData { public: -- cgit v1.2.3 From 1f24e2795608ed90a108366b3332f57c375211cc Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 10 Feb 2010 14:47:53 -0600 Subject: Fix for U16 dumbness (can have > 64K indices) --- indra/newview/llface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 0a9976f511..4822c303bf 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1081,14 +1081,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex); if (LLPipeline::sUseTriStrips) { - for (U16 i = 0; i < num_indices; i++) + for (U32 i = 0; i < num_indices; i++) { *indicesp++ = vf.mTriStrip[i] + index_offset; } } else { - for (U16 i = 0; i < num_indices; i++) + for (U32 i = 0; i < num_indices; i++) { *indicesp++ = vf.mIndices[i] + index_offset; } -- cgit v1.2.3 From ffcbbf4aaabc652c2050ca6147a9388217cfcaa7 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 11 Feb 2010 18:00:00 -0600 Subject: Multi-threaded asset uploading with proper ordering first draft. --- indra/llmath/llvolume.cpp | 20 ++++++++++++++++---- indra/llmath/llvolume.h | 2 +- indra/llmessage/llcurl.cpp | 28 ++++++++++++++++++++++++++++ indra/llmessage/llcurl.h | 3 +++ indra/llmessage/llhttpclient.cpp | 1 + indra/newview/llface.cpp | 4 ++-- indra/newview/llviewermenufile.h | 10 ++++++++++ 7 files changed, 61 insertions(+), 7 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index d1716e1407..7e1517fba7 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5614,19 +5614,31 @@ void LLVolumeFace::createBinormals() } } -void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& norm_transform) +void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat, LLMatrix4& norm_mat) { + U16 offset = mVertices.size(); + + for (U32 i = 0; i < face.mVertices.size(); ++i) { VertexData v = face.mVertices[i]; - v.mPosition *= mat; - v.mNormal *= norm_transform; + v.mPosition = v.mPosition*mat; + v.mNormal = v.mNormal * norm_mat; mVertices.push_back(v); + + if (offset == 0 && i == 0) + { + mExtents[0] = mExtents[1] = v.mPosition; + } + else + { + update_min_max(mExtents[0], mExtents[1], v.mPosition); + } } - U16 offset = mIndices.size(); + for (U32 i = 0; i < face.mIndices.size(); ++i) { mIndices.push_back(face.mIndices[i]+offset); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 1059c29566..36811785dc 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -805,7 +805,7 @@ public: void createBinormals(); void makeTriStrip(); - void appendFace(const LLVolumeFace& face); + void appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& normal_tranform); class VertexData { diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 024e17a777..b93b94cd25 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -55,6 +55,7 @@ #include "llstl.h" #include "llsdserialize.h" #include "llthread.h" +#include "llvfile.h" ////////////////////////////////////////////////////////////////////////////// /* @@ -801,7 +802,34 @@ bool LLCurlRequest::post(const std::string& url, bool res = addEasy(easy); return res; } + +bool LLCurlRequest::post(const std::string& url, + const headers_t& headers, + const std::string& data, + LLCurl::ResponderPtr responder) +{ + LLCurl::Easy* easy = allocEasy(); + if (!easy) + { + return false; + } + easy->prepRequest(url, headers, responder); + + easy->getInput().write(data.data(), data.size()); + S32 bytes = easy->getInput().str().length(); + easy->setopt(CURLOPT_POST, 1); + easy->setopt(CURLOPT_POSTFIELDS, (void*)NULL); + easy->setopt(CURLOPT_POSTFIELDSIZE, bytes); + + easy->slist_append("Content-Type: application/octet-stream"); + easy->setHeaders(); + + lldebugs << "POSTING: " << bytes << " bytes." << llendl; + bool res = addEasy(easy); + return res; +} + // Note: call once per frame S32 LLCurlRequest::process() { diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index caf02cccd9..4302c19113 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -44,6 +44,7 @@ #include <boost/intrusive_ptr.hpp> #include <curl/curl.h> // TODO: remove dependency +#include "llassettype.h" #include "llbuffer.h" #include "lliopipe.h" #include "llsd.h" @@ -213,6 +214,8 @@ public: void get(const std::string& url, LLCurl::ResponderPtr responder); bool getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, LLCurl::ResponderPtr responder); bool post(const std::string& url, const headers_t& headers, const LLSD& data, LLCurl::ResponderPtr responder); + bool post(const std::string& url, const headers_t& headers, const std::string& data, LLCurl::ResponderPtr responder); + S32 process(); S32 getQueued(); diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index dd56e18caf..46952fa434 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -194,6 +194,7 @@ namespace fileBuffer = new U8 [fileSize]; vfile.read(fileBuffer, fileSize); ostream.write((char*)fileBuffer, fileSize); + delete [] fileBuffer; eos = true; return STATUS_DONE; } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 0a9976f511..4822c303bf 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1081,14 +1081,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex); if (LLPipeline::sUseTriStrips) { - for (U16 i = 0; i < num_indices; i++) + for (U32 i = 0; i < num_indices; i++) { *indicesp++ = vf.mTriStrip[i] + index_offset; } } else { - for (U16 i = 0; i < num_indices; i++) + for (U32 i = 0; i < num_indices; i++) { *indicesp++ = vf.mIndices[i] + index_offset; } diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 7167903311..7ffa5d5e57 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -100,4 +100,14 @@ void assign_defaults_and_show_upload_message( const std::string& display_name, std::string& description); +LLSD generate_new_resource_upload_capability_body( + LLAssetType::EType asset_type, + const std::string& name, + const std::string& desc, + LLFolderType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms); + #endif -- cgit v1.2.3 From 827c1adc917d832b577b37e37b0eb3f26705c29d Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 12:48:42 +0000 Subject: Backed out changeset d89b00b44ab6 --- indra/newview/llagent.cpp | 3 + indra/newview/llappviewer.cpp | 8 +- indra/newview/lldrawable.cpp | 3 - indra/newview/llflexibleobject.cpp | 15 ++- indra/newview/llglsandbox.cpp | 24 +++-- indra/newview/llviewerobject.cpp | 3 + indra/newview/llviewerobjectlist.cpp | 171 ++++++++++++++++++----------------- indra/newview/llviewerobjectlist.h | 31 ++++--- indra/newview/llviewerwindow.cpp | 4 +- indra/newview/llvoclouds.cpp | 4 +- indra/newview/llvotextbubble.cpp | 3 + indra/newview/llvovolume.cpp | 17 +++- indra/newview/llworld.cpp | 3 + indra/newview/pipeline.cpp | 64 +++---------- indra/newview/pipeline.h | 5 +- 15 files changed, 185 insertions(+), 173 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 2354323a66..9f2186f7f7 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3017,6 +3017,9 @@ void LLAgent::endAnimationUpdateUI() //----------------------------------------------------------------------------- void LLAgent::updateCamera() { + static LLFastTimer::DeclareTimer ftm("Camera"); + LLFastTimer t(ftm); + //Ventrella - changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = LLVector3::z_axis; //LLVector3 camera_skyward(0.f, 0.f, 1.f); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2d694eefd3..9eb793783b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3599,13 +3599,15 @@ void LLAppViewer::idle() { // Handle pending gesture processing + static LLFastTimer::DeclareTimer ftm("Agent Position"); + LLFastTimer t(ftm); LLGestureManager::instance().update(); gAgent.updateAgentPosition(gFrameDTClamped, yaw, current_mouse.mX, current_mouse.mY); } { - LLFastTimer t(FTM_OBJECTLIST_UPDATE); // Actually "object update" + LLFastTimer t(FTM_OBJECTLIST_UPDATE); if (!(logoutRequestSent() && hasSavedFinalSnapshot())) { @@ -3639,6 +3641,8 @@ void LLAppViewer::idle() // { + static LLFastTimer::DeclareTimer ftm("HUD Effects"); + LLFastTimer t(ftm); LLSelectMgr::getInstance()->updateEffects(); LLHUDManager::getInstance()->cleanupEffects(); LLHUDManager::getInstance()->sendEffects(); @@ -3895,7 +3899,7 @@ void LLAppViewer::sendLogoutRequest() static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME; #endif -static LLFastTimer::DeclareTimer FTM_IDLE_NETWORK("Network"); +static LLFastTimer::DeclareTimer FTM_IDLE_NETWORK("Idle Network"); void LLAppViewer::idleNetwork() { diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index d60330024a..244fed791f 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -386,8 +386,6 @@ void LLDrawable::makeActive() mParent->makeActive(); } - gPipeline.setActive(this, TRUE); - //all child objects must also be active llassert_always(mVObjp); @@ -434,7 +432,6 @@ void LLDrawable::makeStatic(BOOL warning_enabled) if (isState(ACTIVE)) { clearState(ACTIVE); - gPipeline.setActive(this, FALSE); if (mParent.notNull() && mParent->isActive() && warning_enabled) { diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index aea2de8e92..561965d021 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -51,6 +51,9 @@ /*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f; +static LLFastTimer::DeclareTimer FTM_FLEXIBLE_REBUILD("Rebuild"); +static LLFastTimer::DeclareTimer FTM_DO_FLEXIBLE_UPDATE("Update"); + // LLFlexibleObjectData::pack/unpack now in llprimitive.cpp //----------------------------------------------- @@ -194,7 +197,6 @@ void LLVolumeImplFlexible::remapSections(LLFlexibleObjectSection *source, S32 so } } - //----------------------------------------------------------------------------- void LLVolumeImplFlexible::setAttributesOfAllSections(LLVector3* inScale) { @@ -363,6 +365,7 @@ inline S32 log2(S32 x) void LLVolumeImplFlexible::doFlexibleUpdate() { + LLFastTimer ftm(FTM_DO_FLEXIBLE_UPDATE); LLVolume* volume = mVO->getVolume(); LLPath *path = &volume->getPath(); if (mSimulateRes == 0) @@ -693,7 +696,10 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) } volume->updateRelativeXform(); - doFlexibleUpdate(); + { + LLFastTimer t(FTM_DO_FLEXIBLE_UPDATE); + doFlexibleUpdate(); + } // Object may have been rotated, which means it needs a rebuild. See SL-47220 BOOL rotated = FALSE; @@ -710,7 +716,10 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) volume->regenFaces(); volume->mDrawable->setState(LLDrawable::REBUILD_VOLUME); volume->dirtySpatialGroup(); - doFlexibleRebuild(); + { + LLFastTimer t(FTM_FLEXIBLE_REBUILD); + doFlexibleRebuild(); + } volume->genBBoxes(isVolumeGlobal()); } else if (!mUpdated || rotated) diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 750a9d478f..8569e208eb 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -897,19 +897,21 @@ void LLViewerObjectList::renderObjectBeacons() S32 last_line_width = -1; // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width) - for (S32 i = 0; i < mDebugBeacons.count(); i++) + BOOL flush = FALSE; + for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { - const LLDebugBeacon &debug_beacon = mDebugBeacons[i]; + const LLDebugBeacon &debug_beacon = *iter; LLColor4 color = debug_beacon.mColor; color.mV[3] *= 0.25f; S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - if (i > 0) + if (flush) { gGL.end(); - gGL.flush(); } + flush = TRUE; + gGL.flush(); glLineWidth( (F32)line_width ); last_line_width = line_width; gGL.begin(LLRender::LINES); @@ -936,18 +938,20 @@ void LLViewerObjectList::renderObjectBeacons() S32 last_line_width = -1; // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width) - for (S32 i = 0; i < mDebugBeacons.count(); i++) + BOOL flush = FALSE; + for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { - const LLDebugBeacon &debug_beacon = mDebugBeacons[i]; + const LLDebugBeacon &debug_beacon = *iter; S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - if (i > 0) + if (flush) { gGL.end(); - gGL.flush(); } + flush = TRUE; + gGL.flush(); glLineWidth( (F32)line_width ); last_line_width = line_width; gGL.begin(LLRender::LINES); @@ -969,9 +973,9 @@ void LLViewerObjectList::renderObjectBeacons() gGL.flush(); glLineWidth(1.f); - for (S32 i = 0; i < mDebugBeacons.count(); i++) + for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { - LLDebugBeacon &debug_beacon = mDebugBeacons[i]; + LLDebugBeacon &debug_beacon = *iter; if (debug_beacon.mString == "") { continue; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 886f1d9ef5..4fdfc37d6c 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2001,6 +2001,9 @@ BOOL LLViewerObject::isActive() const BOOL LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { + static LLFastTimer::DeclareTimer ftm("Viewer Object"); + LLFastTimer t(ftm); + if (mDead) { // It's dead. Don't update it. diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 96828ee1b6..6347090f71 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -93,7 +93,7 @@ extern LLPipeline gPipeline; // Statics for object lookup tables. U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check. -LLMap<U64, U32> LLViewerObjectList::sIPAndPortToIndex; +std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex; std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID; LLViewerObjectList::LLViewerObjectList() @@ -571,10 +571,9 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys, void LLViewerObjectList::dirtyAllObjectInventory() { - S32 count = mObjects.count(); - for(S32 i = 0; i < count; ++i) + for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { - mObjects[i]->dirtyInventory(); + (*iter)->dirtyInventory(); } } @@ -587,14 +586,14 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) S32 num_updates, max_value; if (NUM_BINS - 1 == mCurBin) { - num_updates = mObjects.count() - mCurLazyUpdateIndex; - max_value = mObjects.count(); + num_updates = (S32) mObjects.size() - mCurLazyUpdateIndex; + max_value = (S32) mObjects.size(); gTextureList.setUpdateStats(TRUE); } else { - num_updates = (mObjects.count() / NUM_BINS) + 1; - max_value = llmin(mObjects.count(), mCurLazyUpdateIndex + num_updates); + num_updates = ((S32) mObjects.size() / NUM_BINS) + 1; + max_value = llmin((S32) mObjects.size(), mCurLazyUpdateIndex + num_updates); } @@ -647,7 +646,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) } mCurLazyUpdateIndex = max_value; - if (mCurLazyUpdateIndex == mObjects.count()) + if (mCurLazyUpdateIndex == mObjects.size()) { mCurLazyUpdateIndex = 0; } @@ -694,20 +693,26 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) // Make a copy of the list in case something in idleUpdate() messes with it std::vector<LLViewerObject*> idle_list; - idle_list.reserve( mActiveObjects.size() ); + + static LLFastTimer::DeclareTimer idle_copy("Idle Copy"); - for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin(); - active_iter != mActiveObjects.end(); active_iter++) { - objectp = *active_iter; - if (objectp) + LLFastTimer t(idle_copy); + idle_list.reserve( mActiveObjects.size() ); + + for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin(); + active_iter != mActiveObjects.end(); active_iter++) { - idle_list.push_back( objectp ); - } - else - { // There shouldn't be any NULL pointers in the list, but they have caused - // crashes before. This may be idleUpdate() messing with the list. - llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl; + objectp = *active_iter; + if (objectp) + { + idle_list.push_back( objectp ); + } + else + { // There shouldn't be any NULL pointers in the list, but they have caused + // crashes before. This may be idleUpdate() messing with the list. + llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl; + } } } @@ -807,7 +812,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) } */ - LLViewerStats::getInstance()->mNumObjectsStat.addValue(mObjects.count()); + LLViewerStats::getInstance()->mNumObjectsStat.addValue((S32) mObjects.size()); LLViewerStats::getInstance()->mNumActiveObjectsStat.addValue(num_active_objects); LLViewerStats::getInstance()->mNumSizeCulledStat.addValue(mNumSizeCulled); LLViewerStats::getInstance()->mNumVisCulledStat.addValue(mNumVisCulled); @@ -815,9 +820,9 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) void LLViewerObjectList::clearDebugText() { - for (S32 i = 0; i < mObjects.count(); i++) + for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { - mObjects[i]->setDebugText(""); + (*iter)->setDebugText(""); } } @@ -856,7 +861,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) if (objectp->isOnMap()) { - mMapObjects.removeObj(objectp); + removeFromMap(objectp); } // Don't clean up mObject references, these will be cleaned up more efficiently later! @@ -913,10 +918,10 @@ void LLViewerObjectList::killObjects(LLViewerRegion *regionp) { LLViewerObject *objectp; - S32 i; - for (i = 0; i < mObjects.count(); i++) + + for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { - objectp = mObjects[i]; + objectp = *iter; if (objectp->mRegionp == regionp) { @@ -933,10 +938,9 @@ void LLViewerObjectList::killAllObjects() // Used only on global destruction. LLViewerObject *objectp; - for (S32 i = 0; i < mObjects.count(); i++) + for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { - objectp = mObjects[i]; - + objectp = *iter; killObject(objectp); llassert(objectp->isDead()); } @@ -945,7 +949,7 @@ void LLViewerObjectList::killAllObjects() if(!mObjects.empty()) { - llwarns << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.count() << llendl; + llwarns << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.size() << llendl; mObjects.clear(); } @@ -970,16 +974,15 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) return; } - S32 i = 0; S32 num_removed = 0; LLViewerObject *objectp; - while (i < mObjects.count()) + for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ) { // Scan for all of the dead objects and remove any "global" references to them. - objectp = mObjects[i]; + objectp = *iter; if (objectp->isDead()) { - mObjects.remove(i); + iter = mObjects.erase(iter); num_removed++; if (num_removed == mNumDeadObjects) @@ -990,8 +993,7 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) } else { - // iterate, this isn't a dead object. - i++; + ++iter; } } @@ -1041,12 +1043,11 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset) } LLViewerObject *objectp; - S32 i; - for (i = 0; i < mObjects.count(); i++) + for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { - objectp = getObject(i); + objectp = *iter; // There could be dead objects on the object list, so don't update stuff if the object is dead. - if (objectp) + if (!objectp->isDead()) { objectp->updatePositionCaches(); @@ -1076,9 +1077,9 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) F32 max_radius = gSavedSettings.getF32("MiniMapPrimMaxRadius"); - for (S32 i = 0; i < mMapObjects.count(); i++) + for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) { - LLViewerObject* objectp = mMapObjects[i]; + LLViewerObject* objectp = *iter; if (!objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment()) { continue; @@ -1144,21 +1145,14 @@ void LLViewerObjectList::renderObjectBounds(const LLVector3 ¢er) { } -void LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent) -{ - generatePickList(camera); - renderPickList(screen_rect, pick_parcel_wall, render_transparent); -} - void LLViewerObjectList::generatePickList(LLCamera &camera) { LLViewerObject *objectp; S32 i; // Reset all of the GL names to zero. - for (i = 0; i < mObjects.count(); i++) + for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { - objectp = mObjects[i]; - objectp->mGLName = 0; + (*iter)->mGLName = 0; } mSelectPickList.clear(); @@ -1321,17 +1315,19 @@ void LLViewerObjectList::addDebugBeacon(const LLVector3 &pos_agent, const LLColor4 &text_color, S32 line_width) { - LLDebugBeacon *beaconp = mDebugBeacons.reserve_block(1); - beaconp->mPositionAgent = pos_agent; - beaconp->mString = string; - beaconp->mColor = color; - beaconp->mTextColor = text_color; - beaconp->mLineWidth = line_width; + LLDebugBeacon beacon; + beacon.mPositionAgent = pos_agent; + beacon.mString = string; + beacon.mColor = color; + beacon.mTextColor = text_color; + beacon.mLineWidth = line_width; + + mDebugBeacons.push_back(beacon); } void LLViewerObjectList::resetObjectBeacons() { - mDebugBeacons.reset(); + mDebugBeacons.clear(); } LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp) @@ -1349,7 +1345,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi mUUIDObjectMap[fullid] = objectp; - mObjects.put(objectp); + mObjects.push_back(objectp); updateActive(objectp); @@ -1388,7 +1384,7 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe gMessageSystem->getSenderIP(), gMessageSystem->getSenderPort()); - mObjects.put(objectp); + mObjects.push_back(objectp); updateActive(objectp); @@ -1411,11 +1407,11 @@ LLViewerObject *LLViewerObjectList::replaceObject(const LLUUID &id, const LLPCod S32 LLViewerObjectList::findReferences(LLDrawable *drawablep) const { LLViewerObject *objectp; - S32 i; S32 num_refs = 0; - for (i = 0; i < mObjects.count(); i++) + + for (vobj_list_t::const_iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { - objectp = mObjects[i]; + objectp = *iter; if (objectp->mDrawable.notNull()) { num_refs += objectp->mDrawable->findReferences(drawablep); @@ -1460,15 +1456,15 @@ void LLViewerObjectList::orphanize(LLViewerObject *childp, U32 parent_id, U32 ip // Unknown parent, add to orpaned child list U64 parent_info = getIndex(parent_id, ip, port); - if (-1 == mOrphanParents.find(parent_info)) + if (std::find(mOrphanParents.begin(), mOrphanParents.end(), parent_info) == mOrphanParents.end()) { - mOrphanParents.put(parent_info); + mOrphanParents.push_back(parent_info); } LLViewerObjectList::OrphanInfo oi(parent_info, childp->mID); - if (-1 == mOrphanChildren.find(oi)) + if (std::find(mOrphanChildren.begin(), mOrphanChildren.end(), oi) == mOrphanChildren.end()) { - mOrphanChildren.put(oi); + mOrphanChildren.push_back(oi); mNumOrphans++; } } @@ -1491,28 +1487,29 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) // See if we are a parent of an orphan. // Note: This code is fairly inefficient but it should happen very rarely. // It can be sped up if this is somehow a performance issue... - if (0 == mOrphanParents.count()) + if (mOrphanParents.empty()) { // no known orphan parents return; } - if (-1 == mOrphanParents.find(getIndex(objectp->mLocalID, ip, port))) + if (std::find(mOrphanParents.begin(), mOrphanParents.end(), getIndex(objectp->mLocalID, ip, port)) == mOrphanParents.end()) { // did not find objectp in OrphanParent list return; } - S32 i; U64 parent_info = getIndex(objectp->mLocalID, ip, port); BOOL orphans_found = FALSE; // Iterate through the orphan list, and set parents of matching children. - for (i = 0; i < mOrphanChildren.count(); i++) - { - if (mOrphanChildren[i].mParentInfo != parent_info) + + for (std::vector<OrphanInfo>::iterator iter = mOrphanChildren.begin(); iter != mOrphanChildren.end(); ) + { + if (iter->mParentInfo != parent_info) { + ++iter; continue; } - LLViewerObject *childp = findObject(mOrphanChildren[i].mChildInfo); + LLViewerObject *childp = findObject(iter->mChildInfo); if (childp) { if (childp == objectp) @@ -1546,29 +1543,35 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) objectp->addChild(childp); orphans_found = TRUE; + ++iter; } else { llinfos << "Missing orphan child, removing from list" << llendl; - mOrphanChildren.remove(i); - i--; + + iter = mOrphanChildren.erase(iter); } } // Remove orphan parent and children from lists now that they've been found - mOrphanParents.remove(mOrphanParents.find(parent_info)); - - i = 0; - while (i < mOrphanChildren.count()) { - if (mOrphanChildren[i].mParentInfo == parent_info) + std::vector<U64>::iterator iter = std::find(mOrphanParents.begin(), mOrphanParents.end(), parent_info); + if (iter != mOrphanParents.end()) + { + mOrphanParents.erase(iter); + } + } + + for (std::vector<OrphanInfo>::iterator iter = mOrphanChildren.begin(); iter != mOrphanChildren.end(); ) + { + if (iter->mParentInfo == parent_info) { - mOrphanChildren.remove(i); + iter = mOrphanChildren.erase(iter); mNumOrphans--; } else { - i++; + ++iter; } } diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index ace5c5038e..8d3d2c4b44 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -38,8 +38,6 @@ // common includes #include "llstat.h" -#include "lldarrayptr.h" -#include "llmap.h" // *TODO: switch to std::map #include "llstring.h" // project includes @@ -50,7 +48,7 @@ class LLNetMap; class LLDebugBeacon; const U32 CLOSE_BIN_SIZE = 10; -const U32 NUM_BINS = 16; +const U32 NUM_BINS = 128; // GL name = position in object list + GL_NAME_INDEX_OFFSET so that // we can have special numbers like zero. @@ -111,13 +109,12 @@ public: void updateAvatarVisibility(); // Selection related stuff - void renderObjectsForSelect(LLCamera &camera, const LLRect& screen_rect, BOOL pick_parcel_wall = FALSE, BOOL render_transparent = TRUE); void generatePickList(LLCamera &camera); void renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent); LLViewerObject *getSelectedObject(const U32 object_id); - inline S32 getNumObjects() { return mObjects.count(); } + inline S32 getNumObjects() { return (S32) mObjects.size(); } void addToMap(LLViewerObject *objectp); void removeFromMap(LLViewerObject *objectp); @@ -131,7 +128,7 @@ public: S32 findReferences(LLDrawable *drawablep) const; // Find references to drawable in all objects, and return value. - S32 getOrphanParentCount() const { return mOrphanParents.count(); } + S32 getOrphanParentCount() const { return (S32) mOrphanParents.size(); } S32 getOrphanCount() const { return mNumOrphans; } void orphanize(LLViewerObject *childp, U32 parent_id, U32 ip, U32 port); void findOrphans(LLViewerObject* objectp, U32 ip, U32 port); @@ -179,26 +176,28 @@ public: S32 mNumUnknownKills; S32 mNumDeadObjects; protected: - LLDynamicArray<U64> mOrphanParents; // LocalID/ip,port of orphaned objects - LLDynamicArray<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects + std::vector<U64> mOrphanParents; // LocalID/ip,port of orphaned objects + std::vector<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects S32 mNumOrphans; - LLDynamicArrayPtr<LLPointer<LLViewerObject>, 256> mObjects; + typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t; + + vobj_list_t mObjects; std::set<LLPointer<LLViewerObject> > mActiveObjects; - LLDynamicArrayPtr<LLPointer<LLViewerObject> > mMapObjects; + vobj_list_t mMapObjects; typedef std::map<LLUUID, LLPointer<LLViewerObject> > vo_map; vo_map mDeadObjects; // Need to keep multiple entries per UUID std::map<LLUUID, LLPointer<LLViewerObject> > mUUIDObjectMap; - LLDynamicArray<LLDebugBeacon> mDebugBeacons; + std::vector<LLDebugBeacon> mDebugBeacons; S32 mCurLazyUpdateIndex; static U32 sSimulatorMachineIndex; - static LLMap<U64, U32> sIPAndPortToIndex; + static std::map<U64, U32> sIPAndPortToIndex; static std::map<U64, LLUUID> sIndexAndLocalIDToUUID; @@ -260,12 +259,16 @@ inline LLViewerObject *LLViewerObjectList::getObject(const S32 index) inline void LLViewerObjectList::addToMap(LLViewerObject *objectp) { - mMapObjects.put(objectp); + mMapObjects.push_back(objectp); } inline void LLViewerObjectList::removeFromMap(LLViewerObject *objectp) { - mMapObjects.removeObj(objectp); + std::vector<LLPointer<LLViewerObject> >::iterator iter = std::find(mMapObjects.begin(), mMapObjects.end(), objectp); + if (iter != mMapObjects.end()) + { + mMapObjects.erase(iter); + } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cd6b9e2c50..de4317b2de 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2316,6 +2316,9 @@ void append_xui_tooltip(LLView* viewp, LLToolTip::Params& params) // event processing. void LLViewerWindow::updateUI() { + static LLFastTimer::DeclareTimer ftm("Update UI"); + LLFastTimer t(ftm); + static std::string last_handle_msg; // animate layout stacks so we have up to date rect for world view @@ -2895,7 +2898,6 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point) // Must be called after displayObjects is called, which sets the mGLName parameter // NOTE: This function gets called 3 times: // render_ui_3d: FALSE, FALSE, TRUE -// renderObjectsForSelect: TRUE, pick_parcel_wall, FALSE // render_hud_elements: FALSE, FALSE, FALSE void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud ) { diff --git a/indra/newview/llvoclouds.cpp b/indra/newview/llvoclouds.cpp index 177cb16c50..5153cef709 100644 --- a/indra/newview/llvoclouds.cpp +++ b/indra/newview/llvoclouds.cpp @@ -77,9 +77,11 @@ BOOL LLVOClouds::isActive() const return TRUE; } - BOOL LLVOClouds::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { + static LLFastTimer::DeclareTimer ftm("Idle Clouds"); + LLFastTimer t(ftm); + if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) { return TRUE; diff --git a/indra/newview/llvotextbubble.cpp b/indra/newview/llvotextbubble.cpp index 75beab519e..428ef20006 100644 --- a/indra/newview/llvotextbubble.cpp +++ b/indra/newview/llvotextbubble.cpp @@ -84,6 +84,9 @@ BOOL LLVOTextBubble::isActive() const BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { + static LLFastTimer::DeclareTimer ftm("Text Bubble"); + LLFastTimer t(ftm); + F32 dt = mUpdateTimer.getElapsedTimeF32(); // Die after a few seconds. if (dt > 1.5f) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index bfe38c14ba..3cdf485d7d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -597,6 +597,9 @@ BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { LLViewerObject::idleUpdate(agent, world, time); + static LLFastTimer::DeclareTimer ftm("Volume"); + LLFastTimer t(ftm); + if (mDead || mDrawable.isNull()) { return TRUE; @@ -618,6 +621,18 @@ BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) mVolumeImpl->doIdleUpdate(agent, world, time); } + const S32 MAX_ACTIVE_OBJECT_QUIET_FRAMES = 40; + + if (mDrawable->isActive()) + { + if (mDrawable->isRoot() && + mDrawable->mQuietCount++ > MAX_ACTIVE_OBJECT_QUIET_FRAMES && + (!mDrawable->getParent() || !mDrawable->getParent()->isActive())) + { + mDrawable->makeStatic(); + } + } + return TRUE; } @@ -1035,7 +1050,7 @@ BOOL LLVOVolume::calcLOD() S32 cur_detail = 0; F32 radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length(); - F32 distance = llmin(mDrawable->mDistanceWRTCamera, MAX_LOD_DISTANCE); + F32 distance = mDrawable->mDistanceWRTCamera; //llmin(mDrawable->mDistanceWRTCamera, MAX_LOD_DISTANCE); distance *= sDistanceFactor; F32 rampDist = LLVOVolume::sLODFactor * 2; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 118d7f8d08..d7e5b464a6 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -657,6 +657,9 @@ void LLWorld::updateParticles() void LLWorld::updateClouds(const F32 dt) { + static LLFastTimer::DeclareTimer ftm("World Clouds"); + LLFastTimer t(ftm); + if (gSavedSettings.getBOOL("FreezeTime") || !gSavedSettings.getBOOL("SkyUseClassicClouds")) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4f4fc83819..d5f87b73fe 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -116,7 +116,6 @@ const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f; const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f; const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f; const F32 BACKLIGHT_NIGHT_MAGNITUDE_OBJECT = 0.08f; -const S32 MAX_ACTIVE_OBJECT_QUIET_FRAMES = 40; const S32 MAX_OFFSCREEN_GEOMETRY_CHANGES_PER_FRAME = 10; const U32 REFLECTION_MAP_RES = 128; @@ -1411,38 +1410,26 @@ void LLPipeline::updateMove() assertInitialized(); - for (LLDrawable::drawable_set_t::iterator iter = mRetexturedList.begin(); - iter != mRetexturedList.end(); ++iter) { - LLDrawable* drawablep = *iter; - if (drawablep && !drawablep->isDead()) - { - drawablep->updateTexture(); - } - } - mRetexturedList.clear(); + static LLFastTimer::DeclareTimer ftm("Retexture"); + LLFastTimer t(ftm); - updateMovedList(mMovedList); - - for (LLDrawable::drawable_set_t::iterator iter = mActiveQ.begin(); - iter != mActiveQ.end(); ) - { - LLDrawable::drawable_set_t::iterator curiter = iter++; - LLDrawable* drawablep = *curiter; - if (drawablep && !drawablep->isDead()) + for (LLDrawable::drawable_set_t::iterator iter = mRetexturedList.begin(); + iter != mRetexturedList.end(); ++iter) { - if (drawablep->isRoot() && - drawablep->mQuietCount++ > MAX_ACTIVE_OBJECT_QUIET_FRAMES && - (!drawablep->getParent() || !drawablep->getParent()->isActive())) + LLDrawable* drawablep = *iter; + if (drawablep && !drawablep->isDead()) { - drawablep->makeStatic(); // removes drawable and its children from mActiveQ - iter = mActiveQ.upper_bound(drawablep); // next valid entry + drawablep->updateTexture(); } } - else - { - mActiveQ.erase(curiter); - } + mRetexturedList.clear(); + } + + { + static LLFastTimer::DeclareTimer ftm("Moved List"); + LLFastTimer t(ftm); + updateMovedList(mMovedList); } //balance octrees @@ -3058,12 +3045,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) } } - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PICKING)) - { - LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderForSelect"); - gObjectList.renderObjectsForSelect(camera, gViewerWindow->getWindowRectScaled()); - } - else { LLFastTimer t(FTM_POOLS); @@ -4797,10 +4778,6 @@ void LLPipeline::findReferences(LLDrawable *drawablep) llinfos << "In mRetexturedList" << llendl; } - if (mActiveQ.find(drawablep) != mActiveQ.end()) - { - llinfos << "In mActiveQ" << llendl; - } if (std::find(mBuildQ1.begin(), mBuildQ1.end(), drawablep) != mBuildQ1.end()) { llinfos << "In mBuildQ1" << llendl; @@ -4957,19 +4934,6 @@ void LLPipeline::setLight(LLDrawable *drawablep, BOOL is_light) } } -void LLPipeline::setActive(LLDrawable *drawablep, BOOL active) -{ - assertInitialized(); - if (active) - { - mActiveQ.insert(drawablep); - } - else - { - mActiveQ.erase(drawablep); - } -} - //static void LLPipeline::toggleRenderType(U32 type) { diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 67004a5f2d..c5285943e8 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -270,8 +270,7 @@ public: void shiftObjects(const LLVector3 &offset); void setLight(LLDrawable *drawablep, BOOL is_light); - void setActive(LLDrawable *drawablep, BOOL active); - + BOOL hasRenderBatches(const U32 type) const; LLCullResult::drawinfo_list_t::iterator beginRenderMap(U32 type); LLCullResult::drawinfo_list_t::iterator endRenderMap(U32 type); @@ -589,8 +588,6 @@ protected: LLViewerObject::vobj_list_t mCreateQ; - LLDrawable::drawable_set_t mActiveQ; - LLDrawable::drawable_set_t mRetexturedList; class HighlightItem -- cgit v1.2.3 From f5572abb5eb0c202c96e044f99e47bccfb97ef4a Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 12:49:54 +0000 Subject: Backed out changeset 6c161782dba3 --- indra/llrender/llfontgl.cpp | 30 ++++------- indra/llrender/llrender.cpp | 106 ++++++++++++++++++++++++++++++++++-- indra/llrender/llrender.h | 18 ++++++- indra/llui/lltabcontainer.cpp | 12 ++--- indra/llui/llui.cpp | 112 +++++++++++++++++++++++++-------------- indra/llui/llviewborder.cpp | 58 -------------------- indra/llui/llviewborder.h | 3 +- indra/newview/llhudrender.cpp | 12 ++--- indra/newview/llhudtext.cpp | 2 +- indra/newview/llmediactrl.cpp | 8 +-- indra/newview/llnetmap.cpp | 15 ++++++ indra/newview/llviewerwindow.cpp | 14 ++++- 12 files changed, 249 insertions(+), 141 deletions(-) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 1de1d6ded4..129f3e7999 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -151,14 +151,16 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } } - gGL.pushMatrix(); - glLoadIdentity(); - gGL.translatef(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY), sCurOrigin.mZ); + gGL.pushUIMatrix(); + + gGL.loadUIIdentity(); + + gGL.translateUI(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY), sCurOrigin.mZ); // this code snaps the text origin to a pixel grid to start with F32 pixel_offset_x = llround((F32)sCurOrigin.mX) - (sCurOrigin.mX); F32 pixel_offset_y = llround((F32)sCurOrigin.mY) - (sCurOrigin.mY); - gGL.translatef(-pixel_offset_x, -pixel_offset_y, 0.f); + gGL.translateUI(-pixel_offset_x, -pixel_offset_y, 0.f); LLFastTimer t(FTM_RENDER_FONTS); @@ -246,9 +248,6 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } - // Remember last-used texture to avoid unnecesssary bind calls. - LLImageGL *last_bound_texture = NULL; - for (i = begin_offset; i < begin_offset + length; i++) { llwchar wch = wstr[i]; @@ -261,12 +260,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } // Per-glyph bitmap texture. LLImageGL *image_gl = mFontFreetype->getFontBitmapCache()->getImageGL(fgi->mBitmapNum); - if (last_bound_texture != image_gl) - { - gGL.getTexUnit(0)->bind(image_gl); - last_bound_texture = image_gl; - } - + gGL.getTexUnit(0)->bind(image_gl); + if ((start_x + scaled_max_pixels) < (cur_x + fgi->mXBearing + fgi->mWidth)) { // Not enough room for this character. @@ -330,10 +325,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons // recursively render ellipses at end of string // we've already reserved enough room - gGL.pushMatrix(); - //glLoadIdentity(); - //gGL.translatef(sCurOrigin.mX, sCurOrigin.mY, 0.0f); - //glScalef(sScaleX, sScaleY, 1.f); + gGL.pushUIMatrix(); renderUTF8(std::string("..."), 0, cur_x / sScaleX, (F32)y, @@ -344,10 +336,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons S32_MAX, max_pixels, right_x, FALSE); - gGL.popMatrix(); + gGL.popUIMatrix(); } - gGL.popMatrix(); + gGL.popUIMatrix(); return chars_drawn; } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index f97d81126e..cde60b7e25 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -49,6 +49,9 @@ F64 gGLLastProjection[16]; F64 gGLProjection[16]; S32 gGLViewport[4]; +U32 LLRender::sUICalls = 0; +U32 LLRender::sUIVerts = 0; + static const U32 LL_NUM_TEXTURE_LAYERS = 16; static GLenum sGLTextureType[] = @@ -255,10 +258,9 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind) return false ; } - gGL.flush(); - if ((mCurrTexture != texture->getTexName()) || forceBind) { + gGL.flush(); activate(); enable(texture->getTarget()); mCurrTexture = texture->getTexName(); @@ -445,6 +447,8 @@ void LLTexUnit::setTextureBlendType(eTextureBlendType type) return; } + gGL.flush(); + activate(); mCurrBlendType = type; S32 scale_amount = 1; @@ -756,6 +760,7 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; + mCurrSceneBlendType = BT_ALPHA; } LLRender::~LLRender() @@ -818,6 +823,80 @@ void LLRender::popMatrix() glPopMatrix(); } +void LLRender::translateUI(F32 x, F32 y, F32 z) +{ + if (mUIOffset.empty()) + { + llerrs << "Need to push a UI translation frame before offsetting" << llendl; + } + + mUIOffset.front().mV[0] += x; + mUIOffset.front().mV[1] += y; + mUIOffset.front().mV[2] += z; +} + +void LLRender::scaleUI(F32 x, F32 y, F32 z) +{ + if (mUIScale.empty()) + { + llerrs << "Need to push a UI transformation frame before scaling." << llendl; + } + + mUIScale.front().scaleVec(LLVector3(x,y,z)); +} + +void LLRender::pushUIMatrix() +{ + mUIOffset.push_front(mUIOffset.front()); + if (mUIScale.empty()) + { + mUIScale.push_front(LLVector3(1,1,1)); + } + else + { + mUIScale.push_front(mUIScale.front()); + } +} + +void LLRender::popUIMatrix() +{ + if (mUIOffset.empty()) + { + llerrs << "UI offset stack blown." << llendl; + } + mUIOffset.pop_front(); + mUIScale.pop_front(); +} + +LLVector3 LLRender::getUITranslation() +{ + if (mUIOffset.empty()) + { + llerrs << "UI offset stack empty." << llendl; + } + return mUIOffset.front(); +} + +LLVector3 LLRender::getUIScale() +{ + if (mUIScale.empty()) + { + llerrs << "UI scale stack empty." << llendl; + } + return mUIScale.front(); +} + + +void LLRender::loadUIIdentity() +{ + if (mUIOffset.empty()) + { + llerrs << "Need to push UI translation frame before clearing offset." << llendl; + } + mUIOffset.front().setVec(0,0,0); + mUIScale.front().setVec(1,1,1); +} + void LLRender::setColorMask(bool writeColor, bool writeAlpha) { setColorMask(writeColor, writeColor, writeColor, writeAlpha); @@ -840,6 +919,11 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB void LLRender::setSceneBlendType(eBlendType type) { + if (mCurrSceneBlendType == type) + { + return; + } + flush(); switch (type) { @@ -868,6 +952,7 @@ void LLRender::setSceneBlendType(eBlendType type) llerrs << "Unknown Scene Blend Type: " << type << llendl; break; } + mCurrSceneBlendType = type; } void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) @@ -1009,6 +1094,12 @@ void LLRender::flush() } #endif + if (!mUIOffset.empty()) + { + sUICalls++; + sUIVerts += mCount; + } + mBuffer->setBuffer(immediate_mask); mBuffer->drawArrays(mMode, 0, mCount); @@ -1028,7 +1119,16 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) return; } - mVerticesp[mCount] = LLVector3(x,y,z); + if (mUIOffset.empty()) + { + mVerticesp[mCount] = LLVector3(x,y,z); + } + else + { + LLVector3 vert = (LLVector3(x,y,z)+mUIOffset.front()).scaledVec(mUIScale.front()); + mVerticesp[mCount] = vert; + } + mCount++; if (mCount < 4096) { diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 0121a190ee..6e38fac67b 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -286,6 +286,14 @@ public: void pushMatrix(); void popMatrix(); + void translateUI(F32 x, F32 y, F32 z); + void scaleUI(F32 x, F32 y, F32 z); + void pushUIMatrix(); + void popUIMatrix(); + void loadUIIdentity(); + LLVector3 getUITranslation(); + LLVector3 getUIScale(); + void flush(); void begin(const GLuint& mode); @@ -333,7 +341,9 @@ public: }; public: - + static U32 sUICalls; + static U32 sUIVerts; + private: bool mDirty; U32 mCount; @@ -350,7 +360,13 @@ private: std::vector<LLTexUnit*> mTexUnits; LLTexUnit* mDummyTexUnit; + U32 mCurrSceneBlendType; + F32 mMaxAnisotropy; + + std::list<LLVector3> mUIOffset; + std::list<LLVector3> mUIScale; + }; extern F64 gGLModelView[16]; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 6be76605fd..f11bc2173c 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -402,15 +402,15 @@ void LLTabContainer::draw() if( mIsVertical && has_scroll_arrows ) { // Redraw the arrows so that they appears on top. - gGL.pushMatrix(); - gGL.translatef((F32)mPrevArrowBtn->getRect().mLeft, (F32)mPrevArrowBtn->getRect().mBottom, 0.f); + gGL.pushUIMatrix(); + gGL.translateUI((F32)mPrevArrowBtn->getRect().mLeft, (F32)mPrevArrowBtn->getRect().mBottom, 0.f); mPrevArrowBtn->draw(); - gGL.popMatrix(); + gGL.popUIMatrix(); - gGL.pushMatrix(); - gGL.translatef((F32)mNextArrowBtn->getRect().mLeft, (F32)mNextArrowBtn->getRect().mBottom, 0.f); + gGL.pushUIMatrix(); + gGL.translateUI((F32)mNextArrowBtn->getRect().mLeft, (F32)mNextArrowBtn->getRect().mBottom, 0.f); mNextArrowBtn->draw(); - gGL.popMatrix(); + gGL.popUIMatrix(); } } diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index d0ed3b6fca..0e2e8bf8ed 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -39,6 +39,7 @@ // Linden library includes #include "v2math.h" +#include "m3math.h" #include "v4color.h" #include "llrender.h" #include "llrect.h" @@ -180,19 +181,19 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, const LL void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixel_offset, BOOL filled) { - gGL.pushMatrix(); + gGL.pushUIMatrix(); left += LLFontGL::sCurOrigin.mX; right += LLFontGL::sCurOrigin.mX; bottom += LLFontGL::sCurOrigin.mY; top += LLFontGL::sCurOrigin.mY; - glLoadIdentity(); + gGL.loadUIIdentity(); gl_rect_2d(llfloor((F32)left * LLUI::sGLScaleFactor.mV[VX]) - pixel_offset, llfloor((F32)top * LLUI::sGLScaleFactor.mV[VY]) + pixel_offset, llfloor((F32)right * LLUI::sGLScaleFactor.mV[VX]) + pixel_offset, llfloor((F32)bottom * LLUI::sGLScaleFactor.mV[VY]) - pixel_offset, filled); - gGL.popMatrix(); + gGL.popUIMatrix(); } @@ -508,9 +509,9 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); } - gGL.pushMatrix(); + gGL.pushUIMatrix(); { - gGL.translatef((F32)x, (F32)y, 0.f); + gGL.translateUI((F32)x, (F32)y, 0.f); gGL.getTexUnit(0)->bind(image); @@ -637,7 +638,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex } gGL.end(); } - gGL.popMatrix(); + gGL.popUIMatrix(); if (solid_color) { @@ -660,39 +661,72 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre LLGLSUIDefault gls_ui; - gGL.pushMatrix(); + + gGL.getTexUnit(0)->bind(image); + + gGL.color4fv(color.mV); + + if (degrees == 0.f) { - gGL.translatef((F32)x, (F32)y, 0.f); - if( degrees ) + gGL.pushUIMatrix(); + gGL.translateUI((F32)x, (F32)y, 0.f); + + gGL.begin(LLRender::QUADS); { - F32 offset_x = F32(width/2); - F32 offset_y = F32(height/2); - gGL.translatef( offset_x, offset_y, 0.f); - glRotatef( degrees, 0.f, 0.f, 1.f ); - gGL.translatef( -offset_x, -offset_y, 0.f ); + gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); + gGL.vertex2i(width, height ); + + gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); + gGL.vertex2i(0, height ); + + gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); + gGL.vertex2i(0, 0); + + gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); + gGL.vertex2i(width, 0); } + gGL.end(); + gGL.popUIMatrix(); + } + else + { + gGL.pushUIMatrix(); + gGL.translateUI((F32)x, (F32)y, 0.f); + + F32 offset_x = F32(width/2); + F32 offset_y = F32(height/2); + + gGL.translateUI(offset_x, offset_y, 0.f); + LLMatrix3 quat(0.f, 0.f, degrees*DEG_TO_RAD); + gGL.getTexUnit(0)->bind(image); gGL.color4fv(color.mV); gGL.begin(LLRender::QUADS); { + LLVector3 v; + + v = LLVector3(offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i(width, height ); + gGL.vertex2i(v.mV[0], v.mV[1] ); + v = LLVector3(-offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i(0, height ); + gGL.vertex2i(v.mV[0], v.mV[1] ); + v = LLVector3(-offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i(0, 0); + gGL.vertex2i(v.mV[0], v.mV[1] ); + v = LLVector3(offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i(width, 0); + gGL.vertex2i(v.mV[0], v.mV[1] ); } gGL.end(); + gGL.popUIMatrix(); } - gGL.popMatrix(); } @@ -747,9 +781,9 @@ void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F end_angle += F_TWO_PI; } - gGL.pushMatrix(); + gGL.pushUIMatrix(); { - gGL.translatef(center_x, center_y, 0.f); + gGL.translateUI(center_x, center_y, 0.f); // Inexact, but reasonably fast. F32 delta = (end_angle - start_angle) / steps; @@ -780,15 +814,15 @@ void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F } gGL.end(); } - gGL.popMatrix(); + gGL.popUIMatrix(); } void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled) { - gGL.pushMatrix(); + gGL.pushUIMatrix(); { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.translatef(center_x, center_y, 0.f); + gGL.translateUI(center_x, center_y, 0.f); // Inexact, but reasonably fast. F32 delta = F_TWO_PI / steps; @@ -819,7 +853,7 @@ void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled } gGL.end(); } - gGL.popMatrix(); + gGL.popUIMatrix(); } // Renders a ring with sides (tube shape) @@ -846,9 +880,9 @@ void gl_deep_circle( F32 radius, F32 depth, S32 steps ) void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor4& side_color, S32 steps, BOOL render_center ) { - gGL.pushMatrix(); + gGL.pushUIMatrix(); { - gGL.translatef(0.f, 0.f, -width / 2); + gGL.translateUI(0.f, 0.f, -width / 2); if( render_center ) { gGL.color4fv(center_color.mV); @@ -857,11 +891,11 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor else { gl_washer_2d(radius, radius - width, steps, side_color, side_color); - gGL.translatef(0.f, 0.f, width); + gGL.translateUI(0.f, 0.f, width); gl_washer_2d(radius - width, radius, steps, side_color, side_color); } } - gGL.popMatrix(); + gGL.popUIMatrix(); } // Draw gray and white checkerboard with black border @@ -1050,9 +1084,9 @@ void gl_segmented_rect_2d_tex(const S32 left, S32 width = llabs(right - left); S32 height = llabs(top - bottom); - gGL.pushMatrix(); + gGL.pushUIMatrix(); - gGL.translatef((F32)left, (F32)bottom, 0.f); + gGL.translateUI((F32)left, (F32)bottom, 0.f); LLVector2 border_uv_scale((F32)border_size / (F32)texture_width, (F32)border_size / (F32)texture_height); if (border_uv_scale.mV[VX] > 0.5f) @@ -1193,7 +1227,7 @@ void gl_segmented_rect_2d_tex(const S32 left, } gGL.end(); - gGL.popMatrix(); + gGL.popUIMatrix(); } void gl_segmented_rect_2d_fragment_tex(const S32 left, @@ -1210,9 +1244,9 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, S32 width = llabs(right - left); S32 height = llabs(top - bottom); - gGL.pushMatrix(); + gGL.pushUIMatrix(); - gGL.translatef((F32)left, (F32)bottom, 0.f); + gGL.translateUI((F32)left, (F32)bottom, 0.f); LLVector2 border_uv_scale((F32)border_size / (F32)texture_width, (F32)border_size / (F32)texture_height); if (border_uv_scale.mV[VX] > 0.5f) @@ -1383,7 +1417,7 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, } gGL.end(); - gGL.popMatrix(); + gGL.popUIMatrix(); } void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& border_width, @@ -1591,7 +1625,7 @@ void LLUI::dirtyRect(LLRect rect) //static void LLUI::translate(F32 x, F32 y, F32 z) { - gGL.translatef(x,y,z); + gGL.translateUI(x,y,z); LLFontGL::sCurOrigin.mX += (S32) x; LLFontGL::sCurOrigin.mY += (S32) y; LLFontGL::sCurOrigin.mZ += z; @@ -1600,14 +1634,14 @@ void LLUI::translate(F32 x, F32 y, F32 z) //static void LLUI::pushMatrix() { - gGL.pushMatrix(); + gGL.pushUIMatrix(); LLFontGL::sOriginStack.push_back(LLFontGL::sCurOrigin); } //static void LLUI::popMatrix() { - gGL.popMatrix(); + gGL.popUIMatrix(); LLFontGL::sCurOrigin = *LLFontGL::sOriginStack.rbegin(); LLFontGL::sOriginStack.pop_back(); } @@ -1615,7 +1649,7 @@ void LLUI::popMatrix() //static void LLUI::loadIdentity() { - glLoadIdentity(); + gGL.loadUIIdentity(); LLFontGL::sCurOrigin.mX = 0; LLFontGL::sCurOrigin.mY = 0; LLFontGL::sCurOrigin.mZ = 0; diff --git a/indra/llui/llviewborder.cpp b/indra/llui/llviewborder.cpp index 30717f87de..bd9c43c97f 100644 --- a/indra/llui/llviewborder.cpp +++ b/indra/llui/llviewborder.cpp @@ -125,14 +125,6 @@ void LLViewBorder::draw() llassert( FALSE ); // not implemented } } - else - if( STYLE_TEXTURE == mStyle ) - { - if( mTexture ) - { - drawTextures(); - } - } LLView::draw(); } @@ -255,56 +247,6 @@ void LLViewBorder::drawTwoPixelLines() gl_line_2d(left+1, bottom+1, right-1, bottom+1); } -void LLViewBorder::drawTextures() -{ - //LLGLSUIDefault gls_ui; - - //llassert( FALSE ); // TODO: finish implementing - - //gGL.color4fv(UI_VERTEX_COLOR.mV); - - //gGL.getTexUnit(0)->bind(mTexture); - //gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP); - - //drawTextureTrapezoid( 0.f, mBorderWidth, getRect().getWidth(), 0, 0 ); - //drawTextureTrapezoid( 90.f, mBorderWidth, getRect().getHeight(), (F32)getRect().getWidth(),0 ); - //drawTextureTrapezoid( 180.f, mBorderWidth, getRect().getWidth(), (F32)getRect().getWidth(),(F32)getRect().getHeight() ); - //drawTextureTrapezoid( 270.f, mBorderWidth, getRect().getHeight(), 0, (F32)getRect().getHeight() ); -} - - -void LLViewBorder::drawTextureTrapezoid( F32 degrees, S32 width, S32 length, F32 start_x, F32 start_y ) -{ - gGL.pushMatrix(); - { - gGL.translatef(start_x, start_y, 0.f); - glRotatef( degrees, 0, 0, 1 ); - - gGL.begin(LLRender::QUADS); - { - // width, width /---------\ length-width, width // - // / \ // - // / \ // - // /---------------\ // - // 0,0 length, 0 // - - gGL.texCoord2f( 0, 0 ); - gGL.vertex2i( 0, 0 ); - - gGL.texCoord2f( (GLfloat)length, 0 ); - gGL.vertex2i( length, 0 ); - - gGL.texCoord2f( (GLfloat)(length - width), (GLfloat)width ); - gGL.vertex2i( length - width, width ); - - gGL.texCoord2f( (GLfloat)width, (GLfloat)width ); - gGL.vertex2i( width, width ); - } - gGL.end(); - } - gGL.popMatrix(); -} - BOOL LLViewBorder::getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel& bevel_style) { if (node->hasAttribute("bevel_style")) diff --git a/indra/llui/llviewborder.h b/indra/llui/llviewborder.h index 92fd569325..342e84fd93 100644 --- a/indra/llui/llviewborder.h +++ b/indra/llui/llviewborder.h @@ -99,8 +99,7 @@ private: void drawOnePixelLines(); void drawTwoPixelLines(); void drawTextures(); - void drawTextureTrapezoid( F32 degrees, S32 width, S32 length, F32 start_x, F32 start_y ); - + EBevel mBevel; EStyle mStyle; LLUIColor mHighlightLight; diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index a02dc3355b..325c9c260c 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -121,24 +121,24 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); - + gGL.pushMatrix(); LLUI::pushMatrix(); gl_state_for_2d(world_view_rect.getWidth(), world_view_rect.getHeight()); gViewerWindow->setup3DViewport(); - //gViewerWindow->setup2DRender(); - + winX -= world_view_rect.mLeft; winY -= world_view_rect.mBottom; LLUI::loadIdentity(); + glLoadIdentity(); LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f)); - //glRotatef(angle * RAD_TO_DEG, axis.mV[VX], axis.mV[VY], axis.mV[VZ]); - //glScalef(right_scale, up_scale, 1.f); F32 right_x; font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, wstr.length(), 1000, &right_x); + LLUI::popMatrix(); - + gGL.popMatrix(); + glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 8ad94b957d..8d1d27444b 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -555,7 +555,7 @@ void LLHUDText::renderText(BOOL for_select) } } /// Reset the default color to white. The renderer expects this to be the default. - glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); if (for_select) { gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index d464862eed..6fd6958d2e 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -724,14 +724,14 @@ void LLMediaCtrl::draw() LLGLSUIDefault gls_ui; LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); - gGL.pushMatrix(); + gGL.pushUIMatrix(); { if (mIgnoreUIScale) { - glLoadIdentity(); + gGL.loadUIIdentity(); // font system stores true screen origin, need to scale this by UI scale factor // to get render origin for this view (with unit scale) - gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), + gGL.translateUI(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]), LLFontGL::sCurOrigin.mZ); } @@ -825,7 +825,7 @@ void LLMediaCtrl::draw() gGL.end(); gGL.setSceneBlendType(LLRender::BT_ALPHA); } - gGL.popMatrix(); + gGL.popUIMatrix(); } else diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 234fe13217..05623198ab 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -153,6 +153,18 @@ void LLNetMap::draw() // Prepare a scissor region F32 rotation = 0; + gGL.pushMatrix(); + gGL.pushUIMatrix(); + + LLVector3 offset = gGL.getUITranslation(); + LLVector3 scale = gGL.getUIScale(); + + glLoadIdentity(); + gGL.loadUIIdentity(); + + glScalef(scale.mV[0], scale.mV[1], scale.mV[2]); + gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]); + { LLLocalClipRect clip(getLocalRect()); { @@ -435,6 +447,9 @@ void LLNetMap::draw() } } + gGL.popMatrix(); + gGL.popUIMatrix(); + LLUICtrl::draw(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index de4317b2de..f6227c2dd6 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -476,6 +476,10 @@ public: } ypos += y_inc; + addText(xpos, ypos, llformat("UI Verts/Calls: %d/%d", LLRender::sUIVerts, LLRender::sUICalls)); + LLRender::sUICalls = LLRender::sUIVerts = 0; + ypos += y_inc; + addText(xpos,ypos, llformat("%d/%d Nodes visible", gPipeline.mNumVisibleNodes, LLSpatialGroup::sNodeCount)); ypos += y_inc; @@ -1843,12 +1847,15 @@ void LLViewerWindow::drawDebugText() { gGL.color4f(1,1,1,1); gGL.pushMatrix(); + gGL.pushUIMatrix(); { // scale view by UI global scale factor and aspect ratio correction factor - glScalef(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); + gGL.scaleUI(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); mDebugText->draw(); } + gGL.popUIMatrix(); gGL.popMatrix(); + gGL.flush(); } @@ -1896,9 +1903,11 @@ void LLViewerWindow::draw() // No translation needed, this view is glued to 0,0 gGL.pushMatrix(); + LLUI::pushMatrix(); { + // scale view by UI global scale factor and aspect ratio correction factor - glScalef(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); + gGL.scaleUI(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); LLVector2 old_scale_factor = LLUI::sGLScaleFactor; // apply camera zoom transform (for high res screenshots) @@ -1964,6 +1973,7 @@ void LLViewerWindow::draw() LLUI::sGLScaleFactor = old_scale_factor; } + LLUI::popMatrix(); gGL.popMatrix(); #if LL_DEBUG -- cgit v1.2.3 From 30b2d01a3698fa18876db3638c7393809bee8688 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 12:50:28 +0000 Subject: Backed out changeset f196197a816a --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llviewercontrol.cpp | 1 + indra/newview/llviewerwindow.cpp | 13 +++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c7300fcee2..8a447502b0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7384,7 +7384,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>RenderUseFarClip</key> <map> diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 64eabe65cf..827d34138f 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -514,6 +514,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 77e4663433..3e1306ae3c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1362,7 +1362,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.getBOOL("DisableVerticalSync"), !gNoRender, ignore_pixel_depth, - gSavedSettings.getU32("RenderFSAASamples")); + 0); //gSavedSettings.getU32("RenderFSAASamples")); if (!LLAppViewer::instance()->restoreErrorTrap()) { @@ -4713,8 +4713,9 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, return TRUE; } - U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); - U32 old_fsaa = mWindow->getFSAASamples(); + //U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); + //U32 old_fsaa = mWindow->getFSAASamples(); + // going from windowed to windowed if (!old_fullscreen && !fullscreen) { @@ -4724,7 +4725,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, mWindow->setSize(size); } - if (fsaa == old_fsaa) + //if (fsaa == old_fsaa) { return TRUE; } @@ -4753,13 +4754,13 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, gSavedSettings.setS32("WindowY", old_pos.mY); } - mWindow->setFSAASamples(fsaa); + //mWindow->setFSAASamples(fsaa); result_first_try = mWindow->switchContext(fullscreen, size, disable_vsync); if (!result_first_try) { // try to switch back - mWindow->setFSAASamples(old_fsaa); + //mWindow->setFSAASamples(old_fsaa); result_second_try = mWindow->switchContext(old_fullscreen, old_size, disable_vsync); if (!result_second_try) -- cgit v1.2.3 From 420df10263103f64f366e9a0d2b704f83448a180 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 12:51:11 +0000 Subject: Backed out changeset ac249fda538f --- indra/llui/llui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 852a19660a..44a57a0989 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -710,19 +710,19 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre v = LLVector3(offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2i((GLint)v.mV[0], (GLint)v.mV[1] ); v = LLVector3(-offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2i((GLint)v.mV[0], (GLint)v.mV[1] ); v = LLVector3(-offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2i((GLint)v.mV[0], (GLint)v.mV[1] ); v = LLVector3(offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i(v.mV[0], v.mV[1] ); + gGL.vertex2i((GLint)v.mV[0], (GLint)v.mV[1] ); } gGL.end(); gGL.popUIMatrix(); -- cgit v1.2.3 From e0f95c5929aee8fc28fd360c796c5787b0f95ef5 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 12:52:11 +0000 Subject: restore casting fix. --- indra/llui/llui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 44a57a0989..c4a529f082 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -710,19 +710,19 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre v = LLVector3(offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i((GLint)v.mV[0], (GLint)v.mV[1] ); + gGL.vertex2f((GLint)v.mV[0], (GLint)v.mV[1] ); v = LLVector3(-offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i((GLint)v.mV[0], (GLint)v.mV[1] ); + gGL.vertex2f((GLint)v.mV[0], (GLint)v.mV[1] ); v = LLVector3(-offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i((GLint)v.mV[0], (GLint)v.mV[1] ); + gGL.vertex2f((GLint)v.mV[0], (GLint)v.mV[1] ); v = LLVector3(offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i((GLint)v.mV[0], (GLint)v.mV[1] ); + gGL.vertex2f((GLint)v.mV[0], (GLint)v.mV[1] ); } gGL.end(); gGL.popUIMatrix(); -- cgit v1.2.3 From 257347b8f8b3a11c79128a190e923f15fcfebccb Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 12:54:24 +0000 Subject: restore blend factor init fix. --- indra/llrender/llrender.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index fb153a6e3b..0a1053abc2 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -764,6 +764,9 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; mCurrSceneBlendType = BT_ALPHA; + + mCurrBlendSFactor = BF_ONE; + mCurrBlendDFactor = BF_ZERO; } LLRender::~LLRender() -- cgit v1.2.3 From b55c9b9db6ef1e548ebb77d5e24d2ddc6eb5324e Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 13:05:22 +0000 Subject: sigh, fix another backout-backout problem. --- indra/llrender/llrender.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 6e38fac67b..ef18b556e6 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -364,6 +364,9 @@ private: F32 mMaxAnisotropy; + U32 mCurrBlendSFactor; + U32 mCurrBlendDFactor; + std::list<LLVector3> mUIOffset; std::list<LLVector3> mUIScale; -- cgit v1.2.3 From 848f0ad183180ef5860038b1b709a3fdaa31aa3e Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 13:55:41 +0000 Subject: a better fix for the blend-factor init problem. I think. --- indra/llrender/llrender.cpp | 10 +++++++--- indra/llrender/llrender.h | 8 +++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 0a1053abc2..e701b96a1e 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -93,7 +93,9 @@ static GLenum sGLBlendFactor[] = GL_DST_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA, - GL_ONE_MINUS_SRC_ALPHA + GL_ONE_MINUS_SRC_ALPHA, + + GL_ZERO // 'BF_UNDEF' }; LLTexUnit::LLTexUnit(S32 index) @@ -765,8 +767,8 @@ LLRender::LLRender() mCurrAlphaFuncVal = 0.01f; mCurrSceneBlendType = BT_ALPHA; - mCurrBlendSFactor = BF_ONE; - mCurrBlendDFactor = BF_ZERO; + mCurrBlendSFactor = BF_UNDEF; + mCurrBlendDFactor = BF_UNDEF; } LLRender::~LLRender() @@ -979,6 +981,8 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor) { + llassert(sfactor < BF_UNDEF); + llassert(dfactor < BF_UNDEF); if (mCurrBlendSFactor != sfactor || mCurrBlendDFactor != dfactor) { mCurrBlendSFactor = sfactor; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index ef18b556e6..e9ffba9efe 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -270,7 +270,9 @@ public: BF_DEST_ALPHA, BF_SOURCE_ALPHA, BF_ONE_MINUS_DEST_ALPHA, - BF_ONE_MINUS_SOURCE_ALPHA + BF_ONE_MINUS_SOURCE_ALPHA, + + BF_UNDEF } eBlendFactor; LLRender(); @@ -364,8 +366,8 @@ private: F32 mMaxAnisotropy; - U32 mCurrBlendSFactor; - U32 mCurrBlendDFactor; + eBlendFactor mCurrBlendSFactor; + eBlendFactor mCurrBlendDFactor; std::list<LLVector3> mUIOffset; std::list<LLVector3> mUIScale; -- cgit v1.2.3 From 2aab1d33e125502913075d38d126936d7c2a4a2e Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 13 Feb 2010 14:45:34 +0000 Subject: gah, more blending fixing. --- indra/llrender/llrender.cpp | 8 -------- indra/llrender/llrender.h | 2 -- 2 files changed, 10 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index e701b96a1e..57e7dbe77d 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -765,7 +765,6 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; - mCurrSceneBlendType = BT_ALPHA; mCurrBlendSFactor = BF_UNDEF; mCurrBlendDFactor = BF_UNDEF; @@ -927,12 +926,6 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB void LLRender::setSceneBlendType(eBlendType type) { - if (mCurrSceneBlendType == type) - { - return; - } - - flush(); switch (type) { case BT_ALPHA: @@ -960,7 +953,6 @@ void LLRender::setSceneBlendType(eBlendType type) llerrs << "Unknown Scene Blend Type: " << type << llendl; break; } - mCurrSceneBlendType = type; } void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index e9ffba9efe..df24c985bd 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -362,8 +362,6 @@ private: std::vector<LLTexUnit*> mTexUnits; LLTexUnit* mDummyTexUnit; - U32 mCurrSceneBlendType; - F32 mMaxAnisotropy; eBlendFactor mCurrBlendSFactor; -- cgit v1.2.3 From de88d6ced487fd55fa6f6bb860849979f031a363 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 17 Feb 2010 11:29:16 -0600 Subject: Switched program database on windows to edit and continue for non-release builds. Adding a debug watch to LLCurlRequest to avoid invalidating iterator on processing posts. Mesh bulk uploading rewrite work in progress. 404 icons for mesh assets. --- indra/cmake/00-Common.cmake | 6 +++--- indra/llmessage/llcurl.cpp | 9 +++++++++ indra/llmessage/llcurl.h | 3 ++- indra/newview/llvovolume.cpp | 15 ++++++++++++--- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 49a1ec7f2c..2219311fc7 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -35,13 +35,13 @@ if (WINDOWS) # Don't build DLLs. set(BUILD_SHARED_LIBS OFF) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP" + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /ZI /MDd /MP" CACHE STRING "C++ compiler debug options" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP" + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /ZI /MD /MP" CACHE STRING "C++ compiler release-with-debug options" FORCE) set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP" + "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /MD /MP" CACHE STRING "C++ compiler release options" FORCE) set(CMAKE_CXX_STANDARD_LIBRARIES "") diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index b93b94cd25..5212ba1eca 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -711,6 +711,7 @@ LLCurlRequest::LLCurlRequest() : mActiveRequestCount(0) { mThreadID = LLThread::currentID(); + mProcessing = FALSE; } LLCurlRequest::~LLCurlRequest() @@ -745,6 +746,11 @@ LLCurl::Easy* LLCurlRequest::allocEasy() bool LLCurlRequest::addEasy(LLCurl::Easy* easy) { llassert_always(mActiveMulti); + + if (mProcessing) + { + llerrs << "Posting to a LLCurlRequest instance from within a responder is not allowed (causes DNS timeouts)." << llendl; + } bool res = mActiveMulti->addEasy(easy); return res; } @@ -835,6 +841,8 @@ S32 LLCurlRequest::process() { llassert_always(mThreadID == LLThread::currentID()); S32 res = 0; + + mProcessing = TRUE; for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ) { @@ -848,6 +856,7 @@ S32 LLCurlRequest::process() delete multi; } } + mProcessing = FALSE; return res; } diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 4302c19113..5367643289 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -215,7 +215,7 @@ public: bool getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, LLCurl::ResponderPtr responder); bool post(const std::string& url, const headers_t& headers, const LLSD& data, LLCurl::ResponderPtr responder); bool post(const std::string& url, const headers_t& headers, const std::string& data, LLCurl::ResponderPtr responder); - + S32 process(); S32 getQueued(); @@ -229,6 +229,7 @@ private: curlmulti_set_t mMultiSet; LLCurl::Multi* mActiveMulti; S32 mActiveRequestCount; + BOOL mProcessing; U32 mThreadID; // debug }; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index fb28b78daf..cb67890515 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -920,6 +920,8 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool S32 lod = mLOD; + BOOL is404 = FALSE; + if (isSculpted()) { // if it's a mesh @@ -932,6 +934,11 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE); lod = gMeshRepo.getActualMeshLOD(volume_params, lod); + if (lod == -1) + { + is404 = TRUE; + lod = 0; + } } } @@ -962,7 +969,10 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool } } - + if (is404) + { + setIcon(LLViewerTextureManager::getFetchedTextureFromFile("icons/Inv_Mesh.png", TRUE, LLViewerTexture::BOOST_UI)); + } if ((LLPrimitive::setVolume(volume_params, lod, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged) { @@ -995,10 +1005,9 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms, const S32 detail, bool } else // otherwise is sculptie { - if (mSculptTexture.notNull()) { - sculpt(); + sculpt(); } } } -- cgit v1.2.3 From 74621ff8a8a141d50a3c92430afbe53a9e00edb5 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 17 Feb 2010 15:50:50 -0600 Subject: Post-review cleanup. --- indra/cmake/00-Common.cmake | 2 +- indra/llmessage/llcurl.cpp | 1 - indra/llmessage/llcurl.h | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 2219311fc7..113e21a715 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -41,7 +41,7 @@ if (WINDOWS) "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /ZI /MD /MP" CACHE STRING "C++ compiler release-with-debug options" FORCE) set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /MD /MP" + "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP" CACHE STRING "C++ compiler release options" FORCE) set(CMAKE_CXX_STANDARD_LIBRARIES "") diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 5212ba1eca..0c919011ac 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -55,7 +55,6 @@ #include "llstl.h" #include "llsdserialize.h" #include "llthread.h" -#include "llvfile.h" ////////////////////////////////////////////////////////////////////////////// /* diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 5367643289..6ec0a5d8a7 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -44,7 +44,6 @@ #include <boost/intrusive_ptr.hpp> #include <curl/curl.h> // TODO: remove dependency -#include "llassettype.h" #include "llbuffer.h" #include "lliopipe.h" #include "llsd.h" -- cgit v1.2.3 From ee8036712847315141c78d37646d629796442d09 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 17 Feb 2010 18:08:00 -0600 Subject: 16-bit limit awareness when consolidating models. --- indra/llmath/llvolume.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 7c98536e72..33a00b80ca 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5619,6 +5619,10 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat, LLMatrix { U16 offset = mVertices.size(); + if (face.mVertices.size() + mVertices.size() > 65536) + { + llerrs << "Cannot append face -- 16-bit overflow will occur." << llendl; + } for (U32 i = 0; i < face.mVertices.size(); ++i) { -- cgit v1.2.3 From e09822153e135e8fc89f6fdb3338bb9e8e5b6132 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 18 Feb 2010 15:52:49 +0000 Subject: EXT-5389 Unreadable resident names with glow. An alternative fix just for render-pipeline. This is here instead of the trunk because it's cosmetically less good, and codewise a little weirder, and slightly (unmeasurably?) less performant. But its advantage over the trunk fix is, it's still Z-buffered when FBOs are turned on. Which we really care about on render-pipeline. --- indra/newview/lldrawpoolsimple.cpp | 6 +++++- indra/newview/llhudtext.cpp | 2 +- indra/newview/pipeline.cpp | 9 +++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index ca7a1b47c2..0a94e1f45a 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -71,7 +71,11 @@ void LLDrawPoolGlow::render(S32 pass) LLGLDepthTest depth(GL_TRUE, GL_FALSE); gGL.setColorMask(false, true); renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask()); - + + // Render name tags invisibly, zero-ing glow (alpha) where they exist (EXT-5389) + gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ZERO); // LLHUDText::renderText(true) might clobber this, but right now it doesn't. + LLHUDObject::renderAllForSelect(); // we slightly abuse renderForSelect() because it happens to do the right thing for our needs + gGL.setColorMask(true, false); gGL.setSceneBlendType(LLRender::BT_ALPHA); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 9ed5d13831..b49e14bc7d 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -374,7 +374,7 @@ void LLHUDText::renderText(BOOL for_select) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); S32 name = mSourceObject->mGLName; - LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name); + LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name, 0); gGL.color4ubv(coloru.mV); gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec); LLUI::popMatrix(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 559ae83182..3a37ce8fbb 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2794,9 +2794,6 @@ void render_hud_elements() LLWorld::getInstance()->renderPropertyLines(); LLViewerParcelMgr::getInstance()->render(); LLViewerParcelMgr::getInstance()->renderParcelCollision(); - - // Render name tags. - LLHUDObject::renderAll(); } else if (gForceRenderLandFence) { @@ -3200,8 +3197,10 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { // Render debugging beacons. - gObjectList.renderObjectBeacons(); + gObjectList.renderObjectBeacons(); gObjectList.resetObjectBeacons(); + // Render name tags + LLHUDObject::renderAll(); } LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderGeomEnd"); @@ -6923,6 +6922,8 @@ void LLPipeline::renderDeferredLighting() // Render debugging beacons. gObjectList.renderObjectBeacons(); gObjectList.resetObjectBeacons(); + // Render name tags + LLHUDObject::renderAll(); } } -- cgit v1.2.3 From dc7db357ac4e50f2d1e0d47fd50fd712f67dffe6 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 18 Feb 2010 16:49:45 +0000 Subject: Backed out changeset 83d7019fda75 backing-out render-pipeline-specific version of EXT-5389 fix because it just doesn't reliably work right. --- indra/newview/lldrawpoolsimple.cpp | 6 +----- indra/newview/llhudtext.cpp | 2 +- indra/newview/pipeline.cpp | 9 ++++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 0a94e1f45a..ca7a1b47c2 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -71,11 +71,7 @@ void LLDrawPoolGlow::render(S32 pass) LLGLDepthTest depth(GL_TRUE, GL_FALSE); gGL.setColorMask(false, true); renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask()); - - // Render name tags invisibly, zero-ing glow (alpha) where they exist (EXT-5389) - gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ZERO); // LLHUDText::renderText(true) might clobber this, but right now it doesn't. - LLHUDObject::renderAllForSelect(); // we slightly abuse renderForSelect() because it happens to do the right thing for our needs - + gGL.setColorMask(true, false); gGL.setSceneBlendType(LLRender::BT_ALPHA); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index b49e14bc7d..9ed5d13831 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -374,7 +374,7 @@ void LLHUDText::renderText(BOOL for_select) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); S32 name = mSourceObject->mGLName; - LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name, 0); + LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name); gGL.color4ubv(coloru.mV); gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec); LLUI::popMatrix(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3a37ce8fbb..559ae83182 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2794,6 +2794,9 @@ void render_hud_elements() LLWorld::getInstance()->renderPropertyLines(); LLViewerParcelMgr::getInstance()->render(); LLViewerParcelMgr::getInstance()->renderParcelCollision(); + + // Render name tags. + LLHUDObject::renderAll(); } else if (gForceRenderLandFence) { @@ -3197,10 +3200,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { // Render debugging beacons. - gObjectList.renderObjectBeacons(); + gObjectList.renderObjectBeacons(); gObjectList.resetObjectBeacons(); - // Render name tags - LLHUDObject::renderAll(); } LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderGeomEnd"); @@ -6922,8 +6923,6 @@ void LLPipeline::renderDeferredLighting() // Render debugging beacons. gObjectList.renderObjectBeacons(); gObjectList.resetObjectBeacons(); - // Render name tags - LLHUDObject::renderAll(); } } -- cgit v1.2.3 From 38158f0e14663ac73c7ed79723ba6e34a1253e2a Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 18 Feb 2010 23:04:16 -0600 Subject: Model preview now loads materials. --- indra/newview/llviewerjointmesh.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 7225aa1523..92029d10f6 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -561,12 +561,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) } else { - // This warning will always trigger if you've hacked the avatar to show as incomplete. - // Ignore the warning if that's the case. - if (!gSavedSettings.getBOOL("RenderUnloadedAvatar")) - { - //llwarns << "Layerset without composite" << llendl; - } gGL.getTexUnit(0)->bind(LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT)); } } -- cgit v1.2.3 From 8bafcc0491d0131a53226365f18b3ba68648a742 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 19 Feb 2010 09:45:30 +0000 Subject: EXT-5553 improve alpha mask ('fast alpha') heuristic rev'd by davep --- indra/llrender/llimagegl.cpp | 62 ++++++++++++++++++++++++++++++++++++-------- indra/llrender/llimagegl.h | 2 +- 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 36ac3ff119..4251392546 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1639,7 +1639,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() } } -void LLImageGL::analyzeAlpha(const void* data_in, S32 w, S32 h) +void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h) { if(!mNeedsAlphaAndPickMask) { @@ -1647,24 +1647,64 @@ void LLImageGL::analyzeAlpha(const void* data_in, S32 w, S32 h) } U32 length = w * h; - const GLubyte* current = ((const GLubyte*) data_in) + mAlphaOffset ; - S32 sample[16]; - memset(sample, 0, sizeof(S32)*16); - - for (U32 i = 0; i < length; i++) + U32 sample[16]; + memset(sample, 0, sizeof(U32)*16); + + // generate histogram of quantized alpha. + // also add-in the histogram of a 2x2 box-sampled version. The idea is + // this will mid-skew the data (and thus increase the chances of not + // being used as a mask) from high-frequency alpha maps which + // suffer the worst from aliasing when used as alpha masks. + if (w >= 2 && h >= 2) + { + llassert(w%2 == 0); + llassert(h%2 == 0); + const GLubyte* rowstart = ((const GLubyte*) data_in) + mAlphaOffset; + for (U32 y = 0; y < h; y+=2) + { + const GLubyte* current = rowstart; + for (U32 x = 0; x < w; x+=2) + { + U32 s1 = current[0]; + U32 s2 = current[w * mAlphaStride]; + current += mAlphaStride; + U32 s3 = current[0]; + U32 s4 = current[w * mAlphaStride]; + current += mAlphaStride; + + ++sample[s1/16]; + ++sample[s2/16]; + ++sample[s3/16]; + ++sample[s4/16]; + + sample[(s1+s2+s3+s4)/(16 * 4)] += 4; + } + + rowstart += 2 * w * mAlphaStride; + } + length += length; + } + else { - ++sample[*current/16]; - current += mAlphaStride ; + const GLubyte* current = ((const GLubyte*) data_in) + mAlphaOffset; + for (U32 i = 0; i < length; i++) + { + ++sample[*current/16]; + current += mAlphaStride; + } } + + // if more than 1/16th of alpha samples are mid-range, this + // shouldn't be treated as a 1-bit mask - U32 total = 0; + U32 midrangetotal = 0; for (U32 i = 4; i < 11; i++) { - total += sample[i]; + midrangetotal += sample[i]; } - if (total > length/16) + if (midrangetotal > length/16) { mIsMask = FALSE; } diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index f0870c3fc4..1b303307f6 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -91,7 +91,7 @@ public: protected: virtual ~LLImageGL(); - void analyzeAlpha(const void* data_in, S32 w, S32 h); + void analyzeAlpha(const void* data_in, U32 w, U32 h); void calcAlphaChannelOffsetAndStride(); public: -- cgit v1.2.3 From afd30a8bb02863cb9325a8863e8069f88355db57 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 19 Feb 2010 13:56:44 +0000 Subject: fix warning introduced from trunk merge. --- indra/llrender/llfontgl.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 32ebbd1e3b..867d14c855 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -247,10 +247,6 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } } - - // Remember last-used texture to avoid unnecesssary bind calls. - LLImageGL *last_bound_texture = NULL; - const LLFontGlyphInfo* next_glyph = NULL; for (i = begin_offset; i < begin_offset + length; i++) -- cgit v1.2.3 From 237f1a1ba362aa2dfd9bb386e431713bdfcad2dc Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 19 Feb 2010 12:41:08 -0600 Subject: Consolidate now preserves materials. --- indra/llmath/v4color.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index d6fbdec61e..6b63b976b0 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -114,6 +114,7 @@ class LLColor4 const LLColor4& operator=(const LLColor3 &a); // Assigns vec3 to vec4 and returns vec4 + bool operator<(const LLColor4& rhs) const; friend std::ostream& operator<<(std::ostream& s, const LLColor4 &a); // Print a friend LLColor4 operator+(const LLColor4 &a, const LLColor4 &b); // Return vector a + b friend LLColor4 operator-(const LLColor4 &a, const LLColor4 &b); // Return vector a minus b @@ -595,6 +596,23 @@ inline LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u) a.mV[VW] + (b.mV[VW] - a.mV[VW]) * u); } +inline bool LLColor4::operator<(const LLColor4& rhs) const +{ + if (mV[0] != rhs.mV[0]) + { + return mV[0] < rhs.mV[0]; + } + if (mV[1] != rhs.mV[1]) + { + return mV[1] < rhs.mV[1]; + } + if (mV[2] != rhs.mV[2]) + { + return mV[2] < rhs.mV[2]; + } + + return mV[3] < rhs.mV[3]; +} void LLColor4::clamp() { -- cgit v1.2.3 From ca12b3d971db20559cb242417dc6c3f64d63c1d6 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sat, 20 Feb 2010 17:50:18 +0000 Subject: raise RenderDeferredSSAOMaxScale from 60 to 200. This is fine. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7dc4308893..5d5a6ca58c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6061,7 +6061,7 @@ <key>Type</key> <string>U32</string> <key>Value</key> - <integer>60</integer> + <integer>200</integer> </map> <key>RenderSSAOFactor</key> <map> -- cgit v1.2.3 From 066f9de07ecfcf142103f646695e5be63a22a667 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 23 Feb 2010 16:57:06 -0600 Subject: Fix for normals getting squished on consolidation. Replaced some magic numbers with constants. Switched up throttling of mesh upload HTTP posts to prevent overloading one capability at a time. Added some feedback on upload progress via debug text. Made debug text move with side panel (keep debug text from rendering on top of side panel). --- indra/llmath/llvolume.cpp | 1 + indra/newview/llviewerwindow.cpp | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 33a00b80ca..704308f20f 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5630,6 +5630,7 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat, LLMatrix v.mPosition = v.mPosition*mat; v.mNormal = v.mNormal * norm_mat; + v.mNormal.normalize(); mVertices.push_back(v); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fd59ea41b2..5c039c9f94 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -31,7 +31,6 @@ */ #include "llviewerprecompiledheaders.h" - #include "llviewerwindow.h" #if LL_WINDOWS @@ -45,6 +44,7 @@ #include <algorithm> #include "llfloaterreg.h" +#include "llmeshrepository.h" #include "llpanellogin.h" #include "llviewerkeyboard.h" #include "llviewermenu.h" @@ -318,7 +318,7 @@ public: mTextColor = LLColor4( 0.86f, 0.86f, 0.86f, 1.f ); // Draw stuff growing up from right lower corner of screen - U32 xpos = mWindow->getWindowWidthScaled() - 350; + U32 xpos = mWindow->getWorldViewWidthScaled() - 350; U32 ypos = 64; const U32 y_inc = 20; @@ -583,6 +583,22 @@ public: ypos += y_inc; } } + + //temporary hack to give feedback on mesh upload progress + if (!gMeshRepo.mUploads.empty()) + { + for (std::vector<LLMeshUploadThread*>::iterator iter = gMeshRepo.mUploads.begin(); + iter != gMeshRepo.mUploads.end(); ++iter) + { + LLMeshUploadThread* thread = *iter; + + addText(xpos, ypos, llformat("Mesh Upload -- price quote: %d:%d | upload: %d:%d | create: %d", + thread->mPendingConfirmations, thread->mUploadQ.size(), + thread->mPendingUploads, thread->mConfirmedQ.size(), + thread->mCompletedQ.size())); + ypos += y_inc; + } + } } void draw() -- cgit v1.2.3 From 469af6771d757dd951daaed3e2b1d59ee2127c0e Mon Sep 17 00:00:00 2001 From: Palmer Truelson <palmer@lindenlab.com> Date: Tue, 23 Feb 2010 22:32:17 -0800 Subject: D'oh. Merge bork. --- indra/llrender/llrender.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 73c628d4b5..a73a128368 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -366,9 +366,6 @@ private: eBlendFactor mCurrBlendDFactor; F32 mMaxAnisotropy; - eBlendFactor mCurrBlendSFactor; - eBlendFactor mCurrBlendDFactor; - std::list<LLVector3> mUIOffset; std::list<LLVector3> mUIScale; -- cgit v1.2.3 From 2063bc2a3a5848d0290c97ce7661fc8d8f224976 Mon Sep 17 00:00:00 2001 From: Palmer Truelson <palmer@lindenlab.com> Date: Wed, 24 Feb 2010 12:18:13 -0800 Subject: Allow for turning off of FBOs --- indra/newview/llviewerdisplay.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index fdf2060686..0a927cd5ea 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -861,14 +861,26 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { gPipeline.mDeferredScreen.flush(); - LLRenderTarget::copyContentsToFramebuffer(gPipeline.mDeferredScreen, 0, 0, gPipeline.mDeferredScreen.getWidth(), gPipeline.mDeferredScreen.getHeight(), - 0, 0, gPipeline.mDeferredScreen.getWidth(), gPipeline.mDeferredScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); + if(LLRenderTarget::sUseFBO) + { + LLRenderTarget::copyContentsToFramebuffer(gPipeline.mDeferredScreen, 0, 0, gPipeline.mDeferredScreen.getWidth(), + gPipeline.mDeferredScreen.getHeight(), 0, 0, + gPipeline.mDeferredScreen.getWidth(), + gPipeline.mDeferredScreen.getHeight(), + GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } } else { gPipeline.mScreen.flush(); - LLRenderTarget::copyContentsToFramebuffer(gPipeline.mScreen, 0, 0, gPipeline.mScreen.getWidth(), gPipeline.mScreen.getHeight(), - 0, 0, gPipeline.mScreen.getWidth(), gPipeline.mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); + if(LLRenderTarget::sUseFBO) + { + LLRenderTarget::copyContentsToFramebuffer(gPipeline.mScreen, 0, 0, gPipeline.mScreen.getWidth(), + gPipeline.mScreen.getHeight(), 0, 0, + gPipeline.mScreen.getWidth(), + gPipeline.mScreen.getHeight(), + GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } } } -- cgit v1.2.3 From 4de18937025f92a0340277c3215fc43cac2f6688 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 24 Feb 2010 19:53:22 -0600 Subject: Added lower level pool to curl easy handles to speed up HTTP requests (from 40 ms per request to < 1 ms per request). --- indra/llmessage/llcurl.cpp | 87 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 0c919011ac..c640e176ee 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -55,6 +55,7 @@ #include "llstl.h" #include "llsdserialize.h" #include "llthread.h" +#include "lltimer.h" ////////////////////////////////////////////////////////////////////////////// /* @@ -256,7 +257,12 @@ public: void resetState(); + static CURL* allocEasyHandle(); + static void releaseEasyHandle(CURL* handle); + private: + friend class LLCurl; + CURL* mCurlEasyHandle; struct curl_slist* mHeaders; @@ -271,8 +277,62 @@ private: std::vector<char*> mStrings; ResponderPtr mResponder; + + static std::set<CURL*> sFreeHandles; + static std::set<CURL*> sActiveHandles; + static LLMutex* sHandleMutex; }; +std::set<CURL*> LLCurl::Easy::sFreeHandles; +std::set<CURL*> LLCurl::Easy::sActiveHandles; +LLMutex* LLCurl::Easy::sHandleMutex = NULL; + + +//static +CURL* LLCurl::Easy::allocEasyHandle() +{ + CURL* ret = NULL; + LLMutexLock lock(sHandleMutex); + if (sFreeHandles.empty()) + { + ret = curl_easy_init(); + } + else + { + ret = *(sFreeHandles.begin()); + sFreeHandles.erase(ret); + curl_easy_reset(ret); + } + + if (ret) + { + sActiveHandles.insert(ret); + } + + return ret; +} + +//static +void LLCurl::Easy::releaseEasyHandle(CURL* handle) +{ + if (!handle) + { + llerrs << "handle cannot be NULL!" << llendl; + } + + LLMutexLock lock(sHandleMutex); + + if (sActiveHandles.find(handle) != sActiveHandles.end()) + { + sActiveHandles.erase(handle); + sFreeHandles.insert(handle); + } + else + { + llerrs << "Invalid handle." << llendl; + } +} + LLCurl::Easy::Easy() : mHeaders(NULL), mCurlEasyHandle(NULL) @@ -283,11 +343,12 @@ LLCurl::Easy::Easy() LLCurl::Easy* LLCurl::Easy::getEasy() { Easy* easy = new Easy(); - easy->mCurlEasyHandle = curl_easy_init(); + easy->mCurlEasyHandle = allocEasyHandle(); + if (!easy->mCurlEasyHandle) { // this can happen if we have too many open files (fails in c-ares/ares_init.c) - llwarns << "curl_multi_init() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl; + llwarns << "allocEasyHandle() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl; delete easy; return NULL; } @@ -301,7 +362,7 @@ LLCurl::Easy* LLCurl::Easy::getEasy() LLCurl::Easy::~Easy() { - curl_easy_cleanup(mCurlEasyHandle); + releaseEasyHandle(mCurlEasyHandle); --gCurlEasyCount; curl_slist_free_all(mHeaders); for_each(mStrings.begin(), mStrings.end(), DeletePointerArray()); @@ -543,6 +604,7 @@ LLCurl::Multi::Multi() mErrorCount(0) { mCurlMultiHandle = curl_multi_init(); + if (!mCurlMultiHandle) { llwarns << "curl_multi_init() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl; @@ -1078,6 +1140,8 @@ void LLCurl::initClass() // - http://curl.haxx.se/libcurl/c/curl_global_init.html curl_global_init(CURL_GLOBAL_ALL); + Easy::sHandleMutex = new LLMutex(NULL); + #if SAFE_SSL S32 mutex_count = CRYPTO_num_locks(); for (S32 i=0; i<mutex_count; i++) @@ -1095,5 +1159,22 @@ void LLCurl::cleanupClass() CRYPTO_set_locking_callback(NULL); for_each(sSSLMutex.begin(), sSSLMutex.end(), DeletePointer()); #endif + + delete Easy::sHandleMutex; + Easy::sHandleMutex = NULL; + + for (std::set<CURL*>::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter) + { + CURL* curl = *iter; + curl_easy_cleanup(curl); + } + + Easy::sFreeHandles.clear(); + + if (!Easy::sActiveHandles.empty()) + { + llerrs << "CURL easy handles not cleaned up on shutdown!" << llendl; + } + curl_global_cleanup(); } -- cgit v1.2.3 From 3c78771acee787e087bd2e2391397794d4d98f6d Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 24 Feb 2010 22:02:01 -0600 Subject: Removed scale from model importer. Removed support for scale entry in mesh assets. Fixed MeshMaxConcurrentRequests being ignored. Added mesh download queue debug text. --- indra/llmath/llvolume.cpp | 4 ---- indra/newview/llviewerwindow.cpp | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 704308f20f..904786079f 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2098,8 +2098,6 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) min_tc.setValue(mdl[i]["TexCoord0Domain"]["Min"]); max_tc.setValue(mdl[i]["TexCoord0Domain"]["Max"]); - F32 scale = llclamp((F32) mdl[i]["Scale"].asReal(), 1.f, 10.f); - LLVector3 pos_range = max_pos - min_pos; LLVector2 tc_range = max_tc - min_tc; @@ -2117,8 +2115,6 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) (F32) v[1] / 65535.f * pos_range.mV[1] + min_pos.mV[1], (F32) v[2] / 65535.f * pos_range.mV[2] + min_pos.mV[2]); - face.mVertices[j].mPosition *= scale; - if (j == 0) { min = max = face.mVertices[j].mPosition; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6bdb322c09..f554acf1df 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -599,6 +599,20 @@ public: ypos += y_inc; } } + + S32 pending = (S32) gMeshRepo.mPendingRequests.size(); + S32 header = (S32) gMeshRepo.mThread->mHeaderReqQ.size(); + S32 lod = (S32) gMeshRepo.mThread->mLODReqQ.size(); + + if (pending + header + lod + LLMeshRepoThread::sActiveHeaderRequests + LLMeshRepoThread::sActiveLODRequests != 0) + { + addText(xpos, ypos, llformat ("Mesh Queue - %d pending (%d:%d header | %d:%d LOD)", + pending, + LLMeshRepoThread::sActiveHeaderRequests, header, + LLMeshRepoThread::sActiveLODRequests, lod)); + + ypos += y_inc; + } } void draw() -- cgit v1.2.3 From 56c0d25ec88df661a15bd1401efd4a9f67b86328 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 24 Feb 2010 23:36:55 -0600 Subject: Fix for attempting to load mesh as texture. Fix for failing to retry when mesh uploads fail. Fix for race condition deadlocking mesh fetching thread. --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 562c733a3e..726673013b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1021,7 +1021,7 @@ void LLVOVolume::updateSculptTexture() { LLPointer<LLViewerFetchedTexture> old_sculpt = mSculptTexture; - if (isSculpted()) + if (isSculpted() && !isMesh()) { LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); LLUUID id = sculpt_params->getSculptTexture(); -- cgit v1.2.3 From 64d83571c9596900f32d0af63c2dd9968badb82f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 24 Feb 2010 23:40:46 -0600 Subject: Merge ? --- indra/llui/lllayoutstack.cpp | 38 +++++++++++++++++++++++++++++++++----- indra/llui/lllayoutstack.h | 10 +++++++++- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index dc79550eb4..4512091371 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -49,9 +49,11 @@ static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("la // struct LLLayoutStack::LayoutPanel { - LayoutPanel(LLPanel* panelp, ELayoutOrientation orientation, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize) : mPanel(panelp), + LayoutPanel(LLPanel* panelp, ELayoutOrientation orientation, S32 min_width, S32 min_height, S32 max_width, S32 max_height, BOOL auto_resize, BOOL user_resize) : mPanel(panelp), mMinWidth(min_width), mMinHeight(min_height), + mMaxWidth(max_width), + mMaxHeight(max_height), mAutoResize(auto_resize), mUserResize(user_resize), mOrientation(orientation), @@ -112,6 +114,11 @@ struct LLLayoutStack::LayoutPanel LLPanel* mPanel; S32 mMinWidth; S32 mMinHeight; + + // mMaxWidth & mMaxHeight are added to make configurable max width of the nearby chat bar. EXT-5589 + // they are not processed by LLLayoutStack but they can be if necessary + S32 mMaxWidth; + S32 mMaxHeight; BOOL mAutoResize; BOOL mUserResize; BOOL mCollapsed; @@ -261,10 +268,14 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o { const S32 DEFAULT_MIN_WIDTH = 0; const S32 DEFAULT_MIN_HEIGHT = 0; + const S32 DEFAULT_MAX_WIDTH = S32_MAX; + const S32 DEFAULT_MAX_HEIGHT = S32_MAX; const BOOL DEFAULT_AUTO_RESIZE = TRUE; S32 min_width = DEFAULT_MIN_WIDTH; S32 min_height = DEFAULT_MIN_HEIGHT; + S32 max_width = DEFAULT_MAX_WIDTH; + S32 max_height = DEFAULT_MAX_HEIGHT; BOOL auto_resize = DEFAULT_AUTO_RESIZE; LLXMLNodePtr output_child; @@ -281,6 +292,10 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o DEFAULT_MIN_WIDTH, output_child); get_attribute_s32_and_write(child_node, "min_height", &min_height, DEFAULT_MIN_HEIGHT, output_child); + get_attribute_s32_and_write(child_node, "max_width", &max_width, + DEFAULT_MAX_WIDTH, output_child); + get_attribute_s32_and_write(child_node, "max_height", &max_height, + DEFAULT_MAX_HEIGHT, output_child); get_attribute_bool_and_write(child_node, "auto_resize", &auto_resize, DEFAULT_AUTO_RESIZE, output_child); @@ -293,7 +308,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o if (panelp) { panelp->setFollowsNone(); - layout_stackp->addPanel(panelp, min_width, min_height, auto_resize, user_resize); + layout_stackp->addPanel(panelp, min_width, min_height, max_width, max_height, auto_resize, user_resize); } } else @@ -309,7 +324,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o if (new_child) { // put child in new embedded panel - layout_stackp->addPanel(panelp, min_width, min_height, auto_resize, user_resize); + layout_stackp->addPanel(panelp, min_width, min_height, max_width, max_height, auto_resize, user_resize); // resize panel to contain widget and move widget to be contained in panel panelp->setRect(new_child->getRect()); new_child->setOrigin(0, 0); @@ -359,14 +374,14 @@ S32 LLLayoutStack::getDefaultWidth(S32 cur_width) return cur_width; } -void LLLayoutStack::addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, EAnimate animate, S32 index) +void LLLayoutStack::addPanel(LLPanel* panel, S32 min_width, S32 min_height, S32 max_width, S32 max_height, BOOL auto_resize, BOOL user_resize, EAnimate animate, S32 index) { // panel starts off invisible (collapsed) if (animate == ANIMATE) { panel->setVisible(FALSE); } - LayoutPanel* embedded_panel = new LayoutPanel(panel, mOrientation, min_width, min_height, auto_resize, user_resize); + LayoutPanel* embedded_panel = new LayoutPanel(panel, mOrientation, min_width, min_height, max_width, max_height, auto_resize, user_resize); mPanels.insert(mPanels.begin() + llclamp(index, 0, (S32)mPanels.size()), embedded_panel); @@ -437,6 +452,19 @@ bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_widt return NULL != panel; } +bool LLLayoutStack::getPanelMaxSize(const std::string& panel_name, S32* max_widthp, S32* max_heightp) +{ + LayoutPanel* panel = findEmbeddedPanelByName(panel_name); + + if (panel) + { + if (max_widthp) *max_widthp = panel->mMaxWidth; + if (max_heightp) *max_heightp = panel->mMaxHeight; + } + + return NULL != panel; +} + static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index c4f10038f8..e454454fe2 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -74,7 +74,7 @@ public: ANIMATE } EAnimate; - void addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, EAnimate animate = NO_ANIMATE, S32 index = S32_MAX); + void addPanel(LLPanel* panel, S32 min_width, S32 min_height, S32 max_width, S32 max_height, BOOL auto_resize, BOOL user_resize, EAnimate animate = NO_ANIMATE, S32 index = S32_MAX); void removePanel(LLPanel* panel); void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE); S32 getNumPanels() { return mPanels.size(); } @@ -89,6 +89,14 @@ public: * @returns true if specified by panel_name internal panel exists, false otherwise. */ bool getPanelMinSize(const std::string& panel_name, S32* min_widthp, S32* min_heightp); + + /** + * Gets maximal width and/or height of the specified by name panel. + * + * If it is necessary to get only the one dimension pass NULL for another one. + * @returns true if specified by panel_name internal panel exists, false otherwise. + */ + bool getPanelMaxSize(const std::string& panel_name, S32* max_width, S32* max_height); void updateLayout(BOOL force_resize = FALSE); -- cgit v1.2.3 From 1ceceecf7501076fa92fa7c9eb5cdf1aa8d5191e Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 25 Feb 2010 15:19:44 -0600 Subject: LOD tweaking (sort of) works again in importer. Got rid of another spot that was loading meshes as textures. --- indra/newview/llviewerobject.cpp | 2 +- indra/newview/llviewerobject.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b5642d07a5..8dea60cc87 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2932,7 +2932,7 @@ void LLViewerObject::boostTexturePriority(BOOL boost_children /* = TRUE */) getTEImage(i)->setBoostLevel(LLViewerTexture::BOOST_SELECTED); } - if (isSculpted()) + if (isSculpted() && !isMesh()) { LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); LLUUID sculpt_id = sculpt_params->getSculptTexture(); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 266c40d493..bf5e0b6656 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -229,6 +229,7 @@ public: virtual BOOL isFlexible() const { return FALSE; } virtual BOOL isSculpted() const { return FALSE; } + virtual BOOL isMesh() const { return FALSE; } virtual BOOL hasLightTexture() const { return FALSE; } // This method returns true if the object is over land owned by -- cgit v1.2.3 From 26a0c18e95d8d542016d89cc78b948438bc335cb Mon Sep 17 00:00:00 2001 From: Palmer Truelson <palmer@lindenlab.com> Date: Thu, 25 Feb 2010 16:02:23 -0800 Subject: Turn of FBOs on x1600 on mac --- indra/newview/featuretable_mac.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 12d47a904c..db0252d2e7 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -366,6 +366,7 @@ list ATI_Radeon_X1500 Disregard128DefaultDrawDistance 1 0 list ATI_Radeon_X1600 Disregard128DefaultDrawDistance 1 0 +RenderUseFBO 0 0 list ATI_Radeon_X1700 Disregard128DefaultDrawDistance 1 0 list ATI_Mobility_Radeon_X1xxx -- cgit v1.2.3 From b414b5067e3e47da7d9baf490d94534b4c65a8eb Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sun, 28 Feb 2010 16:40:30 -0600 Subject: Remove some dead code. Add LH transform to LLVector3 Add DebugShowUploadCost Make LOD generation on model preview less finnicky. Remove error level based LOD generation. Better framing of model before upload. Better error handling for model uploader. Remove [COST] argument from model upload menu item. Remove L$ check from model upload menu item being enabled. --- indra/llmath/m4math.cpp | 31 ------------ indra/llmath/m4math.h | 5 +- indra/llmath/v3math.cpp | 22 +++++++++ indra/llmath/v3math.h | 3 ++ indra/llrender/llvertexbuffer.cpp | 6 +++ indra/newview/app_settings/settings.xml | 13 ++++- indra/newview/llviewermenu.cpp | 3 +- indra/newview/llviewermenufile.cpp | 10 ++++ indra/newview/llviewermessage.cpp | 1 - indra/newview/llviewerwindow.cpp | 14 ++++++ indra/newview/pipeline.cpp | 57 ++++++++++++++++++++++ indra/newview/pipeline.h | 4 ++ .../skins/default/xui/en/menu_inventory_add.xml | 4 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 11 +++++ .../skins/default/xui/en/panel_main_inventory.xml | 4 +- 15 files changed, 145 insertions(+), 43 deletions(-) diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index 5c112b52b2..ce5428f0e1 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -684,37 +684,6 @@ const LLMatrix4& LLMatrix4::initMatrix(const LLMatrix3 &mat, const LLVector4 & // LLMatrix4 Operators - -/* Not implemented to help enforce code consistency with the syntax of - row-major notation. This is a Good Thing. -LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b) -{ - // Operate "to the right" on column-vector b - LLVector4 vec; - vec.mV[VX] = a.mMatrix[VX][VX] * b.mV[VX] + - a.mMatrix[VY][VX] * b.mV[VY] + - a.mMatrix[VZ][VX] * b.mV[VZ] + - a.mMatrix[VW][VX] * b.mV[VW]; - - vec.mV[VY] = a.mMatrix[VX][VY] * b.mV[VX] + - a.mMatrix[VY][VY] * b.mV[VY] + - a.mMatrix[VZ][VY] * b.mV[VZ] + - a.mMatrix[VW][VY] * b.mV[VW]; - - vec.mV[VZ] = a.mMatrix[VX][VZ] * b.mV[VX] + - a.mMatrix[VY][VZ] * b.mV[VY] + - a.mMatrix[VZ][VZ] * b.mV[VZ] + - a.mMatrix[VW][VZ] * b.mV[VW]; - - vec.mV[VW] = a.mMatrix[VX][VW] * b.mV[VX] + - a.mMatrix[VY][VW] * b.mV[VY] + - a.mMatrix[VZ][VW] * b.mV[VZ] + - a.mMatrix[VW][VW] * b.mV[VW]; - return vec; -} -*/ - - LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b) { // Operate "to the left" on row-vector a diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h index 6007b96bd9..40599a0886 100644 --- a/indra/llmath/m4math.h +++ b/indra/llmath/m4math.h @@ -226,10 +226,7 @@ public: // Operators // -// Not implemented to enforce code that agrees with symbolic syntax -// friend LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b); // Apply rotation a to vector b - -// friend inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b); // Return a * b + // friend inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b); // Return a * b friend LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b); // Return transform of vector a by matrix b friend const LLVector3 operator*(const LLVector3 &a, const LLMatrix4 &b); // Return full transform of a by matrix b friend LLVector4 rotate_vector(const LLVector4 &a, const LLMatrix4 &b); // Rotates a but does not translate diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index 63683ed496..82aad6550b 100644 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp @@ -197,6 +197,28 @@ const LLVector3& LLVector3::rotVec(const LLQuaternion &q) return *this; } +const LLVector3& LLVector3::transVec(const LLMatrix4& mat) +{ + setVec( + mV[VX] * mat.mMatrix[VX][VX] + + mV[VY] * mat.mMatrix[VX][VY] + + mV[VZ] * mat.mMatrix[VX][VZ] + + mat.mMatrix[VX][VW], + + mV[VX] * mat.mMatrix[VY][VX] + + mV[VY] * mat.mMatrix[VY][VY] + + mV[VZ] * mat.mMatrix[VY][VZ] + + mat.mMatrix[VY][VW], + + mV[VX] * mat.mMatrix[VZ][VX] + + mV[VY] * mat.mMatrix[VZ][VY] + + mV[VZ] * mat.mMatrix[VZ][VZ] + + mat.mMatrix[VZ][VW]); + + return *this; +} + + const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3 &vec) { if ( !vec.isExactlyZero() && angle ) diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 73738cffd2..76dd938887 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -36,10 +36,12 @@ #include "llerror.h" #include "llmath.h" + #include "llsd.h" class LLVector2; class LLVector4; class LLMatrix3; +class LLMatrix4; class LLVector3d; class LLQuaternion; @@ -115,6 +117,7 @@ class LLVector3 const LLVector3& rotVec(F32 angle, F32 x, F32 y, F32 z); // Rotates about x,y,z by angle radians const LLVector3& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat const LLVector3& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q + const LLVector3& transVec(const LLMatrix4& mat); // Transforms by LLMatrix4 mat (mat * v) const LLVector3& scaleVec(const LLVector3& vec); // scales per component by vec LLVector3 scaledVec(const LLVector3& vec) const; // get a copy of this vector scaled by vec diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 116e265914..415d2f603b 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -668,6 +668,12 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) { LLMemType mt2(LLMemType::MTYPE_VERTEX_ALLOCATE_BUFFER); + if (nverts < 0 || nindices < 0 || + nverts > 65536) + { + llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl; + } + updateNumVerts(nverts); updateNumIndices(nindices); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index bb90aeb91a..cb30147925 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1687,7 +1687,7 @@ <key>DebugShowRenderInfo</key> <map> <key>Comment</key> - <string>Show depth buffer contents</string> + <string>Show stats about current scene</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -1695,6 +1695,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>DebugShowUploadCost</key> + <map> + <key>Comment</key> + <string>Show what it would cost to upload assets in current scene</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DebugShowRenderMatrices</key> <map> <key>Comment</key> diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b25d622d17..9404d7ce6b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -445,8 +445,7 @@ void init_menus() gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost); - gMenuHolder->childSetLabelArg("Upload Model", "[COST]", upload_cost); - + gAFKMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Away", TRUE); gBusyMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Busy", TRUE); gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", TRUE); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 0f26975149..53688f1210 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -92,6 +92,15 @@ class LLFileEnableUpload : public view_listener_t } }; +class LLFileEnableUploadModel : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gAgent.getRegion() && !gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice").empty(); + return new_value; + } +}; + //============================================================================ #if LL_WINDOWS @@ -1283,6 +1292,7 @@ void init_menu_file() view_listener_t::addCommit(new LLFileQuit(), "File.Quit"); view_listener_t::addEnable(new LLFileEnableUpload(), "File.EnableUpload"); + view_listener_t::addEnable(new LLFileEnableUploadModel(), "File.EnableUploadModel"); // "File.SaveTexture" moved to llpanelmaininventory so that it can be properly handled. } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6a9e6f090f..a8702b2c6b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4842,7 +4842,6 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost)); gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost)); - gMenuHolder->childSetLabelArg("Upload Model", "[COST]", llformat("%d", upload_cost)); gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", llformat("%d", upload_cost)); gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", llformat("%d", upload_cost)); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f554acf1df..5b21e13bf1 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -584,6 +584,20 @@ public: } } + + if (gSavedSettings.getBOOL("DebugShowUploadCost")) + { + addText(xpos, ypos, llformat(" Meshes: L$%d", gPipeline.mDebugMeshUploadCost)); + ypos += y_inc/2.f; + addText(xpos, ypos, llformat(" Sculpties: L$%d", gPipeline.mDebugSculptUploadCost)); + ypos += y_inc/2.f; + addText(xpos, ypos, llformat(" Textures: L$%d", gPipeline.mDebugTextureUploadCost)); + ypos += y_inc/2.f; + addText(xpos, ypos, "Upload Cost: "); + + ypos += y_inc; + } + //temporary hack to give feedback on mesh upload progress if (!gMeshRepo.mUploads.empty()) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 559ae83182..43b2104135 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3553,6 +3553,63 @@ void LLPipeline::renderDebug() } } + if (gSavedSettings.getBOOL("DebugShowUploadCost")) + { + std::set<LLUUID> textures; + std::set<LLUUID> sculpts; + std::set<LLUUID> meshes; + + BOOL selected = TRUE; + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) + { + selected = FALSE; + } + + for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter) + { + LLSpatialGroup* group = *iter; + LLSpatialGroup::OctreeNode* node = group->mOctreeNode; + for (LLSpatialGroup::OctreeNode::element_iter elem = node->getData().begin(); elem != node->getData().end(); ++elem) + { + LLDrawable* drawable = *elem; + LLVOVolume* volume = drawable->getVOVolume(); + if (volume && volume->isSelected() == selected) + { + for (U32 i = 0; i < volume->getNumTEs(); ++i) + { + LLTextureEntry* te = volume->getTE(i); + textures.insert(te->getID()); + } + + if (volume->isSculpted()) + { + LLUUID sculpt_id = volume->getVolume()->getParams().getSculptID(); + if (volume->isMesh()) + { + meshes.insert(sculpt_id); + } + else + { + sculpts.insert(sculpt_id); + } + } + } + } + } + + gPipeline.mDebugTextureUploadCost = textures.size() * 10; + gPipeline.mDebugSculptUploadCost = sculpts.size()*10; + + U32 mesh_cost = 0; + + for (std::set<LLUUID>::iterator iter = meshes.begin(); iter != meshes.end(); ++iter) + { + mesh_cost += gMeshRepo.getResourceCost(*iter)*10; + } + + gPipeline.mDebugMeshUploadCost = mesh_cost; + } + for (LLCullResult::bridge_list_t::const_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i) { LLSpatialBridge* bridge = *i; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 33c18c1b86..814c54326a 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -435,6 +435,10 @@ public: S32 mNumVisibleNodes; S32 mVerticesRelit; + S32 mDebugTextureUploadCost; + S32 mDebugSculptUploadCost; + S32 mDebugMeshUploadCost; + S32 mLightingChanges; S32 mGeometryChanges; diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index 0d974075f5..05a4e60de7 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -43,14 +43,14 @@ function="File.EnableUpload" /> </menu_item_call> <menu_item_call - label="Model (L$[COST])..." + label="Model..." layout="topleft" name="Upload Model"> <menu_item_call.on_click function="File.UploadModel" parameter="" /> <menu_item_call.on_enable - function="File.EnableUpload" /> + function="File.EnableUploadModel" /> </menu_item_call> <menu_item_call label="Scene..." diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 158e764eae..5c75a95c16 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2061,6 +2061,17 @@ function="ToggleControl" parameter="DebugShowTime" /> </menu_item_check> + <menu_item_check + label="Show Upload Cost" + layout="topleft" + name="Show Upload Cost"> + <menu_item_check.on_check + function="CheckControl" + parameter="DebugShowUploadCost" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugShowUploadCost" /> + </menu_item_check> <menu_item_check label="Show Render Info" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 5cd5d0dfea..afd098ba21 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -80,14 +80,14 @@ function="File.EnableUpload" /> </menu_item_call> <menu_item_call - label="Model (L$[COST])..." + label="Model..." layout="topleft" name="Upload Model"> <menu_item_call.on_click function="File.UploadModel" parameter="" /> <menu_item_call.on_enable - function="File.EnableUpload" /> + function="File.EnableUploadModel" /> </menu_item_call> <menu_item_call label="Scene..." -- cgit v1.2.3 From dc01f8db212a09c9745e72e7f01c61ba648b3355 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 1 Mar 2010 19:36:10 -0600 Subject: "Model..." upload button always enabled now. Default fast alpha to on. --- indra/newview/app_settings/settings.xml | 4 ++-- indra/newview/llviewermenufile.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 26ed763b0a..0238fab5af 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6910,13 +6910,13 @@ <key>RenderFastAlpha</key> <map> <key>Comment</key> - <string>Use lossy alpha rendering optimization (opaque/nonexistent small alpha faces).</string> + <string>Use alpha masks where appropriate.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>RenderFastUI</key> <map> diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 53688f1210..e260220493 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -96,8 +96,7 @@ class LLFileEnableUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = gAgent.getRegion() && !gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice").empty(); - return new_value; + return true; } }; -- cgit v1.2.3 From 21586ca40f661ec0c5bcce37dc681b3b37ee5a08 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 1 Mar 2010 20:27:07 -0600 Subject: Fix for gcc compiler error ? Fix for cropping of models in model preview window. Fix for prim count and upload cost always being 0. --- indra/newview/llviewerwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5b21e13bf1..d682e85b7e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -588,11 +588,11 @@ public: if (gSavedSettings.getBOOL("DebugShowUploadCost")) { addText(xpos, ypos, llformat(" Meshes: L$%d", gPipeline.mDebugMeshUploadCost)); - ypos += y_inc/2.f; + ypos += y_inc/2; addText(xpos, ypos, llformat(" Sculpties: L$%d", gPipeline.mDebugSculptUploadCost)); - ypos += y_inc/2.f; + ypos += y_inc/2; addText(xpos, ypos, llformat(" Textures: L$%d", gPipeline.mDebugTextureUploadCost)); - ypos += y_inc/2.f; + ypos += y_inc/2; addText(xpos, ypos, "Upload Cost: "); ypos += y_inc; -- cgit v1.2.3 From e9d926385f4d8933d10bb4a3168628e0a6f0ad2a Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 2 Mar 2010 12:03:00 -0600 Subject: Curl tweaks to get rid of various types of timeouts. - Scrub host names from capability ips (requires disabling SSL host name verification) - Reset connections that have received a timeout (avoids cascading timeouts from reusing a cached bad connection) --- indra/llmessage/llcurl.cpp | 11 ++++++++--- indra/newview/llviewerregion.cpp | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index c640e176ee..637110ba0f 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -353,9 +353,10 @@ LLCurl::Easy* LLCurl::Easy::getEasy() return NULL; } - // set no DMS caching as default for all easy handles. This prevents them adopting a + // set no DNS caching as default for all easy handles. This prevents them adopting a // multi handles cache if they are added to one. curl_easy_setopt(easy->mCurlEasyHandle, CURLOPT_DNS_CACHE_TIMEOUT, 0); + ++gCurlEasyCount; return easy; } @@ -440,6 +441,7 @@ U32 LLCurl::Easy::report(CURLcode code) { responseCode = 499; responseReason = strerror(code) + " : " + mErrorBuffer; + setopt(CURLOPT_FRESH_CONNECT, TRUE); } if (mResponder) @@ -526,7 +528,7 @@ void LLCurl::Easy::prepRequest(const std::string& url, if (post) setoptString(CURLOPT_ENCODING, ""); -// setopt(CURLOPT_VERBOSE, 1); // usefull for debugging + //setopt(CURLOPT_VERBOSE, 1); // usefull for debugging setopt(CURLOPT_NOSIGNAL, 1); mOutput.reset(new LLBufferArray); @@ -543,9 +545,12 @@ void LLCurl::Easy::prepRequest(const std::string& url, setCA(); setopt(CURLOPT_SSL_VERIFYPEER, LLCurl::getSSLVerify()); - setopt(CURLOPT_SSL_VERIFYHOST, LLCurl::getSSLVerify()? 2 : 0); + //setopt(CURLOPT_SSL_VERIFYHOST, LLCurl::getSSLVerify()? 2 : 0); + setopt(CURLOPT_SSL_VERIFYHOST, 0); setopt(CURLOPT_TIMEOUT, CURL_REQUEST_TIMEOUT); + setopt(CURLOPT_FORBID_REUSE, TRUE); + setoptString(CURLOPT_URL, url); mResponder = responder; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 6737b113af..be7fb04206 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1552,7 +1552,20 @@ std::string LLViewerRegion::getCapability(const std::string& name) const { return ""; } - return iter->second; + + std::string http_url = iter->second; + + std::string ip_string = mHost.getIPString(); + std::string host_string = mHost.getHostName(); + + std::string::size_type idx = http_url.find(host_string); + + if (!ip_string.empty() && !host_string.empty() && idx != std::string::npos) + { + http_url.replace(idx, host_string.length(), ip_string); + } + + return http_url; } void LLViewerRegion::logActiveCapabilities() const -- cgit v1.2.3 From e38adc5baf0bf4090168088fc4b9a71a5b231aa4 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 2 Mar 2010 12:35:19 -0600 Subject: cleanup from review --- indra/llmessage/llcurl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 637110ba0f..f8a7eb0417 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -546,11 +546,11 @@ void LLCurl::Easy::prepRequest(const std::string& url, setopt(CURLOPT_SSL_VERIFYPEER, LLCurl::getSSLVerify()); //setopt(CURLOPT_SSL_VERIFYHOST, LLCurl::getSSLVerify()? 2 : 0); + + //don't verify host name so urls with scrubbed host names will work (improves DNS performance) setopt(CURLOPT_SSL_VERIFYHOST, 0); setopt(CURLOPT_TIMEOUT, CURL_REQUEST_TIMEOUT); - setopt(CURLOPT_FORBID_REUSE, TRUE); - setoptString(CURLOPT_URL, url); mResponder = responder; -- cgit v1.2.3 From 5f9591535138d782f0f9666b39534149de0562a1 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 2 Mar 2010 17:06:08 -0600 Subject: Can upload textures from model preview now. Fix for bad region crossing. --- indra/newview/llviewerregion.cpp | 14 +------------- indra/newview/llviewertexture.cpp | 11 +++++++++-- indra/newview/llviewerwindow.cpp | 4 ++-- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index be7fb04206..dc1dfeb82b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1553,19 +1553,7 @@ std::string LLViewerRegion::getCapability(const std::string& name) const return ""; } - std::string http_url = iter->second; - - std::string ip_string = mHost.getIPString(); - std::string host_string = mHost.getHostName(); - - std::string::size_type idx = http_url.find(host_string); - - if (!ip_string.empty() && !host_string.empty() && idx != std::string::npos) - { - http_url.replace(idx, host_string.length(), ip_string); - } - - return http_url; + return iter->second; } void LLViewerRegion::logActiveCapabilities() const diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 0f0fd5da30..d0c3768b34 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1367,8 +1367,15 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) mOrigWidth = mRawImage->getWidth(); mOrigHeight = mRawImage->getHeight(); - // leave black border, do not scale image content - mRawImage->expandToPowerOfTwo(MAX_IMAGE_SIZE, FALSE); + + if (mBoostLevel == BOOST_PREVIEW) + { + mRawImage->biasedScaleToPowerOfTwo(1024); + } + else + { // leave black border, do not scale image content + mRawImage->expandToPowerOfTwo(MAX_IMAGE_SIZE, FALSE); + } mFullWidth = mRawImage->getWidth(); mFullHeight = mRawImage->getHeight(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d682e85b7e..1f19c23a6f 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -607,8 +607,8 @@ public: LLMeshUploadThread* thread = *iter; addText(xpos, ypos, llformat("Mesh Upload -- price quote: %d:%d | upload: %d:%d | create: %d", - thread->mPendingConfirmations, thread->mUploadQ.size(), - thread->mPendingUploads, thread->mConfirmedQ.size(), + thread->mPendingConfirmations, thread->mUploadQ.size()+thread->mTextureQ.size(), + thread->mPendingUploads, thread->mConfirmedQ.size()+thread->mConfirmedTextureQ.size(), thread->mCompletedQ.size())); ypos += y_inc; } -- cgit v1.2.3 From ac2dc19029d0b17292beadc834fdf41330eb88d8 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 2 Mar 2010 19:04:13 -0600 Subject: Fix for bad handling of creating mesh prim instances. --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1f19c23a6f..0bdac6eff4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -609,7 +609,7 @@ public: addText(xpos, ypos, llformat("Mesh Upload -- price quote: %d:%d | upload: %d:%d | create: %d", thread->mPendingConfirmations, thread->mUploadQ.size()+thread->mTextureQ.size(), thread->mPendingUploads, thread->mConfirmedQ.size()+thread->mConfirmedTextureQ.size(), - thread->mCompletedQ.size())); + thread->mInstanceQ.size())); ypos += y_inc; } } -- cgit v1.2.3 From ea6397fe4990b73e190391d61781c609fbd1f8c1 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 4 Mar 2010 15:30:15 -0600 Subject: Optimiziation pass. Added RenderUseStreamVBO to enable/disable usage of VBO's for streaming buffers. Faster traversal of LLCullResult members. Removal of llpushcallstacks from inner loops. Sprinkling in fast timers. --- indra/llrender/llglslshader.cpp | 6 ++ indra/llrender/llvertexbuffer.cpp | 6 ++ indra/llrender/llvertexbuffer.h | 2 + indra/newview/app_settings/settings.xml | 11 +++ indra/newview/lldrawable.cpp | 7 ++ indra/newview/lldrawpool.cpp | 2 +- indra/newview/lldrawpoolalpha.cpp | 132 ++++++++++++++++---------------- indra/newview/lldrawpoolbump.cpp | 4 +- indra/newview/llface.cpp | 4 +- indra/newview/llspatialpartition.cpp | 36 +++++++-- indra/newview/llspatialpartition.h | 7 ++ indra/newview/llviewercontrol.cpp | 1 + indra/newview/llvovolume.cpp | 6 +- indra/newview/pipeline.cpp | 21 ++++- 14 files changed, 160 insertions(+), 85 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index ca92cb6580..2b3179116d 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -343,8 +343,11 @@ BOOL LLGLSLShader::link(BOOL suppress_errors) return LLShaderMgr::instance()->linkProgramObject(mProgramObject, suppress_errors); } +static LLFastTimer::DeclareTimer FTM_BIND_SHADER("Bind Shader"); + void LLGLSLShader::bind() { + LLFastTimer ftm(FTM_BIND_SHADER); if (gGLManager.mHasShaderObjects) { glUseProgramObjectARB(mProgramObject); @@ -357,8 +360,11 @@ void LLGLSLShader::bind() } } +static LLFastTimer::DeclareTimer FTM_UNBIND_SHADER("Unbind Shader"); + void LLGLSLShader::unbind() { + LLFastTimer ftm(FTM_UNBIND_SHADER); if (gGLManager.mHasShaderObjects) { stop_glerror(); diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 415d2f603b..4064e688e8 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -61,6 +61,7 @@ BOOL LLVertexBuffer::sVBOActive = FALSE; BOOL LLVertexBuffer::sIBOActive = FALSE; U32 LLVertexBuffer::sAllocatedBytes = 0; BOOL LLVertexBuffer::sMapped = FALSE; +BOOL LLVertexBuffer::sUseStreamDraw = TRUE; std::vector<U32> LLVertexBuffer::sDeleteList; @@ -381,6 +382,11 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) : { mUsage = 0 ; } + + if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw) + { + mUsage = 0; + } S32 stride = calcStride(typemask, mOffsets); diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index b785a22976..e2fecdffef 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -83,6 +83,8 @@ public: static LLVBOPool sDynamicVBOPool; static LLVBOPool sStreamIBOPool; static LLVBOPool sDynamicIBOPool; + + static BOOL sUseStreamDraw; static void initClass(bool use_vbo); static void cleanupClass(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0238fab5af..e234af699b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7531,6 +7531,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>RenderUseStreamVBO</key> + <map> + <key>Comment</key> + <string>Use VBO's for stream buffers</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>RenderVolumeLODFactor</key> <map> <key>Comment</key> diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 390e950d75..fd9cb18a42 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -683,8 +683,11 @@ BOOL LLDrawable::updateMoveDamped() return done_moving; } +static LLFastTimer::DeclareTimer FTM_UPDATE_DISTANCE("Update Distance"); + void LLDrawable::updateDistance(LLCamera& camera, bool force_update) { + LLFastTimer t(FTM_UPDATE_DISTANCE); if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD) { llerrs << "WTF?" << llendl; @@ -1317,8 +1320,12 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* } } +static LLFastTimer::DeclareTimer FTM_BRIDGE_DISTANCE_UPDATE("Bridge Distance"); + void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) { + LLFastTimer t(FTM_BRIDGE_DISTANCE_UPDATE); + if (mDrawable == NULL) { markDead(); diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index ef946ac49e..ae30af3647 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -442,7 +442,6 @@ void LLRenderPass::renderTexture(U32 type, U32 mask) void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture) { - llpushcallstacks ; for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i) { LLDrawInfo* pparams = *i; @@ -475,6 +474,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) { if (params.mTexture.notNull()) { + params.mTexture->addTextureStats(params.mVSize); gGL.getTexUnit(0)->bind(params.mTexture, TRUE) ; if (params.mTextureMatrix) { diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 875c9ac6a9..75973cfa54 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -294,96 +294,98 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) LLRenderPass::applyModelMatrix(params); - if (params.mFullbright) { - // Turn off lighting if it hasn't already been so. - if (light_enabled || !initialized_lighting) + if (params.mFullbright) + { + // Turn off lighting if it hasn't already been so. + if (light_enabled || !initialized_lighting) + { + initialized_lighting = TRUE; + if (use_shaders) + { + target_shader = fullbright_shader; + } + else + { + gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); + } + light_enabled = FALSE; + } + } + // Turn on lighting if it isn't already. + else if (!light_enabled || !initialized_lighting) { initialized_lighting = TRUE; if (use_shaders) { - target_shader = fullbright_shader; + target_shader = simple_shader; } else { - gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); + gPipeline.enableLightsDynamic(); } - light_enabled = FALSE; + light_enabled = TRUE; } - } - // Turn on lighting if it isn't already. - else if (!light_enabled || !initialized_lighting) - { - initialized_lighting = TRUE; - if (use_shaders) - { - target_shader = simple_shader; - } - else - { - gPipeline.enableLightsDynamic(); - } - light_enabled = TRUE; - } - // If we need shaders, and we're not ALREADY using the proper shader, then bind it - // (this way we won't rebind shaders unnecessarily). - if(use_shaders && (current_shader != target_shader)) - { - llassert(target_shader != NULL); - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } - current_shader = target_shader; - if (deferred_render) - { - gPipeline.bindDeferredShader(*current_shader); - diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - } - else + // If we need shaders, and we're not ALREADY using the proper shader, then bind it + // (this way we won't rebind shaders unnecessarily). + if(use_shaders && (current_shader != target_shader)) { - current_shader->bind(); + llassert(target_shader != NULL); + if (deferred_render && current_shader != NULL) + { + gPipeline.unbindDeferredShader(*current_shader); + diffuse_channel = 0; + } + current_shader = target_shader; + if (deferred_render) + { + gPipeline.bindDeferredShader(*current_shader); + diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + } + else + { + current_shader->bind(); + } } - } - else if (!use_shaders && current_shader != NULL) - { - if (deferred_render) + else if (!use_shaders && current_shader != NULL) { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; + if (deferred_render) + { + gPipeline.unbindDeferredShader(*current_shader); + diffuse_channel = 0; + } + LLGLSLShader::bindNoShader(); + current_shader = NULL; } - LLGLSLShader::bindNoShader(); - current_shader = NULL; - } - - if (params.mGroup) - { - params.mGroup->rebuildMesh(); - } - - if (params.mTexture.notNull()) - { - gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get()); - if(params.mTexture.notNull()) + if (params.mGroup) { - params.mTexture->addTextureStats(params.mVSize); + params.mGroup->rebuildMesh(); } - if (params.mTextureMatrix) + + + if (params.mTexture.notNull()) { - gGL.getTexUnit(0)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); - gPipeline.mTextureMatrixOps++; + gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get()); + if(params.mTexture.notNull()) + { + params.mTexture->addTextureStats(params.mVSize); + } + if (params.mTextureMatrix) + { + gGL.getTexUnit(0)->activate(); + glMatrixMode(GL_TEXTURE); + glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); + gPipeline.mTextureMatrixOps++; + } } } params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); - + if (params.mTextureMatrix && params.mTexture.notNull()) { gGL.getTexUnit(0)->activate(); diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index a4a8dc80b5..8f3e775976 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -837,7 +837,6 @@ void LLBumpImageList::addTextureStats(U8 bump, const LLUUID& base_image_id, F32 void LLBumpImageList::updateImages() { - llpushcallstacks ; for (bump_image_map_t::iterator iter = mBrightnessEntries.begin(); iter != mBrightnessEntries.end(); ) { bump_image_map_t::iterator curiter = iter++; @@ -864,7 +863,7 @@ void LLBumpImageList::updateImages() } } } - llpushcallstacks ; + for (bump_image_map_t::iterator iter = mDarknessEntries.begin(); iter != mDarknessEntries.end(); ) { bump_image_map_t::iterator curiter = iter++; @@ -891,7 +890,6 @@ void LLBumpImageList::updateImages() } } } - llpushcallstacks ; } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 770811b587..53330e4d98 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -883,12 +883,14 @@ void LLFace::updateRebuildFlags() } } +static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom"); + BOOL LLFace::getGeometryVolume(const LLVolume& volume, const S32 &f, const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, const U16 &index_offset) { - llpushcallstacks ; + LLFastTimer t(FTM_FACE_GET_GEOM); const LLVolumeFace &vf = volume.getVolumeFace(f); S32 num_vertices = (S32)vf.mVertices.size(); S32 num_indices = LLPipeline::sUseTriStrips ? (S32)vf.mTriStrip.size() : (S32) vf.mIndices.size(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 19bf40b56a..3742f70df5 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1513,6 +1513,7 @@ void LLSpatialGroup::checkOcclusion() { if (LLPipeline::sUseOcclusion > 1) { + LLFastTimer t(FTM_OCCLUSION_READBACK); LLSpatialGroup* parent = getParent(); if (parent && parent->isOcclusionState(LLSpatialGroup::OCCLUDED)) { //if the parent has been marked as occluded, the child is implicitly occluded @@ -1520,7 +1521,6 @@ void LLSpatialGroup::checkOcclusion() } else if (isOcclusionState(QUERY_PENDING)) { //otherwise, if a query is pending, read it back - LLFastTimer t(FTM_OCCLUSION_READBACK); GLuint res = 1; if (!isOcclusionState(DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID]) { @@ -3422,11 +3422,23 @@ LLCullResult::LLCullResult() void LLCullResult::clear() { mVisibleGroupsSize = 0; + mVisibleGroupsEnd = mVisibleGroups.begin(); + mAlphaGroupsSize = 0; + mAlphaGroupsEnd = mAlphaGroups.begin(); + mOcclusionGroupsSize = 0; + mOcclusionGroupsEnd = mOcclusionGroups.begin(); + mDrawableGroupsSize = 0; + mDrawableGroupsEnd = mDrawableGroups.begin(); + mVisibleListSize = 0; + mVisibleListEnd = mVisibleList.begin(); + mVisibleBridgeSize = 0; + mVisibleBridgeEnd = mVisibleBridge.begin(); + for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++) { @@ -3435,6 +3447,7 @@ void LLCullResult::clear() mRenderMap[i][j] = 0; } mRenderMapSize[i] = 0; + mRenderMapEnd[i] = mRenderMap[i].begin(); } } @@ -3445,7 +3458,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginVisibleGroups() LLCullResult::sg_list_t::iterator LLCullResult::endVisibleGroups() { - return mVisibleGroups.begin() + mVisibleGroupsSize; + return mVisibleGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() @@ -3455,7 +3468,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() LLCullResult::sg_list_t::iterator LLCullResult::endAlphaGroups() { - return mAlphaGroups.begin() + mAlphaGroupsSize; + return mAlphaGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() @@ -3465,7 +3478,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() LLCullResult::sg_list_t::iterator LLCullResult::endOcclusionGroups() { - return mOcclusionGroups.begin() + mOcclusionGroupsSize; + return mOcclusionGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() @@ -3475,7 +3488,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() LLCullResult::sg_list_t::iterator LLCullResult::endDrawableGroups() { - return mDrawableGroups.begin() + mDrawableGroupsSize; + return mDrawableGroupsEnd; } LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() @@ -3485,7 +3498,7 @@ LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() LLCullResult::drawable_list_t::iterator LLCullResult::endVisibleList() { - return mVisibleList.begin() + mVisibleListSize; + return mVisibleListEnd; } LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() @@ -3495,7 +3508,7 @@ LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() LLCullResult::bridge_list_t::iterator LLCullResult::endVisibleBridge() { - return mVisibleBridge.begin() + mVisibleBridgeSize; + return mVisibleBridgeEnd; } LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) @@ -3505,7 +3518,7 @@ LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) LLCullResult::drawinfo_list_t::iterator LLCullResult::endRenderMap(U32 type) { - return mRenderMap[type].begin() + mRenderMapSize[type]; + return mRenderMapEnd[type]; } void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) @@ -3519,6 +3532,7 @@ void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) mVisibleGroups.push_back(group); } ++mVisibleGroupsSize; + mVisibleGroupsEnd = mVisibleGroups.begin()+mVisibleGroupsSize; } void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) @@ -3532,6 +3546,7 @@ void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) mAlphaGroups.push_back(group); } ++mAlphaGroupsSize; + mAlphaGroupsEnd = mAlphaGroups.begin()+mAlphaGroupsSize; } void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) @@ -3545,6 +3560,7 @@ void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) mOcclusionGroups.push_back(group); } ++mOcclusionGroupsSize; + mOcclusionGroupsEnd = mOcclusionGroups.begin()+mOcclusionGroupsSize; } void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) @@ -3558,6 +3574,7 @@ void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) mDrawableGroups.push_back(group); } ++mDrawableGroupsSize; + mDrawableGroupsEnd = mDrawableGroups.begin()+mDrawableGroupsSize; } void LLCullResult::pushDrawable(LLDrawable* drawable) @@ -3571,6 +3588,7 @@ void LLCullResult::pushDrawable(LLDrawable* drawable) mVisibleList.push_back(drawable); } ++mVisibleListSize; + mVisibleListEnd = mVisibleList.begin()+mVisibleListSize; } void LLCullResult::pushBridge(LLSpatialBridge* bridge) @@ -3584,6 +3602,7 @@ void LLCullResult::pushBridge(LLSpatialBridge* bridge) mVisibleBridge.push_back(bridge); } ++mVisibleBridgeSize; + mVisibleBridgeEnd = mVisibleBridge.begin()+mVisibleBridgeSize; } void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) @@ -3597,6 +3616,7 @@ void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) mRenderMap[type].push_back(draw_info); } ++mRenderMapSize[type]; + mRenderMapEnd[type] = mRenderMap[type].begin() + mRenderMapSize[type]; } diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index c5719bebcc..ef6b915e5c 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -535,12 +535,19 @@ private: U32 mRenderMapSize[LLRenderPass::NUM_RENDER_TYPES]; sg_list_t mVisibleGroups; + sg_list_t::iterator mVisibleGroupsEnd; sg_list_t mAlphaGroups; + sg_list_t::iterator mAlphaGroupsEnd; sg_list_t mOcclusionGroups; + sg_list_t::iterator mOcclusionGroupsEnd; sg_list_t mDrawableGroups; + sg_list_t::iterator mDrawableGroupsEnd; drawable_list_t mVisibleList; + drawable_list_t::iterator mVisibleListEnd; bridge_list_t mVisibleBridge; + bridge_list_t::iterator mVisibleBridgeEnd; drawinfo_list_t mRenderMap[LLRenderPass::NUM_RENDER_TYPES]; + drawinfo_list_t::iterator mRenderMapEnd[LLRenderPass::NUM_RENDER_TYPES]; }; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 0b7f6900ed..1d99be9960 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -571,6 +571,7 @@ void settings_setup_listeners() gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _2)); + gSavedSettings.getControl("RenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _2)); gSavedSettings.getControl("RenderLightingDetail")->getSignal()->connect(boost::bind(&handleRenderLightingDetailChanged, _2)); gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _2)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index eb2e6e3d76..39db6196a3 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3422,7 +3422,6 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { - llpushcallstacks ; if (group->changeLOD()) { group->mLastUpdateDistance = group->mDistance; @@ -3651,9 +3650,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); +static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild"); + void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { - llpushcallstacks ; llassert(group); if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY)) { @@ -3664,6 +3664,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { + LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); LLDrawable* drawablep = *drawable_iter; if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) @@ -3750,7 +3751,6 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort) { - llpushcallstacks ; //calculate maximum number of vertices to store in a single buffer U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 43b2104135..eb3ad95586 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -362,6 +362,7 @@ void LLPipeline::init() sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD"); sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); + LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO"); sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); @@ -1739,8 +1740,12 @@ void LLPipeline::markOccluder(LLSpatialGroup* group) } } +static LLFastTimer::DeclareTimer FTM_DO_OCCLUSION("Do Occlusion"); + void LLPipeline::doOcclusion(LLCamera& camera) { + LLFastTimer t(FTM_DO_OCCLUSION); + LLVertexBuffer::unbind(); if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION)) @@ -1816,7 +1821,6 @@ void LLPipeline::rebuildPriorityGroups() void LLPipeline::rebuildGroups() { - llpushcallstacks ; // Iterate through some drawables on the non-priority build queue S32 size = (S32) mGroupQ2.size(); S32 min_count = llclamp((S32) ((F32) (size * size)/4096*0.25f), 1, size); @@ -1961,9 +1965,13 @@ void LLPipeline::updateGeom(F32 max_dtime) updateMovedList(mMovedBridge); } +static LLFastTimer::DeclareTimer FTM_MARK_VISIBLE("Mark Visible"); + void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_VISIBLE); + LLFastTimer t(FTM_MARK_VISIBLE); + if(!drawablep || drawablep->isDead()) { return; @@ -4704,8 +4712,12 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) mLightMask = 0; } +static LLFastTimer::DeclareTimer FTM_ENABLE_LIGHTS("Enable Lights"); + void LLPipeline::enableLights(U32 mask) { + LLFastTimer ftm(FTM_ENABLE_LIGHTS); + assertInitialized(); if (mLightingDetail == 0) @@ -4813,16 +4825,16 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color) enableLights(mask); glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV); - if (mLightingDetail >= 2) + /*if (mLightingDetail >= 2) { glColor4f(0.f, 0.f, 0.f, 1.f); // no local lighting by default - } + }*/ } void LLPipeline::disableLights() { enableLights(0); // no lighting (full bright) - glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default + //glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default } //============================================================================ @@ -5425,6 +5437,7 @@ void LLPipeline::resetVertexBuffers() { sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); + LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO"); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) -- cgit v1.2.3 From 643bbdae728e01a0855accf3b5e614026dc56f9f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 5 Mar 2010 10:48:25 -0600 Subject: Tweak LLDynamicArrayIndexed to not abuse its std::vector. --- indra/llcommon/lldarray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/lldarray.h b/indra/llcommon/lldarray.h index 0e56a11d53..af647c7e7a 100644 --- a/indra/llcommon/lldarray.h +++ b/indra/llcommon/lldarray.h @@ -202,7 +202,7 @@ public: { U32 n = mVector.size(); mIndexMap[k] = n; - mVector.resize(n+1); + mVector.push_back(Type()); llassert(mVector.size() == mIndexMap.size()); return mVector[n]; } -- cgit v1.2.3 From 3ea01fb66e75ec6da1cee994da37ef461af66a48 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 5 Mar 2010 10:49:05 -0600 Subject: Remove some fast timers that were being futzy. --- indra/llrender/llglslshader.cpp | 6 ------ indra/newview/lldrawable.cpp | 7 ------- indra/newview/pipeline.cpp | 13 ++----------- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 2b3179116d..ca92cb6580 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -343,11 +343,8 @@ BOOL LLGLSLShader::link(BOOL suppress_errors) return LLShaderMgr::instance()->linkProgramObject(mProgramObject, suppress_errors); } -static LLFastTimer::DeclareTimer FTM_BIND_SHADER("Bind Shader"); - void LLGLSLShader::bind() { - LLFastTimer ftm(FTM_BIND_SHADER); if (gGLManager.mHasShaderObjects) { glUseProgramObjectARB(mProgramObject); @@ -360,11 +357,8 @@ void LLGLSLShader::bind() } } -static LLFastTimer::DeclareTimer FTM_UNBIND_SHADER("Unbind Shader"); - void LLGLSLShader::unbind() { - LLFastTimer ftm(FTM_UNBIND_SHADER); if (gGLManager.mHasShaderObjects) { stop_glerror(); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index fd9cb18a42..390e950d75 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -683,11 +683,8 @@ BOOL LLDrawable::updateMoveDamped() return done_moving; } -static LLFastTimer::DeclareTimer FTM_UPDATE_DISTANCE("Update Distance"); - void LLDrawable::updateDistance(LLCamera& camera, bool force_update) { - LLFastTimer t(FTM_UPDATE_DISTANCE); if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD) { llerrs << "WTF?" << llendl; @@ -1320,12 +1317,8 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* } } -static LLFastTimer::DeclareTimer FTM_BRIDGE_DISTANCE_UPDATE("Bridge Distance"); - void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) { - LLFastTimer t(FTM_BRIDGE_DISTANCE_UPDATE); - if (mDrawable == NULL) { markDead(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index eb3ad95586..e65c8b9af8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -511,6 +511,7 @@ void LLPipeline::destroyGL() } static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); + void LLPipeline::resizeScreenTexture() { LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE); @@ -1740,12 +1741,8 @@ void LLPipeline::markOccluder(LLSpatialGroup* group) } } -static LLFastTimer::DeclareTimer FTM_DO_OCCLUSION("Do Occlusion"); - void LLPipeline::doOcclusion(LLCamera& camera) { - LLFastTimer t(FTM_DO_OCCLUSION); - LLVertexBuffer::unbind(); if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION)) @@ -1965,12 +1962,9 @@ void LLPipeline::updateGeom(F32 max_dtime) updateMovedList(mMovedBridge); } -static LLFastTimer::DeclareTimer FTM_MARK_VISIBLE("Mark Visible"); - void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_VISIBLE); - LLFastTimer t(FTM_MARK_VISIBLE); if(!drawablep || drawablep->isDead()) { @@ -4712,12 +4706,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) mLightMask = 0; } -static LLFastTimer::DeclareTimer FTM_ENABLE_LIGHTS("Enable Lights"); - void LLPipeline::enableLights(U32 mask) { - LLFastTimer ftm(FTM_ENABLE_LIGHTS); - assertInitialized(); if (mLightingDetail == 0) @@ -5573,6 +5563,7 @@ void LLPipeline::bindScreenToTexture() } static LLFastTimer::DeclareTimer FTM_RENDER_BLOOM("Bloom"); + void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) { LLMemType mt_ru(LLMemType::MTYPE_PIPELINE_RENDER_BLOOM); -- cgit v1.2.3 From 372212ae764a32bf667d3cb4cf5b99e6c6147b0f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 5 Mar 2010 10:49:52 -0600 Subject: Fix for sun specular highlights showing up in shadow when diffuse ambiance greater than 0. --- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 531f7376a3..249ac7ef9b 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -275,7 +275,7 @@ void main() { vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*scol*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + col.rgb += vary_SunlitColor*scol_ambocc.r*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; } col = atmosLighting(col); -- cgit v1.2.3 From 988520f3a7d5d5e817326945d8b9c3808c4eb5f7 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 5 Mar 2010 10:50:29 -0600 Subject: Fix for avatar eyes not showing up when deferred rendering enabled. --- indra/newview/lldrawpoolavatar.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 546b60f286..012e41383f 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -157,6 +157,8 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); + sSkipTransparent = TRUE; + if (LLPipeline::sImpostorRender) { beginDeferredSkinned(); @@ -181,6 +183,8 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); + sSkipTransparent = FALSE; + if (LLPipeline::sImpostorRender) { endDeferredSkinned(); @@ -564,7 +568,6 @@ void LLDrawPoolAvatar::endSkinned() void LLDrawPoolAvatar::beginDeferredSkinned() { - sSkipTransparent = TRUE; sShaderLevel = mVertexShaderLevel; sVertexProgram = &gDeferredAvatarProgram; @@ -579,7 +582,6 @@ void LLDrawPoolAvatar::beginDeferredSkinned() void LLDrawPoolAvatar::endDeferredSkinned() { - sSkipTransparent = FALSE; // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = FALSE; disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); -- cgit v1.2.3 From 16a30929f9b12359658d0f462b6bac25ed9a36fb Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 5 Mar 2010 13:17:31 -0600 Subject: Inventory now updates appropriately when using model uploader. --- indra/newview/llassetuploadresponders.cpp | 16 +--------------- indra/newview/llviewermenufile.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index a0be6efdc2..9a66bae247 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -73,7 +73,7 @@ static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; void dialog_refresh_all(); -static void on_new_single_inventory_upload_complete( +void on_new_single_inventory_upload_complete( LLAssetType::EType asset_type, LLInventoryType::EType inventory_type, const std::string inventory_type_string, @@ -94,11 +94,6 @@ static void on_new_single_inventory_upload_complete( LLNotificationsUtil::add("UploadPayment", args); } - // Actually add the upload to viewer inventory - llinfos << "Adding " << server_response["new_inventory_item"].asUUID() - << " " << server_response["new_asset"].asUUID() - << " to inventory." << llendl; - if( item_folder_id.notNull() ) { U32 everyone_perms = PERM_NONE; @@ -165,15 +160,6 @@ static void on_new_single_inventory_upload_complete( server_response["new_inventory_item"].asUUID(), TAKE_FOCUS_NO); - if( - (LLAssetType::AT_TEXTURE == asset_type || - LLAssetType::AT_SOUND == asset_type) && - (LLFilePicker::instance().getFileCount() <= - FILE_COUNT_DISPLAY_THRESHOLD) ) - { - panel->openSelected(); - } - // restore keyboard focus gFocusMgr.setKeyboardFocus(focus); } diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 7ffa5d5e57..e700b0565e 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -110,4 +110,15 @@ LLSD generate_new_resource_upload_capability_body( U32 group_perms, U32 everyone_perms); +void on_new_single_inventory_upload_complete( + LLAssetType::EType asset_type, + LLInventoryType::EType inventory_type, + const std::string inventory_type_string, + const LLUUID& item_folder_id, + const std::string& item_name, + const std::string& item_description, + const LLSD& server_response, + S32 upload_price); + + #endif -- cgit v1.2.3 From b43441d9024db6e2ff46e53aace14f1fb6c1bbe6 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 5 Mar 2010 14:33:14 -0600 Subject: COMMENTS! --- indra/newview/llspatialpartition.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index ef6b915e5c..88fab01ea4 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -347,11 +347,11 @@ public: F32 mBuilt; OctreeNode* mOctreeNode; LLSpatialPartition* mSpatialPartition; - LLVector3 mBounds[2]; - LLVector3 mExtents[2]; + LLVector3 mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects) + LLVector3 mExtents[2]; // extents (min, max) of this node and all its children - LLVector3 mObjectExtents[2]; - LLVector3 mObjectBounds[2]; + LLVector3 mObjectExtents[2]; // extents (min, max) of objects in this node + LLVector3 mObjectBounds[2]; // bounding box (center, size) of objects in this node LLPointer<LLVertexBuffer> mVertexBuffer; F32* mOcclusionVerts; -- cgit v1.2.3 From 1889d02569a58d08b6c452e609819a1961bf64e8 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 6 Mar 2010 00:42:39 -0600 Subject: Better bounding boxes for meshes. --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 39db6196a3..1d3d943b06 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1329,7 +1329,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global) BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION); - for (S32 i = 0; i < getVolume()->getNumFaces(); i++) + for (S32 i = 0; i < getVolume()->getNumVolumeFaces(); i++) { LLFace *face = mDrawable->getFace(i); if (!face) -- cgit v1.2.3 From 665567e2f97f8ec4de2810fb63d6b845e67833e2 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sun, 7 Mar 2010 09:40:11 +0000 Subject: Remove the class2/class3 water shaders, which aren't materially different from class1 except for some minor const tweaks (I've migrated class3's tweaks into class1 on the assumption that this was what davep sees all the time) --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index d21575119d..5cb8bbba0f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -131,11 +131,11 @@ void main() //color.rgb = scaleSoftClip(color.rgb); //color.a = spec * sunAngle2; - //wavef.z = -0.25f; + //wavef.z *= 0.1f; wavef = normalize(wavef); wavef = (norm_mat*vec4(wavef, 1.0)).xyz; - gl_FragData[0] = vec4(color.rgb, 0.75); - gl_FragData[1] = vec4(1,1,1, 0.8); + gl_FragData[0] = vec4(color.rgb, 0.5); + gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); } -- cgit v1.2.3 From bd884d89e9d278454f0c9f27d5083a9d6500d582 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sun, 7 Mar 2010 09:41:47 +0000 Subject: Remove an extraneous normalize() from the water fragment shader - the last thing we did to this vector was normalize it anyway. --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 5cb8bbba0f..411c4bc1c3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -132,7 +132,7 @@ void main() //color.a = spec * sunAngle2; //wavef.z *= 0.1f; - wavef = normalize(wavef); + //wavef = normalize(wavef); wavef = (norm_mat*vec4(wavef, 1.0)).xyz; gl_FragData[0] = vec4(color.rgb, 0.5); -- cgit v1.2.3 From ead28366c6f33ca2794043ffbced28a950e6e334 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sun, 7 Mar 2010 10:09:06 +0000 Subject: trivial comment typo fix. --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 411c4bc1c3..1fc5811382 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -115,7 +115,7 @@ void main() vec4 fb = texture2D(screenTex, distort2); //mix with reflection - // Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug + // Note we actually want to use just df1, but multiplying by 0.999999 gets around an nvidia compiler bug color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); float shadow = 1.0; -- cgit v1.2.3 From 88a1b6676ed825345f0615050b9870b325fb6ef1 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sun, 7 Mar 2010 10:15:07 +0000 Subject: Some extra comments to help me get things straight. --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 1fc5811382..55c893d73b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -135,7 +135,7 @@ void main() //wavef = normalize(wavef); wavef = (norm_mat*vec4(wavef, 1.0)).xyz; - gl_FragData[0] = vec4(color.rgb, 0.5); - gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); - gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); + gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse + gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec + gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); // normal } -- cgit v1.2.3 From 64797175a14785ac740ae27e647a5b0241700577 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sun, 7 Mar 2010 11:34:31 +0000 Subject: Add a touch of fakey ripple to shadows on the surface of water, as if the water has depth. Using 4th component of the normal map to encode a position displacement (along the normal) in the class2 shadow lookup. --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 4 ++-- indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 55c893d73b..ceb7e0fb56 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -133,9 +133,9 @@ void main() //wavef.z *= 0.1f; //wavef = normalize(wavef); - wavef = (norm_mat*vec4(wavef, 1.0)).xyz; + vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); // normal + gl_FragData[2] = vec4(screenspacewavef*0.5+0.5, screenspacewavef.z*0.5); // normal, displace } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 74a948f584..50502dbdad 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -159,7 +159,9 @@ void main() vec4 pos = getPosition(pos_screen); - vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; + vec4 nmap4 = texture2DRect(normalMap, pos_screen); + float displace = nmap4.w; + vec3 norm = nmap4.xyz*2.0-1.0; /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL { @@ -168,9 +170,9 @@ void main() }*/ float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - vec4 spos = vec4(pos.xyz + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); + vec4 spos = vec4(pos.xyz + displace*norm + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); if (spos.z > -shadow_clip.w) { -- cgit v1.2.3 From 80ab668f4494601b6968748e227208f5b95a63bf Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sun, 7 Mar 2010 18:31:32 +0000 Subject: Add support for glBlendFuncSeparate(). I want it to fix glow-through-alpha, but this checkin doesn't includes any of those changes. --- indra/llrender/llgl.cpp | 28 +++++++++++++++++++++++++++- indra/llrender/llgl.h | 1 + indra/llrender/llglheaders.h | 22 +++++++++++++++++++++- indra/llrender/llrender.cpp | 41 ++++++++++++++++++++++++++++++++++++----- indra/llrender/llrender.h | 10 ++++++++-- 5 files changed, 93 insertions(+), 9 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index a3f7a946ec..4c256f4b06 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -185,6 +185,9 @@ PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glRenderbufferStorageMultisampleEXT = // GL_EXT_framebuffer_blit PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT = NULL; +// GL_EXT_blend_func_separate +PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT = NULL; + // GL_ARB_draw_buffers PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB = NULL; @@ -324,6 +327,7 @@ LLGLManager::LLGLManager() : mHasCompressedTextures(FALSE), mHasFramebufferObject(FALSE), mHasFramebufferMultisample(FALSE), + mHasBlendFuncSeparate(FALSE), mHasVertexBufferObject(FALSE), mHasPBuffer(FALSE), @@ -632,6 +636,12 @@ void LLGLManager::initExtensions() mHasDrawBuffers = TRUE; #else mHasDrawBuffers = FALSE; +# endif +# if GL_EXT_blend_func_separate + mHasBlendFuncSeparate = TRUE; +#else +#error XXXXXX + mHasBlendFuncSeparate = FALSE; # endif mHasMipMapGeneration = FALSE; mHasSeparateSpecularColor = FALSE; @@ -659,6 +669,7 @@ void LLGLManager::initExtensions() && ExtensionExists("GL_EXT_packed_depth_stencil", gGLHExts.mSysExts); mHasFramebufferMultisample = mHasFramebufferObject && ExtensionExists("GL_EXT_framebuffer_multisample", gGLHExts.mSysExts); mHasDrawBuffers = ExtensionExists("GL_ARB_draw_buffers", gGLHExts.mSysExts); + mHasBlendFuncSeparate = ExtensionExists("GL_EXT_blend_func_separate", gGLHExts.mSysExts); mHasTextureRectangle = ExtensionExists("GL_ARB_texture_rectangle", gGLHExts.mSysExts); #if !LL_DARWIN mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); @@ -682,6 +693,7 @@ void LLGLManager::initExtensions() mHasFramebufferObject = FALSE; mHasFramebufferMultisample = FALSE; mHasDrawBuffers = FALSE; + mHasBlendFuncSeparate = FALSE; mHasMipMapGeneration = FALSE; mHasSeparateSpecularColor = FALSE; mHasAnisotropic = FALSE; @@ -706,6 +718,7 @@ void LLGLManager::initExtensions() mHasShaderObjects = FALSE; mHasVertexShader = FALSE; mHasFragmentShader = FALSE; + mHasBlendFuncSeparate = FALSE; LL_WARNS("RenderInit") << "GL extension support forced to SIMPLE level via LL_GL_BASICEXT" << LL_ENDL; } if (getenv("LL_GL_BLACKLIST")) /* Flawfinder: ignore */ @@ -734,7 +747,8 @@ void LLGLManager::initExtensions() if (strchr(blacklist,'r')) mHasDrawBuffers = FALSE;//S if (strchr(blacklist,'s')) mHasFramebufferMultisample = FALSE; if (strchr(blacklist,'t')) mHasTextureRectangle = FALSE; - + if (strchr(blacklist,'u')) mHasBlendFuncSeparate = FALSE;//S + } #endif // LL_LINUX || LL_SOLARIS @@ -782,6 +796,14 @@ void LLGLManager::initExtensions() { LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_fragment_shader" << LL_ENDL; } + if (!mHasBlendFuncSeparate) + { + LL_INFOS("RenderInit") << "Couldn't initialize GL_EXT_blend_func_separate" << LL_ENDL; + } + if (!mHasDrawBuffers) + { + LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_draw_buffers" << LL_ENDL; + } // Disable certain things due to known bugs if (mIsIntel && mHasMipMapGeneration) @@ -852,6 +874,10 @@ void LLGLManager::initExtensions() { glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDrawBuffersARB"); } + if (mHasBlendFuncSeparate) + { + glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glBlendFuncSeparateEXT"); + } #if (!LL_LINUX && !LL_SOLARIS) || LL_LINUX_NV_GL_HEADERS // This is expected to be a static symbol on Linux GL implementations, except if we use the nvidia headers - bah glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements"); diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 91421f3c95..0c2da7dd08 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -87,6 +87,7 @@ public: BOOL mHasCompressedTextures; BOOL mHasFramebufferObject; BOOL mHasFramebufferMultisample; + BOOL mHasBlendFuncSeparate; // ARB Extensions BOOL mHasVertexBufferObject; diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index f33ae7d8f0..f6d35bc766 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -216,6 +216,9 @@ extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB; extern PFNGLCOLORTABLEEXTPROC glColorTableEXT; +//GL_EXT_blend_func_separate +extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT; + //GL_EXT_framebuffer_object extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT; extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT; @@ -249,7 +252,10 @@ extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT; # include "GL/glh_extensions.h" # undef __APPLE__ -#elif LL_LINUX +#elif LL_LINUX +//---------------------------------------------------------------------------- +// LL_LINUX + //---------------------------------------------------------------------------- // Linux, MESA headers, but not necessarily assuming MESA runtime. // quotes so we get libraries/.../GL/ version @@ -285,6 +291,7 @@ extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT; # define LL_LINUX_NV_GL_HEADERS 0 #endif // LL_LINUX && defined(WINGDIAPI) + #if LL_LINUX_NV_GL_HEADERS // Missing functions when using nvidia headers: extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; @@ -445,6 +452,9 @@ extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB; extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB; extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB; +//GL_EXT_blend_func_separate +extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT; + //GL_EXT_framebuffer_object extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT; extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT; @@ -473,7 +483,10 @@ extern PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT; //GL_ARB_draw_buffers extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB; + #elif LL_WINDOWS +//---------------------------------------------------------------------------- +// LL_WINDOWS // windows gl headers depend on things like APIENTRY, so include windows. #define WIN32_LEAN_AND_MEAN @@ -641,6 +654,9 @@ extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB; extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB; extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB; +//GL_EXT_blend_func_separate +extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT; + //GL_EXT_framebuffer_object extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT; extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT; @@ -669,6 +685,7 @@ extern PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT; //GL_ARB_draw_buffers extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB; + #elif LL_DARWIN //---------------------------------------------------------------------------- // LL_DARWIN @@ -685,6 +702,9 @@ extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB; // Note that they also must not be called on 10.3.9. This should be taken care of by a runtime check for the existence of the GL extension. #include <AvailabilityMacros.h> +//GL_EXT_blend_func_separate +extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // GL_EXT_framebuffer_object extern GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; extern void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 57e7dbe77d..6622178196 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -766,8 +766,10 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; - mCurrBlendSFactor = BF_UNDEF; - mCurrBlendDFactor = BF_UNDEF; + mCurrBlendColorSFactor = BF_UNDEF; + mCurrBlendAlphaSFactor = BF_UNDEF; + mCurrBlendColorDFactor = BF_UNDEF; + mCurrBlendAlphaDFactor = BF_UNDEF; } LLRender::~LLRender() @@ -975,15 +977,44 @@ void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor) { llassert(sfactor < BF_UNDEF); llassert(dfactor < BF_UNDEF); - if (mCurrBlendSFactor != sfactor || mCurrBlendDFactor != dfactor) + if (mCurrBlendColorSFactor != sfactor || mCurrBlendColorDFactor != dfactor || + mCurrBlendAlphaSFactor != sfactor || mCurrBlendAlphaDFactor != dfactor) { - mCurrBlendSFactor = sfactor; - mCurrBlendDFactor = dfactor; + mCurrBlendColorSFactor = sfactor; + mCurrBlendAlphaSFactor = sfactor; + mCurrBlendColorDFactor = dfactor; + mCurrBlendAlphaDFactor = dfactor; flush(); glBlendFunc(sGLBlendFactor[sfactor], sGLBlendFactor[dfactor]); } } +void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, + eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor) +{ + llassert(color_sfactor < BF_UNDEF); + llassert(color_dfactor < BF_UNDEF); + llassert(alpha_sfactor < BF_UNDEF); + llassert(alpha_dfactor < BF_UNDEF); + if (!gGLManager.mHasBlendFuncSeparate) + { + LL_WARNS_ONCE("render") << "no glBlendFuncSeparateEXT(), using color-only blend func" << llendl; + blendFunc(color_sfactor, color_dfactor); + return; + } + if (mCurrBlendColorSFactor != color_sfactor || mCurrBlendColorDFactor != color_dfactor || + mCurrBlendAlphaSFactor != alpha_sfactor || mCurrBlendAlphaDFactor != alpha_dfactor) + { + mCurrBlendColorSFactor = color_sfactor; + mCurrBlendAlphaSFactor = alpha_sfactor; + mCurrBlendColorDFactor = color_dfactor; + mCurrBlendAlphaDFactor = alpha_dfactor; + flush(); + glBlendFuncSeparateEXT(sGLBlendFactor[color_sfactor], sGLBlendFactor[color_dfactor], + sGLBlendFactor[alpha_sfactor], sGLBlendFactor[alpha_dfactor]); + } +} + LLTexUnit* LLRender::getTexUnit(U32 index) { if (index < mTexUnits.size()) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index a73a128368..3cda4b5770 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -323,7 +323,11 @@ public: void setAlphaRejectSettings(eCompareFunc func, F32 value = 0.01f); + // applies blend func to both color and alpha void blendFunc(eBlendFactor sfactor, eBlendFactor dfactor); + // applies separate blend functions to color and alpha + void blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, + eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor); LLTexUnit* getTexUnit(U32 index); @@ -362,8 +366,10 @@ private: std::vector<LLTexUnit*> mTexUnits; LLTexUnit* mDummyTexUnit; - eBlendFactor mCurrBlendSFactor; - eBlendFactor mCurrBlendDFactor; + eBlendFactor mCurrBlendColorSFactor; + eBlendFactor mCurrBlendColorDFactor; + eBlendFactor mCurrBlendAlphaSFactor; + eBlendFactor mCurrBlendAlphaDFactor; F32 mMaxAnisotropy; std::list<LLVector3> mUIOffset; -- cgit v1.2.3 From 9beeb33f091083d10be3169930b9c205efc2821b Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 8 Mar 2010 12:28:33 +0000 Subject: fixes VWR-4214 Glow effect passes through alpha textures where alpha is actually "solid" and its many many dupes. In summary this does the following: * When laying down alpha, uses the new separated color-and-alpha blend func support to suppress existing glow in proportion to the opacity of the incoming fragments * Moves glowing-alpha support from the glow pool to the alpha pool, ensures that the glow pass for a vertex buffer happens after the alpha pass for the vertex buffer so that it doesn't suppress its *own* glow. Tested with all shader modes, FBO on/off, and deferred rendering. Tested with every permutation of alpha/non-alpha/glow/non-glow/fullbright/waterglow/particle interaction I could contrive so far. :) --- indra/newview/lldrawpoolalpha.cpp | 37 ++++++++++++++++++++++++++++++++++++- indra/newview/llvovolume.cpp | 16 +++++----------- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 75973cfa54..9a778a063d 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -204,7 +204,12 @@ void LLDrawPoolAlpha::render(S32 pass) } LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy ? GL_TRUE : GL_FALSE); + + gGL.setColorMask(true, true); + gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA, + LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); renderAlpha(getVertexDataMask()); + gGL.setColorMask(true, false); if (deferred_render && current_shader != NULL) { @@ -283,9 +288,18 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i) { LLSpatialGroup* group = *i; + llassert(group); + llassert(group->mSpatialPartition); + if (group->mSpatialPartition->mRenderByGroup && - !group->isDead()) + !group->isDead()) { + bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. + // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_CLOUD && + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; + LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) @@ -385,6 +399,27 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + + // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. + if (draw_glow_for_this_partition && + params.mGlowColor.mV[3] > 0) + { + // install glow-accumulating blend mode + gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color + LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) + + // glow doesn't use vertex colors from the mesh data + params.mVertexBuffer->setBuffer(mask & ~LLVertexBuffer::MAP_COLOR); + glColor4ubv(params.mGlowColor.mV); + + // do the actual drawing, again + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + + // restore our alpha blend mode + gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA, + LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); + } if (params.mTextureMatrix && params.mTexture.notNull()) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 1d3d943b06..91aa994eab 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3317,11 +3317,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, S32 idx = draw_vec.size()-1; - BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || - (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); - + (type == LLRenderPass::PASS_INVISIBLE) || + (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { llwarns << "Non fullbright face has no normals!" << llendl; @@ -3350,12 +3349,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LLViewerTexture* tex = facep->getTexture(); - U8 glow = 0; - - if (type == LLRenderPass::PASS_GLOW) - { - glow = (U8) (facep->getTextureEntry()->getGlow() * 255); - } + U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); if (facep->mVertexBuffer.isNull()) { @@ -4001,7 +3995,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } } - if (LLPipeline::sRenderGlow && te->getGlow() > 0.f) + if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f) { registerFace(group, facep, LLRenderPass::PASS_GLOW); } -- cgit v1.2.3 From fa29257c8fa82cd7b04663868744b06ea58294f0 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 8 Mar 2010 14:51:27 +0000 Subject: VWR-4214 followup Make the fix work for alpha masks ('fast alpha') too - ironically this hasn't ever worked either AFAICT. --- indra/newview/lldrawpoolalpha.cpp | 26 +++++++++++++++++++------- indra/newview/lldrawpoolalpha.h | 7 +++++++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 9a778a063d..7fd7cd3910 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -60,7 +60,9 @@ static BOOL deferred_render = FALSE; LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) : LLRenderPass(type), current_shader(NULL), target_shader(NULL), - simple_shader(NULL), fullbright_shader(NULL) + simple_shader(NULL), fullbright_shader(NULL), + mColorSFactor(LLRender::BF_UNDEF), mColorDFactor(LLRender::BF_UNDEF), + mAlphaSFactor(LLRender::BF_UNDEF), mAlphaDFactor(LLRender::BF_UNDEF) { } @@ -178,9 +180,16 @@ void LLDrawPoolAlpha::render(S32 pass) LLGLSPipelineAlpha gls_pipeline_alpha; + gGL.setColorMask(true, true); + if (LLPipeline::sFastAlpha && !deferred_render) { - LLGLDisable blend_disable(GL_BLEND); + mColorSFactor = LLRender::BF_ONE; // } + mColorDFactor = LLRender::BF_ZERO; // } these are like disabling blend on the color channels, but we're still blending on the alpha channel so that we can suppress glow + mAlphaSFactor = LLRender::BF_ZERO; + mAlphaDFactor = LLRender::BF_ZERO; // block (zero-out) glow where the alpha test succeeds + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.33f); if (mVertexShaderLevel > 0) { @@ -205,10 +214,14 @@ void LLDrawPoolAlpha::render(S32 pass) LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy ? GL_TRUE : GL_FALSE); - gGL.setColorMask(true, true); - gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA, - LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); + mColorSFactor = LLRender::BF_SOURCE_ALPHA; // } regular alpha blend + mColorDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } + mAlphaSFactor = LLRender::BF_ZERO; // } glow suppression + mAlphaDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + renderAlpha(getVertexDataMask()); + gGL.setColorMask(true, false); if (deferred_render && current_shader != NULL) @@ -417,8 +430,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); // restore our alpha blend mode - gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA, - LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); } if (params.mTextureMatrix && params.mTexture.notNull()) diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index 3aa752f72c..61f73d0b31 100644 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -34,6 +34,7 @@ #define LL_LLDRAWPOOLALPHA_H #include "lldrawpool.h" +#include "llrender.h" #include "llframetimer.h" class LLFace; @@ -83,6 +84,12 @@ private: LLGLSLShader* target_shader; LLGLSLShader* simple_shader; LLGLSLShader* fullbright_shader; + + // our 'normal' alpha blend function for this pass + LLRender::eBlendFactor mColorSFactor; + LLRender::eBlendFactor mColorDFactor; + LLRender::eBlendFactor mAlphaSFactor; + LLRender::eBlendFactor mAlphaDFactor; }; class LLDrawPoolAlphaPostWater : public LLDrawPoolAlpha -- cgit v1.2.3 From b9a2c6eafacdaa4838cd62672b3255c3e9c0ee16 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 8 Mar 2010 15:48:27 +0000 Subject: Remove a '#error XXX' I was using to test ifdef-hell. --- indra/llrender/llgl.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 4c256f4b06..97019d48c4 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -640,7 +640,6 @@ void LLGLManager::initExtensions() # if GL_EXT_blend_func_separate mHasBlendFuncSeparate = TRUE; #else -#error XXXXXX mHasBlendFuncSeparate = FALSE; # endif mHasMipMapGeneration = FALSE; -- cgit v1.2.3 From 38334e22e3dbbf7ddc735e8f64a8dc39691d1701 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 8 Mar 2010 21:33:19 -0600 Subject: Multi-threaded file dialog --- indra/newview/llappviewer.cpp | 7 +++++ indra/newview/llfilepicker.cpp | 19 +++++++++----- indra/newview/llfilepicker.h | 2 +- indra/newview/llviewermenufile.cpp | 53 +++++++++++++++++++++++++++++++++++++- indra/newview/llviewermenufile.h | 26 +++++++++++++++++++ 5 files changed, 99 insertions(+), 8 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 33ab12c623..e3bfb823d0 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -78,6 +78,7 @@ #include "llteleporthistory.h" #include "lllocationhistory.h" #include "llfasttimerview.h" +#include "llviewermenufile.h" #include "llvoicechannel.h" #include "llsidetray.h" @@ -1567,6 +1568,8 @@ bool LLAppViewer::cleanup() sTextureFetch->shutDownTextureCacheThread() ; sTextureFetch->shutDownImageDecodeThread() ; + LLFilePickerThread::cleanupClass(); + delete sTextureCache; sTextureCache = NULL; delete sTextureFetch; @@ -1717,6 +1720,8 @@ bool LLAppViewer::initThreads() // Mesh streaming and caching gMeshRepo.init(); + LLFilePickerThread::initClass(); + // *FIX: no error handling here! return true; } @@ -3461,6 +3466,8 @@ void LLAppViewer::idle() LLEventTimer::updateClass(); LLCriticalDamp::updateInterpolants(); LLMortician::updateClass(); + LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() + F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); // Cap out-of-control frame times diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 6a502e8d8c..868d0b67c8 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -211,7 +211,7 @@ BOOL LLFilePicker::setupFilter(ELoadFilter filter) return res; } -BOOL LLFilePicker::getOpenFile(ELoadFilter filter) +BOOL LLFilePicker::getOpenFile(ELoadFilter filter, BOOL blocking) { if( mLocked ) { @@ -230,8 +230,11 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter) setupFilter(filter); - // Modal, so pause agent - send_agent_pause(); + if (blocking) + { + // Modal, so pause agent + send_agent_pause(); + } reset(); @@ -242,10 +245,14 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter) std::string filename = utf16str_to_utf8str(llutf16string(mFilesW)); mFiles.push_back(filename); } - send_agent_resume(); - // Account for the fact that the app has been stalled. - LLFrameTimer::updateFrameTime(); + if (blocking) + { + send_agent_resume(); + // Account for the fact that the app has been stalled. + LLFrameTimer::updateFrameTime(); + } + return success; } diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 98dc36c296..b96f957673 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -113,7 +113,7 @@ public: // open the dialog. This is a modal operation BOOL getSaveFile( ESaveFilter filter = FFSAVE_ALL, const std::string& filename = LLStringUtil::null ); - BOOL getOpenFile( ELoadFilter filter = FFLOAD_ALL ); + BOOL getOpenFile( ELoadFilter filter = FFLOAD_ALL, BOOL blocking = TRUE ); BOOL getMultipleOpenFiles( ELoadFilter filter = FFLOAD_ALL ); // Get the filename(s) found. getFirstFile() sets the pointer to diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index e260220493..8b53751275 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -100,6 +100,57 @@ class LLFileEnableUploadModel : public view_listener_t } }; +LLMutex* LLFilePickerThread::sMutex = NULL; +std::queue<LLFilePickerThread*> LLFilePickerThread::sDeadQ; + +//virtual +void LLFilePickerThread::run() +{ + LLFilePicker picker; + if (picker.getOpenFile(mFilter, FALSE)) + { + mFile = picker.getFirstFile(); + } + + { + LLMutexLock lock(sMutex); + sDeadQ.push(this); + } + +} + +//static +void LLFilePickerThread::initClass() +{ + sMutex = new LLMutex(NULL); +} + +//static +void LLFilePickerThread::cleanupClass() +{ + clearDead(); + + delete sMutex; + sMutex = NULL; +} + +//static +void LLFilePickerThread::clearDead() +{ + if (!sDeadQ.empty()) + { + LLMutexLock lock(sMutex); + while (!sDeadQ.empty()) + { + LLFilePickerThread* thread = sDeadQ.front(); + thread->notify(thread->mFile); + delete thread; + sDeadQ.pop(); + } + } +} + + //============================================================================ #if LL_WINDOWS @@ -290,7 +341,7 @@ class LLFileUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::showInstance("upload_model"); + LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::getInstance("upload_model"); if (fmp) { fmp->loadModel(3); diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index e700b0565e..8936b5cdb4 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -36,6 +36,7 @@ #include "llfoldertype.h" #include "llassetstorage.h" #include "llinventorytype.h" +#include "llfilepicker.h" class LLTransactionID; @@ -120,5 +121,30 @@ void on_new_single_inventory_upload_complete( const LLSD& server_response, S32 upload_price); +class LLFilePickerThread : public LLThread +{ //multi-threaded file picker (runs system specific file picker in background and calls "notify" from main thread) +public: + + static std::queue<LLFilePickerThread*> sDeadQ; + static LLMutex* sMutex; + + static void initClass(); + static void cleanupClass(); + static void clearDead(); + + std::string mFile; + + LLFilePicker::ELoadFilter mFilter; + + LLFilePickerThread(LLFilePicker::ELoadFilter filter) + : LLThread("file picker"), mFilter(filter) + { + + } + virtual void run(); + + virtual void notify(const std::string& filename) = 0; +}; + #endif -- cgit v1.2.3 From b26d5803468c029bba735acf2ae57ea50b542dee Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 8 Mar 2010 21:50:24 -0600 Subject: little bool --- indra/newview/llfilepicker.cpp | 2 +- indra/newview/llfilepicker.h | 2 +- indra/newview/llviewermenufile.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 868d0b67c8..fe30556234 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -211,7 +211,7 @@ BOOL LLFilePicker::setupFilter(ELoadFilter filter) return res; } -BOOL LLFilePicker::getOpenFile(ELoadFilter filter, BOOL blocking) +BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) { if( mLocked ) { diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index b96f957673..10fb30af9f 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -113,7 +113,7 @@ public: // open the dialog. This is a modal operation BOOL getSaveFile( ESaveFilter filter = FFSAVE_ALL, const std::string& filename = LLStringUtil::null ); - BOOL getOpenFile( ELoadFilter filter = FFLOAD_ALL, BOOL blocking = TRUE ); + BOOL getOpenFile( ELoadFilter filter = FFLOAD_ALL, bool blocking = true ); BOOL getMultipleOpenFiles( ELoadFilter filter = FFLOAD_ALL ); // Get the filename(s) found. getFirstFile() sets the pointer to diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 8b53751275..b22a74080f 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -107,7 +107,7 @@ std::queue<LLFilePickerThread*> LLFilePickerThread::sDeadQ; void LLFilePickerThread::run() { LLFilePicker picker; - if (picker.getOpenFile(mFilter, FALSE)) + if (picker.getOpenFile(mFilter, false)) { mFile = picker.getFirstFile(); } -- cgit v1.2.3 From 68991a2cce21932137a2d678f4258dad83ee27d6 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 8 Mar 2010 22:16:08 -0600 Subject: Mac and linux fix? --- indra/newview/llfilepicker.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index fe30556234..324d99937e 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -834,7 +834,7 @@ OSStatus LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& fi return error; } -BOOL LLFilePicker::getOpenFile(ELoadFilter filter) +BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) { if( mLocked ) return FALSE; @@ -853,20 +853,29 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter) mNavOptions.optionFlags |= kNavSupportPackages; } - // Modal, so pause agent - send_agent_pause(); + if (blocking) + { + // Modal, so pause agent + send_agent_pause(); + } + { error = doNavChooseDialog(filter); } - send_agent_resume(); + if (error == noErr) { if (getFileCount()) success = true; } - // Account for the fact that the app has been stalled. - LLFrameTimer::updateFrameTime(); + if (blocking) + { + send_agent_resume(); + // Account for the fact that the app has been stalled. + LLFrameTimer::updateFrameTime(); + } + return success; } @@ -1223,7 +1232,7 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename return rtn; } -BOOL LLFilePicker::getOpenFile( ELoadFilter filter ) +BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) { BOOL rtn = FALSE; -- cgit v1.2.3 From 4c022455685598bfd3ab90c4611e053fad72345d Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 9 Mar 2010 13:28:23 +0000 Subject: Disable alpha-masking for glowing surfaces. It seems beyond my ability to get right. Refactor some replicated and/or strangely-expressed logic. --- indra/newview/llspatialpartition.h | 5 +++-- indra/newview/llvovolume.cpp | 24 ++++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 88fab01ea4..d74216de2d 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -614,14 +614,15 @@ public: //class for wrangling geometry out of volumes (implemented in LLVOVolume.cpp) class LLVolumeGeometryManager: public LLGeometryManager { -public: + public: virtual ~LLVolumeGeometryManager() { } virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); - + private: + bool canRenderAsMask(LLFace* facep); // logic helper }; //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 91aa994eab..90a06a966d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3319,7 +3319,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + (type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)); if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { @@ -3414,6 +3414,16 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); +bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) +{ + const LLTextureEntry* te = facep->getTextureEntry(); + return (LLPipeline::sFastAlpha && + (te->getColor().mV[3] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask + facep->getTexture()->getIsAlphaMask()); +} + void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (group->changeLOD()) @@ -3539,10 +3549,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3891,15 +3898,12 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: const LLTextureEntry* te = facep->getTextureEntry(); - BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE; + BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; if (is_alpha) { // can we safely treat this as an alpha mask? - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { if (te->getFullbright()) { -- cgit v1.2.3 From 8da956d60926cb9c62c15e6766ea542049690777 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 9 Mar 2010 13:45:53 +0000 Subject: We can enable alpha masking for fullbright faces as long as we're not in deferred mode. Deferred masked fullbrights are still broken (we fall back to blending instead of masking as a workaround), but they always have been. :/ --- indra/newview/llvovolume.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 90a06a966d..1725879b7f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3417,11 +3417,15 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) { const LLTextureEntry* te = facep->getTextureEntry(); - return (LLPipeline::sFastAlpha && - (te->getColor().mV[3] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + return ( + LLPipeline::sFastAlpha && // do we want masks at all? + + (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha + !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - facep->getTexture()->getIsAlphaMask()); + + facep->getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily calculated but expensive) + ); } void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) -- cgit v1.2.3 From d60f5e937f2ed264f3e01eec7e32b9260e3d772f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 9 Mar 2010 14:28:06 -0600 Subject: Tool tips for model preview. Rename "Impostor" to "Lowest" --- indra/llmath/llvolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 904786079f..d85c56046f 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1918,7 +1918,7 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) std::string nm[] = { - "impostor", + "lowest_lod", "low_lod", "medium_lod", "high_lod" -- cgit v1.2.3 From 4c0e2f79219913b57424bfe136b75a6a58fb8639 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 11 Mar 2010 12:02:37 -0600 Subject: "Generate Normals" is less busted now. --- indra/llmath/llvolume.cpp | 67 ++++++++++++++++++++++++++++++++++++++++++++--- indra/llmath/llvolume.h | 33 +++++++++++++++++++++++ 2 files changed, 97 insertions(+), 3 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index d85c56046f..9ea3912a88 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1882,9 +1882,15 @@ bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs bool retval = false; if (rhs.mPosition == mPosition && rhs.mTexCoord == mTexCoord) { - F32 cur_angle = rhs.mNormal*mNormal; - - retval = cur_angle > angle_cutoff; + if (angle_cutoff > 1.f) + { + retval = (mNormal == rhs.mNormal); + } + else + { + F32 cur_angle = rhs.mNormal*mNormal; + retval = cur_angle > angle_cutoff; + } } return retval; @@ -4953,6 +4959,61 @@ BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build) } } +void LLVolumeFace::optimize(F32 angle_cutoff) +{ + LLVolumeFace new_face; + + VertexMapData::PointMap point_map; + + //remove redundant vertices + for (U32 i = 0; i < mIndices.size(); ++i) + { + U16 index = mIndices[i]; + + LLVolumeFace::VertexData cv = mVertices[index]; + + BOOL found = FALSE; + VertexMapData::PointMap::iterator point_iter = point_map.find(cv.mPosition); + if (point_iter != point_map.end()) + { //duplicate point might exist + for (U32 j = 0; j < point_iter->second.size(); ++j) + { + LLVolumeFace::VertexData& tv = (point_iter->second)[j]; + if (tv.compareNormal(cv, angle_cutoff)) + { + found = TRUE; + new_face.mIndices.push_back((point_iter->second)[j].mIndex); + break; + } + } + } + + if (!found) + { + new_face.mVertices.push_back(cv); + U16 index = (U16) new_face.mVertices.size()-1; + new_face.mIndices.push_back(index); + + VertexMapData d; + d.mPosition = cv.mPosition; + d.mTexCoord = cv.mTexCoord; + d.mNormal = cv.mNormal; + d.mIndex = index; + if (point_iter != point_map.end()) + { + point_iter->second.push_back(d); + } + else + { + point_map[d.mPosition].push_back(d); + } + } + } + + mVertices = new_face.mVertices; + mIndices = new_face.mIndices; +} + void LerpPlanarVertex(LLVolumeFace::VertexData& v0, LLVolumeFace::VertexData& v1, LLVolumeFace::VertexData& v2, diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 36811785dc..f1c1fdceba 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -820,6 +820,39 @@ public: bool compareNormal(const VertexData& rhs, F32 angle_cutoff) const; }; + class VertexMapData : public LLVolumeFace::VertexData + { + public: + U16 mIndex; + + bool operator==(const LLVolumeFace::VertexData& rhs) const + { + return mPosition == rhs.mPosition && + mTexCoord == rhs.mTexCoord && + mNormal == rhs.mNormal; + } + + struct ComparePosition + { + bool operator()(const LLVector3& a, const LLVector3& b) const + { + if (a.mV[0] != b.mV[0]) + { + return a.mV[0] < b.mV[0]; + } + if (a.mV[1] != b.mV[1]) + { + return a.mV[1] < b.mV[1]; + } + return a.mV[2] < b.mV[2]; + } + }; + + typedef std::map<LLVector3, std::vector<VertexMapData>, VertexMapData::ComparePosition > PointMap; + }; + + void optimize(F32 angle_cutoff = 2.f); + enum { SINGLE_MASK = 0x0001, -- cgit v1.2.3 From 294e7036e48b7efc17b2d48ebc050045bb0c5d14 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 12 Mar 2010 17:24:57 -0600 Subject: Fix for file dialog crashing on mac and linux when uploading meshes. --- indra/newview/llviewermenufile.cpp | 18 +++++++++++++++++- indra/newview/llviewermenufile.h | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index b22a74080f..1026ff86a5 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -103,15 +103,31 @@ class LLFileEnableUploadModel : public view_listener_t LLMutex* LLFilePickerThread::sMutex = NULL; std::queue<LLFilePickerThread*> LLFilePickerThread::sDeadQ; +void LLFilePickerThread::getFile() +{ +#if LL_WINDOWS + start(); +#else + run(); +#endif +} + //virtual void LLFilePickerThread::run() { LLFilePicker picker; +#if LL_WINDOWS if (picker.getOpenFile(mFilter, false)) { mFile = picker.getFirstFile(); } - +#else + if (picker.getOpenFile(mFilter, true)) + { + mFile = picker.getFirstFile(); + } +#endif + { LLMutexLock lock(sMutex); sDeadQ.push(this); diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 8936b5cdb4..08444551a9 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -141,6 +141,9 @@ public: { } + + void getFile(); + virtual void run(); virtual void notify(const std::string& filename) = 0; -- cgit v1.2.3 From 71d11af31083ced30da7b67a2a63e624c93b44a3 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 13 Mar 2010 17:39:32 -0600 Subject: Mesh cache. Has a bug. --- indra/llmath/llvolume.cpp | 28 ++++++++++++++-------------- indra/llmath/llvolume.h | 2 +- indra/llvfs/llvfile.cpp | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 9ea3912a88..52a3fb2195 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1962,7 +1962,7 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) return unpackVolumeFaces(is, header[nm[lod]]["size"].asInteger()); } -BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) +bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) { U8* result = NULL; U32 cur_size = 0; @@ -2002,7 +2002,7 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) inflateEnd(&strm); free(result); delete [] in; - return FALSE; + return false; } switch (ret) @@ -2014,7 +2014,7 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) inflateEnd(&strm); free(result); delete [] in; - return FALSE; + return false; break; } @@ -2032,7 +2032,7 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) if (ret != Z_STREAM_END) { free(result); - return FALSE; + return false; } } @@ -2047,7 +2047,7 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) if (!LLSDSerialize::deserialize(mdl, istr, cur_size)) { llwarns << "not a valid mesh asset!" << llendl; - return FALSE; + return false; } } @@ -2074,7 +2074,7 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) LLVolumeFace& face = mVolumeFaces[i]; - face.mHasBinormals = FALSE; + face.mHasBinormals = false; //copy out indices face.mIndices.resize(idx.size()/2); @@ -2146,24 +2146,24 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) // modifier flags? - BOOL do_mirror = (mParams.getSculptType() & LL_SCULPT_FLAG_MIRROR); - BOOL do_invert = (mParams.getSculptType() &LL_SCULPT_FLAG_INVERT); + bool do_mirror = (mParams.getSculptType() & LL_SCULPT_FLAG_MIRROR); + bool do_invert = (mParams.getSculptType() &LL_SCULPT_FLAG_INVERT); // translate to actions: - BOOL do_reflect_x = FALSE; - BOOL do_reverse_triangles = FALSE; - BOOL do_invert_normals = FALSE; + bool do_reflect_x = false; + bool do_reverse_triangles = false; + bool do_invert_normals = false; if (do_mirror) { - do_reflect_x = TRUE; + do_reflect_x = true; do_reverse_triangles = !do_reverse_triangles; } if (do_invert) { - do_invert_normals = TRUE; + do_invert_normals = true; do_reverse_triangles = !do_reverse_triangles; } @@ -2201,7 +2201,7 @@ BOOL LLVolume::unpackVolumeFaces(std::istream& is, S32 size) } mSculptLevel = 0; // success! - return TRUE; + return true; } void tetrahedron_set_normal(LLVolumeFace::VertexData* cv) diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index f1c1fdceba..60c1569e55 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -1009,7 +1009,7 @@ protected: public: virtual BOOL createVolumeFacesFromFile(const std::string& file_name); virtual BOOL createVolumeFacesFromStream(std::istream& is); - virtual BOOL unpackVolumeFaces(std::istream& is, S32 size); + virtual bool unpackVolumeFaces(std::istream& is, S32 size); virtual void makeTetrahedron(); virtual BOOL isTetrahedron(); diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index e0e282d7af..6751f3eb93 100644 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -320,7 +320,7 @@ BOOL LLVFile::setMaxSize(S32 size) if (!mVFS->checkAvailable(size)) { - LLFastTimer t(FTM_VFILE_WAIT); + //LLFastTimer t(FTM_VFILE_WAIT); S32 count = 0; while (sVFSThread->getPending() > 1000) { -- cgit v1.2.3 From 80eeff0297be277c79683c293ab46eda2a5e7fb0 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 16 Mar 2010 14:08:11 -0500 Subject: Alert dialog when mesh upload fails. --- indra/newview/skins/default/xui/en/notifications.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a3abe36db4..f204b8082a 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5905,6 +5905,12 @@ Selected button can not be shown right now. The button will be shown when there is enough space for it. </notification> + <notification + name="MeshUploadError" + icon="alert.tga" + type="alert"> + [LABEL] failed to upload: [MESSAGE] [IDENTIFIER] [INVALIDITY_IDENTIFIER] + </notification> <global name="UnsupportedCPU"> - Your CPU speed does not meet the minimum requirements. -- cgit v1.2.3 From 4f46c4ef41298a58c165288511b1e919acbff6b8 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 17 Mar 2010 15:36:52 -0500 Subject: Disable fast alpha by default. Pull scene importer option from upload menu. --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/skins/default/xui/en/menu_inventory_add.xml | 14 ++------------ .../newview/skins/default/xui/en/panel_main_inventory.xml | 10 ---------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2fb3f52692..8d6a1790f1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6916,7 +6916,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> <key>RenderFastUI</key> <map> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index 05a4e60de7..4e178eef96 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -42,7 +42,7 @@ <menu_item_call.on_enable function="File.EnableUpload" /> </menu_item_call> - <menu_item_call + <menu_item_call label="Model..." layout="topleft" name="Upload Model"> @@ -51,17 +51,7 @@ parameter="" /> <menu_item_call.on_enable function="File.EnableUploadModel" /> - </menu_item_call> - <menu_item_call - label="Scene..." - layout="topleft" - name="Upload Scene"> - <menu_item_call.on_click - function="File.UploadScene" - parameter="" /> - <menu_item_call.on_enable - function="File.EnableUpload" /> - </menu_item_call> + </menu_item_call> <menu_item_call label="Bulk (L$[COST] per file)..." layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index cbe36626fe..65da20ae8c 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -89,16 +89,6 @@ <menu_item_call.on_enable function="File.EnableUploadModel" /> </menu_item_call> - <menu_item_call - label="Scene..." - layout="topleft" - name="Upload Scene"> - <menu_item_call.on_click - function="File.UploadScene" - parameter="" /> - <menu_item_call.on_enable - function="File.EnableUpload" /> - </menu_item_call> <menu_item_call label="Bulk (L$[COST] per file)..." layout="topleft" -- cgit v1.2.3 From 7c3bc40df78398b446a74b313b9068fc59db4756 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 17 Mar 2010 21:17:01 -0500 Subject: Fix for impostors being fullbright when deferred rendering enabled. --- indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 8c140a7b4f..508bbf415e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -11,7 +11,8 @@ uniform sampler2D specularMap; void main() { - gl_FragData[0] = texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragData[0] = vec4(col.rgb, col.a <= 0.5 ? 0.0 : 0.005); gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); } -- cgit v1.2.3 From 0afe2491ab6a05bf62a2fce438dfdbbaf0b191df Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 17 Mar 2010 22:22:02 -0500 Subject: CTS-110 Remove soft alpha in deferred pipeline (breaks some content). Will revisit soft alpha in materials project. --- .../newview/app_settings/shaders/class1/deferred/alphaF.glsl | 11 ----------- .../app_settings/shaders/class1/deferred/fullbrightF.glsl | 11 ----------- .../newview/app_settings/shaders/class2/deferred/alphaF.glsl | 11 ----------- indra/newview/pipeline.cpp | 1 - 4 files changed, 34 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 4fb109d687..fea2e16090 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -24,8 +24,6 @@ varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_light; -uniform float alpha_soften; - uniform mat4 inv_proj; vec4 getPosition(vec2 pos_screen) @@ -57,15 +55,6 @@ void main() color.rgb = scaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && gl_Color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = gl_Color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index e518bddb98..0db9586a88 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -23,8 +23,6 @@ varying vec4 vary_position; varying vec3 vary_normal; varying vec3 vary_fragcoord; -uniform float alpha_soften; - uniform mat4 inv_proj; vec4 getPosition(vec2 pos_screen) @@ -56,15 +54,6 @@ void main() color.rgb = fullbrightScaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index ad16de6d81..665fe16b43 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -29,8 +29,6 @@ varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_light; -uniform float alpha_soften; - uniform float shadow_bias; uniform mat4 inv_proj; @@ -115,15 +113,6 @@ void main() color.rgb = scaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && gl_Color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = gl_Color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1)*shadow; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e65c8b9af8..ee5ed32a83 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6249,7 +6249,6 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen shader.uniform2f("screen_res", mDeferredScreen.getWidth(), mDeferredScreen.getHeight()); shader.uniform1f("near_clip", LLViewerCamera::getInstance()->getNear()*2.f); - shader.uniform1f("alpha_soften", gSavedSettings.getF32("RenderDeferredAlphaSoften")); shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")); shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")); shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale")); -- cgit v1.2.3 From 4a12ace4f58c7cc432dcefe408c72285e9e81d12 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 18 Mar 2010 15:43:37 -0500 Subject: XML changes for new graphics preferences --- indra/newview/app_settings/settings.xml | 26 +- .../default/xui/en/panel_preferences_graphics1.xml | 285 ++++++++++----------- 2 files changed, 163 insertions(+), 148 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8d6a1790f1..38d0df9a17 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6657,6 +6657,18 @@ <integer>1</integer> </map> + <key>RenderDeferredSSAO</key> + <map> + <key>Comment</key> + <string>Execute screen space ambient occlusion shader in deferred renderer.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>RenderDeferredBlurLight</key> <map> <key>Comment</key> @@ -7289,7 +7301,19 @@ <key>Value</key> <integer>2</integer> </map> - <key>RenderReflectionRes</key> + <key>RenderShadowDetail</key> + <map> + <key>Comment</key> + <string>Detail of shadows.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>2</integer> + </map> + + <key>RenderReflectionRes</key> <map> <key>Comment</key> <string>Reflection map resolution.</string> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index c74de043e9..3a37486e86 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -182,12 +182,12 @@ visiblity_control="ShowAdvancedGraphicsSettings" border="false" follows="top|left" - height="260" + height="283" label="CustomGraphics" layout="topleft" left="5" name="CustomGraphics Panel" - top="124" + top="101" width="485"> <text type="string" @@ -238,119 +238,105 @@ <check_box.commit_callback function="Pref.VertexShaderEnable" /> </check_box> - <check_box - control_name="RenderWaterReflections" - height="16" - initial_value="true" - label="Water reflections" - layout="topleft" - left_delta="0" - name="Reflections" - top_pad="1" - width="256"> - <check_box.commit_callback - function="Pref.VertexShaderEnable" /> - </check_box> - <text - type="string" - length="1" - follows="left|top" - height="12" - layout="topleft" - left_delta="0" - name="ReflectionDetailText" - top_pad="7" - width="128"> - Reflection detail: - </text> - <radio_group - control_name="RenderReflectionDetail" - draw_border="false" - height="70" - layout="topleft" - left_delta="-2" - name="ReflectionDetailRadio" - top_pad="3" - width="321"> - <radio_item - height="16" - label="Terrain and trees" - layout="topleft" - left="3" - name="0" - top="3" - width="315" /> - <radio_item - height="16" - label="All static objects" - layout="topleft" - left_delta="0" - name="1" - top_delta="16" - width="315" /> - <radio_item - height="16" - label="All avatars and objects" - layout="topleft" - left_delta="0" - name="2" - top_delta="16" - width="315" /> - <radio_item - height="16" - label="Everything" - layout="topleft" - left_delta="0" - name="3" - top_delta="16" - width="315" /> - </radio_group> - <text - type="string" - length="1" - follows="left|top" - height="12" - layout="topleft" - left_delta="2" - name="AvatarRenderingText" - top_pad="5" - width="128"> - Avatar rendering: - </text> - <check_box - control_name="RenderUseImpostors" - height="16" - initial_value="true" - label="Avatar impostors" - layout="topleft" - left_delta="0" - name="AvatarImpostors" - top_pad="7" - width="256" /> - <check_box - control_name="RenderAvatarVP" + <check_box + control_name="RenderDeferred" height="16" initial_value="true" - label="Hardware skinning" + label="Lighting Shaders" layout="topleft" left_delta="0" - name="AvatarVertexProgram" + name="UseLightShaders" top_pad="1" - width="256"> - <check_box.commit_callback - function="Pref.VertexShaderEnable" /> - </check_box> - <check_box - control_name="RenderAvatarCloth" + width="256"/> + <check_box + control_name="RenderDeferredSSAO" height="16" initial_value="true" - label="Avatar cloth" + label="Ambient Occlusion" layout="topleft" left_delta="0" - name="AvatarCloth" + name="UseSSAO" top_pad="1" - width="256" /> + width="256"/> + <text + type="string" + length="1" + top_pad="8" + follows="top|left" + height="23" + width="110" + word_wrap="true" + layout="topleft" + left="10" + name="reflection_label"> + Water Reflections: + </text> + <combo_box + control_name="RenderReflectionDetail" + height="23" + layout="topleft" + left_="10" + top_pad ="0" + name="ReflectionDetailRadio" + width="150"> + <combo_box.item + label="None" + name="0" + value="0"/> + <combo_box.item + label="Terrain and trees" + name="1" + value="1"/> + <combo_box.item + label="All static objects" + name="2" + value="2"/> + <combo_box.item + label="All avatars and objects" + name="3" + value="3"/> + <combo_box.item + label="Everything" + name="4" + value="4"/> + </combo_box> + + <text + type="string" + length="1" + top_pad="8" + follows="top|left" + height="23" + width="110" + word_wrap="true" + layout="topleft" + left="10" + name="shadows_label"> + Shadows: + </text> + <combo_box + control_name="RenderShadowDetail" + height="23" + layout="topleft" + left="10" + top_pad="0" + name="ShadowDetailRadio" + width="150"> + <combo_box.item + label="None" + name="0" + value="0"/> + <combo_box.item + label="Sun/Moon" + name="1" + value="1"/> + <combo_box.item + label="Sun/Moon + Projectors" + name="2" + value="2"/> + </combo_box> + <slider control_name="RenderFarClip" decimal_digits="0" @@ -549,7 +535,7 @@ layout="topleft" left="444" name="PostProcessText" - top="305" + top="328" width="128"> Low </text> @@ -626,46 +612,51 @@ width="128"> Low </text> - <text - type="string" - length="1" - follows="left|top" - height="12" - layout="topleft" - left_delta="-230" - name="LightingDetailText" - top_pad="8" - width="140"> - Lighting detail: - </text> - <radio_group - control_name="RenderLightingDetail" - draw_border="false" - height="38" - layout="topleft" - left_delta="0" - name="LightingDetailRadio" - top_pad="5" - width="321"> - <radio_item - height="16" - label="Sun and moon only" - layout="topleft" - left="3" - name="SunMoon" - value="0" - top="3" - width="156" /> - <radio_item - height="16" - label="Nearby local lights" - layout="topleft" - left_delta="0" - name="LocalLights" - value="1" - top_delta="16" - width="156" /> - </radio_group> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="-230" + name="AvatarRenderingText" + top_pad="8" + width="128"> + Avatar rendering: + </text> + <check_box + control_name="RenderUseImpostors" + height="16" + initial_value="true" + label="Avatar impostors" + layout="topleft" + left_delta="0" + name="AvatarImpostors" + top_pad="7" + width="256" /> + <check_box + control_name="RenderAvatarVP" + height="16" + initial_value="true" + label="Hardware skinning" + layout="topleft" + left_delta="0" + name="AvatarVertexProgram" + top_pad="1" + width="256"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> + <check_box + control_name="RenderAvatarCloth" + height="16" + initial_value="true" + label="Avatar cloth" + layout="topleft" + left_delta="0" + name="AvatarCloth" + top_pad="1" + width="256" /> <text type="string" length="1" @@ -674,7 +665,7 @@ layout="topleft" left="358" name="TerrainDetailText" - top="465" + top="488" width="155"> Terrain detail: </text> @@ -703,7 +694,7 @@ name="2" top_delta="16" width="315" /> - </radio_group> + </radio_group> --> </panel> <button -- cgit v1.2.3 From 16b5db66419fdad8a8f958fd4e542c96429965ae Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 19 Mar 2010 14:34:49 -0500 Subject: Replace usage of RenderWaterReflections with RenderReflectionDetail. --- indra/newview/app_settings/high_graphics.xml | 2 -- indra/newview/app_settings/low_graphics.xml | 4 ++-- indra/newview/app_settings/mid_graphics.xml | 4 ++-- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/app_settings/ultra_graphics.xml | 4 +--- indra/newview/featuretable.txt | 17 ++++++----------- indra/newview/llfloaterpreference.cpp | 4 ++-- indra/newview/pipeline.cpp | 13 ++++++------- .../default/xui/en/panel_preferences_graphics1.xml | 2 +- 9 files changed, 20 insertions(+), 41 deletions(-) diff --git a/indra/newview/app_settings/high_graphics.xml b/indra/newview/app_settings/high_graphics.xml index 6368f7099e..c3fa2ab75e 100644 --- a/indra/newview/app_settings/high_graphics.xml +++ b/indra/newview/app_settings/high_graphics.xml @@ -31,8 +31,6 @@ <!--Default for now--> <RenderVolumeLODFactor value="1.125"/> <!--NO SHADERS--> - <RenderWaterReflections value="FALSE"/> - <!--NO SHADERS--> <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index 3f67a70d7a..cff5bb0dfe 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -31,8 +31,8 @@ <!--Default for now--> <RenderVolumeLODFactor value="1.125"/> <!--NO SHADERS--> - <RenderWaterReflections value="FALSE"/> - <!--NO SHADERS--> + <RenderReflectionDetail value="0"/> + <!--NO SHADERS--> <VertexShaderEnable value="FALSE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index 12da77da40..6f919f153d 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -31,8 +31,8 @@ <!--Default for now--> <RenderVolumeLODFactor value="1.125"/> <!--NO SHADERS--> - <RenderWaterReflections value="FALSE"/> - <!--NO SHADERS--> + <RenderReflectionDetail value="0"/> + <!--NO SHADERS--> <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 38d0df9a17..900ae6259e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7610,17 +7610,6 @@ <key>Value</key> <integer>512</integer> </map> - <key>RenderWaterReflections</key> - <map> - <key>Comment</key> - <string>Reflect the environment in the water.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>RotateRight</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/ultra_graphics.xml b/indra/newview/app_settings/ultra_graphics.xml index f16ec6c30f..149aa32000 100644 --- a/indra/newview/app_settings/ultra_graphics.xml +++ b/indra/newview/app_settings/ultra_graphics.xml @@ -19,7 +19,7 @@ <!--bump okay--> <RenderObjectBump value="TRUE"/> <!--NO SHADERS--> - <RenderReflectionDetail value="3"/> + <RenderReflectionDetail value="4"/> <!--Simple--> <RenderTerrainDetail value="1"/> <!--Default for now--> @@ -31,8 +31,6 @@ <!--Default for now--> <RenderVolumeLODFactor value="2.0"/> <!--NO SHADERS--> - <RenderWaterReflections value="TRUE"/> - <!--NO SHADERS--> <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 4029bf95a0..7f13240e60 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -23,7 +23,7 @@ version 21 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 0 +RenderAnisotropic 1 1 RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarVP 1 1 @@ -39,14 +39,13 @@ RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 @@ -78,7 +77,6 @@ RenderTerrainLODFactor 1 1 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 @@ -103,7 +101,6 @@ RenderTerrainLODFactor 1 1.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 @@ -128,7 +125,6 @@ RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 @@ -147,13 +143,12 @@ RenderGlowResolutionPow 1 9 RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 @@ -194,7 +189,7 @@ RenderVBOEnable 1 1 list NoPixelShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 @@ -204,7 +199,7 @@ WindLightUseAtmosShaders 0 0 list NoVertexShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 @@ -220,7 +215,7 @@ RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderUseImpostors 0 0 RenderVBOEnable 1 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 WindLightUseAtmosShaders 0 0 // diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 8bffe9bf57..f19683304f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -884,7 +884,7 @@ void LLFloaterPreference::refreshEnabledState() void LLFloaterPreference::disableUnavailableSettings() { - LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections"); + LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections"); LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram"); LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders"); @@ -918,7 +918,7 @@ void LLFloaterPreference::disableUnavailableSettings() } // disabled reflections - if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderWaterReflections")) + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) { ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(FALSE); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index ee5ed32a83..e61dff139e 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7313,17 +7313,16 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) (1<<LLPipeline::RENDER_TYPE_SKY) | (1<<LLPipeline::RENDER_TYPE_CLOUDS)); - if (gSavedSettings.getBOOL("RenderWaterReflections")) + S32 detail = gSavedSettings.getS32("RenderReflectionDetail"); + if (detail > 0) { //mask out selected geometry based on reflection detail - - S32 detail = gSavedSettings.getS32("RenderReflectionDetail"); - if (detail < 3) + if (detail < 4) { mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_PARTICLES); - if (detail < 2) + if (detail < 3) { mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_AVATAR); - if (detail < 1) + if (detail < 2) { mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_VOLUME); } @@ -7343,7 +7342,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (LLDrawPoolWater::sNeedsDistortionUpdate) { mRenderTypeMask = ref_mask; - if (gSavedSettings.getBOOL("RenderWaterReflections")) + if (gSavedSettings.getS32("RenderReflectionDetail") > 0) { gPipeline.grabReferences(ref_result); LLGLUserClipPlane clip_plane(plane, mat, projection); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 3a37486e86..e38ad01ff9 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -278,7 +278,7 @@ layout="topleft" left_="10" top_pad ="0" - name="ReflectionDetailRadio" + name="Reflections" width="150"> <combo_box.item label="None" -- cgit v1.2.3 From 964d9953c6bc77749fc1083d32daf494232e1a65 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 19 Mar 2010 15:25:04 -0500 Subject: Cleanup of RenderReflectionDetail getting duplicated in low/mid_graphics.xml --- indra/newview/app_settings/low_graphics.xml | 76 ++++++++++++++--------------- indra/newview/app_settings/mid_graphics.xml | 76 ++++++++++++++--------------- 2 files changed, 74 insertions(+), 78 deletions(-) diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index cff5bb0dfe..72cbb2808b 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -1,39 +1,37 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<settings version = "101"> - <!--NO SHADERS--> - <RenderAvatarCloth value="FALSE"/> - <!--Default for now--> - <RenderAvatarLODFactor value="0.5"/> - <!--NO SHADERS--> - <RenderAvatarVP value="FALSE"/> - <!--Short Range--> - <RenderFarClip value="64"/> - <!--Default for now--> - <RenderFlexTimeFactor value="0.5"/> - <!--256... but they don't use this--> - <RenderGlowResolutionPow value="8"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="0"/> - <!--Low number--> - <RenderMaxPartCount value="1024"/> - <!--bump okay--> - <RenderObjectBump value="FALSE"/> - <!--NO SHADERS--> - <RenderReflectionDetail value="0"/> - <!--Simple--> - <RenderTerrainDetail value="0"/> - <!--Default for now--> - <RenderTerrainLODFactor value="1.0"/> - <!--Default for now--> - <RenderTreeLODFactor value="0.5"/> - <!--Try Impostors--> - <RenderUseImpostors value="TRUE"/> - <!--Default for now--> - <RenderVolumeLODFactor value="1.125"/> - <!--NO SHADERS--> - <RenderReflectionDetail value="0"/> - <!--NO SHADERS--> - <VertexShaderEnable value="FALSE"/> - <!--NO SHADERS--> - <WindLightUseAtmosShaders value="FALSE"/> -</settings> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<settings version = "101"> + <!--NO SHADERS--> + <RenderAvatarCloth value="FALSE"/> + <!--Default for now--> + <RenderAvatarLODFactor value="0.5"/> + <!--NO SHADERS--> + <RenderAvatarVP value="FALSE"/> + <!--Short Range--> + <RenderFarClip value="64"/> + <!--Default for now--> + <RenderFlexTimeFactor value="0.5"/> + <!--256... but they don't use this--> + <RenderGlowResolutionPow value="8"/> + <!--Sun/Moon only--> + <RenderLightingDetail value="0"/> + <!--Low number--> + <RenderMaxPartCount value="1024"/> + <!--bump okay--> + <RenderObjectBump value="FALSE"/> + <!--NO SHADERS--> + <RenderReflectionDetail value="0"/> + <!--Simple--> + <RenderTerrainDetail value="0"/> + <!--Default for now--> + <RenderTerrainLODFactor value="1.0"/> + <!--Default for now--> + <RenderTreeLODFactor value="0.5"/> + <!--Try Impostors--> + <RenderUseImpostors value="TRUE"/> + <!--Default for now--> + <RenderVolumeLODFactor value="1.125"/> + <!--NO SHADERS--> + <VertexShaderEnable value="FALSE"/> + <!--NO SHADERS--> + <WindLightUseAtmosShaders value="FALSE"/> +</settings> diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index 6f919f153d..743dfa418c 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -1,39 +1,37 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<settings version = "101"> - <!--NO SHADERS--> - <RenderAvatarCloth value="FALSE"/> - <!--Default for now--> - <RenderAvatarLODFactor value="0.5"/> - <!--NO SHADERS--> - <RenderAvatarVP value="TRUE"/> - <!--Short Range--> - <RenderFarClip value="96"/> - <!--Default for now--> - <RenderFlexTimeFactor value="1"/> - <!--256... but they don't use this--> - <RenderGlowResolutionPow value="8"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="1"/> - <!--Low number--> - <RenderMaxPartCount value="2048"/> - <!--bump okay--> - <RenderObjectBump value="TRUE"/> - <!--NO SHADERS--> - <RenderReflectionDetail value="0"/> - <!--Simple--> - <RenderTerrainDetail value="1"/> - <!--Default for now--> - <RenderTerrainLODFactor value="1.0"/> - <!--Default for now--> - <RenderTreeLODFactor value="0.5"/> - <!--Try Impostors--> - <RenderUseImpostors value="TRUE"/> - <!--Default for now--> - <RenderVolumeLODFactor value="1.125"/> - <!--NO SHADERS--> - <RenderReflectionDetail value="0"/> - <!--NO SHADERS--> - <VertexShaderEnable value="TRUE"/> - <!--NO SHADERS--> - <WindLightUseAtmosShaders value="FALSE"/> -</settings> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<settings version = "101"> + <!--NO SHADERS--> + <RenderAvatarCloth value="FALSE"/> + <!--Default for now--> + <RenderAvatarLODFactor value="0.5"/> + <!--NO SHADERS--> + <RenderAvatarVP value="TRUE"/> + <!--Short Range--> + <RenderFarClip value="96"/> + <!--Default for now--> + <RenderFlexTimeFactor value="1"/> + <!--256... but they don't use this--> + <RenderGlowResolutionPow value="8"/> + <!--Sun/Moon only--> + <RenderLightingDetail value="1"/> + <!--Low number--> + <RenderMaxPartCount value="2048"/> + <!--bump okay--> + <RenderObjectBump value="TRUE"/> + <!--NO SHADERS--> + <RenderReflectionDetail value="0"/> + <!--Simple--> + <RenderTerrainDetail value="1"/> + <!--Default for now--> + <RenderTerrainLODFactor value="1.0"/> + <!--Default for now--> + <RenderTreeLODFactor value="0.5"/> + <!--Try Impostors--> + <RenderUseImpostors value="TRUE"/> + <!--Default for now--> + <RenderVolumeLODFactor value="1.125"/> + <!--NO SHADERS--> + <VertexShaderEnable value="TRUE"/> + <!--NO SHADERS--> + <WindLightUseAtmosShaders value="FALSE"/> +</settings> -- cgit v1.2.3 From d4699a1b0e922258682d9b6e164a5bcc6bbd7238 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 19 Mar 2010 15:25:35 -0500 Subject: Replace RenderDeferredShadow/RenderDeferredSunShadow with RenderShadowDetail --- indra/newview/app_settings/settings.xml | 26 +--- indra/newview/llviewercontrol.cpp | 2 +- indra/newview/llviewershadermgr.cpp | 2 +- indra/newview/pipeline.cpp | 237 ++++++++++++++++---------------- 4 files changed, 122 insertions(+), 145 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 900ae6259e..68d759019d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6596,19 +6596,7 @@ <key>Value</key> <integer>0</integer> </map> - - <key>RenderDeferredShadow</key> - <map> - <key>Comment</key> - <string>Enable shadows in deferred renderer.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - + <key>RenderDeferredGI</key> <map> <key>Comment</key> @@ -6621,18 +6609,6 @@ <integer>0</integer> </map> - <key>RenderDeferredSunShadow</key> - <map> - <key>Comment</key> - <string>Generate shadows from the sun.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderDeferredSun</key> <map> <key>Comment</key> diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 1d99be9960..8051fcbcfa 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -546,7 +546,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _2)); gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _2)); gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); - gSavedSettings.getControl("RenderDeferredShadow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderDeferredGI")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2)); gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _2)); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 86b1a8c910..5b7b464e91 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -378,7 +378,7 @@ void LLViewerShaderMgr::setShaders() if (LLPipeline::sRenderDeferred) { - if (gSavedSettings.getBOOL("RenderDeferredShadow")) + if (gSavedSettings.getS32("RenderShadowDetail") > 0) { if (gSavedSettings.getBOOL("RenderDeferredGI")) { //shadows + gi diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e61dff139e..04118ad767 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6344,7 +6344,7 @@ void LLPipeline::renderDeferredLighting() glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], 0); } - if (gSavedSettings.getBOOL("RenderDeferredShadow")) + if (gSavedSettings.getS32("RenderShadowDetail") > 0) { glPushMatrix(); glLoadIdentity(); @@ -7980,30 +7980,11 @@ void LLPipeline::generateHighlight(LLCamera& camera) void LLPipeline::generateSunShadow(LLCamera& camera) { - if (!sRenderDeferred || !gSavedSettings.getBOOL("RenderDeferredShadow")) + if (!sRenderDeferred || gSavedSettings.getS32("RenderShadowDetail") <= 0) { return; } - //temporary hack to disable shadows but keep local lights - static BOOL clear = TRUE; - BOOL gen_shadow = gSavedSettings.getBOOL("RenderDeferredSunShadow"); - if (!gen_shadow) - { - if (clear) - { - clear = FALSE; - for (U32 i = 0; i < 6; i++) - { - mShadow[i].bindTarget(); - mShadow[i].clear(); - mShadow[i].flush(); - } - } - return; - } - clear = TRUE; - F64 last_modelview[16]; F64 last_projection[16]; for (U32 i = 0; i < 16; i++) @@ -8519,135 +8500,155 @@ void LLPipeline::generateSunShadow(LLCamera& camera) } } - - - F32 fade_amt = gFrameIntervalSeconds * llmax(LLViewerCamera::getInstance()->getVelocityStat()->getCurrentPerSec(), 1.f); - //update shadow targets - for (U32 i = 0; i < 2; i++) - { //for each current shadow - LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW4+i; + //hack to disable projector shadows + static bool clear = true; + bool gen_shadow = gSavedSettings.getS32("RenderShadowDetail") > 1; + + if (gen_shadow) + { + clear = true; + F32 fade_amt = gFrameIntervalSeconds * llmax(LLViewerCamera::getInstance()->getVelocityStat()->getCurrentPerSec(), 1.f); - if (mShadowSpotLight[i].notNull() && - (mShadowSpotLight[i] == mTargetShadowSpotLight[0] || - mShadowSpotLight[i] == mTargetShadowSpotLight[1])) - { //keep this spotlight - mSpotLightFade[i] = llmin(mSpotLightFade[i]+fade_amt, 1.f); - } - else - { //fade out this light - mSpotLightFade[i] = llmax(mSpotLightFade[i]-fade_amt, 0.f); - - if (mSpotLightFade[i] == 0.f || mShadowSpotLight[i].isNull()) - { //faded out, grab one of the pending spots (whichever one isn't already taken) - if (mTargetShadowSpotLight[0] != mShadowSpotLight[(i+1)%2]) - { - mShadowSpotLight[i] = mTargetShadowSpotLight[0]; - } - else - { - mShadowSpotLight[i] = mTargetShadowSpotLight[1]; + //update shadow targets + for (U32 i = 0; i < 2; i++) + { //for each current shadow + LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW4+i; + + if (mShadowSpotLight[i].notNull() && + (mShadowSpotLight[i] == mTargetShadowSpotLight[0] || + mShadowSpotLight[i] == mTargetShadowSpotLight[1])) + { //keep this spotlight + mSpotLightFade[i] = llmin(mSpotLightFade[i]+fade_amt, 1.f); + } + else + { //fade out this light + mSpotLightFade[i] = llmax(mSpotLightFade[i]-fade_amt, 0.f); + + if (mSpotLightFade[i] == 0.f || mShadowSpotLight[i].isNull()) + { //faded out, grab one of the pending spots (whichever one isn't already taken) + if (mTargetShadowSpotLight[0] != mShadowSpotLight[(i+1)%2]) + { + mShadowSpotLight[i] = mTargetShadowSpotLight[0]; + } + else + { + mShadowSpotLight[i] = mTargetShadowSpotLight[1]; + } } } } - } - - for (S32 i = 0; i < 2; i++) - { - glh_set_current_modelview(saved_view); - glh_set_current_projection(saved_proj); - - if (mShadowSpotLight[i].isNull()) + + for (S32 i = 0; i < 2; i++) { - continue; - } + glh_set_current_modelview(saved_view); + glh_set_current_projection(saved_proj); - LLVOVolume* volume = mShadowSpotLight[i]->getVOVolume(); + if (mShadowSpotLight[i].isNull()) + { + continue; + } - if (!volume) - { - mShadowSpotLight[i] = NULL; - continue; - } + LLVOVolume* volume = mShadowSpotLight[i]->getVOVolume(); - LLDrawable* drawable = mShadowSpotLight[i]; + if (!volume) + { + mShadowSpotLight[i] = NULL; + continue; + } - LLVector3 params = volume->getSpotLightParams(); - F32 fov = params.mV[0]; + LLDrawable* drawable = mShadowSpotLight[i]; - //get agent->light space matrix (modelview) - LLVector3 center = drawable->getPositionAgent(); - LLQuaternion quat = volume->getRenderRotation(); + LLVector3 params = volume->getSpotLightParams(); + F32 fov = params.mV[0]; - //get near clip plane - LLVector3 scale = volume->getScale(); - LLVector3 at_axis(0,0,-scale.mV[2]*0.5f); - at_axis *= quat; + //get agent->light space matrix (modelview) + LLVector3 center = drawable->getPositionAgent(); + LLQuaternion quat = volume->getRenderRotation(); - LLVector3 np = center+at_axis; - at_axis.normVec(); + //get near clip plane + LLVector3 scale = volume->getScale(); + LLVector3 at_axis(0,0,-scale.mV[2]*0.5f); + at_axis *= quat; - //get origin that has given fov for plane np, at_axis, and given scale - F32 dist = (scale.mV[1]*0.5f)/tanf(fov*0.5f); + LLVector3 np = center+at_axis; + at_axis.normVec(); - LLVector3 origin = np - at_axis*dist; + //get origin that has given fov for plane np, at_axis, and given scale + F32 dist = (scale.mV[1]*0.5f)/tanf(fov*0.5f); - LLMatrix4 mat(quat, LLVector4(origin, 1.f)); + LLVector3 origin = np - at_axis*dist; - view[i+4] = glh::matrix4f((F32*) mat.mMatrix); + LLMatrix4 mat(quat, LLVector4(origin, 1.f)); - view[i+4] = view[i+4].inverse(); + view[i+4] = glh::matrix4f((F32*) mat.mMatrix); - //get perspective matrix - F32 near_clip = dist+0.01f; - F32 width = scale.mV[VX]; - F32 height = scale.mV[VY]; - F32 far_clip = dist+volume->getLightRadius()*1.5f; + view[i+4] = view[i+4].inverse(); - F32 fovy = fov * RAD_TO_DEG; - F32 aspect = width/height; - - proj[i+4] = gl_perspective(fovy, aspect, near_clip, far_clip); + //get perspective matrix + F32 near_clip = dist+0.01f; + F32 width = scale.mV[VX]; + F32 height = scale.mV[VY]; + F32 far_clip = dist+volume->getLightRadius()*1.5f; - //translate and scale to from [-1, 1] to [0, 1] - glh::matrix4f trans(0.5f, 0.f, 0.f, 0.5f, - 0.f, 0.5f, 0.f, 0.5f, - 0.f, 0.f, 0.5f, 0.5f, - 0.f, 0.f, 0.f, 1.f); + F32 fovy = fov * RAD_TO_DEG; + F32 aspect = width/height; + + proj[i+4] = gl_perspective(fovy, aspect, near_clip, far_clip); - glh_set_current_modelview(view[i+4]); - glh_set_current_projection(proj[i+4]); + //translate and scale to from [-1, 1] to [0, 1] + glh::matrix4f trans(0.5f, 0.f, 0.f, 0.5f, + 0.f, 0.5f, 0.f, 0.5f, + 0.f, 0.f, 0.5f, 0.5f, + 0.f, 0.f, 0.f, 1.f); - mSunShadowMatrix[i+4] = trans*proj[i+4]*view[i+4]*inv_view; - - for (U32 j = 0; j < 16; j++) - { - gGLLastModelView[j] = mShadowModelview[i+4].m[j]; - gGLLastProjection[j] = mShadowProjection[i+4].m[j]; - } + glh_set_current_modelview(view[i+4]); + glh_set_current_projection(proj[i+4]); - mShadowModelview[i+4] = view[i+4]; - mShadowProjection[i+4] = proj[i+4]; + mSunShadowMatrix[i+4] = trans*proj[i+4]*view[i+4]*inv_view; + + for (U32 j = 0; j < 16; j++) + { + gGLLastModelView[j] = mShadowModelview[i+4].m[j]; + gGLLastProjection[j] = mShadowProjection[i+4].m[j]; + } - LLCamera shadow_cam = camera; - shadow_cam.setFar(far_clip); - shadow_cam.setOrigin(origin); + mShadowModelview[i+4] = view[i+4]; + mShadowProjection[i+4] = proj[i+4]; - LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); + LLCamera shadow_cam = camera; + shadow_cam.setFar(far_clip); + shadow_cam.setOrigin(origin); - stop_glerror(); + LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); + + stop_glerror(); - mShadow[i+4].bindTarget(); - mShadow[i+4].getViewport(gGLViewport); + mShadow[i+4].bindTarget(); + mShadow[i+4].getViewport(gGLViewport); - static LLCullResult result[2]; + static LLCullResult result[2]; - LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW0+i+4; + LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW0+i+4; - renderShadow(view[i+4], proj[i+4], shadow_cam, result[i], FALSE, FALSE); + renderShadow(view[i+4], proj[i+4], shadow_cam, result[i], FALSE, FALSE); - mShadow[i+4].flush(); - } + mShadow[i+4].flush(); + } + } + else + { + if (clear) + { + clear = false; + for (U32 i = 4; i < 6; i++) + { + mShadow[i].bindTarget(); + mShadow[i].clear(); + mShadow[i].flush(); + } + } + } if (!gSavedSettings.getBOOL("CameraOffset")) { -- cgit v1.2.3 From bbfacbd50d6e8beac36fd8de1dc51ceb109a4a7d Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 19 Mar 2010 18:14:17 -0500 Subject: RenderDeferredSSAO works as an independent setting -- decoupled shadows from SSAO. --- .../shaders/class1/deferred/blurLightF.glsl | 20 +- .../shaders/class1/deferred/multiSpotLightF.glsl | 3 +- .../shaders/class1/deferred/softenLightF.glsl | 27 ++- .../shaders/class1/deferred/spotLightF.glsl | 11 -- .../shaders/class1/deferred/sunLightF.glsl | 201 +-------------------- .../shaders/class2/deferred/multiSpotLightF.glsl | 3 - .../shaders/class2/deferred/softenLightF.glsl | 10 +- .../shaders/class2/deferred/spotLightF.glsl | 4 - .../shaders/class2/deferred/sunLightF.glsl | 64 +------ indra/newview/llviewercontrol.cpp | 1 + indra/newview/llviewershadermgr.cpp | 14 +- indra/newview/pipeline.cpp | 156 ++++++++-------- 12 files changed, 138 insertions(+), 376 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index bd5e9dd758..0fad5b4b50 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -10,13 +10,11 @@ uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; -uniform sampler2DRect giLightMap; uniform float dist_factor; uniform float blur_size; uniform vec2 delta; -uniform vec3 kern[32]; -uniform int kern_length; +uniform vec3 kern[4]; uniform float kern_scale; varying vec2 vary_fragcoord; @@ -50,7 +48,7 @@ void main() vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' vec4 col = defined_weight.xyxx * ccol; - for (int i = 1; i < kern_length; i++) + for (int i = 1; i < 4; i++) { vec2 tc = vary_fragcoord.xy + kern[i].z*dlt; vec3 samppos = getPosition(tc).xyz; @@ -61,12 +59,22 @@ void main() defined_weight += kern[i].xy; } } + for (int i = 1; i < 4; i++) + { + vec2 tc = vary_fragcoord.xy - kern[i].z*dlt; + vec3 samppos = getPosition(tc).xyz; + float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane + if (d*d <= 0.003) + { + col += texture2DRect(lightMap, tc)*kern[i].xyxx; + defined_weight += kern[i].xy; + } + } col /= defined_weight.xyxx; gl_FragColor = col; - - //gl_FragColor = ccol; } + diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 2c8d90d1a6..82e9450e68 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -7,6 +7,8 @@ #version 120 +//class 1 -- no shadows + #extension GL_ARB_texture_rectangle : enable uniform sampler2DRect diffuseRect; @@ -14,7 +16,6 @@ uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform samplerCube environmentMap; -uniform sampler2DRect lightMap; uniform sampler2D noiseMap; uniform sampler2D lightFunc; uniform sampler2D projectionMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index b4b0d0ce9d..9cf60aad48 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -11,6 +11,7 @@ uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect positionMap; uniform sampler2DRect normalMap; +uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; uniform sampler2D noiseMap; uniform samplerCube environmentMap; @@ -40,7 +41,7 @@ uniform float scene_light_strength; uniform vec3 env_mat[3]; //uniform mat4 shadow_matrix[3]; //uniform vec4 shadow_clip; -//uniform mat3 ssao_effect_mat; +uniform mat3 ssao_effect_mat; varying vec4 vary_light; varying vec2 vary_fragcoord; @@ -178,7 +179,17 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { temp2.x += .25; //increase ambient when there are more clouds - vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; + vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; + + /* decrease value and saturation (that in HSV, not HSL) for occluded areas + * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html + * // The following line of code performs the equivalent of: + * float ambAlpha = tmpAmbient.a; + * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis + * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); + * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); + */ + tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); //haze color setAdditiveColor( @@ -250,10 +261,14 @@ void main() vec4 diffuse = texture2DRect(diffuseRect, tc); vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); - calcAtmospherics(pos.xyz, 0.0); + vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; + float scol = max(scol_ambocc.r, diffuse.a); + float ambocc = scol_ambocc.g; + + calcAtmospherics(pos.xyz, ambocc); vec3 col = atmosAmbient(vec3(0)); - col += atmosAffectDirectionalLight(clamp(da, diffuse.a, 1.0)); + col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a)); col *= diffuse.rgb; @@ -261,12 +276,12 @@ void main() { vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + col.rgb += vary_SunlitColor*scol_ambocc.r*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; } col = atmosLighting(col); col = scaleSoftClip(col); - + gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 2a7234fd83..f320dbb400 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -161,17 +161,6 @@ void main() } } - /*if (spec.a > 0.0) - { - //vec3 ref = reflect(normalize(pos), norm); - float sa = dot(normalize(lv-normalize(pos)),norm);; - //sa = max(sa, 0.0); - //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*lcol*spec.rgb; - }*/ - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index fafc2ae3cc..56e4055c02 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -5,206 +5,11 @@ * $License$ */ -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2DRectShadow shadowMap4; -uniform sampler2DRectShadow shadowMap5; -uniform sampler2D noiseMap; - -uniform sampler2D lightFunc; - - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -varying vec2 vary_fragcoord; -varying vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} +//class 1, no shadow, no SSAO, should never be called -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm) -{ - float ret = 1.0; - - float dist = dot(pos.xyz,pos.xyz); - - if (dist < 64.0*64.0) - { - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) - { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - ret = (1.0 - (float(points != 0) * angle_hidden)); - ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); - } - - return min(ret, 1.0); -} +#extension GL_ARB_texture_rectangle : enable void main() { - vec2 pos_screen = vary_fragcoord.xy; - - //try doing an unproject here - - vec4 pos = getPosition(pos_screen); - - vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; - - /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL - { - gl_FragColor = vec4(0.0); // doesn't matter - return; - }*/ - - float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - - vec4 spos = vec4(pos.xyz + norm.xyz * (-pos.z/64.0*shadow_offset+shadow_bias), 1.0); - - //vec3 debug = vec3(0,0,0); - - if (dp_directional_light == 0.0) - { - // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup - shadow = 0.0; - } - else if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= screen_res; - shadow = shadow2DRectProj(shadowMap3, lpos).x; - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= screen_res; - shadow = shadow2DRectProj(shadowMap2, lpos).x; - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= screen_res; - shadow = shadow2DRectProj(shadowMap1, lpos).x; - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= screen_res; - shadow = shadow2DRectProj(shadowMap0, lpos).x; - } - - // take the most-shadowed value out of these two: - // * the blurred sun shadow in the light (shadow) map - // * an unblurred dot product between the sun and this norm - // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting - shadow = min(shadow, dp_directional_light); - - /*debug.r = lpos.y / (lpos.w*screen_res.y); - - lpos.xy /= lpos.w*32.0; - if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1) - { - debug.gb = vec2(0.5, 0.5); - } - - debug += (1.0-shadow)*0.5;*/ - - } - else - { - // more distant than the shadow map covers - just use directional shading as shadow - shadow = dp_directional_light; - } - - gl_FragColor[0] = shadow; - gl_FragColor[1] = calcAmbientOcclusion(pos, norm); - - //spotlight shadow 1 - vec4 lpos = shadow_matrix[4]*spos; - lpos.xy *= screen_res; - gl_FragColor[2] = shadow2DRectProj(shadowMap4, lpos).x; - - //spotlight shadow 2 - lpos = shadow_matrix[5]*spos; - lpos.xy *= screen_res; - gl_FragColor[3] = shadow2DRectProj(shadowMap5, lpos).x; - - //gl_FragColor.rgb = pos.xyz; - //gl_FragColor.b = shadow; - //gl_FragColor.rgb = debug; + gl_FragColor = vec4(0,0,0,0); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 3e29c684e8..5308e5bb1e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -230,9 +230,6 @@ void main() } } - //attenuate point light contribution by SSAO component - col *= texture2DRect(lightMap, frag.xy).g; - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 249ac7ef9b..589a292751 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -11,6 +11,7 @@ uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; +uniform sampler2DRect depthMap; uniform sampler2D noiseMap; uniform samplerCube environmentMap; uniform sampler2D lightFunc; @@ -41,7 +42,6 @@ uniform vec3 env_mat[3]; uniform vec4 shadow_clip; uniform mat3 ssao_effect_mat; -uniform sampler2DRect depthMap; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -282,13 +282,5 @@ void main() col = scaleSoftClip(col); gl_FragColor.rgb = col; - - //gl_FragColor.rgb = gi_col.rgb; gl_FragColor.a = 0.0; - - //gl_FragColor.rg = scol_ambocc.rg; - //gl_FragColor.rgb = texture2DRect(lightMap, vary_fragcoord.xy).rgb; - //gl_FragColor.rgb = norm.rgb*0.5+0.5; - //gl_FragColor.rgb = vec3(ambocc); - //gl_FragColor.rgb = vec3(scol); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 6617e33c0d..eeaecc157f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -179,10 +179,6 @@ void main() } } - //attenuate point light contribution by SSAO component - col *= texture2DRect(lightMap, frag.xy).g; - - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 50502dbdad..04c9a4d19a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -7,6 +7,8 @@ #extension GL_ARB_texture_rectangle : enable +//class 2, shadows, no SSAO + uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2DRectShadow shadowMap0; @@ -52,66 +54,6 @@ vec4 getPosition(vec2 pos_screen) return pos; } -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm) -{ - float ret = 1.0; - - float dist = dot(pos.xyz,pos.xyz); - - if (dist < 64.0*64.0) - { - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) - { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - ret = (1.0 - (float(points != 0) * angle_hidden)); - ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); - } - - return min(ret, 1.0); -} - float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; @@ -232,7 +174,7 @@ void main() } gl_FragColor[0] = shadow; - gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + gl_FragColor[1] = 1.0; //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 8051fcbcfa..862e1de685 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -547,6 +547,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _2)); gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderDeferredGI")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2)); gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _2)); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 5b7b464e91..50e5522174 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -973,10 +973,22 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + S32 level = 0; + std::string fragment; + + if (gSavedSettings.getBOOL("RenderDeferredSSAO")) + { + fragment = "deferred/sunLightSSAOF.glsl"; + } + else + { + fragment = "deferred/sunLightF.glsl"; + } + gDeferredSunProgram.mName = "Deferred Sun Shader"; gDeferredSunProgram.mShaderFiles.clear(); gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredSunProgram.createShader(NULL, NULL); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 04118ad767..5cfd6c3d38 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6344,16 +6344,16 @@ void LLPipeline::renderDeferredLighting() glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], 0); } - if (gSavedSettings.getS32("RenderShadowDetail") > 0) - { - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); + glPushMatrix(); + glLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); - mDeferredLight[0].bindTarget(); - if (gSavedSettings.getBOOL("RenderDeferredSun")) + mDeferredLight[0].bindTarget(); + + if (gSavedSettings.getBOOL("RenderDeferredSSAO") || gSavedSettings.getS32("RenderShadowDetail") > 0) + { { //paint shadow/SSAO light map (direct lighting lightmap) LLFastTimer ftm(FTM_SUN_SHADOW); bindDeferredShader(gDeferredSunProgram, 0); @@ -6394,18 +6394,22 @@ void LLPipeline::renderDeferredLighting() unbindDeferredShader(gDeferredSunProgram); } - else - { - mDeferredLight[0].clear(GL_COLOR_BUFFER_BIT); - } + } + else + { + glClearColor(1,1,1,1); + mDeferredLight[0].clear(GL_COLOR_BUFFER_BIT); + glClearColor(0,0,0,0); + } - mDeferredLight[0].flush(); + mDeferredLight[0].flush(); + { //global illumination specific block (still experimental) if (gSavedSettings.getBOOL("RenderDeferredBlurLight") && - gSavedSettings.getBOOL("RenderDeferredGI")) - { + gSavedSettings.getBOOL("RenderDeferredGI")) + { LLFastTimer ftm(FTM_EDGE_DETECTION); - //get edge map + //generate edge map LLGLDisable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); LLGLDepthTest depth(GL_FALSE); @@ -6502,79 +6506,79 @@ void LLPipeline::renderDeferredLighting() unbindDeferredShader(gDeferredPostGIProgram); } } + } - if (gSavedSettings.getBOOL("RenderDeferredBlurLight")) - { //soften direct lighting lightmap - LLFastTimer ftm(FTM_SOFTEN_SHADOW); - //blur lightmap - mDeferredLight[1].bindTarget(); + if (gSavedSettings.getBOOL("RenderDeferredSSAO")) + { //soften direct lighting lightmap + LLFastTimer ftm(FTM_SOFTEN_SHADOW); + //blur lightmap + mDeferredLight[1].bindTarget(); - glClearColor(1,1,1,1); - mDeferredLight[1].clear(GL_COLOR_BUFFER_BIT); - glClearColor(0,0,0,0); - - bindDeferredShader(gDeferredBlurLightProgram); + glClearColor(1,1,1,1); + mDeferredLight[1].clear(GL_COLOR_BUFFER_BIT); + glClearColor(0,0,0,0); + + bindDeferredShader(gDeferredBlurLightProgram); - LLVector3 go = gSavedSettings.getVector3("RenderShadowGaussian"); - const U32 kern_length = 4; - F32 blur_size = gSavedSettings.getF32("RenderShadowBlurSize"); - F32 dist_factor = gSavedSettings.getF32("RenderShadowBlurDistFactor"); + LLVector3 go = gSavedSettings.getVector3("RenderShadowGaussian"); + const U32 kern_length = 4; + F32 blur_size = gSavedSettings.getF32("RenderShadowBlurSize"); + F32 dist_factor = gSavedSettings.getF32("RenderShadowBlurDistFactor"); - // sample symmetrically with the middle sample falling exactly on 0.0 - F32 x = 0.f; + // sample symmetrically with the middle sample falling exactly on 0.0 + F32 x = 0.f; - LLVector3 gauss[32]; // xweight, yweight, offset + LLVector3 gauss[32]; // xweight, yweight, offset - for (U32 i = 0; i < kern_length; i++) - { - gauss[i].mV[0] = llgaussian(x, go.mV[0]); - gauss[i].mV[1] = llgaussian(x, go.mV[1]); - gauss[i].mV[2] = x; - x += 1.f; - } + for (U32 i = 0; i < kern_length; i++) + { + gauss[i].mV[0] = llgaussian(x, go.mV[0]); + gauss[i].mV[1] = llgaussian(x, go.mV[1]); + gauss[i].mV[2] = x; + x += 1.f; + } - gDeferredBlurLightProgram.uniform2f("delta", 1.f, 0.f); - gDeferredBlurLightProgram.uniform1f("dist_factor", dist_factor); - gDeferredBlurLightProgram.uniform3fv("kern[0]", kern_length, gauss[0].mV); - gDeferredBlurLightProgram.uniform3fv("kern", kern_length, gauss[0].mV); - gDeferredBlurLightProgram.uniform1f("kern_scale", blur_size * (kern_length/2.f - 0.5f)); + gDeferredBlurLightProgram.uniform2f("delta", 1.f, 0.f); + gDeferredBlurLightProgram.uniform1f("dist_factor", dist_factor); + gDeferredBlurLightProgram.uniform3fv("kern[0]", kern_length, gauss[0].mV); + gDeferredBlurLightProgram.uniform3fv("kern", kern_length, gauss[0].mV); + gDeferredBlurLightProgram.uniform1f("kern_scale", blur_size * (kern_length/2.f - 0.5f)); + + { + LLGLDisable blend(GL_BLEND); + LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); + stop_glerror(); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); + stop_glerror(); + } - { - LLGLDisable blend(GL_BLEND); - LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); - stop_glerror(); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); - stop_glerror(); - } - - mDeferredLight[1].flush(); - unbindDeferredShader(gDeferredBlurLightProgram); + mDeferredLight[1].flush(); + unbindDeferredShader(gDeferredBlurLightProgram); - bindDeferredShader(gDeferredBlurLightProgram, 1); - mDeferredLight[0].bindTarget(); + bindDeferredShader(gDeferredBlurLightProgram, 1); + mDeferredLight[0].bindTarget(); - gDeferredBlurLightProgram.uniform2f("delta", 0.f, 1.f); + gDeferredBlurLightProgram.uniform2f("delta", 0.f, 1.f); - { - LLGLDisable blend(GL_BLEND); - LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); - stop_glerror(); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); - stop_glerror(); - } - mDeferredLight[0].flush(); - unbindDeferredShader(gDeferredBlurLightProgram); + { + LLGLDisable blend(GL_BLEND); + LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); + stop_glerror(); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); + stop_glerror(); } - - stop_glerror(); - glPopMatrix(); - stop_glerror(); - glMatrixMode(GL_MODELVIEW); - stop_glerror(); - glPopMatrix(); - stop_glerror(); + mDeferredLight[0].flush(); + unbindDeferredShader(gDeferredBlurLightProgram); } + stop_glerror(); + glPopMatrix(); + stop_glerror(); + glMatrixMode(GL_MODELVIEW); + stop_glerror(); + glPopMatrix(); + stop_glerror(); + //copy depth and stencil from deferred screen //mScreen.copyContents(mDeferredScreen, 0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight(), // 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); -- cgit v1.2.3 From 09dd7e1967835020e985baf3069faa1d4cc42382 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 19 Mar 2010 18:19:18 -0500 Subject: Line ending fix. --- indra/newview/app_settings/low_graphics.xml | 74 ++++++++++++++--------------- indra/newview/app_settings/mid_graphics.xml | 74 ++++++++++++++--------------- 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index 72cbb2808b..54320117fc 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -1,37 +1,37 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<settings version = "101"> - <!--NO SHADERS--> - <RenderAvatarCloth value="FALSE"/> - <!--Default for now--> - <RenderAvatarLODFactor value="0.5"/> - <!--NO SHADERS--> - <RenderAvatarVP value="FALSE"/> - <!--Short Range--> - <RenderFarClip value="64"/> - <!--Default for now--> - <RenderFlexTimeFactor value="0.5"/> - <!--256... but they don't use this--> - <RenderGlowResolutionPow value="8"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="0"/> - <!--Low number--> - <RenderMaxPartCount value="1024"/> - <!--bump okay--> - <RenderObjectBump value="FALSE"/> - <!--NO SHADERS--> - <RenderReflectionDetail value="0"/> - <!--Simple--> - <RenderTerrainDetail value="0"/> - <!--Default for now--> - <RenderTerrainLODFactor value="1.0"/> - <!--Default for now--> - <RenderTreeLODFactor value="0.5"/> - <!--Try Impostors--> - <RenderUseImpostors value="TRUE"/> - <!--Default for now--> - <RenderVolumeLODFactor value="1.125"/> - <!--NO SHADERS--> - <VertexShaderEnable value="FALSE"/> - <!--NO SHADERS--> - <WindLightUseAtmosShaders value="FALSE"/> -</settings> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<settings version = "101"> + <!--NO SHADERS--> + <RenderAvatarCloth value="FALSE"/> + <!--Default for now--> + <RenderAvatarLODFactor value="0.5"/> + <!--NO SHADERS--> + <RenderAvatarVP value="FALSE"/> + <!--Short Range--> + <RenderFarClip value="64"/> + <!--Default for now--> + <RenderFlexTimeFactor value="0.5"/> + <!--256... but they don't use this--> + <RenderGlowResolutionPow value="8"/> + <!--Sun/Moon only--> + <RenderLightingDetail value="0"/> + <!--Low number--> + <RenderMaxPartCount value="1024"/> + <!--bump okay--> + <RenderObjectBump value="FALSE"/> + <!--NO SHADERS--> + <RenderReflectionDetail value="0"/> + <!--Simple--> + <RenderTerrainDetail value="0"/> + <!--Default for now--> + <RenderTerrainLODFactor value="1.0"/> + <!--Default for now--> + <RenderTreeLODFactor value="0.5"/> + <!--Try Impostors--> + <RenderUseImpostors value="TRUE"/> + <!--Default for now--> + <RenderVolumeLODFactor value="1.125"/> + <!--NO SHADERS--> + <VertexShaderEnable value="FALSE"/> + <!--NO SHADERS--> + <WindLightUseAtmosShaders value="FALSE"/> +</settings> diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index 743dfa418c..422988498d 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -1,37 +1,37 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<settings version = "101"> - <!--NO SHADERS--> - <RenderAvatarCloth value="FALSE"/> - <!--Default for now--> - <RenderAvatarLODFactor value="0.5"/> - <!--NO SHADERS--> - <RenderAvatarVP value="TRUE"/> - <!--Short Range--> - <RenderFarClip value="96"/> - <!--Default for now--> - <RenderFlexTimeFactor value="1"/> - <!--256... but they don't use this--> - <RenderGlowResolutionPow value="8"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="1"/> - <!--Low number--> - <RenderMaxPartCount value="2048"/> - <!--bump okay--> - <RenderObjectBump value="TRUE"/> - <!--NO SHADERS--> - <RenderReflectionDetail value="0"/> - <!--Simple--> - <RenderTerrainDetail value="1"/> - <!--Default for now--> - <RenderTerrainLODFactor value="1.0"/> - <!--Default for now--> - <RenderTreeLODFactor value="0.5"/> - <!--Try Impostors--> - <RenderUseImpostors value="TRUE"/> - <!--Default for now--> - <RenderVolumeLODFactor value="1.125"/> - <!--NO SHADERS--> - <VertexShaderEnable value="TRUE"/> - <!--NO SHADERS--> - <WindLightUseAtmosShaders value="FALSE"/> -</settings> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<settings version = "101"> + <!--NO SHADERS--> + <RenderAvatarCloth value="FALSE"/> + <!--Default for now--> + <RenderAvatarLODFactor value="0.5"/> + <!--NO SHADERS--> + <RenderAvatarVP value="TRUE"/> + <!--Short Range--> + <RenderFarClip value="96"/> + <!--Default for now--> + <RenderFlexTimeFactor value="1"/> + <!--256... but they don't use this--> + <RenderGlowResolutionPow value="8"/> + <!--Sun/Moon only--> + <RenderLightingDetail value="1"/> + <!--Low number--> + <RenderMaxPartCount value="2048"/> + <!--bump okay--> + <RenderObjectBump value="TRUE"/> + <!--NO SHADERS--> + <RenderReflectionDetail value="0"/> + <!--Simple--> + <RenderTerrainDetail value="1"/> + <!--Default for now--> + <RenderTerrainLODFactor value="1.0"/> + <!--Default for now--> + <RenderTreeLODFactor value="0.5"/> + <!--Try Impostors--> + <RenderUseImpostors value="TRUE"/> + <!--Default for now--> + <RenderVolumeLODFactor value="1.125"/> + <!--NO SHADERS--> + <VertexShaderEnable value="TRUE"/> + <!--NO SHADERS--> + <WindLightUseAtmosShaders value="FALSE"/> +</settings> -- cgit v1.2.3 From 97d6eef1d3b808d0a5f09fd0bb3c725a49e94ea5 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 19 Mar 2010 21:25:43 -0500 Subject: Make gcc happy --- indra/newview/llviewershadermgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 50e5522174..c15f93d9aa 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -973,7 +973,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { - S32 level = 0; std::string fragment; if (gSavedSettings.getBOOL("RenderDeferredSSAO")) -- cgit v1.2.3 From 8f9fae7815f24ca59e2a7e180b7baab3bc75e2e7 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 20 Mar 2010 14:15:13 -0500 Subject: SSAO version of sunLight shaders. --- .../shaders/class1/deferred/sunLightSSAOF.glsl | 123 ++++++++++ .../shaders/class2/deferred/sunLightSSAOF.glsl | 248 +++++++++++++++++++++ 2 files changed, 371 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl new file mode 100644 index 0000000000..7450817ea7 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -0,0 +1,123 @@ +/** + * @file sunLightSSAOF.glsl + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#extension GL_ARB_texture_rectangle : enable + +//class 1 -- no shadow, SSAO only + +uniform sampler2DRect depthMap; +uniform sampler2DRect normalMap; +uniform sampler2D noiseMap; + +uniform sampler2D lightFunc; + + +// Inputs +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform float ssao_radius; +uniform float ssao_max_radius; +uniform float ssao_factor; +uniform float ssao_factor_inv; + +varying vec2 vary_fragcoord; +varying vec4 vary_light; + +uniform mat4 inv_proj; +uniform vec2 screen_res; + +uniform float shadow_bias; +uniform float shadow_offset; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos /= pos.w; + pos.w = 1.0; + return pos; +} + +//calculate decreases in ambient lighting when crowded out (SSAO) +float calcAmbientOcclusion(vec4 pos, vec3 norm) +{ + float ret = 1.0; + + float dist = dot(pos.xyz,pos.xyz); + + if (dist < 64.0*64.0) + { + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; + + float angle_hidden = 0.0; + int points = 0; + + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); + + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } + + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + ret = (1.0 - (float(points != 0) * angle_hidden)); + ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); + } + + return min(ret, 1.0); +} + +void main() +{ + vec2 pos_screen = vary_fragcoord.xy; + + //try doing an unproject here + + vec4 pos = getPosition(pos_screen); + + vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; + + gl_FragColor[0] = 1.0; + gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + gl_FragColor[2] = 1.0; + gl_FragColor[3] = 1.0; +} diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl new file mode 100644 index 0000000000..d77d17942a --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -0,0 +1,248 @@ +/** + * @file sunLightSSAOF.glsl + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#extension GL_ARB_texture_rectangle : enable + +//class 2 -- shadows and SSAO + +uniform sampler2DRect depthMap; +uniform sampler2DRect normalMap; +uniform sampler2DRectShadow shadowMap0; +uniform sampler2DRectShadow shadowMap1; +uniform sampler2DRectShadow shadowMap2; +uniform sampler2DRectShadow shadowMap3; +uniform sampler2DShadow shadowMap4; +uniform sampler2DShadow shadowMap5; +uniform sampler2D noiseMap; + +uniform sampler2D lightFunc; + +// Inputs +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform float ssao_radius; +uniform float ssao_max_radius; +uniform float ssao_factor; +uniform float ssao_factor_inv; + +varying vec2 vary_fragcoord; +varying vec4 vary_light; + +uniform mat4 inv_proj; +uniform vec2 screen_res; +uniform vec2 shadow_res; +uniform vec2 proj_shadow_res; + +uniform float shadow_bias; +uniform float shadow_offset; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos /= pos.w; + pos.w = 1.0; + return pos; +} + +//calculate decreases in ambient lighting when crowded out (SSAO) +float calcAmbientOcclusion(vec4 pos, vec3 norm) +{ + float ret = 1.0; + + float dist = dot(pos.xyz,pos.xyz); + + if (dist < 64.0*64.0) + { + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; + + float angle_hidden = 0.0; + int points = 0; + + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); + + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } + + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + ret = (1.0 - (float(points != 0) * angle_hidden)); + ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); + } + + return min(ret, 1.0); +} + +float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) +{ + stc.xyz /= stc.w; + stc.z += shadow_bias*scl; + + float cs = shadow2DRect(shadowMap, stc.xyz).x; + float shadow = cs; + + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); + + return shadow/5.0; + + //return shadow; +} + +float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) +{ + stc.xyz /= stc.w; + stc.z += shadow_bias*scl; + + float cs = shadow2D(shadowMap, stc.xyz).x; + float shadow = cs; + + vec2 off = 1.5/proj_shadow_res; + + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); + + + return shadow/5.0; + + //return shadow; +} + +void main() +{ + vec2 pos_screen = vary_fragcoord.xy; + + //try doing an unproject here + + vec4 pos = getPosition(pos_screen); + + vec4 nmap4 = texture2DRect(normalMap, pos_screen); + float displace = nmap4.w; + vec3 norm = nmap4.xyz*2.0-1.0; + + /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL + { + gl_FragColor = vec4(0.0); // doesn't matter + return; + }*/ + + float shadow = 1.0; + float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + + vec4 spos = vec4(pos.xyz + displace*norm + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); + + if (spos.z > -shadow_clip.w) + { + if (dp_directional_light == 0.0) + { + // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup + shadow = 0.0; + } + else + { + vec4 lpos; + + if (spos.z < -shadow_clip.z) + { + lpos = shadow_matrix[3]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap3, lpos, 0.25); + shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); + } + else if (spos.z < -shadow_clip.y) + { + lpos = shadow_matrix[2]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap2, lpos, 0.5); + } + else if (spos.z < -shadow_clip.x) + { + lpos = shadow_matrix[1]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap1, lpos, 0.75); + } + else + { + lpos = shadow_matrix[0]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap0, lpos, 1.0); + } + + // take the most-shadowed value out of these two: + // * the blurred sun shadow in the light (shadow) map + // * an unblurred dot product between the sun and this norm + // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting + shadow = min(shadow, dp_directional_light); + + //lpos.xy /= lpos.w*32.0; + //if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1) + //{ + // shadow = 0.0; + //} + + } + } + else + { + // more distant than the shadow map covers + shadow = 1.0; + } + + gl_FragColor[0] = shadow; + gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + + //spotlight shadow 1 + vec4 lpos = shadow_matrix[4]*spos; + gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8).x; + + //spotlight shadow 2 + lpos = shadow_matrix[5]*spos; + gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8).x; + + //gl_FragColor.rgb = pos.xyz; + //gl_FragColor.b = shadow; +} -- cgit v1.2.3 From 06e3d288e40e46204d84aed9c548a6ca529e78d8 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 20 Mar 2010 16:56:36 -0500 Subject: Tweak detail settings and make graphics preferences widget enabling respect requirements. --- indra/newview/app_settings/high_graphics.xml | 9 ++- indra/newview/app_settings/low_graphics.xml | 9 ++- indra/newview/app_settings/mid_graphics.xml | 9 ++- indra/newview/app_settings/settings.xml | 11 --- indra/newview/app_settings/ultra_graphics.xml | 9 ++- indra/newview/featuretable.txt | 38 +++++++--- indra/newview/llfloaterpreference.cpp | 60 +++++++++++++++- indra/newview/llviewercontrol.cpp | 10 --- indra/newview/llviewershadermgr.cpp | 39 ++++++++--- indra/newview/llviewerstats.cpp | 2 +- indra/newview/pipeline.cpp | 13 +++- .../default/xui/en/panel_preferences_graphics1.xml | 80 ++++++++++++---------- 12 files changed, 198 insertions(+), 91 deletions(-) diff --git a/indra/newview/app_settings/high_graphics.xml b/indra/newview/app_settings/high_graphics.xml index c3fa2ab75e..93d39c8414 100644 --- a/indra/newview/app_settings/high_graphics.xml +++ b/indra/newview/app_settings/high_graphics.xml @@ -12,8 +12,6 @@ <RenderFlexTimeFactor value="1"/> <!--256... but they don't use this--> <RenderGlowResolutionPow value="9"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="1"/> <!--Low number--> <RenderMaxPartCount value="4096"/> <!--bump okay--> @@ -34,4 +32,11 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> + <!--Deferred Shading--> + <RenderDeferred value="TRUE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--Sun Shadows--> + <RenderShadowDetail value="1"/> + </settings> diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index 54320117fc..a300c8646c 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -12,8 +12,6 @@ <RenderFlexTimeFactor value="0.5"/> <!--256... but they don't use this--> <RenderGlowResolutionPow value="8"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="0"/> <!--Low number--> <RenderMaxPartCount value="1024"/> <!--bump okay--> @@ -34,4 +32,11 @@ <VertexShaderEnable value="FALSE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> + <!--No Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--No Shadows--> + <RenderShadowDetail value="0"/> + </settings> diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index 422988498d..a1430a58f9 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -12,8 +12,6 @@ <RenderFlexTimeFactor value="1"/> <!--256... but they don't use this--> <RenderGlowResolutionPow value="8"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="1"/> <!--Low number--> <RenderMaxPartCount value="2048"/> <!--bump okay--> @@ -34,4 +32,11 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> + <!--No Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--No Shadows--> + <RenderShadowDetail value="0"/> + </settings> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 68d759019d..520cbae15b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7167,17 +7167,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>RenderLightingDetail</key> - <map> - <key>Comment</key> - <string>Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>1</integer> - </map> <key>RenderMaxPartCount</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/ultra_graphics.xml b/indra/newview/app_settings/ultra_graphics.xml index 149aa32000..f741089ca2 100644 --- a/indra/newview/app_settings/ultra_graphics.xml +++ b/indra/newview/app_settings/ultra_graphics.xml @@ -12,8 +12,6 @@ <RenderFlexTimeFactor value="1"/> <!--256... but they don't use this--> <RenderGlowResolutionPow value="9"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="1"/> <!--Low number--> <RenderMaxPartCount value="4096"/> <!--bump okay--> @@ -34,4 +32,11 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> + <!--Deferred Shading--> + <RenderDeferred value="TRUE"/> + <!--SSAO Enabled--> + <RenderDeferredSSAO value="TRUE"/> + <!--Full Shadows--> + <RenderShadowDetail value="2"/> + </settings> diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 7f13240e60..1913f52499 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -35,7 +35,6 @@ RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 RenderGround 1 1 -RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 @@ -55,6 +54,9 @@ Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 RenderShaderLightingMaxLevel 1 3 +RenderDeferred 1 1 +RenderDeferredSSAO 1 1 +RenderShadowDetail 1 2 // @@ -68,7 +70,6 @@ RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0.5 RenderGlowResolutionPow 1 8 -RenderLightingDetail 1 0 RenderMaxPartCount 1 1024 RenderObjectBump 1 0 RenderReflectionDetail 1 0 @@ -80,6 +81,10 @@ RenderVolumeLODFactor 1 1.125 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // Mid Graphics Settings @@ -92,7 +97,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 -RenderLightingDetail 1 1 RenderMaxPartCount 1 2048 RenderObjectBump 1 1 RenderReflectionDetail 1 0 @@ -104,6 +108,10 @@ RenderVolumeLODFactor 1 1.125 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // High Graphics Settings (purty) @@ -116,7 +124,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLightingDetail 1 1 RenderMaxPartCount 1 4096 RenderObjectBump 1 1 RenderReflectionDetail 1 2 @@ -128,6 +135,10 @@ RenderVolumeLODFactor 1 1.125 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 +RenderDeferred 1 1 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 1 + // // Ultra graphics (REALLY PURTY!) @@ -140,7 +151,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 256 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 RenderReflectionDetail 1 4 @@ -152,6 +162,10 @@ RenderVolumeLODFactor 1 2.0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 +RenderDeferred 1 1 +RenderDeferredSSAO 1 1 +RenderShadowDetail 1 2 + // // Class Unknown Hardware (unknown) @@ -192,6 +206,9 @@ RenderAvatarCloth 0 0 RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // No Vertex Shaders available @@ -202,6 +219,10 @@ RenderAvatarCloth 0 0 RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 + // "Default" setups for safe, low, medium, high // @@ -209,7 +230,6 @@ list safe RenderAnisotropic 1 0 RenderAvatarCloth 0 0 RenderAvatarVP 0 0 -RenderLightingDetail 1 0 RenderObjectBump 0 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 @@ -217,6 +237,10 @@ RenderUseImpostors 0 0 RenderVBOEnable 1 0 RenderReflectionDetail 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 + // // CPU based feature masks @@ -240,11 +264,9 @@ RenderVBOEnable 1 0 list Intel RenderAnisotropic 1 0 -RenderLightingDetail 1 0 list GeForce2 RenderAnisotropic 1 0 -RenderLightingDetail 1 0 RenderMaxPartCount 1 2048 RenderTerrainDetail 1 0 RenderVBOEnable 1 1 diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index f19683304f..2d23f848af 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -819,7 +819,7 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { - LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections"); + LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections"); LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio"); // Reflections @@ -832,7 +832,7 @@ void LLFloaterPreference::refreshEnabledState() bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); getChild<LLCheckBoxCtrl>("BumpShiny")->setEnabled(bumpshiny ? TRUE : FALSE); - radio_reflection_detail->setEnabled(ctrl_reflections->get() && reflections); + radio_reflection_detail->setEnabled(reflections); // Avatar Mode // Enable Avatar Shaders @@ -878,6 +878,26 @@ void LLFloaterPreference::refreshEnabledState() // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); + + //Deferred/SSAO/Shadows + LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); + if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseFBO") && + shaders) + { + BOOL enabled = ctrl_wind_light->get() ? TRUE : FALSE; + + ctrl_deferred->setEnabled(enabled); + + LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO"); + LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail"); + + enabled = enabled && (ctrl_deferred->get() ? TRUE : FALSE); + + ctrl_ssao->setEnabled(enabled); + ctrl_shadow->setEnabled(enabled); + } + + // now turn off any features that are unavailable disableUnavailableSettings(); } @@ -890,6 +910,9 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders"); LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders"); LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors"); + LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); + LLComboBox* ctrl_shadows = getChild<LLComboBox>("ShadowDetail"); + LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO"); // if vertex shaders off, disable all shader related products if(!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")) @@ -901,13 +924,22 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setValue(FALSE); ctrl_reflections->setEnabled(FALSE); - ctrl_reflections->setValue(FALSE); + ctrl_reflections->setValue(0); ctrl_avatar_vp->setEnabled(FALSE); ctrl_avatar_vp->setValue(FALSE); ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); + + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); } // disabled windlight @@ -915,6 +947,16 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); + + //deferred needs windlight, disable deferred + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); } // disabled reflections @@ -932,13 +974,25 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); + + //deferred needs AvatarVP, disable deferred + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); } + // disabled cloth if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) { ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); } + // disabled impostors if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors")) { diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 862e1de685..e13411442d 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -297,15 +297,6 @@ static bool handleWLSkyDetailChanged(const LLSD&) return true; } -static bool handleRenderLightingDetailChanged(const LLSD& newvalue) -{ - if (gPipeline.isInit()) - { - gPipeline.setLightingDetail(newvalue.asInteger()); - } - return true; -} - static bool handleResetVertexBuffersChanged(const LLSD&) { if (gPipeline.isInit()) @@ -574,7 +565,6 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _2)); gSavedSettings.getControl("RenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _2)); - gSavedSettings.getControl("RenderLightingDetail")->getSignal()->connect(boost::bind(&handleRenderLightingDetailChanged, _2)); gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _2)); gSavedSettings.getControl("JoystickAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); gSavedSettings.getControl("JoystickAxis1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index c15f93d9aa..a0d0b9d490 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -317,10 +317,16 @@ S32 LLViewerShaderMgr::getVertexShaderLevel(S32 type) void LLViewerShaderMgr::setShaders() { - if (!gPipeline.mInitialized || !sInitialized) + //setShaders might be called redundantly by gSavedSettings, so return on reentrance + static bool reentrance = false; + + if (!gPipeline.mInitialized || !sInitialized || reentrance) { return; } + + reentrance = true; + // Make sure the compiled shader map is cleared before we recompile shaders. mShaderObjects.clear(); @@ -368,15 +374,8 @@ void LLViewerShaderMgr::setShaders() S32 wl_class = 2; S32 water_class = 2; S32 deferred_class = 0; - if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") - && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) - { - // user has disabled WindLight in their settings, downgrade - // windlight shaders to stub versions. - wl_class = 1; - } - - if (LLPipeline::sRenderDeferred) + + if (gSavedSettings.getBOOL("RenderDeferred")) { if (gSavedSettings.getS32("RenderShadowDetail") > 0) { @@ -393,6 +392,24 @@ void LLViewerShaderMgr::setShaders() { //no shadows deferred_class = 1; } + + //make sure framebuffer objects are enabled + gSavedSettings.setBOOL("RenderUseFBO", TRUE); + + //make sure hardware skinning is enabled + gSavedSettings.setBOOL("RenderAvatarVP", TRUE); + + //make sure atmospheric shaders are enabled + gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); + } + + + if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") + && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) + { + // user has disabled WindLight in their settings, downgrade + // windlight shaders to stub versions. + wl_class = 1; } if(!gSavedSettings.getBOOL("EnableRippleWater")) @@ -517,6 +534,8 @@ void LLViewerShaderMgr::setShaders() gViewerWindow->setCursor(UI_CURSOR_ARROW); } gPipeline.createGLBuffers(); + + reentrance = false; } void LLViewerShaderMgr::unloadShaders() diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 8059f866ba..045a5485ef 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -591,7 +591,7 @@ void update_statistics(U32 frame_count) } } LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); #if 0 // 1.9.2 diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5cfd6c3d38..26670351c6 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -409,6 +409,8 @@ void LLPipeline::init() { mSpotLightFade[i] = 1.f; } + + setLightingDetail(-1); } LLPipeline::~LLPipeline() @@ -905,13 +907,18 @@ S32 LLPipeline::setLightingDetail(S32 level) if (level < 0) { - level = gSavedSettings.getS32("RenderLightingDetail"); + if (gSavedSettings.getBOOL("VertexShaderEnable")) + { + level = 1; + } + else + { + level = 0; + } } level = llclamp(level, 0, getMaxLightingDetail()); if (level != mLightingDetail) { - gSavedSettings.setS32("RenderLightingDetail", level); - mLightingDetail = level; if (mVertexShadersLoaded == 1) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index e38ad01ff9..e6e7094847 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -242,12 +242,15 @@ control_name="RenderDeferred" height="16" initial_value="true" - label="Lighting Shaders" + label="Lighting and Shadows" layout="topleft" left_delta="0" name="UseLightShaders" top_pad="1" - width="256"/> + width="256"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> <check_box control_name="RenderDeferredSSAO" height="16" @@ -257,9 +260,12 @@ left_delta="0" name="UseSSAO" top_pad="1" - width="256"/> + width="256"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> - <text + <text type="string" length="1" top_pad="8" @@ -269,72 +275,72 @@ word_wrap="true" layout="topleft" left="10" - name="reflection_label"> - Water Reflections: + name="shadows_label"> + Shadows: </text> <combo_box - control_name="RenderReflectionDetail" + control_name="RenderShadowDetail" height="23" layout="topleft" - left_="10" - top_pad ="0" - name="Reflections" + left="10" + top_pad="0" + name="ShadowDetail" width="150"> <combo_box.item label="None" name="0" value="0"/> <combo_box.item - label="Terrain and trees" + label="Sun/Moon" name="1" value="1"/> <combo_box.item - label="All static objects" + label="Sun/Moon + Projectors" name="2" value="2"/> - <combo_box.item - label="All avatars and objects" - name="3" - value="3"/> - <combo_box.item - label="Everything" - name="4" - value="4"/> </combo_box> <text - type="string" - length="1" - top_pad="8" - follows="top|left" - height="23" - width="110" - word_wrap="true" - layout="topleft" - left="10" - name="shadows_label"> - Shadows: + type="string" + length="1" + top_pad="8" + follows="top|left" + height="23" + width="110" + word_wrap="true" + layout="topleft" + left="10" + name="reflection_label"> + Water Reflections: </text> <combo_box - control_name="RenderShadowDetail" + control_name="RenderReflectionDetail" height="23" layout="topleft" - left="10" - top_pad="0" - name="ShadowDetailRadio" + left_="10" + top_pad ="0" + name="Reflections" width="150"> <combo_box.item label="None" name="0" value="0"/> <combo_box.item - label="Sun/Moon" + label="Terrain and trees" name="1" value="1"/> <combo_box.item - label="Sun/Moon + Projectors" + label="All static objects" name="2" value="2"/> + <combo_box.item + label="All avatars and objects" + name="3" + value="3"/> + <combo_box.item + label="Everything" + name="4" + value="4"/> </combo_box> <slider -- cgit v1.2.3 From fc3ae43f70d68865de6b8e2f353b867ddbb8371a Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sun, 21 Mar 2010 18:59:44 +0000 Subject: indra/llcommon/llthread.h : dos2unix --- indra/llcommon/llthread.h | 570 +++++++++++++++++++++++----------------------- 1 file changed, 285 insertions(+), 285 deletions(-) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 5d5ecd62fc..4b6c3df105 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -1,285 +1,285 @@ -/** - * @file llthread.h - * @brief Base classes for thread, mutex and condition handling. - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLTHREAD_H -#define LL_LLTHREAD_H - -#include "llapp.h" -#include "llapr.h" -#include "apr_thread_cond.h" - -class LLThread; -class LLMutex; -class LLCondition; - -#if LL_WINDOWS -#define ll_thread_local __declspec(thread) -#else -#define ll_thread_local __thread -#endif - -class LL_COMMON_API LLThread -{ -private: - static U32 sIDIter; - -public: - typedef enum e_thread_status - { - STOPPED = 0, // The thread is not running. Not started, or has exited its run function - RUNNING = 1, // The thread is currently running - QUITTING= 2 // Someone wants this thread to quit - } EThreadStatus; - - LLThread(const std::string& name, apr_pool_t *poolp = NULL); - virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state. - virtual void shutdown(); // stops the thread - - bool isQuitting() const { return (QUITTING == mStatus); } - bool isStopped() const { return (STOPPED == mStatus); } - - static U32 currentID(); // Return ID of current thread - static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure. - -public: - // PAUSE / RESUME functionality. See source code for important usage notes. - // Called from MAIN THREAD. - void pause(); - void unpause(); - bool isPaused() { return isStopped() || mPaused == TRUE; } - - // Cause the thread to wake up and check its condition - void wake(); - - // Same as above, but to be used when the condition is already locked. - void wakeLocked(); - - // Called from run() (CHILD THREAD). Pause the thread if requested until unpaused. - void checkPause(); - - // this kicks off the apr thread - void start(void); - - apr_pool_t *getAPRPool() { return mAPRPoolp; } - LLVolatileAPRPool* getLocalAPRFilePool() { return mLocalAPRFilePoolp ; } - - U32 getID() const { return mID; } - -private: - BOOL mPaused; - - // static function passed to APR thread creation routine - static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap); - -protected: - std::string mName; - LLCondition* mRunCondition; - - apr_thread_t *mAPRThreadp; - apr_pool_t *mAPRPoolp; - BOOL mIsLocalPool; - EThreadStatus mStatus; - U32 mID; - - //a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used. - //Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes. - // otherwise it will cause severe memory leaking!!! --bao - LLVolatileAPRPool *mLocalAPRFilePoolp ; - - void setQuitting(); - - // virtual function overridden by subclass -- this will be called when the thread runs - virtual void run(void) = 0; - - // virtual predicate function -- returns true if the thread should wake up, false if it should sleep. - virtual bool runCondition(void); - - // Lock/Unlock Run Condition -- use around modification of any variable used in runCondition() - inline void lockData(); - inline void unlockData(); - - // This is the predicate that decides whether the thread should sleep. - // It should only be called with mRunCondition locked, since the virtual runCondition() function may need to access - // data structures that are thread-unsafe. - bool shouldSleep(void) { return (mStatus == RUNNING) && (isPaused() || (!runCondition())); } - - // To avoid spurious signals (and the associated context switches) when the condition may or may not have changed, you can do the following: - // mRunCondition->lock(); - // if(!shouldSleep()) - // mRunCondition->signal(); - // mRunCondition->unlock(); -}; - -//============================================================================ - -#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO) - -class LL_COMMON_API LLMutex -{ -public: - typedef enum - { - NO_THREAD = 0xFFFFFFFF - } e_locking_thread; - - LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex - ~LLMutex(); - - void lock(); // blocks - void unlock(); - bool isLocked(); // non-blocking, but does do a lock/unlock so not free - U32 lockingThread() const; //get ID of locking thread - -protected: - apr_thread_mutex_t *mAPRMutexp; - mutable U32 mCount; - mutable U32 mLockingThread; - - apr_pool_t *mAPRPoolp; - BOOL mIsLocalPool; - -#if MUTEX_DEBUG - std::map<U32, BOOL> mIsLocked; -#endif -}; - -// Actually a condition/mutex pair (since each condition needs to be associated with a mutex). -class LL_COMMON_API LLCondition : public LLMutex -{ -public: - LLCondition(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well. - ~LLCondition(); - - void wait(); // blocks - void signal(); - void broadcast(); - -protected: - apr_thread_cond_t *mAPRCondp; -}; - -class LLMutexLock -{ -public: - LLMutexLock(LLMutex* mutex) - { - mMutex = mutex; - mMutex->lock(); - } - ~LLMutexLock() - { - mMutex->unlock(); - } -private: - LLMutex* mMutex; -}; - -//============================================================================ - -void LLThread::lockData() -{ - mRunCondition->lock(); -} - -void LLThread::unlockData() -{ - mRunCondition->unlock(); -} - - -//============================================================================ - -// see llmemory.h for LLPointer<> definition - -class LL_COMMON_API LLThreadSafeRefCount -{ -public: - static void initThreadSafeRefCount(); // creates sMutex - static void cleanupThreadSafeRefCount(); // destroys sMutex - -private: - static LLMutex* sMutex; - -private: - LLThreadSafeRefCount(const LLThreadSafeRefCount&); // not implemented - LLThreadSafeRefCount&operator=(const LLThreadSafeRefCount&); // not implemented - -protected: - virtual ~LLThreadSafeRefCount(); // use unref() - -public: - LLThreadSafeRefCount(); - - void ref() - { - if (sMutex) sMutex->lock(); - mRef++; - if (sMutex) sMutex->unlock(); - } - - S32 unref() - { - llassert(mRef >= 1); - if (sMutex) sMutex->lock(); - S32 res = --mRef; - if (sMutex) sMutex->unlock(); - if (0 == res) - { - delete this; - return 0; - } - return res; - } - S32 getNumRefs() const - { - return mRef; - } - -private: - S32 mRef; -}; - -//============================================================================ - -// Simple responder for self destructing callbacks -// Pure virtual class -class LL_COMMON_API LLResponder : public LLThreadSafeRefCount -{ -protected: - virtual ~LLResponder(); -public: - virtual void completed(bool success) = 0; -}; - -//============================================================================ - -#endif // LL_LLTHREAD_H +/** + * @file llthread.h + * @brief Base classes for thread, mutex and condition handling. + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLTHREAD_H +#define LL_LLTHREAD_H + +#include "llapp.h" +#include "llapr.h" +#include "apr_thread_cond.h" + +class LLThread; +class LLMutex; +class LLCondition; + +#if LL_WINDOWS +#define ll_thread_local __declspec(thread) +#else +#define ll_thread_local __thread +#endif + +class LL_COMMON_API LLThread +{ +private: + static U32 sIDIter; + +public: + typedef enum e_thread_status + { + STOPPED = 0, // The thread is not running. Not started, or has exited its run function + RUNNING = 1, // The thread is currently running + QUITTING= 2 // Someone wants this thread to quit + } EThreadStatus; + + LLThread(const std::string& name, apr_pool_t *poolp = NULL); + virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state. + virtual void shutdown(); // stops the thread + + bool isQuitting() const { return (QUITTING == mStatus); } + bool isStopped() const { return (STOPPED == mStatus); } + + static U32 currentID(); // Return ID of current thread + static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure. + +public: + // PAUSE / RESUME functionality. See source code for important usage notes. + // Called from MAIN THREAD. + void pause(); + void unpause(); + bool isPaused() { return isStopped() || mPaused == TRUE; } + + // Cause the thread to wake up and check its condition + void wake(); + + // Same as above, but to be used when the condition is already locked. + void wakeLocked(); + + // Called from run() (CHILD THREAD). Pause the thread if requested until unpaused. + void checkPause(); + + // this kicks off the apr thread + void start(void); + + apr_pool_t *getAPRPool() { return mAPRPoolp; } + LLVolatileAPRPool* getLocalAPRFilePool() { return mLocalAPRFilePoolp ; } + + U32 getID() const { return mID; } + +private: + BOOL mPaused; + + // static function passed to APR thread creation routine + static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap); + +protected: + std::string mName; + LLCondition* mRunCondition; + + apr_thread_t *mAPRThreadp; + apr_pool_t *mAPRPoolp; + BOOL mIsLocalPool; + EThreadStatus mStatus; + U32 mID; + + //a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used. + //Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes. + // otherwise it will cause severe memory leaking!!! --bao + LLVolatileAPRPool *mLocalAPRFilePoolp ; + + void setQuitting(); + + // virtual function overridden by subclass -- this will be called when the thread runs + virtual void run(void) = 0; + + // virtual predicate function -- returns true if the thread should wake up, false if it should sleep. + virtual bool runCondition(void); + + // Lock/Unlock Run Condition -- use around modification of any variable used in runCondition() + inline void lockData(); + inline void unlockData(); + + // This is the predicate that decides whether the thread should sleep. + // It should only be called with mRunCondition locked, since the virtual runCondition() function may need to access + // data structures that are thread-unsafe. + bool shouldSleep(void) { return (mStatus == RUNNING) && (isPaused() || (!runCondition())); } + + // To avoid spurious signals (and the associated context switches) when the condition may or may not have changed, you can do the following: + // mRunCondition->lock(); + // if(!shouldSleep()) + // mRunCondition->signal(); + // mRunCondition->unlock(); +}; + +//============================================================================ + +#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO) + +class LL_COMMON_API LLMutex +{ +public: + typedef enum + { + NO_THREAD = 0xFFFFFFFF + } e_locking_thread; + + LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex + ~LLMutex(); + + void lock(); // blocks + void unlock(); + bool isLocked(); // non-blocking, but does do a lock/unlock so not free + U32 lockingThread() const; //get ID of locking thread + +protected: + apr_thread_mutex_t *mAPRMutexp; + mutable U32 mCount; + mutable U32 mLockingThread; + + apr_pool_t *mAPRPoolp; + BOOL mIsLocalPool; + +#if MUTEX_DEBUG + std::map<U32, BOOL> mIsLocked; +#endif +}; + +// Actually a condition/mutex pair (since each condition needs to be associated with a mutex). +class LL_COMMON_API LLCondition : public LLMutex +{ +public: + LLCondition(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well. + ~LLCondition(); + + void wait(); // blocks + void signal(); + void broadcast(); + +protected: + apr_thread_cond_t *mAPRCondp; +}; + +class LLMutexLock +{ +public: + LLMutexLock(LLMutex* mutex) + { + mMutex = mutex; + mMutex->lock(); + } + ~LLMutexLock() + { + mMutex->unlock(); + } +private: + LLMutex* mMutex; +}; + +//============================================================================ + +void LLThread::lockData() +{ + mRunCondition->lock(); +} + +void LLThread::unlockData() +{ + mRunCondition->unlock(); +} + + +//============================================================================ + +// see llmemory.h for LLPointer<> definition + +class LL_COMMON_API LLThreadSafeRefCount +{ +public: + static void initThreadSafeRefCount(); // creates sMutex + static void cleanupThreadSafeRefCount(); // destroys sMutex + +private: + static LLMutex* sMutex; + +private: + LLThreadSafeRefCount(const LLThreadSafeRefCount&); // not implemented + LLThreadSafeRefCount&operator=(const LLThreadSafeRefCount&); // not implemented + +protected: + virtual ~LLThreadSafeRefCount(); // use unref() + +public: + LLThreadSafeRefCount(); + + void ref() + { + if (sMutex) sMutex->lock(); + mRef++; + if (sMutex) sMutex->unlock(); + } + + S32 unref() + { + llassert(mRef >= 1); + if (sMutex) sMutex->lock(); + S32 res = --mRef; + if (sMutex) sMutex->unlock(); + if (0 == res) + { + delete this; + return 0; + } + return res; + } + S32 getNumRefs() const + { + return mRef; + } + +private: + S32 mRef; +}; + +//============================================================================ + +// Simple responder for self destructing callbacks +// Pure virtual class +class LL_COMMON_API LLResponder : public LLThreadSafeRefCount +{ +protected: + virtual ~LLResponder(); +public: + virtual void completed(bool success) = 0; +}; + +//============================================================================ + +#endif // LL_LLTHREAD_H -- cgit v1.2.3 From eb3206fb93187efdef3dce389862ed31be516963 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 22 Mar 2010 16:10:34 +0000 Subject: screen-space reflections mk4. generally subtle. very cheap. --- .../shaders/class1/deferred/softenLightF.glsl | 47 +++++++++++++++++---- .../shaders/class2/deferred/softenLightF.glsl | 48 ++++++++++++++++++---- .../shaders/class3/deferred/softenLightF.glsl | 48 ++++++++++++++++++---- 3 files changed, 119 insertions(+), 24 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 9cf60aad48..7d57eaa13d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -56,9 +56,8 @@ vec3 vary_AtmosAttenuation; uniform mat4 inv_proj; uniform vec2 screen_res; -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; +vec4 getPosition_d(vec2 pos_screen, float depth) +{ vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -69,6 +68,12 @@ vec4 getPosition(vec2 pos_screen) return pos; } +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; + return getPosition_d(pos_screen, depth); +} + vec3 getPositionEye() { return vary_PositionEye; @@ -252,7 +257,8 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - vec3 pos = getPosition(tc).xyz; + float depth = texture2DRect(depthMap, tc.xy).a; + vec3 pos = getPosition_d(tc, depth).xyz; vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; @@ -272,11 +278,36 @@ void main() col *= diffuse.rgb; - if (spec.a > 0.0) + if (spec.a > 0.0) // specular reflection { - vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*scol_ambocc.r*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + // the old infinite-sky shiny reflection + // + vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnorm, vary_light.xyz); + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + + // screen-space cheap fakey reflection map + // + // first figure out where we'll make our 2D guess from + vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // get attributes from the 2D guess point + float refdepth = texture2DRect(depthMap, ref2d).a; + vec3 refpos = getPosition_d(ref2d, refdepth).xyz; + vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; + vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); + // figure out how appropriate our guess actually was + float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); + // darken reflections from points which face away from the reflected ray - our guess was a back-face + //refapprop *= step(dot(refnorm, refn), 0.0); + refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant + // get appropriate light strength for guess-point + float reflit = max(dot(refn, vary_light.xyz), 0.0); + // apply sun color to guess-point, dampen according to inappropriateness of guess + vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + vec3 ssshiny = (refprod * spec.a); + + // add the two types of shiny together + col += (ssshiny + dumbshiny) * spec.rgb; } col = atmosLighting(col); diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 589a292751..c5530c5f59 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -55,9 +55,8 @@ vec3 vary_AmblitColor; vec3 vary_AdditiveColor; vec3 vary_AtmosAttenuation; -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; +vec4 getPosition_d(vec2 pos_screen, float depth) +{ vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -68,6 +67,12 @@ vec4 getPosition(vec2 pos_screen) return pos; } +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; + return getPosition_d(pos_screen, depth); +} + vec3 getPositionEye() { return vary_PositionEye; @@ -251,7 +256,8 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - vec3 pos = getPosition(tc).xyz; + float depth = texture2DRect(depthMap, tc.xy).a; + vec3 pos = getPosition_d(tc, depth).xyz; vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; @@ -271,11 +277,37 @@ void main() col *= diffuse.rgb; - if (spec.a > 0.0) + if (spec.a > 0.0) // specular reflection { - vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*scol_ambocc.r*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + // the old infinite-sky shiny reflection + // + vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnorm, vary_light.xyz); + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + + // screen-space cheap fakey reflection map + // + // first figure out where we'll make our 2D guess from + vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // get attributes from the 2D guess point + float refdepth = texture2DRect(depthMap, ref2d).a; + vec3 refpos = getPosition_d(ref2d, refdepth).xyz; + vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; + float refshad = texture2DRect(lightMap, ref2d).r; + vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); + // figure out how appropriate our guess actually was + float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); + // darken reflections from points which face away from the reflected ray - our guess was a back-face + //refapprop *= step(dot(refnorm, refn), 0.0); + refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant + // get appropriate light strength for guess-point + float reflit = min(max(dot(refn, vary_light.xyz), 0.0), refshad); + // apply sun color to guess-point, dampen according to inappropriateness of guess + vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + vec3 ssshiny = (refprod * spec.a); + + // add the two types of shiny together + col += (ssshiny + dumbshiny) * spec.rgb; } col = atmosLighting(col); diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 96a083b522..265fb437ec 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -56,9 +56,8 @@ vec3 vary_AdditiveColor; vec3 vary_AtmosAttenuation; uniform float gi_ambiance; -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; +vec4 getPosition_d(vec2 pos_screen, float depth) +{ vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -69,6 +68,12 @@ vec4 getPosition(vec2 pos_screen) return pos; } +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; + return getPosition_d(pos_screen, depth); +} + vec3 getPositionEye() { return vary_PositionEye; @@ -252,7 +257,8 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - vec3 pos = getPosition(tc).xyz; + float depth = texture2DRect(depthMap, tc.xy).a; + vec3 pos = getPosition_d(tc, depth).xyz; vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; @@ -274,11 +280,37 @@ void main() col *= diffuse.rgb; - if (spec.a > 0.0) + if (spec.a > 0.0) // specular reflection { - vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*scol*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + // the old infinite-sky shiny reflection + // + vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnorm, vary_light.xyz); + vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; + + // screen-space cheap fakey reflection map + // + // first figure out where we'll make our 2D guess from + vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // get attributes from the 2D guess point + float refdepth = texture2DRect(depthMap, ref2d).a; + vec3 refpos = getPosition_d(ref2d, refdepth).xyz; + vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; + float refshad = texture2DRect(lightMap, ref2d).r; + vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); + // figure out how appropriate our guess actually was + float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); + // darken reflections from points which face away from the reflected ray - our guess was a back-face + //refapprop *= step(dot(refnorm, refn), 0.0); + refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant + // get appropriate light strength for guess-point + float reflit = min(max(dot(refn, vary_light.xyz), 0.0), refshad); + // apply sun color to guess-point, dampen according to inappropriateness of guess + vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + vec3 ssshiny = (refprod * spec.a); + + // add the two types of shiny together + col += (ssshiny + dumbshiny) * spec.rgb; } col = atmosLighting(col); -- cgit v1.2.3 From 87c4bac9356ad7ac9d0328f5d83335f70600da3e Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 22 Mar 2010 16:26:15 +0000 Subject: bring linux featuretable in line with recent win32 featuretable changes. --- indra/newview/featuretable_linux.txt | 86 ++++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 19 deletions(-) diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index 61a8e51c50..254b9c4ce4 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -23,7 +23,7 @@ version 21 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 0 +RenderAnisotropic 1 1 RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarVP 1 1 @@ -35,18 +35,16 @@ RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 RenderGround 1 1 -RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 @@ -55,6 +53,10 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 +RenderShaderLightingMaxLevel 1 3 +RenderDeferred 1 1 +RenderDeferredSSAO 1 1 +RenderShadowDetail 1 2 // // Low Graphics Settings @@ -67,7 +69,6 @@ RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0.5 RenderGlowResolutionPow 1 8 -RenderLightingDetail 1 0 RenderMaxPartCount 1 1024 RenderObjectBump 1 0 RenderReflectionDetail 1 0 @@ -76,10 +77,13 @@ RenderTerrainLODFactor 1 1 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // Mid Graphics Settings @@ -92,7 +96,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 -RenderLightingDetail 1 1 RenderMaxPartCount 1 2048 RenderObjectBump 1 1 RenderReflectionDetail 1 0 @@ -101,10 +104,13 @@ RenderTerrainLODFactor 1 1.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // High Graphics Settings (purty) @@ -117,7 +123,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLightingDetail 1 1 RenderMaxPartCount 1 4096 RenderObjectBump 1 1 RenderReflectionDetail 1 2 @@ -126,10 +131,13 @@ RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 +RenderDeferred 1 1 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 1 + // // Ultra graphics (REALLY PURTY!) @@ -142,19 +150,21 @@ RenderAvatarVP 1 1 RenderFarClip 1 256 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 +RenderDeferred 1 1 +RenderDeferredSSAO 1 1 +RenderShadowDetail 1 2 + // // Class Unknown Hardware (unknown) @@ -192,9 +202,12 @@ RenderVBOEnable 1 1 list NoPixelShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // No Vertex Shaders available @@ -202,9 +215,13 @@ WindLightUseAtmosShaders 0 0 list NoVertexShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 + // "Default" setups for safe, low, medium, high // @@ -212,14 +229,17 @@ list safe RenderAnisotropic 1 0 RenderAvatarCloth 0 0 RenderAvatarVP 0 0 -RenderLightingDetail 1 0 RenderObjectBump 0 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderUseImpostors 0 0 RenderVBOEnable 1 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 + // // CPU based feature masks @@ -243,13 +263,11 @@ RenderVBOEnable 1 0 list Intel RenderAnisotropic 1 0 -RenderLightingDetail 1 0 // Avoid some Intel crashes on Linux RenderCubeMap 0 0 list GeForce2 RenderAnisotropic 1 0 -RenderLightingDetail 1 0 RenderMaxPartCount 1 2048 RenderTerrainDetail 1 0 RenderVBOEnable 1 1 @@ -461,17 +479,47 @@ list NVIDIA_GeForce_Go_6 RenderVBOEnable 1 0 Disregard128DefaultDrawDistance 1 0 +list NVIDIA_GeForce_7000 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7100 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7200 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7300 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7400 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7500 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7600 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7700 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7800 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7900 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7200 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7300 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7300_LE +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7400 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7600 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7700 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7800 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7900 +RenderShaderLightingMaxLevel 1 2 -- cgit v1.2.3 From 500d1ec0ccbad710392c323e9b1f46b2241f7f90 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 22 Mar 2010 16:28:01 +0000 Subject: lowest water reflection level label 'none' changed to a more accurate 'minimal' --- indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index e6e7094847..66eae5f516 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -322,7 +322,7 @@ name="Reflections" width="150"> <combo_box.item - label="None" + label="Minimal" name="0" value="0"/> <combo_box.item -- cgit v1.2.3 From ebea9eed4d30376e8914c0e778250ecc45f9dd22 Mon Sep 17 00:00:00 2001 From: Palmer <palmer@lindenlab.com> Date: Tue, 23 Mar 2010 13:29:40 -0700 Subject: Fix for crash logger crashing. bleh! Reviewed by DaveP --- indra/llcrashlogger/llcrashlogger.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index c1022c1195..4bda00ed86 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -370,6 +370,8 @@ void LLCrashLogger::updateApplication(const std::string& message) bool LLCrashLogger::init() { + LLCurl::initClass(); + // We assume that all the logs we're looking for reside on the current drive gDirUtilp->initAppDirs("SecondLife"); -- cgit v1.2.3 From fc0bbcbc26aa4fdd8770b9777c58f10d651136e9 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 25 Mar 2010 19:22:08 -0500 Subject: rigged attachments WIP --- indra/llrender/llvertexbuffer.cpp | 14 ++++++++++++++ indra/llrender/llvertexbuffer.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 4064e688e8..d5b00f27a7 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -62,6 +62,7 @@ BOOL LLVertexBuffer::sIBOActive = FALSE; U32 LLVertexBuffer::sAllocatedBytes = 0; BOOL LLVertexBuffer::sMapped = FALSE; BOOL LLVertexBuffer::sUseStreamDraw = TRUE; +S32 LLVertexBuffer::sWeight4Loc = -1; std::vector<U32> LLVertexBuffer::sDeleteList; @@ -76,6 +77,7 @@ S32 LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_MAX] = sizeof(LLColor4U), // TYPE_COLOR, sizeof(LLVector3), // TYPE_BINORMAL, sizeof(F32), // TYPE_WEIGHT, + sizeof(LLVector4), // TYPE_WEIGHT4, sizeof(LLVector4), // TYPE_CLOTHWEIGHT, }; @@ -1015,6 +1017,12 @@ bool LLVertexBuffer::getWeightStrider(LLStrider<F32>& strider, S32 index) { return VertexBufferStrider<F32,TYPE_WEIGHT>::get(*this, strider, index); } + +bool LLVertexBuffer::getWeight4Strider(LLStrider<LLVector4>& strider, S32 index) +{ + return VertexBufferStrider<LLVector4,TYPE_WEIGHT4>::get(*this, strider, index); +} + bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, S32 index) { return VertexBufferStrider<LLVector4,TYPE_CLOTHWEIGHT>::get(*this, strider, index); @@ -1284,6 +1292,12 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const { glVertexAttribPointerARB(1, 1, GL_FLOAT, FALSE, stride, (void*)(base + mOffsets[TYPE_WEIGHT])); } + + if (data_mask & MAP_WEIGHT4 && sWeight4Loc != -1) + { + glVertexAttribPointerARB(sWeight4Loc, 4, GL_FLOAT, FALSE, stride, (void*)(base+mOffsets[TYPE_WEIGHT4])); + } + if (data_mask & MAP_CLOTHWEIGHT) { glVertexAttribPointerARB(4, 4, GL_FLOAT, TRUE, stride, (void*)(base + mOffsets[TYPE_CLOTHWEIGHT])); diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index e2fecdffef..225237215c 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -84,6 +84,8 @@ public: static LLVBOPool sStreamIBOPool; static LLVBOPool sDynamicIBOPool; + static S32 sWeight4Loc; + static BOOL sUseStreamDraw; static void initClass(bool use_vbo); @@ -109,6 +111,7 @@ public: // These use VertexAttribPointer and should possibly be made generic TYPE_BINORMAL, TYPE_WEIGHT, + TYPE_WEIGHT4, TYPE_CLOTHWEIGHT, TYPE_MAX, TYPE_INDEX, @@ -124,6 +127,7 @@ public: // These use VertexAttribPointer and should possibly be made generic MAP_BINORMAL = (1<<TYPE_BINORMAL), MAP_WEIGHT = (1<<TYPE_WEIGHT), + MAP_WEIGHT4 = (1<<TYPE_WEIGHT4), MAP_CLOTHWEIGHT = (1<<TYPE_CLOTHWEIGHT), }; @@ -173,6 +177,7 @@ public: bool getBinormalStrider(LLStrider<LLVector3>& strider, S32 index=0); bool getColorStrider(LLStrider<LLColor4U>& strider, S32 index=0); bool getWeightStrider(LLStrider<F32>& strider, S32 index=0); + bool getWeight4Strider(LLStrider<LLVector4>& strider, S32 index=0); bool getClothWeightStrider(LLStrider<LLVector4>& strider, S32 index=0); BOOL isEmpty() const { return mEmpty; } -- cgit v1.2.3 From 122308205b2958b27152b9dd5375554ef76dd084 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 26 Mar 2010 09:07:08 +0000 Subject: screen-space reflections: remember to unbias the value from the depth map. don't use varying version of lightnorm for lighting the reflection-guess-point. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 3 ++- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 3 ++- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 7d57eaa13d..c78d7ece7e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -288,6 +288,7 @@ void main() // screen-space cheap fakey reflection map // + depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // get attributes from the 2D guess point @@ -301,7 +302,7 @@ void main() //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant // get appropriate light strength for guess-point - float reflit = max(dot(refn, vary_light.xyz), 0.0); + float reflit = max(dot(refn, lightnorm.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; vec3 ssshiny = (refprod * spec.a); diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index c5530c5f59..9305d77ddb 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -287,6 +287,7 @@ void main() // screen-space cheap fakey reflection map // + depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // get attributes from the 2D guess point @@ -301,7 +302,7 @@ void main() //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant // get appropriate light strength for guess-point - float reflit = min(max(dot(refn, vary_light.xyz), 0.0), refshad); + float reflit = min(max(dot(refn, lightnorm.xyz), 0.0), refshad); // apply sun color to guess-point, dampen according to inappropriateness of guess vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; vec3 ssshiny = (refprod * spec.a); diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 265fb437ec..262b34ede7 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -290,6 +290,7 @@ void main() // screen-space cheap fakey reflection map // + depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // get attributes from the 2D guess point @@ -304,7 +305,7 @@ void main() //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant // get appropriate light strength for guess-point - float reflit = min(max(dot(refn, vary_light.xyz), 0.0), refshad); + float reflit = min(max(dot(refn, lightnorm.xyz), 0.0), refshad); // apply sun color to guess-point, dampen according to inappropriateness of guess vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; vec3 ssshiny = (refprod * spec.a); -- cgit v1.2.3 From 92257b55a405f3625cbbcf07357b3ca929a04882 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" <falcon@lindenlab.com> Date: Fri, 26 Mar 2010 18:23:05 -0700 Subject: DEV-47845 Fix to work with TCP/LLSD message. This checkin is experimental, so if it breaks a build, just revert to the previous changeset. --- etc/message.xml | 7 +++ indra/newview/llpanelobject.cpp | 34 ++++++++++++ indra/newview/llpanelobject.h | 6 ++- indra/newview/llselectmgr.cpp | 23 ++++++++- indra/newview/llselectmgr.h | 1 + indra/newview/llviewerobject.cpp | 60 ++++++++++++++++++++++ indra/newview/llviewerobject.h | 6 +++ .../newview/skins/default/xui/en/floater_tools.xml | 33 ++++++++++++ scripts/messages/message_template.msg | 4 ++ 9 files changed, 172 insertions(+), 2 deletions(-) diff --git a/etc/message.xml b/etc/message.xml index c17ae3656d..7283d903b9 100644 --- a/etc/message.xml +++ b/etc/message.xml @@ -572,6 +572,13 @@ <boolean>false</boolean> </map> + <key>ObjectPhysicsProperties</key> + <map> + <key>flavor</key> + <string>llsd</string> + <key>trusted-sender</key> + <boolean>true</boolean> + </map> </map> <key>capBans</key> diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 30221da12a..991e97b767 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -137,6 +137,10 @@ BOOL LLPanelObject::postBuild() // Phantom checkbox mCheckPhantom = getChild<LLCheckBoxCtrl>("Phantom Checkbox Ctrl"); childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); + + // PhysicsRep combobox + mComboPhysicsRep = getChild<LLComboBox>("Physics Rep Combo Ctrl"); + childSetCommitCallback("Physics Rep Combo Ctrl", onCommitPhysicsRep,this); // Position mLabelPosition = getChild<LLTextBox>("label position"); @@ -320,6 +324,7 @@ LLPanelObject::LLPanelObject() mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), + mPhysicsRep(0), mCastShadows(TRUE), mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), @@ -527,6 +532,10 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); + mPhysicsRep = objectp->getPhysicsRep(); + mComboPhysicsRep->setCurrentByIndex(mPhysicsRep); + mComboPhysicsRep->setEnabled(editable); + #if 0 // 1.9.2 mCastShadows = root_objectp->flagCastShadows(); mCheckCastShadows->set( mCastShadows ); @@ -1232,6 +1241,22 @@ void LLPanelObject::sendIsPhantom() } } +void LLPanelObject::sendPhysicsRep() +{ + U8 value = (U8)mComboPhysicsRep->getCurrentIndex(); + if (mPhysicsRep != value) + { + LLSelectMgr::getInstance()->selectionUpdatePhysicsRep(value); + mPhysicsRep = value; + + llinfos << "update physicsrep sent" << llendl; + } + else + { + llinfos << "update physicstep not changed" << llendl; + } +} + void LLPanelObject::sendCastShadows() { BOOL value = mCheckCastShadows->get(); @@ -1905,6 +1930,8 @@ void LLPanelObject::clearCtrls() mCheckTemporary ->setEnabled( FALSE ); mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); + mComboPhysicsRep->setCurrentByIndex(0); + mComboPhysicsRep->setEnabled(FALSE); #if 0 // 1.9.2 mCheckCastShadows->set(FALSE); mCheckCastShadows->setEnabled( FALSE ); @@ -1999,6 +2026,13 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata ) self->sendIsPhantom(); } +// static +void LLPanelObject::onCommitPhysicsRep(LLUICtrl* ctrl, void* userdata ) +{ + LLPanelObject* self = (LLPanelObject*) userdata; + self->sendPhysicsRep(); +} + // static void LLPanelObject::onCommitCastShadows( LLUICtrl* ctrl, void* userdata ) { diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 58d9fe9b76..fbc0902141 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -71,6 +71,7 @@ public: static void onCommitPhysics( LLUICtrl* ctrl, void* userdata); static void onCommitTemporary( LLUICtrl* ctrl, void* userdata); static void onCommitPhantom( LLUICtrl* ctrl, void* userdata); + static void onCommitPhysicsRep( LLUICtrl* ctrl, void* userdata); static void onCommitCastShadows( LLUICtrl* ctrl, void* userdata); static void onCommitParametric(LLUICtrl* ctrl, void* userdata); @@ -93,6 +94,7 @@ protected: void sendIsPhysical(); void sendIsTemporary(); void sendIsPhantom(); + void sendPhysicsRep(); void sendCastShadows(); void sendSculpt(); @@ -165,8 +167,9 @@ protected: LLCheckBoxCtrl *mCheckPhysics; LLCheckBoxCtrl *mCheckTemporary; LLCheckBoxCtrl *mCheckPhantom; + LLComboBox *mComboPhysicsRep; LLCheckBoxCtrl *mCheckCastShadows; - + LLTextureCtrl *mCtrlSculptTexture; LLTextBox *mLabelSculptType; LLComboBox *mCtrlSculptType; @@ -177,6 +180,7 @@ protected: BOOL mIsPhysical; // to avoid sending "physical" when not changed BOOL mIsTemporary; // to avoid sending "temporary" when not changed BOOL mIsPhantom; // to avoid sending "phantom" when not changed + U8 mPhysicsRep; // to avoid sending "physics rep spec" when not changed BOOL mCastShadows; // to avoid sending "cast shadows" when not changed S32 mSelectedType; // So we know what selected type we last were diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index f45abca246..9d1893b68a 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3930,6 +3930,28 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } +struct LLSelectMgrApplyPhysicsRep : public LLSelectedObjectFunctor +{ + LLSelectMgrApplyPhysicsRep(U8 value) : mValue(value) {} + U8 mValue; + virtual bool apply(LLViewerObject* object) + { + if ( object->permModify() ) // preemptive permissions check + { + object->setPhysicsRep( mValue ); + object->updateFlags(); + } + return true; + } +}; + + +void LLSelectMgr::selectionUpdatePhysicsRep(U8 rep) +{ + llwarns << "physics rep ->" << (U32)rep << llendl; + LLSelectMgrApplyPhysicsRep func(rep); + getSelection()->applyToObjects(&func); +} //---------------------------------------------------------------------- // Helpful packing functions for sendObjectMessage() @@ -4619,7 +4641,6 @@ void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**) LLSelectMgr::getInstance()->highlightObjectAndFamily(objects); } - extern LLGLdouble gGLModelView[16]; void LLSelectMgr::updateSilhouettes() diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 60b151f1c6..f14136c275 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -484,6 +484,7 @@ public: void selectionUpdatePhysics(BOOL use_physics); void selectionUpdateTemporary(BOOL is_temporary); void selectionUpdatePhantom(BOOL is_ghost); + void selectionUpdatePhysicsRep(U8 rep); void selectionUpdateCastShadows(BOOL cast_shadows); void selectionDump(); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 8dea60cc87..1ee30b49bf 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -189,6 +189,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mGLName(0), mbCanSelect(TRUE), mFlags(0), + mPhysicsRep(0), mDrawable(), mCreateSelected(FALSE), mRenderMedia(FALSE), @@ -4952,7 +4953,14 @@ void LLViewerObject::updateFlags() gMessageSystem->addBOOL("IsTemporary", flagTemporaryOnRez() ); gMessageSystem->addBOOL("IsPhantom", flagPhantom() ); gMessageSystem->addBOOL("CastsShadows", flagCastShadows() ); + gMessageSystem->nextBlock("ExtraPhysics"); + gMessageSystem->addU8("PhysicsRep", getPhysicsRep() ); gMessageSystem->sendReliable( regionp->getHost() ); + + if (getPhysicsRep() != 0) + { + llwarns << "sent non default physics rep" << llendl; + } } BOOL LLViewerObject::setFlags(U32 flags, BOOL state) @@ -4984,6 +4992,12 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state) return setit; } +void LLViewerObject::setPhysicsRep(U8 rep) +{ + mPhysicsRep = rep; + updateFlags(); +} + void LLViewerObject::applyAngularVelocity(F32 dt) { //do target omega here @@ -5194,4 +5208,50 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif return ; } +#include "../llcommon/llsdserialize.h" +class ObjectPhysicsProperties : public LLHTTPNode +{ +public: + virtual void post( + ResponsePtr responder, + const LLSD& context, + const LLSD& input) const + { + LLSD objectData = input["body"]["ObjectData"]; + S32 numEntries = objectData.size(); + + for ( S32 i = 0; i < numEntries; i++ ) + { + U32 localID = objectData[i]["LocalID"].asInteger(); + + std::ostringstream string; + LLSDSerialize::serialize( input, string, LLSDSerialize::LLSD_XML, LLSDFormatter::OPTIONS_PRETTY); + llinfos << string.str() << llendl; + + // Iterate through nodes at end, since it can be on both the regular AND hover list + struct f : public LLSelectedNodeFunctor + { + U32 mID; + f(const U32& id) : mID(id) {} + virtual bool apply(LLSelectNode* node) + { + return (node->getObject() && node->getObject()->mLocalID == mID ); + } + } func(localID); + + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func); + + U8 physicsRepSpec = (U8)objectData[i]["PhysicsRepSpec"].asInteger(); + + if (node) + { + node->getObject()->setPhysicsRep(physicsRepSpec); + } + } + + }; +}; + +LLHTTPRegistration<ObjectPhysicsProperties> + gHTTPRegistrationObjectPhysicsProperties("/message/ObjectPhysicsProperties"); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index bf5e0b6656..da7e4002f5 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -460,6 +460,8 @@ public: inline BOOL flagCameraDecoupled() const { return ((mFlags & FLAGS_CAMERA_DECOUPLED) != 0); } inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); } + inline U8 getPhysicsRep() const { return mPhysicsRep; } + bool getIncludeInSearch() const; void setIncludeInSearch(bool include_in_search); @@ -475,6 +477,7 @@ public: void updateFlags(); BOOL setFlags(U32 flag, BOOL state); + void setPhysicsRep(U8 rep); virtual void dump() const; static U32 getNumZombieObjects() { return sNumZombieObjects; } @@ -554,6 +557,9 @@ public: // Grabbed from UPDATE_FLAGS U32 mFlags; + // Sent to sim in UPDATE_FLAGS, received in ObjectPhysicsProperties + U8 mPhysicsRep; + // Pipeline classes LLPointer<LLDrawable> mDrawable; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index aec03b8053..26c08bdf7c 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1419,6 +1419,39 @@ even though the user gets a free copy. text_enabled_color="1 1 1 1" top_pad="3" width="87" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="label physicsrep" + top_pad="10" + width="121"> + Physics Rep: + </text> + <combo_box + height="23" + layout="topleft" + follows="left|top" + name="Physics Rep Combo Ctrl" + tool_tip="Choose the physics representation" + left_pad="0" + width="108"> + <combo_box.item + label="Default" + name="Default" + value="Default" /> + <combo_box.item + label="No Shape" + name="No Shape" + value="No Shape" /> + <combo_box.item + label="Convex Hull" + name="Convex Hull" + value="Convex Hull" /> + </combo_box> <!-- <text type="string" diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index d4f791c202..7813bfba83 100644 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -2061,6 +2061,10 @@ version 2.0 { IsPhantom BOOL } { CastsShadows BOOL } } + { + ExtraPhysics Variable + { PhysicsRep U8 } + } } -- cgit v1.2.3 From 79d2c59112213151060b928a2528c481cfde09fe Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Sun, 28 Mar 2010 21:45:32 +0100 Subject: ss reflections: make the guess less far from the source. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index c78d7ece7e..e14869af9e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -290,7 +290,7 @@ void main() // depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from - vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 9305d77ddb..78e4c179d7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -289,7 +289,7 @@ void main() // depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from - vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 262b34ede7..9ecb0a40ff 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -292,7 +292,7 @@ void main() // depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from - vec2 ref2d = tc.xy + (0.5 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; -- cgit v1.2.3 From ccd5b9e2f3f1139814a63d9db03c3671c249930c Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 29 Mar 2010 11:30:08 +0100 Subject: ss reflections tweakage: + // Offset the guess source a little according to a trivial + // checkerboard dither function and spec.a. + // This is meant to be similar to sampling a blurred version + // of the diffuse map. LOD would be better in that regard. + // The goal of the blur is to soften reflections in surfaces + // with low shinyness, and also to disguise our lameness. --- .../app_settings/shaders/class1/deferred/softenLightF.glsl | 8 ++++++++ .../app_settings/shaders/class2/deferred/softenLightF.glsl | 8 ++++++++ .../app_settings/shaders/class3/deferred/softenLightF.glsl | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index e14869af9e..4646bd4d40 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -291,6 +291,14 @@ void main() depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // Offset the guess source a little according to a trivial + // checkerboard dither function and spec.a. + // This is meant to be similar to sampling a blurred version + // of the diffuse map. LOD would be better in that regard. + // The goal of the blur is to soften reflections in surfaces + // with low shinyness, and also to disguise our lameness. + float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 + ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 78e4c179d7..5769288a36 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -290,6 +290,14 @@ void main() depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // Offset the guess source a little according to a trivial + // checkerboard dither function and spec.a. + // This is meant to be similar to sampling a blurred version + // of the diffuse map. LOD would be better in that regard. + // The goal of the blur is to soften reflections in surfaces + // with low shinyness, and also to disguise our lameness. + float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 + ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 9ecb0a40ff..70a1c53456 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -293,6 +293,14 @@ void main() depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // Offset the guess source a little according to a trivial + // checkerboard dither function and spec.a. + // This is meant to be similar to sampling a blurred version + // of the diffuse map. LOD would be better in that regard. + // The goal of the blur is to soften reflections in surfaces + // with low shinyness, and also to disguise our lameness. + float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 + ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; -- cgit v1.2.3 From 784e83462b19c0fbea6656e2a845a1f3ab4b1e70 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 31 Mar 2010 18:23:42 +0100 Subject: debug ssreflection blur direction. minor. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 4646bd4d40..155f03fdcf 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -290,7 +290,7 @@ void main() // depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from - vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // Offset the guess source a little according to a trivial // checkerboard dither function and spec.a. // This is meant to be similar to sampling a blurred version @@ -299,6 +299,7 @@ void main() // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += tc.xy; // use as offset from destination // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; -- cgit v1.2.3 From e3c49e617edf6dfe61389e3e90c28082e5b678ce Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 31 Mar 2010 18:27:50 +0100 Subject: debug ssreflection blur direction. minor. --- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 3 ++- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 5769288a36..922a07c306 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -289,7 +289,7 @@ void main() // depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from - vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // Offset the guess source a little according to a trivial // checkerboard dither function and spec.a. // This is meant to be similar to sampling a blurred version @@ -298,6 +298,7 @@ void main() // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += tc.xy; // use as offset from destination // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 70a1c53456..ddd69befc3 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -292,7 +292,7 @@ void main() // depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from - vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; // Offset the guess source a little according to a trivial // checkerboard dither function and spec.a. // This is meant to be similar to sampling a blurred version @@ -301,6 +301,7 @@ void main() // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += tc.xy; // use as offset from destination // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; -- cgit v1.2.3 From a503cb57465594bf693ed335d04715389725b3b0 Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Wed, 31 Mar 2010 15:17:30 -0500 Subject: viewer side support for coalesced objects --- indra/newview/llviewerregion.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 524710f9e2..c6fe78eb74 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1511,6 +1511,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("UpdateNotecardTaskInventory"); capabilityNames.append("UpdateScriptTask"); capabilityNames.append("UploadBakedTexture"); + capabilityNames.append("UploadObjectAsset"); capabilityNames.append("ViewerStartAuction"); capabilityNames.append("ViewerStats"); capabilityNames.append("WebFetchInventoryDescendents"); -- cgit v1.2.3 From b2381a039de7e0edbd643d198b85ba8e00524b6b Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" <falcon@lindenlab.com> Date: Wed, 31 Mar 2010 17:35:26 -0700 Subject: DEV-47845 Cleaned up names. --- indra/newview/llpanelobject.cpp | 36 +++++++++++----------- indra/newview/llpanelobject.h | 22 ++++++------- indra/newview/llselectmgr.cpp | 12 ++++---- indra/newview/llselectmgr.h | 2 +- indra/newview/llviewerobject.cpp | 27 ++++++++-------- indra/newview/llviewerobject.h | 6 ++-- .../newview/skins/default/xui/en/floater_tools.xml | 18 +++++------ scripts/messages/message_template.msg | 2 +- 8 files changed, 62 insertions(+), 63 deletions(-) diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 991e97b767..669ff3ffd6 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -138,9 +138,9 @@ BOOL LLPanelObject::postBuild() mCheckPhantom = getChild<LLCheckBoxCtrl>("Phantom Checkbox Ctrl"); childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); - // PhysicsRep combobox - mComboPhysicsRep = getChild<LLComboBox>("Physics Rep Combo Ctrl"); - childSetCommitCallback("Physics Rep Combo Ctrl", onCommitPhysicsRep,this); + // PhysicsShapeType combobox + mComboPhysicsShapeType = getChild<LLComboBox>("Physics Shape Type Combo Ctrl"); + childSetCommitCallback("Physics Shape Type Combo Ctrl", onCommitPhysicsShapeType,this); // Position mLabelPosition = getChild<LLTextBox>("label position"); @@ -324,7 +324,7 @@ LLPanelObject::LLPanelObject() mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), - mPhysicsRep(0), + mPhysicsShapeType(0), mCastShadows(TRUE), mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), @@ -532,9 +532,9 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); - mPhysicsRep = objectp->getPhysicsRep(); - mComboPhysicsRep->setCurrentByIndex(mPhysicsRep); - mComboPhysicsRep->setEnabled(editable); + mPhysicsShapeType = objectp->getPhysicsShapeType(); + mComboPhysicsShapeType->setCurrentByIndex(mPhysicsShapeType); + mComboPhysicsShapeType->setEnabled(editable); #if 0 // 1.9.2 mCastShadows = root_objectp->flagCastShadows(); @@ -1241,19 +1241,19 @@ void LLPanelObject::sendIsPhantom() } } -void LLPanelObject::sendPhysicsRep() +void LLPanelObject::sendPhysicsShapeType() { - U8 value = (U8)mComboPhysicsRep->getCurrentIndex(); - if (mPhysicsRep != value) + U8 value = (U8)mComboPhysicsShapeType->getCurrentIndex(); + if (mPhysicsShapeType != value) { - LLSelectMgr::getInstance()->selectionUpdatePhysicsRep(value); - mPhysicsRep = value; + LLSelectMgr::getInstance()->selectionUpdatePhysicsShapeType(value); + mPhysicsShapeType = value; - llinfos << "update physicsrep sent" << llendl; + llinfos << "update physics shape type sent" << llendl; } else { - llinfos << "update physicstep not changed" << llendl; + llinfos << "update physics shape type not changed" << llendl; } } @@ -1930,8 +1930,8 @@ void LLPanelObject::clearCtrls() mCheckTemporary ->setEnabled( FALSE ); mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); - mComboPhysicsRep->setCurrentByIndex(0); - mComboPhysicsRep->setEnabled(FALSE); + mComboPhysicsShapeType->setCurrentByIndex(0); + mComboPhysicsShapeType->setEnabled(FALSE); #if 0 // 1.9.2 mCheckCastShadows->set(FALSE); mCheckCastShadows->setEnabled( FALSE ); @@ -2027,10 +2027,10 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata ) } // static -void LLPanelObject::onCommitPhysicsRep(LLUICtrl* ctrl, void* userdata ) +void LLPanelObject::onCommitPhysicsShapeType(LLUICtrl* ctrl, void* userdata ) { LLPanelObject* self = (LLPanelObject*) userdata; - self->sendPhysicsRep(); + self->sendPhysicsShapeType(); } // static diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index fbc0902141..7f368c38c7 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -65,14 +65,14 @@ public: static bool precommitValidate(const LLSD& data); static void onCommitLock(LLUICtrl *ctrl, void *data); - static void onCommitPosition( LLUICtrl* ctrl, void* userdata); - static void onCommitScale( LLUICtrl* ctrl, void* userdata); - static void onCommitRotation( LLUICtrl* ctrl, void* userdata); - static void onCommitPhysics( LLUICtrl* ctrl, void* userdata); - static void onCommitTemporary( LLUICtrl* ctrl, void* userdata); - static void onCommitPhantom( LLUICtrl* ctrl, void* userdata); - static void onCommitPhysicsRep( LLUICtrl* ctrl, void* userdata); - static void onCommitCastShadows( LLUICtrl* ctrl, void* userdata); + static void onCommitPosition( LLUICtrl* ctrl, void* userdata); + static void onCommitScale( LLUICtrl* ctrl, void* userdata); + static void onCommitRotation( LLUICtrl* ctrl, void* userdata); + static void onCommitPhysics( LLUICtrl* ctrl, void* userdata); + static void onCommitTemporary( LLUICtrl* ctrl, void* userdata); + static void onCommitPhantom( LLUICtrl* ctrl, void* userdata); + static void onCommitPhysicsShapeType( LLUICtrl* ctrl, void* userdata); + static void onCommitCastShadows( LLUICtrl* ctrl, void* userdata); static void onCommitParametric(LLUICtrl* ctrl, void* userdata); @@ -94,7 +94,7 @@ protected: void sendIsPhysical(); void sendIsTemporary(); void sendIsPhantom(); - void sendPhysicsRep(); + void sendPhysicsShapeType(); void sendCastShadows(); void sendSculpt(); @@ -167,7 +167,7 @@ protected: LLCheckBoxCtrl *mCheckPhysics; LLCheckBoxCtrl *mCheckTemporary; LLCheckBoxCtrl *mCheckPhantom; - LLComboBox *mComboPhysicsRep; + LLComboBox *mComboPhysicsShapeType; LLCheckBoxCtrl *mCheckCastShadows; LLTextureCtrl *mCtrlSculptTexture; @@ -180,7 +180,7 @@ protected: BOOL mIsPhysical; // to avoid sending "physical" when not changed BOOL mIsTemporary; // to avoid sending "temporary" when not changed BOOL mIsPhantom; // to avoid sending "phantom" when not changed - U8 mPhysicsRep; // to avoid sending "physics rep spec" when not changed + U8 mPhysicsShapeType; // to avoid sending "physics shape type" when not changed BOOL mCastShadows; // to avoid sending "cast shadows" when not changed S32 mSelectedType; // So we know what selected type we last were diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9d1893b68a..89fb6bf4df 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3930,15 +3930,15 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } -struct LLSelectMgrApplyPhysicsRep : public LLSelectedObjectFunctor +struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor { - LLSelectMgrApplyPhysicsRep(U8 value) : mValue(value) {} + LLSelectMgrApplyPhysicsShapeType(U8 value) : mValue(value) {} U8 mValue; virtual bool apply(LLViewerObject* object) { if ( object->permModify() ) // preemptive permissions check { - object->setPhysicsRep( mValue ); + object->setPhysicsShapeType( mValue ); object->updateFlags(); } return true; @@ -3946,10 +3946,10 @@ struct LLSelectMgrApplyPhysicsRep : public LLSelectedObjectFunctor }; -void LLSelectMgr::selectionUpdatePhysicsRep(U8 rep) +void LLSelectMgr::selectionUpdatePhysicsShapeType(U8 type) { - llwarns << "physics rep ->" << (U32)rep << llendl; - LLSelectMgrApplyPhysicsRep func(rep); + llwarns << "physics shape type ->" << (U32)type << llendl; + LLSelectMgrApplyPhysicsShapeType func(type); getSelection()->applyToObjects(&func); } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index f14136c275..7db0adb31e 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -484,7 +484,7 @@ public: void selectionUpdatePhysics(BOOL use_physics); void selectionUpdateTemporary(BOOL is_temporary); void selectionUpdatePhantom(BOOL is_ghost); - void selectionUpdatePhysicsRep(U8 rep); + void selectionUpdatePhysicsShapeType(U8 type); void selectionUpdateCastShadows(BOOL cast_shadows); void selectionDump(); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1ee30b49bf..fb48f3311b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -52,6 +52,7 @@ #include "llprimitive.h" #include "llquantize.h" #include "llregionhandle.h" +#include "llsdserialize.h" #include "lltree_common.h" #include "llxfermanager.h" #include "message.h" @@ -189,7 +190,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mGLName(0), mbCanSelect(TRUE), mFlags(0), - mPhysicsRep(0), + mPhysicsShapeType(0), mDrawable(), mCreateSelected(FALSE), mRenderMedia(FALSE), @@ -4954,10 +4955,10 @@ void LLViewerObject::updateFlags() gMessageSystem->addBOOL("IsPhantom", flagPhantom() ); gMessageSystem->addBOOL("CastsShadows", flagCastShadows() ); gMessageSystem->nextBlock("ExtraPhysics"); - gMessageSystem->addU8("PhysicsRep", getPhysicsRep() ); + gMessageSystem->addU8("PhysicsShapeType", getPhysicsShapeType() ); gMessageSystem->sendReliable( regionp->getHost() ); - if (getPhysicsRep() != 0) + if (getPhysicsShapeType() != 0) { llwarns << "sent non default physics rep" << llendl; } @@ -4992,9 +4993,9 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state) return setit; } -void LLViewerObject::setPhysicsRep(U8 rep) +void LLViewerObject::setPhysicsShapeType(U8 type) { - mPhysicsRep = rep; + mPhysicsShapeType = type; updateFlags(); } @@ -5208,7 +5209,7 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif return ; } -#include "../llcommon/llsdserialize.h" + class ObjectPhysicsProperties : public LLHTTPNode { public: @@ -5222,11 +5223,8 @@ public: for ( S32 i = 0; i < numEntries; i++ ) { - U32 localID = objectData[i]["LocalID"].asInteger(); - - std::ostringstream string; - LLSDSerialize::serialize( input, string, LLSDSerialize::LLSD_XML, LLSDFormatter::OPTIONS_PRETTY); - llinfos << string.str() << llendl; + LLSD& currObjectData = objectData[i]; + U32 localID = currObjectData["LocalID"].asInteger(); // Iterate through nodes at end, since it can be on both the regular AND hover list struct f : public LLSelectedNodeFunctor @@ -5241,11 +5239,12 @@ public: LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func); - U8 physicsRepSpec = (U8)objectData[i]["PhysicsRepSpec"].asInteger(); - if (node) { - node->getObject()->setPhysicsRep(physicsRepSpec); + // The LLSD message builder doesn't know how to handle U8, so we need to send as S8 and cast + U8 physicsShapeType = (U8)currObjectData["PhysicsShapeType"].asInteger(); + + node->getObject()->setPhysicsShapeType(physicsShapeType); } } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index da7e4002f5..8b542af773 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -460,7 +460,7 @@ public: inline BOOL flagCameraDecoupled() const { return ((mFlags & FLAGS_CAMERA_DECOUPLED) != 0); } inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); } - inline U8 getPhysicsRep() const { return mPhysicsRep; } + inline U8 getPhysicsShapeType() const { return mPhysicsShapeType; } bool getIncludeInSearch() const; void setIncludeInSearch(bool include_in_search); @@ -477,7 +477,7 @@ public: void updateFlags(); BOOL setFlags(U32 flag, BOOL state); - void setPhysicsRep(U8 rep); + void setPhysicsShapeType(U8 type); virtual void dump() const; static U32 getNumZombieObjects() { return sNumZombieObjects; } @@ -558,7 +558,7 @@ public: U32 mFlags; // Sent to sim in UPDATE_FLAGS, received in ObjectPhysicsProperties - U8 mPhysicsRep; + U8 mPhysicsShapeType; // Pipeline classes LLPointer<LLDrawable> mDrawable; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 26c08bdf7c..fd6a5127d8 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1426,7 +1426,7 @@ even though the user gets a free copy. height="10" layout="topleft" left_delta="0" - name="label physicsrep" + name="label physicsshapetype" top_pad="10" width="121"> Physics Rep: @@ -1435,18 +1435,18 @@ even though the user gets a free copy. height="23" layout="topleft" follows="left|top" - name="Physics Rep Combo Ctrl" - tool_tip="Choose the physics representation" + name="Physics Shape Type Combo Ctrl" + tool_tip="Choose the physics shape type" left_pad="0" width="108"> <combo_box.item - label="Default" - name="Default" - value="Default" /> + label="Prim" + name="Prim" + value="Prim" /> <combo_box.item - label="No Shape" - name="No Shape" - value="No Shape" /> + label="None" + name="None" + value="None" /> <combo_box.item label="Convex Hull" name="Convex Hull" diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index 7813bfba83..6043542877 100644 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -2063,7 +2063,7 @@ version 2.0 } { ExtraPhysics Variable - { PhysicsRep U8 } + { PhysicsShapeType U8 } } } -- cgit v1.2.3 From 19c83c67c42305e41bff4b651975671d34a22b55 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" <falcon@lindenlab.com> Date: Thu, 1 Apr 2010 11:30:43 -0700 Subject: DEV-47845 More cleanup. Fixed a bug where the physics shape type wouldn't get displayed properly until you re-selected an object. --- indra/newview/llviewerobject.cpp | 1 + indra/newview/skins/default/xui/en/floater_tools.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b7139b9647..5b778cc816 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5249,6 +5249,7 @@ public: } } + dialog_refresh_all(); }; }; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 4d608fb00a..e851312d8e 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1428,7 +1428,7 @@ even though the user gets a free copy. name="label physicsshapetype" top_pad="10" width="121"> - Physics Rep: + Physics Shape Type: </text> <combo_box height="23" -- cgit v1.2.3 From 17d5a40f8a6681151f0530c342174c5321d664eb Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" <falcon@lindenlab.com> Date: Thu, 1 Apr 2010 11:34:05 -0700 Subject: Fixed line ending --- indra/newview/llviewerobject.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a8212ade91..7532102378 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5234,15 +5234,15 @@ public: LLSD& currObjectData = objectData[i]; U32 localID = currObjectData["LocalID"].asInteger(); - // Iterate through nodes at end, since it can be on both the regular AND hover list - struct f : public LLSelectedNodeFunctor - { - U32 mID; - f(const U32& id) : mID(id) {} - virtual bool apply(LLSelectNode* node) - { - return (node->getObject() && node->getObject()->mLocalID == mID ); - } + // Iterate through nodes at end, since it can be on both the regular AND hover list + struct f : public LLSelectedNodeFunctor + { + U32 mID; + f(const U32& id) : mID(id) {} + virtual bool apply(LLSelectNode* node) + { + return (node->getObject() && node->getObject()->mLocalID == mID ); + } } func(localID); LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func); -- cgit v1.2.3 From f17cfd952a274cc6c684e50db004d62373a49d1f Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" <falcon@lindenlab.com> Date: Thu, 1 Apr 2010 17:03:51 -0700 Subject: DEV-47845: Finished fixing an update bug on the physics shape type and fixed the name of that combo box. --- indra/newview/app_settings/keywords.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 0805e94b10..18edce42a4 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -353,6 +353,11 @@ PRIM_BUMP_SHINY Followed by an integer face, one of PRIM_SHINY_NONE, PRIM_SHINY PRIM_FULLBRIGHT Followed by an integer face, and TRUE or FALSE PRIM_TEXGEN Followed by an integer face, and one of PRIM_TEXGEN_DEFAULT or PRIM_TEXGEN_PLANAR PRIM_GLOW Followed by an integer face, and a float from 0.0 to 1.0 specifying glow amount +PRIM_PHYSICS_SHAPE_TYPE Followed by one of PRIM_PHYSICS_SHAPE_PRIM (use prim as-is for physics), PRIM_PHYSICS_SHAPE_NONE (do not use prim for physics), PRIM_PHYSICS_SHAPE_CONVEX (use convex hull of prim for physics) + +PRIM_PHYSICS_SHAPE_PRIM Sets the physics shape type to PRIM (i.e., use the prim as-is in the physics engine) +PRIM_PHYSICS_SHAPE_NONE Sets the physics shape type to NONE (i.e., the shape will not exist the physics engine) +PRIM_PHYSICS_SHAPE_CONVEX Sets the physics shape type to CONVEX (i.e., use the convex hull of the prim in the physics engine) PRIM_TYPE_BOX Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear PRIM_TYPE_CYLINDER Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear -- cgit v1.2.3 From 6fbe144e4cf578bb76c4e015c191300c17ac44fe Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 2 Apr 2010 13:24:42 +0100 Subject: merge fix --- indra/newview/skins/default/xui/en/panel_main_inventory.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 0eea309d35..1b04d01abf 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -38,16 +38,6 @@ width="300"> Items: </text> - label="Model..." - layout="topleft" - name="Upload Model"> - <menu_item_call.on_click - function="File.UploadModel" - parameter="" /> - <menu_item_call.on_enable - function="File.EnableUploadModel" /> - </menu_item_call> - <menu_item_call <filter_editor text_pad_left="10" follows="left|top|right" -- cgit v1.2.3 From 89ad33a53ef239adf332532fa1039ae6313f5ba9 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 2 Apr 2010 14:40:15 +0100 Subject: ssreflections: reflect sunlight direction for reflection. dunno how I feel about this yet. --- .../newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 155f03fdcf..51d737f10b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -310,8 +310,11 @@ void main() // darken reflections from points which face away from the reflected ray - our guess was a back-face //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant - // get appropriate light strength for guess-point - float reflit = max(dot(refn, lightnorm.xyz), 0.0); + // get appropriate light strength for guess-point. + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; vec3 ssshiny = (refprod * spec.a); -- cgit v1.2.3 From cae24385d7a119d0ad634d252bd3bb1e4e68c57c Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 2 Apr 2010 14:50:24 +0100 Subject: ssreflections: use the minimum of the lighting dp and the appropriateness. not the product. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 51d737f10b..8b2b983ba4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -317,6 +317,8 @@ void main() float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); // add the two types of shiny together -- cgit v1.2.3 From 145ffe0da00f87ad16eb17dcec3c5a1a201fe32b Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 2 Apr 2010 15:20:35 +0100 Subject: ssreflections: water reflections strongly imply that the non-perspective reflection from eye is the right one. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 8b2b983ba4..25733e80d1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -282,7 +282,8 @@ void main() { // the old infinite-sky shiny reflection // - vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); + //vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnorm, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; -- cgit v1.2.3 From 7261a23f39ce2dbfadf52427ce693896d9d24bf0 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 2 Apr 2010 15:46:47 +0100 Subject: ssreflections: perspective reflection for sunlight, planar reflection for ssreflection --- .../newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 25733e80d1..d00d3ed412 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -282,13 +282,13 @@ void main() { // the old infinite-sky shiny reflection // - vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); - //vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnorm, vary_light.xyz); + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; // screen-space cheap fakey reflection map // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; -- cgit v1.2.3 From 35d92b2db91a9da1ae240f14202195c36a2b40bf Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 2 Apr 2010 15:59:11 +0100 Subject: clean-up transplant --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index d00d3ed412..503c7d0b83 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -317,7 +317,6 @@ void main() vec3 reflight = reflect(lightnorm.xyz, norm.xyz); float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess - vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); -- cgit v1.2.3 From 33fd1e26beac37701301dfce3478a145720d73c9 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 2 Apr 2010 16:03:20 +0100 Subject: apply ssreflection changes to class2 and class3 too. --- .../shaders/class2/deferred/softenLightF.glsl | 13 +++++++++---- .../shaders/class3/deferred/softenLightF.glsl | 15 ++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 922a07c306..d6fbae7b22 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -281,12 +281,13 @@ void main() { // the old infinite-sky shiny reflection // - vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnorm, vary_light.xyz); + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; // screen-space cheap fakey reflection map // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; @@ -311,9 +312,13 @@ void main() //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant // get appropriate light strength for guess-point - float reflit = min(max(dot(refn, lightnorm.xyz), 0.0), refshad); + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess - vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); // add the two types of shiny together diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index ddd69befc3..ecfd9bef52 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -284,12 +284,13 @@ void main() { // the old infinite-sky shiny reflection // - vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnorm, vary_light.xyz); + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; // screen-space cheap fakey reflection map // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; @@ -313,10 +314,14 @@ void main() // darken reflections from points which face away from the reflected ray - our guess was a back-face //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant - // get appropriate light strength for guess-point - float reflit = min(max(dot(refn, lightnorm.xyz), 0.0), refshad); + // get appropriate light strength for guess-point. + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess - vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); // add the two types of shiny together -- cgit v1.2.3 From a63c59be9e7df57143ddd04e44263c232f420a21 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 2 Apr 2010 16:09:31 +0100 Subject: ssreflection: restore the shadow factor I accidentally removed with the last update. --- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index d6fbae7b22..00a6a9dcb5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -315,7 +315,7 @@ void main() // reflect light direction to increase the illusion that // these are reflections. vec3 reflight = reflect(lightnorm.xyz, norm.xyz); - float reflit = max(dot(refn, reflight.xyz), 0.0); + float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad); // apply sun color to guess-point, dampen according to inappropriateness of guess float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index ecfd9bef52..aaa74eb7df 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -318,7 +318,7 @@ void main() // reflect light direction to increase the illusion that // these are reflections. vec3 reflight = reflect(lightnorm.xyz, norm.xyz); - float reflit = max(dot(refn, reflight.xyz), 0.0); + float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad); // apply sun color to guess-point, dampen according to inappropriateness of guess float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; -- cgit v1.2.3 From 807d835c2bfc5d794a74f9690d1fafbe55ff88cc Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 2 Apr 2010 14:43:05 -0500 Subject: First draft of skin weights in .mesh asset --- indra/llcommon/llsdserialize.cpp | 137 +++++++++++++++++++++++++++++++++++++++ indra/llcommon/llsdserialize.h | 4 ++ indra/llmath/llvolume.cpp | 135 +++++++++++++------------------------- indra/llmath/llvolume.h | 6 ++ 4 files changed, 192 insertions(+), 90 deletions(-) diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index cf337be161..c341b15539 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -39,6 +39,7 @@ #include <iostream> #include "apr_base64.h" +#include "zlib/zlib.h" // for davep's dirty little zip functions #if !LL_WINDOWS #include <netinet/in.h> // htonl & ntohl @@ -1989,3 +1990,139 @@ std::ostream& operator<<(std::ostream& s, const LLSD& llsd) return s; } + +//dirty little zippers -- yell at davep if these are horrid + +//return a string containing gzipped bytes of binary serialized LLSD +// VERY inefficient -- creates several copies of LLSD block in memory +std::string zip_llsd(LLSD& data) +{ + std::stringstream llsd_strm; + + LLSDSerialize::serialize(data, llsd_strm, LLSDSerialize::LLSD_BINARY); + + z_stream strm; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + + S32 ret = deflateInit(&strm, Z_BEST_COMPRESSION); + if (ret != Z_OK) + { + llwarns << "Failed to compress LLSD block." << llendl; + return std::string(); + } + + std::string source = llsd_strm.str(); + + strm.avail_in = source.size(); + strm.next_in = (U8*) source.data(); + U8* output = new U8[strm.avail_in]; + strm.avail_out = strm.avail_in; + strm.next_out = output; + ret = deflate(&strm, Z_FINISH); + if (ret != Z_STREAM_END) + { + delete [] output; + llwarns << "Failed to compress LLSD block." << llendl; + } + + std::string::size_type size = source.size()-strm.avail_out; + + std::string result((char*) output, size); + deflateEnd(&strm); + delete [] output; + + return result; +} + +//decompress a block of LLSD from provided istream +// not very efficient -- creats a copy of decompressed LLSD block in memory +// and deserializes from that copy using LLSDSerialize +bool unzip_llsd(LLSD& data, std::istream& is, S32 size) +{ + U8* result = NULL; + U32 cur_size = 0; + z_stream strm; + + const U32 CHUNK = 65536; + + U8 *in = new U8[size]; + is.read((char*) in, size); + + U8 out[CHUNK]; + + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = size; + strm.next_in = in; + + S32 ret = inflateInit(&strm); + + if (ret != Z_OK) + { + llerrs << "WTF?" << llendl; + } + + do + { + strm.avail_out = CHUNK; + strm.next_out = out; + ret = inflate(&strm, Z_NO_FLUSH); + if (ret == Z_STREAM_ERROR) + { + inflateEnd(&strm); + free(result); + delete [] in; + return false; + } + + switch (ret) + { + case Z_NEED_DICT: + ret = Z_DATA_ERROR; + case Z_DATA_ERROR: + case Z_MEM_ERROR: + inflateEnd(&strm); + free(result); + delete [] in; + return false; + break; + } + + U32 have = CHUNK-strm.avail_out; + + result = (U8*) realloc(result, cur_size + have); + memcpy(result+cur_size, out, have); + cur_size += have; + + } while (strm.avail_out == 0); + + inflateEnd(&strm); + delete [] in; + + if (ret != Z_STREAM_END) + { + free(result); + return false; + } + + //result now points to the decompressed LLSD block + { + std::string res_str((char*) result, cur_size); + std::istringstream istr(res_str); + + if (!LLSDSerialize::deserialize(data, istr, cur_size)) + { + llwarns << "Failed to unzip LLSD block" << llendl; + return false; + } + } + + free(result); + return true; +} + + + diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h index 2f2b292189..390eaca783 100644 --- a/indra/llcommon/llsdserialize.h +++ b/indra/llcommon/llsdserialize.h @@ -796,4 +796,8 @@ public: } }; +//dirty little zip functions -- yell at davep +LL_COMMON_API std::string zip_llsd(LLSD& data); +LL_COMMON_API bool unzip_llsd(LLSD& data, std::istream& is, S32 size); + #endif // LL_LLSDSERIALIZE_H diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 52a3fb2195..c563af592f 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -47,8 +47,6 @@ #include "llvolume.h" #include "llstl.h" #include "llsdserialize.h" -#include "zlib/zlib.h" - #define DEBUG_SILHOUETTE_BINORMALS 0 #define DEBUG_SILHOUETTE_NORMALS 0 // TomY: Use this to display normals using the silhouette @@ -1964,97 +1962,15 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is) bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) { - U8* result = NULL; - U32 cur_size = 0; - - { - //input stream is now pointing at a zlib compressed block of LLSD - //decompress block - z_stream strm; - - const U32 CHUNK = 65536; - - U8 *in = new U8[size]; - is.read((char*) in, size); - - U8 out[CHUNK]; - - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.avail_in = size; - strm.next_in = in; - - S32 ret = inflateInit(&strm); - - if (ret != Z_OK) - { - llerrs << "WTF?" << llendl; - } - - do - { - strm.avail_out = CHUNK; - strm.next_out = out; - ret = inflate(&strm, Z_NO_FLUSH); - if (ret == Z_STREAM_ERROR) - { - inflateEnd(&strm); - free(result); - delete [] in; - return false; - } - - switch (ret) - { - case Z_NEED_DICT: - ret = Z_DATA_ERROR; - case Z_DATA_ERROR: - case Z_MEM_ERROR: - inflateEnd(&strm); - free(result); - delete [] in; - return false; - break; - } - - U32 have = CHUNK-strm.avail_out; - - result = (U8*) realloc(result, cur_size + have); - memcpy(result+cur_size, out, have); - cur_size += have; - - } while (strm.avail_out == 0); - - inflateEnd(&strm); - delete [] in; - - if (ret != Z_STREAM_END) - { - free(result); - return false; - } - } - - //result now points to the decompressed LLSD block - + //input stream is now pointing at a zlib compressed block of LLSD + //decompress block LLSD mdl; - + if (!unzip_llsd(mdl, is, size)) { - std::string res_str((char*) result, cur_size); - std::istringstream istr(res_str); - - if (!LLSDSerialize::deserialize(mdl, istr, cur_size)) - { - llwarns << "not a valid mesh asset!" << llendl; - return false; - } + llwarns << "not a valid mesh asset!" << llendl; + return false; } - - - free(result); - - + { U32 face_count = mdl.size(); @@ -2094,11 +2010,50 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) U32 num_verts = pos.size()/(3*2); face.mVertices.resize(num_verts); + if (mdl[i].has("Weights")) + { + face.mWeights.resize(num_verts); + LLSD::Binary weights = mdl[i]["Weights"]; + + LLSD::Binary::iterator iter = weights.begin(); + + U32 cur_vertex = 0; + while (iter != weights.end()) + { + const S32 END_INFLUENCES = 0xFF; + U8 joint = *(iter++); + + U32 cur_influence = 0; + while (joint != END_INFLUENCES) + { + U16 influence = *(iter++); + influence = influence << 8; + influence |= *(iter++); + + F32 w = llmin((F32) influence / 65535.f, 0.99999f); + face.mWeights[cur_vertex].mV[cur_influence++] = (F32) joint + w; + + if (cur_influence >= 4) + { + joint = END_INFLUENCES; + } + else + { + joint = *(iter++); + } + } + + cur_vertex++; + iter++; + } + } + LLVector3 min_pos; LLVector3 max_pos; LLVector2 min_tc; LLVector2 max_tc; + min_pos.setValue(mdl[i]["PositionDomain"]["Min"]); max_pos.setValue(mdl[i]["PositionDomain"]["Max"]); min_tc.setValue(mdl[i]["TexCoord0Domain"]["Min"]); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 60c1569e55..c6a156ae37 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -49,6 +49,7 @@ class LLVolume; //#include "vmath.h" #include "v2math.h" #include "v3math.h" +#include "v4math.h" #include "llquaternion.h" #include "llstrider.h" #include "v4coloru.h" @@ -887,6 +888,11 @@ public: std::vector<U16> mTriStrip; std::vector<S32> mEdge; + //list of skin weights for rigged volumes + // format is mWeights[vertex_index].mV[influence] = <joint_index>.<weight> + // mWeights.size() should be empty or match mVertices.size() + std::vector<LLVector4> mWeights; + private: BOOL createUnCutCubeCap(LLVolume* volume, BOOL partial_build = FALSE); BOOL createCap(LLVolume* volume, BOOL partial_build = FALSE); -- cgit v1.2.3 From 8f16be49dc86f0fca228b09ce0b788ad03482888 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 6 Apr 2010 15:09:18 +0100 Subject: some fixing from the viewer-trunk merge. --- indra/llmessage/llcurl.cpp | 2 ++ indra/newview/llinventorybridge.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 63a684ccc4..7c6660e28b 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -1173,4 +1173,6 @@ void LLCurl::cleanupClass() { llerrs << "CURL easy handles not cleaned up on shutdown!" << llendl; } +} + diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index e5abe02afd..d5e4da41e4 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -46,7 +46,6 @@ class LLInventoryModel; class LLMenuGL; class LLCallingCardObserver; class LLViewerJointAttachment; - MESH_ICON_NAME, typedef std::vector<std::string> menuentry_vec_t; @@ -219,6 +218,7 @@ enum EInventoryIcon ANIMATION_ICON_NAME, GESTURE_ICON_NAME, + MESH_ICON_NAME, LINKITEM_ICON_NAME, LINKFOLDER_ICON_NAME, -- cgit v1.2.3 From 1de148608699e85a893e9e4e4ebf6e9c851d8f58 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 6 Apr 2010 15:12:22 +0100 Subject: more fixing from the viewer-trunk merge --- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llinventorybridge.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 182629d2da..5c0898407e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -997,7 +997,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, { llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; } - new_listener = new LLMeshBridge(inventory, uuid); + new_listener = new LLMeshBridge(inventory, root, uuid); break; default: diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index d5e4da41e4..75b206f3b7 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -640,8 +640,10 @@ public: virtual void buildContextMenu(LLMenuGL& menu, U32 flags); protected: - LLMeshBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : - LLItemBridge(inventory, uuid) {} + LLMeshBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : + LLItemBridge(inventory, root, uuid) {} }; -- cgit v1.2.3 From 8f2f9e682b5cb42d0292d1f923777441b85d2feb Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 6 Apr 2010 15:13:15 +0100 Subject: wtf-fix for using \\ instead of // as a comment. --- indra/newview/tests/llviewernetwork_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index f9f42cfc86..e0c7c83f4b 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -216,10 +216,10 @@ namespace tut #ifndef LL_RELEASE_FOR_DOWNLOAD ensure_equals("Agni grid label was not modified by grid file", grid[GRID_LABEL_VALUE].asString(), std::string("Agni")); -#else \\ LL_RELEASE_FOR_DOWNLOAD +#else // LL_RELEASE_FOR_DOWNLOAD ensure_equals("Agni grid label was not modified by grid file", grid[GRID_LABEL_VALUE].asString(), std::string("Secondlife.com")); -#endif \\ LL_RELEASE_FOR_DOWNLOAD +#endif // LL_RELEASE_FOR_DOWNLOAD ensure_equals("Agni name wasn't modified by grid file", grid[GRID_VALUE].asString(), std::string("util.agni.lindenlab.com")); -- cgit v1.2.3 From 5de3e21a38f81559626cdca8a9e5b9e06f955063 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 6 Apr 2010 15:33:35 +0100 Subject: another conflict fix from viewer-trunk merge --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5c0898407e..2e690493cd 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -995,7 +995,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, case LLAssetType::AT_MESH: if(!(inv_type == LLInventoryType::IT_MESH)) { - llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl; } new_listener = new LLMeshBridge(inventory, root, uuid); break; -- cgit v1.2.3 From c1b49a2142f04bde232d65038ac88765423fc7ad Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 6 Apr 2010 15:34:56 +0100 Subject: yet more conflict fixing from viewer-trunk merge --- indra/newview/llinventorybridge.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 2e690493cd..7c156561b9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5107,7 +5107,6 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti return; } LLItemBridge::performAction(model,action); - items.push_back(std::string("Restore Item")); } void LLLinkFolderBridge::gotoItem() { @@ -5125,9 +5124,6 @@ void LLLinkFolderBridge::gotoItem() mRoot->scrollToShowSelection(); } } - - - hide_context_entries(menu, items, disabled_items); } const LLUUID &LLLinkFolderBridge::getFolderID() const { @@ -5138,12 +5134,6 @@ const LLUUID &LLLinkFolderBridge::getFolderID() const const LLUUID& cat_uuid = cat->getUUID(); return cat_uuid; } - case LLAssetType::AT_MESH: - action = new LLMeshBridgeAction(uuid,model); - break; - - - } return LLUUID::null; } -- cgit v1.2.3 From cbf1ae105a980a439cff39026f9e2c05d4f13859 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 6 Apr 2010 15:45:54 +0100 Subject: sigghhhh, yet more conflict resolution from the viewer-trunk merge. actually builds now. let's see if it runs and works. --- indra/newview/llinventorybridge.cpp | 13 +------------ indra/newview/llpanelobjectinventory.cpp | 6 +++--- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7c156561b9..83248e9991 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5389,20 +5389,9 @@ public: LLNotificationsUtil::add("CannotWearInfoNotComplete"); } } - LLInvFVBridgeAction::doIt(); -} - -//virtual -void LLMeshBridgeAction::doIt() -{ - LLViewerInventoryItem* item = getItem(); - if(item) - { - // do it - } - LLInvFVBridgeAction::doIt(); } + virtual ~LLWearableBridgeAction(){} protected: LLWearableBridgeAction(const LLUUID& id,LLInventoryModel* model) : LLInvFVBridgeAction(id,model) {} diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index d6644e16c6..76dee78f3d 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1418,7 +1418,7 @@ public: virtual LLUIImagePtr getIcon() const; virtual void openItem(); - virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); + virtual void performAction(LLInventoryModel* model, std::string action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); }; @@ -1442,7 +1442,7 @@ void LLTaskMeshBridge::openItem() // virtual -void LLTaskMeshBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +void LLTaskMeshBridge::performAction(LLInventoryModel* model, std::string action) { if (action == "mesh action") { @@ -1452,7 +1452,7 @@ void LLTaskMeshBridge::performAction(LLFolderView* folder, LLInventoryModel* mod // do action } } - LLTaskInvFVBridge::performAction(folder, model, action); + LLTaskInvFVBridge::performAction(model, action); } void LLTaskMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) -- cgit v1.2.3 From 47ffcdb93d6e2ac1f9d497e43e0213c98d129254 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 6 Apr 2010 16:24:08 -0500 Subject: Rigged attachments (almost works). --- indra/llmath/llvolume.cpp | 22 +++++--- indra/llrender/llglslshader.cpp | 14 ++++- indra/llrender/llglslshader.h | 3 +- indra/llrender/llshadermgr.cpp | 8 +++ indra/newview/lldrawpoolavatar.cpp | 26 ++++++++- indra/newview/lldrawpoolavatar.h | 2 + indra/newview/llface.cpp | 18 +++++- indra/newview/llface.h | 4 +- indra/newview/llspatialpartition.h | 7 +++ indra/newview/llviewershadermgr.cpp | 25 +++++++++ indra/newview/llviewershadermgr.h | 3 + indra/newview/llvoavatar.cpp | 109 ++++++++++++++++++++++++++++++++++++ indra/newview/llvoavatar.h | 1 + indra/newview/llvovolume.cpp | 20 +++++++ 14 files changed, 247 insertions(+), 15 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index c563af592f..fdd48b9e9e 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2013,22 +2013,23 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) if (mdl[i].has("Weights")) { face.mWeights.resize(num_verts); + LLSD::Binary weights = mdl[i]["Weights"]; - LLSD::Binary::iterator iter = weights.begin(); + U32 idx = 0; U32 cur_vertex = 0; - while (iter != weights.end()) + while (idx < weights.size() && cur_vertex < num_verts) { - const S32 END_INFLUENCES = 0xFF; - U8 joint = *(iter++); + const U8 END_INFLUENCES = 0xFF; + U8 joint = weights[idx++]; U32 cur_influence = 0; while (joint != END_INFLUENCES) { - U16 influence = *(iter++); + U16 influence = weights[idx++]; influence = influence << 8; - influence |= *(iter++); + influence |= weights[idx++]; F32 w = llmin((F32) influence / 65535.f, 0.99999f); face.mWeights[cur_vertex].mV[cur_influence++] = (F32) joint + w; @@ -2039,13 +2040,18 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) } else { - joint = *(iter++); + joint = weights[idx++]; } } cur_vertex++; - iter++; } + + if (cur_vertex != num_verts || idx != weights.size()) + { + llwarns << "Vertex weight count does not match vertex count!" << llendl; + } + } LLVector3 min_pos; diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index ca92cb6580..949057df04 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -61,7 +61,7 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2) LLShaderFeatures::LLShaderFeatures() : calculatesLighting(false), isShiny(false), isFullbright(false), hasWaterFog(false), -hasTransport(false), hasSkinning(false), hasAtmospherics(false), isSpecular(false), +hasTransport(false), hasSkinning(false), hasObjectSkinning(false), hasAtmospherics(false), isSpecular(false), hasGamma(false), hasLighting(false), calculatesAtmospherics(false) { } @@ -717,6 +717,18 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform) return -1; } +GLint LLGLSLShader::getAttribLocation(U32 attrib) +{ + if (attrib < mAttribute.size()) + { + return mAttribute[attrib]; + } + else + { + return -1; + } +} + void LLGLSLShader::uniform1i(const string& uniform, GLint v) { GLint location = getUniformLocation(uniform); diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 166d4af04c..dc493ba162 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -48,6 +48,7 @@ public: bool hasWaterFog; // implies no gamma bool hasTransport; // implies no lighting (it's possible to have neither though) bool hasSkinning; + bool hasObjectSkinning; bool hasAtmospherics; bool hasGamma; @@ -109,7 +110,7 @@ public: void vertexAttrib4fv(U32 index, GLfloat* v); GLint getUniformLocation(const std::string& uniform); - + GLint getAttribLocation(U32 attrib); GLint mapUniformTextureChannel(GLint location, GLenum type); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 1286e91e49..23b76351eb 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -152,6 +152,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } + + if (features->hasObjectSkinning) + { + if (!shader->attachObject("avatar/objectSkinV.glsl")) + { + return FALSE; + } + } /////////////////////////////////////// // Attach Fragment Shader Features Next diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 012e41383f..9311a5f60e 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -320,7 +320,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) S32 LLDrawPoolAvatar::getNumPasses() { - return LLPipeline::sImpostorRender ? 1 : 3; + return LLPipeline::sImpostorRender ? 1 : 4; } void LLDrawPoolAvatar::render(S32 pass) @@ -357,6 +357,8 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) break; case 2: beginSkinned(); + case 3: + beginRigged(); break; } } @@ -381,6 +383,10 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) break; case 2: endSkinned(); + break; + case 3: + endRigged(); + break; } } @@ -566,6 +572,18 @@ void LLDrawPoolAvatar::endSkinned() gGL.getTexUnit(0)->activate(); } +void LLDrawPoolAvatar::beginRigged() +{ + gSkinnedObjectSimpleProgram.bind(); + LLVertexBuffer::sWeight4Loc = gSkinnedObjectSimpleProgram.getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endRigged() +{ + gSkinnedObjectSimpleProgram.unbind(); + LLVertexBuffer::sWeight4Loc = -1; +} + void LLDrawPoolAvatar::beginDeferredSkinned() { sShaderLevel = mVertexShaderLevel; @@ -711,6 +729,12 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) avatarp->renderRigid(); return; } + + if (pass == 3) + { + avatarp->renderSkinnedAttachments(); + return; + } if (sShaderLevel > 0) { diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index b947943619..c43aa9b1e3 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -90,10 +90,12 @@ public: void beginRigid(); void beginFootShadow(); void beginSkinned(); + void beginRigged(); void endRigid(); void endFootShadow(); void endSkinned(); + void endRigged(); void beginDeferredImpostor(); void beginDeferredRigid(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 53330e4d98..bc3e04db18 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -888,7 +888,8 @@ static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom"); BOOL LLFace::getGeometryVolume(const LLVolume& volume, const S32 &f, const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, - const U16 &index_offset) + const U16 &index_offset, + bool force_rebuild) { LLFastTimer t(FTM_FACE_GET_GEOM); const LLVolumeFace &vf = volume.getVolumeFace(f); @@ -925,8 +926,9 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLStrider<LLColor4U> colors; LLStrider<LLVector3> binormals; LLStrider<U16> indicesp; + LLStrider<LLVector4> weights; - BOOL full_rebuild = mDrawablep->isState(LLDrawable::REBUILD_VOLUME); + BOOL full_rebuild = force_rebuild || mDrawablep->isState(LLDrawable::REBUILD_VOLUME); BOOL global_volume = mDrawablep->getVOVolume()->isVolumeGlobal(); LLVector3 scale; @@ -944,6 +946,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, BOOL rebuild_tcoord = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_TCOORD); BOOL rebuild_normal = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL); BOOL rebuild_binormal = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_BINORMAL); + bool rebuild_weights = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_WEIGHT4); const LLTextureEntry *tep = mVObjp->getTE(f); U8 bump_code = tep ? tep->getBumpmap() : 0; @@ -960,7 +963,11 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, { mVertexBuffer->getBinormalStrider(binormals, mGeomIndex); } - + if (rebuild_weights) + { + mVertexBuffer->getWeight4Strider(weights, mGeomIndex); + } + F32 tcoord_xoffset = 0.f ; F32 tcoord_yoffset = 0.f ; F32 tcoord_xscale = 1.f ; @@ -1338,6 +1345,11 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, *binormals++ = binormal; } + if (rebuild_weights) + { + *weights++ = vf.mWeights[i]; + } + if (rebuild_color) { *colors++ = color; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 67dd97e6f7..06ec043c76 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -73,6 +73,7 @@ public: HUD_RENDER = 0x0008, USE_FACE_COLOR = 0x0010, TEXTURE_ANIM = 0x0020, + RIGGED = 0x0040, }; static void initClass(); @@ -145,7 +146,8 @@ public: BOOL getGeometryVolume(const LLVolume& volume, const S32 &f, const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, - const U16 &index_offset); + const U16 &index_offset, + bool force_rebuild = false); // For avatar U16 getGeometryAvatar( diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index d74216de2d..b5e5967374 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -615,6 +615,13 @@ public: class LLVolumeGeometryManager: public LLGeometryManager { public: + typedef enum + { + NONE = 0, + BATCH_SORT, + DISTANCE_SORT + } eSortType; + virtual ~LLVolumeGeometryManager() { } virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index a0d0b9d490..8a68dd6ea7 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -77,6 +77,9 @@ LLGLSLShader gObjectFullbrightShinyProgram; LLGLSLShader gObjectShinyProgram; LLGLSLShader gObjectShinyWaterProgram; +//object hardware skinning shaders +LLGLSLShader gSkinnedObjectSimpleProgram; + //environment shaders LLGLSLShader gTerrainProgram; LLGLSLShader gTerrainWaterProgram; @@ -148,6 +151,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gObjectSimpleProgram); mShaderList.push_back(&gObjectFullbrightProgram); mShaderList.push_back(&gObjectFullbrightShinyProgram); + mShaderList.push_back(&gSkinnedObjectSimpleProgram); mShaderList.push_back(&gTerrainProgram); mShaderList.push_back(&gTerrainWaterProgram); mShaderList.push_back(&gObjectSimpleWaterProgram); @@ -195,6 +199,7 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void) mReservedAttribs.push_back("materialColor"); mReservedAttribs.push_back("specularColor"); mReservedAttribs.push_back("binormal"); + mReservedAttribs.push_back("object_weight"); mAvatarAttribs.reserve(5); mAvatarAttribs.push_back("weight"); @@ -548,6 +553,9 @@ void LLViewerShaderMgr::unloadShaders() gObjectShinyProgram.unload(); gObjectFullbrightShinyProgram.unload(); gObjectShinyWaterProgram.unload(); + + gSkinnedObjectSimpleProgram.unload(); + gWaterProgram.unload(); gUnderWaterProgram.unload(); gTerrainProgram.unload(); @@ -625,6 +633,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() shaders.push_back( make_pair( "lighting/lightSpecularV.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); shaders.push_back( make_pair( "windlight/atmosphericsV.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); shaders.push_back( make_pair( "avatar/avatarSkinV.glsl", 1 ) ); + shaders.push_back( make_pair( "avatar/objectSkinV.glsl", 1 ) ); // We no longer have to bind the shaders to global glhandles, they are automatically added to a map now. for (U32 i = 0; i < shaders.size(); i++) @@ -1214,6 +1223,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleWaterProgram.unload(); gObjectFullbrightProgram.unload(); gObjectFullbrightWaterProgram.unload(); + gSkinnedObjectSimpleProgram.unload(); return FALSE; } @@ -1323,6 +1333,21 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gObjectFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); } + if (success) + { + gSkinnedObjectSimpleProgram.mName = "Skinned Simple Shader"; + gSkinnedObjectSimpleProgram.mFeatures.calculatesLighting = true; + gSkinnedObjectSimpleProgram.mFeatures.calculatesAtmospherics = true; + gSkinnedObjectSimpleProgram.mFeatures.hasGamma = true; + gSkinnedObjectSimpleProgram.mFeatures.hasAtmospherics = true; + gSkinnedObjectSimpleProgram.mFeatures.hasLighting = true; + gSkinnedObjectSimpleProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectSimpleProgram.mShaderFiles.clear(); + gSkinnedObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gSkinnedObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSkinnedObjectSimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gSkinnedObjectSimpleProgram.createShader(NULL, NULL); + } if( !success ) { diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index ac2b4624e0..83a650cdbc 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -82,6 +82,7 @@ public: MATERIAL_COLOR = 0, SPECULAR_COLOR, BINORMAL, + OBJECT_WEIGHT, END_RESERVED_ATTRIBS } eGLSLReservedAttribs; @@ -313,6 +314,8 @@ extern LLGLSLShader gObjectFullbrightShinyProgram; extern LLGLSLShader gObjectShinyProgram; extern LLGLSLShader gObjectShinyWaterProgram; +extern LLGLSLShader gSkinnedObjectSimpleProgram; + //environment shaders extern LLGLSLShader gTerrainProgram; extern LLGLSLShader gTerrainWaterProgram; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c400e8510e..535440692f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -64,6 +64,7 @@ #include "llkeyframefallmotion.h" #include "llkeyframestandmotion.h" #include "llkeyframewalkmotion.h" +#include "llmeshrepository.h" #include "llmutelist.h" #include "llmoveview.h" #include "llquantize.h" @@ -79,6 +80,7 @@ #include "llviewermenu.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" +#include "llviewershadermgr.h" #include "llviewerstats.h" #include "llvoavatarself.h" #include "llvovolume.h" @@ -3644,6 +3646,113 @@ bool LLVOAvatar::shouldAlphaMask() } +U32 LLVOAvatar::renderSkinnedAttachments() +{ + U32 num_indices = 0; + + const U32 data_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_NORMAL | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_WEIGHT4; + + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isHUDAttachment()) + { + const LLDrawable* drawable = attached_object->mDrawable; + if (drawable) + { + for (S32 i = 0; i < drawable->getNumFaces(); ++i) + { + LLFace* face = drawable->getFace(i); + if (face->isState(LLFace::RIGGED)) + { + LLVolume* volume = attached_object->getVolume(); + const LLVolumeFace& vol_face = volume->getVolumeFace(i); + + const LLMeshSkinInfo* skin = NULL; + LLVertexBuffer* buff = face->mVertexBuffer; + + if (!buff || + !buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) || + buff->getRequestedVerts() != vol_face.mVertices.size()) + { + face->mVertexBuffer = NULL; + face->mLastVertexBuffer = NULL; + buff = NULL; + + LLUUID mesh_id = volume->getParams().getSculptID(); + if (mesh_id.notNull()) + { + skin = gMeshRepo.getSkinInfo(mesh_id); + if (skin) + { + face->mVertexBuffer = new LLVertexBuffer(data_mask, 0); + face->mVertexBuffer->allocateBuffer(vol_face.mVertices.size(), vol_face.mIndices.size(), true); + + face->setGeomIndex(0); + face->setIndicesIndex(0); + + U16 offset = 0; + + LLMatrix4 mat_vert = skin->mBindShapeMatrix; + LLMatrix3 mat_normal; + + face->getGeometryVolume(*volume, i, mat_vert, mat_normal, offset, true); + buff = face->mVertexBuffer; + } + } + } + + if (buff) + { + if (skin) + { + LLMatrix4 mat[64]; + + for (U32 i = 0; i < skin->mJointNames.size(); ++i) + { + LLJoint* joint = getJoint(skin->mJointNames[i]); + if (joint) + { + mat[i] = skin->mInvBindMatrix[i]; + mat[i] *= joint->getWorldMatrix(); + } + } + + gSkinnedObjectSimpleProgram.uniformMatrix4fv("matrixPalette", + skin->mJointNames.size(), + FALSE, + (GLfloat*) mat[0].mMatrix); + + buff->setBuffer(data_mask); + + U16 start = face->getGeomStart(); + U16 end = start + face->getGeomCount(); + S32 offset = face->getIndicesStart(); + U32 count = face->getIndicesCount(); + + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); + } + } + } + } + } + } + } + } + + return num_indices; +} + //----------------------------------------------------------------------------- // renderSkinned() //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index d5485413f4..b0535a4a26 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -339,6 +339,7 @@ public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); U32 renderRigid(); U32 renderSkinned(EAvatarRenderPass pass); + U32 renderSkinnedAttachments(); U32 renderTransparent(BOOL first_pass); void renderCollisionVolumes(); static void deleteCachedImages(bool clearAll=true); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index bc83e11fd2..56fb42bb89 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3496,6 +3496,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->clearState(LLDrawable::HAS_ALPHA); + bool rigged = vobj->isAttachment() && + vobj->isMesh() && + gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID()); + //for each face for (S32 i = 0; i < drawablep->getNumFaces(); i++) { @@ -3503,6 +3507,22 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->updateFaceSize(i); LLFace* facep = drawablep->getFace(i); + if (rigged) + { + if (!facep->isState(LLFace::RIGGED)) + { + facep->mVertexBuffer = NULL; + facep->mLastVertexBuffer = NULL; + facep->setState(LLFace::RIGGED); + } + + continue; + } + else + { + facep->clearState(LLFace::RIGGED); + } + if (cur_total > max_total || facep->getIndicesCount() <= 0 || facep->getGeomCount() <= 0) { facep->mVertexBuffer = NULL; -- cgit v1.2.3 From 3f05cd7e7fdb7da83f27f798913a0b0b848a08a6 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 6 Apr 2010 22:24:57 +0100 Subject: extra diffuse sample in ssreflection to decrease aliasing. --- .../app_settings/shaders/class1/deferred/softenLightF.glsl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 503c7d0b83..3f4425a0b2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -298,13 +298,18 @@ void main() // of the diffuse map. LOD would be better in that regard. // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. + // --------------------- + // ^ ^ ^ ^ ^ + // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + + texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); // figure out how appropriate our guess actually was float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); -- cgit v1.2.3 From ecec1641ffe295c3bccbd0b4cb1bd2056b8a83e7 Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" <qarl@lindenlab.com> Date: Tue, 6 Apr 2010 16:41:41 -0500 Subject: fix model importer to create a single coalesced object. --- indra/newview/skins/default/xui/en/menu_viewer.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index c2e19501a6..dccffa67de 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2874,6 +2874,16 @@ shortcut="control|alt|shift|G"> <menu_item_call.on_click function="Advanced.LeaveAdminStatus" /> + </menu_item_call> + <menu_item_call + label="HACK Upload Model..." + layout="topleft" + name="Upload Model"> + <menu_item_call.on_click + function="File.UploadModel" + parameter="" /> + <menu_item_call.on_enable + function="File.EnableUploadModel" /> </menu_item_call> </menu> <menu -- cgit v1.2.3 From de663d15df69aa6961f984f9f1c440f1fe2b3efb Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 6 Apr 2010 17:37:31 -0500 Subject: Cleanup from review. --- indra/llcommon/llsdserialize.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index c341b15539..fdeb93e27f 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -2025,6 +2025,7 @@ std::string zip_llsd(LLSD& data) { delete [] output; llwarns << "Failed to compress LLSD block." << llendl; + return std::string(); } std::string::size_type size = source.size()-strm.avail_out; @@ -2116,6 +2117,7 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size) if (!LLSDSerialize::deserialize(data, istr, cur_size)) { llwarns << "Failed to unzip LLSD block" << llendl; + free(result); return false; } } -- cgit v1.2.3 From 9454398cd93f1b9710ef027206180a605c374dbd Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 7 Apr 2010 09:45:20 +0100 Subject: tidy up ssreflections comments and structure a bit. --- .../app_settings/shaders/class1/deferred/softenLightF.glsl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 3f4425a0b2..158eef9319 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -298,18 +298,20 @@ void main() // of the diffuse map. LOD would be better in that regard. // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. - // --------------------- - // ^ ^ ^ ^ ^ - // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination - // get attributes from the 2D guess point - float refdepth = texture2DRect(depthMap, ref2d).a; - vec3 refpos = getPosition_d(ref2d, refdepth).xyz; + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + // --------------------- + // ^ ^ ^ ^ ^ + // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); + float refdepth = texture2DRect(depthMap, ref2d).a; + vec3 refpos = getPosition_d(ref2d, refdepth).xyz; vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); // figure out how appropriate our guess actually was float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); -- cgit v1.2.3 From e07937ced233513bcae55b2365f9ba5a15108faa Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 7 Apr 2010 10:31:56 +0100 Subject: apply latest ssreflections tweaks to class2 and class3. --- .../app_settings/shaders/class2/deferred/softenLightF.glsl | 13 ++++++++++--- .../app_settings/shaders/class3/deferred/softenLightF.glsl | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 00a6a9dcb5..dbccb7fb8b 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -298,12 +298,19 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination - // get attributes from the 2D guess point + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + // --------------------- + // ^ ^ ^ ^ ^ + // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + + texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; float refshad = texture2DRect(lightMap, ref2d).r; vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); // figure out how appropriate our guess actually was diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index aaa74eb7df..ef81ed1308 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -301,12 +301,19 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination - // get attributes from the 2D guess point + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + // --------------------- + // ^ ^ ^ ^ ^ + // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + + texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; float refshad = texture2DRect(lightMap, ref2d).r; vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); // figure out how appropriate our guess actually was -- cgit v1.2.3 From 70aa3cf12405eb7c0deaedce4dd2ced81ca3e0c8 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 7 Apr 2010 12:41:44 -0500 Subject: Shadow aliasing fix WIP --- indra/newview/app_settings/settings.xml | 48 ++++++++++++++++++++++ .../shaders/class2/deferred/sunLightF.glsl | 32 +++++++++++++-- indra/newview/pipeline.cpp | 14 ++++++- 3 files changed, 89 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index eef3725cd7..b0c56aea7c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6537,6 +6537,54 @@ <real>0.01</real> </map> + <key>RenderShadowBiasError</key> + <map> + <key>Comment</key> + <string>Error scale for shadow bias (based on altitude).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0</real> + </map> + <key>RenderShadowOffsetError</key> + <map> + <key>Comment</key> + <string>Error scale for shadow offset (based on altitude).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0</real> + </map> + + <key>RenderSpotShadowBias</key> + <map> + <key>Comment</key> + <string>Bias value for shadows (prevent shadow acne).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>-0.008</real> + </map> + <key>RenderSpotShadowOffset</key> + <map> + <key>Comment</key> + <string>Offset value for shadows (prevent shadow acne).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.01</real> + </map> + + + <key>RenderShadowResolutionScale</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 04c9a4d19a..4974bbef9e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -41,6 +41,9 @@ uniform vec2 proj_shadow_res; uniform float shadow_bias; uniform float shadow_offset; +uniform float spot_shadow_bias; +uniform float spot_shadow_offset; + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -72,6 +75,24 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) //return shadow; } +float pcfSpotShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) +{ + stc.xyz /= stc.w; + stc.z += spot_shadow_bias*scl; + + float cs = shadow2DRect(shadowMap, stc.xyz).x; + float shadow = cs; + + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); + + return shadow/5.0; + + //return shadow; +} + float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; @@ -114,7 +135,10 @@ void main() float shadow = 1.0; float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - vec4 spos = vec4(pos.xyz + displace*norm + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); + vec3 shadow_pos = pos.xyz + displace*norm; + vec3 offset = vary_light.xyz * (1.0-dp_directional_light); + + vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); if (spos.z > -shadow_clip.w) { @@ -176,13 +200,15 @@ void main() gl_FragColor[0] = shadow; gl_FragColor[1] = 1.0; + spos.xyz = shadow_pos*offset*spot_shadow_offset; + //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8).x; + gl_FragColor[2] = pcfSpotShadow(shadowMap4, lpos, 0.8).x; //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8).x; + gl_FragColor[3] = pcfSpotShadow(shadowMap5, lpos, 0.8).x; //gl_FragColor.rgb = pos.xyz; //gl_FragColor.b = shadow; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3778cae201..2aa0210a80 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -5922,8 +5922,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) } +static LLFastTimer::DeclareTimer FTM_BIND_DEFERRED("Bind Deferred"); + void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRenderTarget* gi_source, LLRenderTarget* last_gi_post, U32 noise_map) { + LLFastTimer t(FTM_BIND_DEFERRED); + if (noise_map == 0xFFFFFFFF) { noise_map = mNoiseMap; @@ -6261,10 +6265,16 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen matrix_nondiag, matrix_nondiag, matrix_diag}; shader.uniformMatrix3fv("ssao_effect_mat", 1, GL_FALSE, ssao_effect_mat); + F32 shadow_offset_error = 1.f + gSavedSettings.getF32("RenderShadowOffsetError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); + F32 shadow_bias_error = 1.f + gSavedSettings.getF32("RenderShadowBiasError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); + shader.uniform2f("screen_res", mDeferredScreen.getWidth(), mDeferredScreen.getHeight()); shader.uniform1f("near_clip", LLViewerCamera::getInstance()->getNear()*2.f); - shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")); - shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")); + shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")*shadow_offset_error); + shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")*shadow_bias_error); + shader.uniform1f ("spot_shadow_offset", gSavedSettings.getF32("RenderSpotShadowOffset")); + shader.uniform1f("spot_shadow_bias", gSavedSettings.getF32("RenderSpotShadowBias")); + shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale")); shader.uniform1f("sun_lum_scale", gSavedSettings.getF32("RenderSunLuminanceScale")); shader.uniform1f("sun_lum_offset", gSavedSettings.getF32("RenderSunLuminanceOffset")); -- cgit v1.2.3 From e24f360c5e2c2745673e25133e7171aa71298eb0 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 7 Apr 2010 13:52:52 -0500 Subject: Whitespace trimming. --- indra/newview/app_settings/settings.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8a3018340e..b9647d0148 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6538,8 +6538,6 @@ <real>0.01</real> </map> - - <key>RenderShadowResolutionScale</key> <map> <key>Comment</key> @@ -6552,8 +6550,6 @@ <real>1.0</real> </map> - - <key>RenderDeferredTreeShadowBias</key> <map> <key>Comment</key> -- cgit v1.2.3 From 711bcaf2ad43bc287b0af97c9e016b3d9a2abd77 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 7 Apr 2010 15:26:43 -0500 Subject: Fix for build failing. --- indra/newview/viewer_manifest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 659ce4a47b..99dfc07cd5 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -276,8 +276,12 @@ class WindowsManifest(ViewerManifest): self.disable_manifest_check() # Mesh 3rd party libs needed for auto LOD and collada reading - self.path("libcollada14dom21.dll") - self.path("glod.dll") + try: + self.path("libcollada14dom21.dll") + self.path("glod.dll") + except RuntimeError, err: + print err.message + print "Skipping COLLADA and GLOD libraries (assumming linked statically)" # For textures if self.args['configuration'].lower() == 'debug': -- cgit v1.2.3 From f5c9196b365eee1032ead18a36320384deffc81a Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 8 Apr 2010 12:42:10 -0500 Subject: Fix for shadows going crazy at high altitudes. --- indra/newview/pipeline.cpp | 76 ++++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2aa0210a80..e3463574a7 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -193,6 +193,7 @@ std::string gPoolNames[] = }; void drawBox(const LLVector3& c, const LLVector3& r); +void drawBoxOutline(const LLVector3& pos, const LLVector3& size); U32 nhpo2(U32 v) { @@ -1531,8 +1532,10 @@ BOOL LLPipeline::visibleObjectsInFrustum(LLCamera& camera) BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& max) { - min = LLVector3(F32_MAX, F32_MAX, F32_MAX); - max = LLVector3(-F32_MAX, -F32_MAX, -F32_MAX); + const F32 X = 65536.f; + + min = LLVector3(X,X,X); + max = LLVector3(-X,-X,-X); U32 saved_camera_id = LLViewerCamera::sCurCameraID; LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; @@ -3667,12 +3670,12 @@ void LLPipeline::renderDebug() for (U32 i = 0; i < 8; i++) { + LLVector3* frust = mShadowCamera[i].mAgentFrustum; + if (i > 3) - { + { //render shadow frusta as volumes gGL.color4fv(col+(i-4)*4); - LLVector3* frust = mShadowCamera[i].mAgentFrustum; - gGL.begin(LLRender::TRIANGLE_STRIP); gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[4].mV); gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[5].mV); @@ -3700,31 +3703,46 @@ void LLPipeline::renderDebug() if (i < 4) { - gGL.begin(LLRender::LINES); - + + //render visible point cloud + gGL.flush(); + glPointSize(8.f); + gGL.begin(LLRender::POINTS); + F32* c = col+i*4; + gGL.color3fv(c); + for (U32 j = 0; j < mShadowFrustPoints[i].size(); ++j) - { + { + gGL.vertex3fv(mShadowFrustPoints[i][j].mV); - gGL.color3fv(c); + } + gGL.end(); - for (U32 k = 0; k < mShadowFrustPoints[i].size(); ++k) - { - if (j != k) - { - gGL.vertex3fv(mShadowFrustPoints[i][j].mV); - gGL.vertex3fv(mShadowFrustPoints[i][k].mV); - } - } + gGL.flush(); + glPointSize(1.f); - if (!mShadowFrustOrigin[i].isExactlyZero()) - { - gGL.vertex3fv(mShadowFrustPoints[i][j].mV); - gGL.color4f(1,1,1,1); - gGL.vertex3fv(mShadowFrustOrigin[i].mV); - } - } + LLVector3* ext = mShadowExtents[i]; + LLVector3 pos = (ext[0]+ext[1])*0.5f; + LLVector3 size = (ext[1]-ext[0])*0.5f; + drawBoxOutline(pos, size); + + //render camera frustum splits as outlines + gGL.begin(LLRender::LINES); + gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[1].mV); + gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[2].mV); + gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[3].mV); + gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[0].mV); + gGL.vertex3fv(frust[4].mV); gGL.vertex3fv(frust[5].mV); + gGL.vertex3fv(frust[5].mV); gGL.vertex3fv(frust[6].mV); + gGL.vertex3fv(frust[6].mV); gGL.vertex3fv(frust[7].mV); + gGL.vertex3fv(frust[7].mV); gGL.vertex3fv(frust[4].mV); + gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[4].mV); + gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[5].mV); + gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[6].mV); + gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[7].mV); gGL.end(); + } /*for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); @@ -7721,14 +7739,14 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector //get point of intersection of 3 planes "p" LLVector3 p = (-d1*(n2%n3)-d2*(n3%n1)-d3*(n1%n2))/(n1*(n2%n3)); - if (llround(p*n1+d1, 0.0001f) == 0.f && - llround(p*n2+d2, 0.0001f) == 0.f && - llround(p*n3+d3, 0.0001f) == 0.f) + if (llround(p*n1+d1, 0.1f) == 0.f && + llround(p*n2+d2, 0.1f) == 0.f && + llround(p*n3+d3, 0.1f) == 0.f) { //point is on all three planes BOOL found = TRUE; for (U32 l = 0; l < ps.size() && found; ++l) { - if (llround(ps[l].dist(p), 0.0001f) > 0.0f) + if (llround(ps[l].dist(p), 0.1f) > 0.0f) { //point is above some plane, not contained found = FALSE; } @@ -8173,7 +8191,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) shadow_cam = camera; shadow_cam.setFar(16.f); - LLViewerCamera::updateFrustumPlanes(shadow_cam); + LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); LLVector3* frust = shadow_cam.mAgentFrustum; -- cgit v1.2.3 From 1df3e85d2d73820a3129ebeb1a3e4c88338e5a93 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 8 Apr 2010 20:42:55 -0500 Subject: Total fix for shadows going wonky at altitude. --- indra/newview/llspatialpartition.cpp | 7 +-- indra/newview/pipeline.cpp | 95 ++++++++++++++++++++++-------------- 2 files changed, 61 insertions(+), 41 deletions(-) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 3742f70df5..77c38798d1 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1924,11 +1924,8 @@ public: return; } - if (mRes == 2) - { - //fully in, don't traverse further (won't effect extents - } - else if (mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) + if ((mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) || + mRes == 2) { //don't need to do frustum check LLSpatialGroup::OctreeTraveler::traverse(n); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e3463574a7..fd1445b33e 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3674,6 +3674,11 @@ void LLPipeline::renderDebug() if (i > 3) { //render shadow frusta as volumes + if (mShadowFrustPoints[i-4].empty()) + { + continue; + } + gGL.color4fv(col+(i-4)*4); gGL.begin(LLRender::TRIANGLE_STRIP); @@ -3704,44 +3709,47 @@ void LLPipeline::renderDebug() if (i < 4) { - //render visible point cloud - gGL.flush(); - glPointSize(8.f); - gGL.begin(LLRender::POINTS); + if (i == 0 || !mShadowFrustPoints[i].empty()) + { + //render visible point cloud + gGL.flush(); + glPointSize(8.f); + gGL.begin(LLRender::POINTS); - F32* c = col+i*4; - gGL.color3fv(c); + F32* c = col+i*4; + gGL.color3fv(c); - for (U32 j = 0; j < mShadowFrustPoints[i].size(); ++j) - { - gGL.vertex3fv(mShadowFrustPoints[i][j].mV); - + for (U32 j = 0; j < mShadowFrustPoints[i].size(); ++j) + { + gGL.vertex3fv(mShadowFrustPoints[i][j].mV); + + } + gGL.end(); + + gGL.flush(); + glPointSize(1.f); + + LLVector3* ext = mShadowExtents[i]; + LLVector3 pos = (ext[0]+ext[1])*0.5f; + LLVector3 size = (ext[1]-ext[0])*0.5f; + drawBoxOutline(pos, size); + + //render camera frustum splits as outlines + gGL.begin(LLRender::LINES); + gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[1].mV); + gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[2].mV); + gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[3].mV); + gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[0].mV); + gGL.vertex3fv(frust[4].mV); gGL.vertex3fv(frust[5].mV); + gGL.vertex3fv(frust[5].mV); gGL.vertex3fv(frust[6].mV); + gGL.vertex3fv(frust[6].mV); gGL.vertex3fv(frust[7].mV); + gGL.vertex3fv(frust[7].mV); gGL.vertex3fv(frust[4].mV); + gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[4].mV); + gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[5].mV); + gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[6].mV); + gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[7].mV); + gGL.end(); } - gGL.end(); - - gGL.flush(); - glPointSize(1.f); - - LLVector3* ext = mShadowExtents[i]; - LLVector3 pos = (ext[0]+ext[1])*0.5f; - LLVector3 size = (ext[1]-ext[0])*0.5f; - drawBoxOutline(pos, size); - - //render camera frustum splits as outlines - gGL.begin(LLRender::LINES); - gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[1].mV); - gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[2].mV); - gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[3].mV); - gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[0].mV); - gGL.vertex3fv(frust[4].mV); gGL.vertex3fv(frust[5].mV); - gGL.vertex3fv(frust[5].mV); gGL.vertex3fv(frust[6].mV); - gGL.vertex3fv(frust[6].mV); gGL.vertex3fv(frust[7].mV); - gGL.vertex3fv(frust[7].mV); gGL.vertex3fv(frust[4].mV); - gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[4].mV); - gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[5].mV); - gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[6].mV); - gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[7].mV); - gGL.end(); } @@ -8107,16 +8115,31 @@ void LLPipeline::generateSunShadow(LLCamera& camera) at.normVec(); + LLCamera main_camera = camera; + F32 near_clip = 0.f; { //get visible point cloud std::vector<LLVector3> fp; + main_camera.calcAgentFrustumPlanes(main_camera.mAgentFrustum); + LLVector3 min,max; - getVisiblePointCloud(camera,min,max,fp); + getVisiblePointCloud(main_camera,min,max,fp); if (fp.empty()) { + if (!hasRenderDebugMask(RENDER_DEBUG_SHADOW_FRUSTA)) + { + mShadowCamera[0] = main_camera; + mShadowExtents[0][0] = min; + mShadowExtents[0][1] = max; + + mShadowFrustPoints[0].clear(); + mShadowFrustPoints[1].clear(); + mShadowFrustPoints[2].clear(); + mShadowFrustPoints[3].clear(); + } mRenderTypeMask = type_mask; return; } -- cgit v1.2.3 From b13af3b8baa05d20ae9f33046f100596182f6be0 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 9 Apr 2010 01:42:50 -0500 Subject: Tweak bias on projectors. Fix some silly shader mistakes. --- indra/newview/app_settings/settings.xml | 2 +- .../shaders/class2/deferred/sunLightF.glsl | 29 ++++------------------ .../shaders/class2/deferred/sunLightSSAOF.glsl | 16 +++++++++--- indra/newview/lldrawpoolavatar.cpp | 5 ++++ 4 files changed, 23 insertions(+), 29 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b9647d0148..fa8dccd659 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6524,7 +6524,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>-0.008</real> + <real>-0.0005</real> </map> <key>RenderSpotShadowOffset</key> <map> diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 4974bbef9e..46db3c990c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -75,28 +75,10 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) //return shadow; } -float pcfSpotShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += spot_shadow_bias*scl; - - float cs = shadow2DRect(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); - - return shadow/5.0; - - //return shadow; -} - float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; - stc.z += shadow_bias*scl; + stc.z += spot_shadow_bias*scl; float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; @@ -107,8 +89,7 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); - - + return shadow/5.0; //return shadow; @@ -200,15 +181,15 @@ void main() gl_FragColor[0] = shadow; gl_FragColor[1] = 1.0; - spos.xyz = shadow_pos*offset*spot_shadow_offset; + spos.xyz = shadow_pos+offset*spot_shadow_offset; //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfSpotShadow(shadowMap4, lpos, 0.8).x; + gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfSpotShadow(shadowMap5, lpos, 0.8).x; + gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); //gl_FragColor.rgb = pos.xyz; //gl_FragColor.b = shadow; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index d77d17942a..a0dfc96f14 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -40,6 +40,9 @@ uniform vec2 proj_shadow_res; uniform float shadow_bias; uniform float shadow_offset; +uniform float spot_shadow_bias; +uniform float spot_shadow_offset; + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -134,7 +137,7 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; - stc.z += shadow_bias*scl; + stc.z += spot_shadow_bias*scl; float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; @@ -173,7 +176,10 @@ void main() float shadow = 1.0; float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - vec4 spos = vec4(pos.xyz + displace*norm + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); + vec3 shadow_pos = pos.xyz + displace*norm; + vec3 offset = vary_light.xyz * (1.0-dp_directional_light); + + vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); if (spos.z > -shadow_clip.w) { @@ -235,13 +241,15 @@ void main() gl_FragColor[0] = shadow; gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + spos.xyz = shadow_pos+offset*spot_shadow_offset; + //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8).x; + gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8).x; + gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); //gl_FragColor.rgb = pos.xyz; //gl_FragColor.b = shadow; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 9311a5f60e..23211d7090 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -314,6 +314,11 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) return; } + if (sShaderLevel > 0) + { + gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; + } + avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); } -- cgit v1.2.3 From fb04904336b77b480f2ebd6bf9219f85c356d36f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 12 Apr 2010 11:11:23 -0500 Subject: Fix for avatars not rendering in non-deferred mode. --- indra/newview/lldrawpoolavatar.cpp | 5 ++++- indra/newview/llvoavatar.cpp | 22 +++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 9311a5f60e..a07be30565 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -320,7 +320,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) S32 LLDrawPoolAvatar::getNumPasses() { - return LLPipeline::sImpostorRender ? 1 : 4; + return LLPipeline::sImpostorRender ? 1 : 3; } void LLDrawPoolAvatar::render(S32 pass) @@ -357,6 +357,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) break; case 2: beginSkinned(); + break; case 3: beginRigged(); break; @@ -574,12 +575,14 @@ void LLDrawPoolAvatar::endSkinned() void LLDrawPoolAvatar::beginRigged() { + sVertexProgram = NULL; gSkinnedObjectSimpleProgram.bind(); LLVertexBuffer::sWeight4Loc = gSkinnedObjectSimpleProgram.getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } void LLDrawPoolAvatar::endRigged() { + sVertexProgram = NULL; gSkinnedObjectSimpleProgram.unbind(); LLVertexBuffer::sWeight4Loc = -1; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6c2eb37971..201c4ce1d5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3645,7 +3645,8 @@ U32 LLVOAvatar::renderSkinnedAttachments() const U32 data_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | - LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_WEIGHT4; for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); @@ -3669,10 +3670,16 @@ U32 LLVOAvatar::renderSkinnedAttachments() if (face->isState(LLFace::RIGGED)) { LLVolume* volume = attached_object->getVolume(); + if (!volume || volume->getNumVolumeFaces() <= i) + { + continue; + } + const LLVolumeFace& vol_face = volume->getVolumeFace(i); const LLMeshSkinInfo* skin = NULL; LLVertexBuffer* buff = face->mVertexBuffer; + LLUUID mesh_id = volume->getParams().getSculptID();; if (!buff || !buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) || @@ -3682,7 +3689,6 @@ U32 LLVOAvatar::renderSkinnedAttachments() face->mLastVertexBuffer = NULL; buff = NULL; - LLUUID mesh_id = volume->getParams().getSculptID(); if (mesh_id.notNull()) { skin = gMeshRepo.getSkinInfo(mesh_id); @@ -3693,7 +3699,8 @@ U32 LLVOAvatar::renderSkinnedAttachments() face->setGeomIndex(0); face->setIndicesIndex(0); - + face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size()); + U16 offset = 0; LLMatrix4 mat_vert = skin->mBindShapeMatrix; @@ -3705,8 +3712,13 @@ U32 LLVOAvatar::renderSkinnedAttachments() } } - if (buff) + if (buff && mesh_id.notNull()) { + if (!skin) + { + skin = gMeshRepo.getSkinInfo(mesh_id); + } + if (skin) { LLMatrix4 mat[64]; @@ -3729,7 +3741,7 @@ U32 LLVOAvatar::renderSkinnedAttachments() buff->setBuffer(data_mask); U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount(); + U16 end = start + face->getGeomCount()-1; S32 offset = face->getIndicesStart(); U32 count = face->getIndicesCount(); -- cgit v1.2.3 From 6b72149cf7ad90c0036d9b037594b0a8e86dc483 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 12 Apr 2010 23:15:42 -0500 Subject: Tracking down ATI deferred bugs WIP --- indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl | 4 ++-- indra/newview/lldrawpoolavatar.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 00083eb6b3..085ffddeec 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -10,7 +10,7 @@ uniform sampler2D diffuseMap; void main() { - gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); - //gl_FragColor = vec4(1,1,1,1); + //gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); + gl_FragColor = vec4(1,1,1,1); } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 23211d7090..5a67e1753a 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -254,7 +254,7 @@ S32 LLDrawPoolAvatar::getNumShadowPasses() void LLDrawPoolAvatar::beginShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); - + sSkipTransparent = TRUE; sVertexProgram = &gDeferredAvatarShadowProgram; if (sShaderLevel > 0) { @@ -276,7 +276,7 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) void LLDrawPoolAvatar::endShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); - + sSkipTransparent = FALSE; if (sShaderLevel > 0) { sRenderingSkinned = FALSE; -- cgit v1.2.3 From e0bfefbd63449c0fe5ef7964677948f012d51506 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" <falcon@lindenlab.com> Date: Tue, 13 Apr 2010 17:31:56 -0700 Subject: Add SimulatorFeatures to the seed capabilities requested by the viewer. --- indra/newview/llviewerregion.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index c6fe78eb74..53ca32d1b0 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -174,7 +174,7 @@ public: mRegion->showReleaseNotes(); } } - + if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) { LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED ); @@ -1493,6 +1493,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("ProvisionVoiceAccountRequest"); capabilityNames.append("RemoteParcelRequest"); capabilityNames.append("RequestTextureDownload"); + capabilityNames.append("SimulatorFeatures"); capabilityNames.append("SearchStatRequest"); capabilityNames.append("SearchStatTracking"); capabilityNames.append("SendPostcard"); -- cgit v1.2.3 From d3d180f5db0350d6a8b930227b17d5001e673295 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 14 Apr 2010 16:18:13 -0500 Subject: Hack to fix ATI depth shadows screwing up alpha masking. --- indra/newview/lldrawpoolavatar.cpp | 2 -- indra/newview/pipeline.cpp | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 588a77a620..2cd9fef9f5 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -254,7 +254,6 @@ S32 LLDrawPoolAvatar::getNumShadowPasses() void LLDrawPoolAvatar::beginShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); - sSkipTransparent = TRUE; sVertexProgram = &gDeferredAvatarShadowProgram; if (sShaderLevel > 0) { @@ -276,7 +275,6 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) void LLDrawPoolAvatar::endShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); - sSkipTransparent = FALSE; if (sShaderLevel > 0) { sRenderingSkinned = FALSE; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bd210b3376..02dc013ca4 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -572,9 +572,12 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) F32 scale = gSavedSettings.getF32("RenderShadowResolutionScale"); + //HACK: make alpha masking work on ATI depth shadows (work around for ATI driver bug) + U32 shadow_fmt = gGLManager.mIsATI ? GL_ALPHA : 0; + for (U32 i = 0; i < 4; i++) { - mShadow[i].allocate(U32(resX*scale),U32(resY*scale), 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE); + mShadow[i].allocate(U32(resX*scale),U32(resY*scale), shadow_fmt, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE); } @@ -583,11 +586,9 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) for (U32 i = 4; i < 6; i++) { - mShadow[i].allocate(width, height, 0, TRUE, FALSE); + mShadow[i].allocate(width, height, shadow_fmt, TRUE, FALSE); } - - width = nhpo2(resX)/2; height = nhpo2(resY)/2; mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE); -- cgit v1.2.3 From 54dd30cc426e16aa99b4f7eea080bbeae0656843 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 15 Apr 2010 00:04:17 -0500 Subject: More rigged attachments work. --- indra/llrender/llshadermgr.cpp | 33 +++++++++++++++++++++------------ indra/llrender/llvertexbuffer.cpp | 21 +++++++++++++++++++++ indra/newview/lldrawpoolavatar.cpp | 3 ++- indra/newview/llvoavatar.cpp | 12 +++++++++--- 4 files changed, 53 insertions(+), 16 deletions(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 23b76351eb..8fc7163b83 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -322,10 +322,13 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type) { GLenum error; - error = glGetError(); - if (error != GL_NO_ERROR) + if (gDebugGL) { - LL_WARNS("ShaderLoading") << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL; + error = glGetError(); + if (error != GL_NO_ERROR) + { + LL_WARNS("ShaderLoading") << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL; + } } LL_DEBUGS("ShaderLoading") << "Loading shader file: " << filename << " class " << shader_level << LL_ENDL; @@ -380,10 +383,13 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade //create shader object GLhandleARB ret = glCreateShaderObjectARB(type); - error = glGetError(); - if (error != GL_NO_ERROR) + if (gDebugGL) { - LL_WARNS("ShaderLoading") << "GL ERROR in glCreateShaderObjectARB: " << error << LL_ENDL; + error = glGetError(); + if (error != GL_NO_ERROR) + { + LL_WARNS("ShaderLoading") << "GL ERROR in glCreateShaderObjectARB: " << error << LL_ENDL; + } } else { @@ -415,13 +421,16 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade //check for errors GLint success = GL_TRUE; glGetObjectParameterivARB(ret, GL_OBJECT_COMPILE_STATUS_ARB, &success); - error = glGetError(); - if (error != GL_NO_ERROR || success == GL_FALSE) + if (gDebugGL) { - //an error occured, print log - LL_WARNS("ShaderLoading") << "GLSL Compilation Error: (" << error << ") in " << filename << LL_ENDL; - dumpObjectLog(ret); - ret = 0; + error = glGetError(); + if (error != GL_NO_ERROR || success == GL_FALSE) + { + //an error occured, print log + LL_WARNS("ShaderLoading") << "GLSL Compilation Error: (" << error << ") in " << filename << LL_ENDL; + dumpObjectLog(ret); + ret = 0; + } } } else diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index d5b00f27a7..668e9e55f9 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -212,6 +212,27 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) glClientActiveTextureARB(GL_TEXTURE0_ARB); } + if (sLastMask & MAP_WEIGHT4) + { + if (sWeight4Loc < 0) + { + llerrs << "Weighting disabled but vertex buffer still bound!" << llendl; + } + + if (!(data_mask & MAP_WEIGHT4)) + { //disable 4-component skin weight + glDisableVertexAttribArrayARB(sWeight4Loc); + } + } + else if (data_mask & MAP_WEIGHT4) + { + if (sWeight4Loc >= 0) + { //enable 4-component skin weight + glEnableVertexAttribArrayARB(sWeight4Loc); + } + } + + sLastMask = data_mask; } } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index de9b71a9b8..1a2558ac5f 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -325,7 +325,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) S32 LLDrawPoolAvatar::getNumPasses() { - return LLPipeline::sImpostorRender ? 1 : 3; + return LLPipeline::sImpostorRender ? 1 : 4; } void LLDrawPoolAvatar::render(S32 pass) @@ -588,6 +588,7 @@ void LLDrawPoolAvatar::beginRigged() void LLDrawPoolAvatar::endRigged() { sVertexProgram = NULL; + LLVertexBuffer::unbind(); gSkinnedObjectSimpleProgram.unbind(); LLVertexBuffer::sWeight4Loc = -1; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 201c4ce1d5..8bf4c0ab96 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3728,8 +3728,8 @@ U32 LLVOAvatar::renderSkinnedAttachments() LLJoint* joint = getJoint(skin->mJointNames[i]); if (joint) { - mat[i] = skin->mInvBindMatrix[i]; - mat[i] *= joint->getWorldMatrix(); + mat[i*2+0] = skin->mInvBindMatrix[i]; + mat[i*2+1] = joint->getWorldMatrix(); } } @@ -3737,6 +3737,10 @@ U32 LLVOAvatar::renderSkinnedAttachments() skin->mJointNames.size(), FALSE, (GLfloat*) mat[0].mMatrix); + gSkinnedObjectSimpleProgram.uniformMatrix4fv("matrixPalette[0]", + skin->mJointNames.size(), + FALSE, + (GLfloat*) mat[0].mMatrix); buff->setBuffer(data_mask); @@ -3745,7 +3749,9 @@ U32 LLVOAvatar::renderSkinnedAttachments() S32 offset = face->getIndicesStart(); U32 count = face->getIndicesCount(); - buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); + glPointSize(8.f); + buff->drawRange(LLRender::POINTS, start, end, count, offset); + glPointSize(1.f); } } } -- cgit v1.2.3 From b0554832e2cffac344590bf49897119e72d142cb Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 15 Apr 2010 00:06:53 -0500 Subject: Quick port of fix for avatar mesh rebuilding bug from viewer-hotfix. --- indra/newview/llvoavatarself.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index c15dbeb8c6..8b87254f81 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -697,15 +697,6 @@ BOOL LLVOAvatarSelf::setParamWeight(LLViewerVisualParam *param, F32 weight, BOOL /*virtual*/ void LLVOAvatarSelf::updateVisualParams() { - for (U32 type = 0; type < WT_COUNT; type++) - { - LLWearable *wearable = gAgentWearables.getTopWearable((EWearableType)type); - if (wearable) - { - wearable->writeToAvatar(); - } - } - LLVOAvatar::updateVisualParams(); } @@ -716,7 +707,14 @@ void LLVOAvatarSelf::idleUpdateAppearanceAnimation() gAgentWearables.animateAllWearableParams(calcMorphAmount(), FALSE); // apply wearable visual params to avatar - updateVisualParams(); + for (U32 type = 0; type < WT_COUNT; type++) + { + LLWearable *wearable = gAgentWearables.getTopWearable((EWearableType)type); + if (wearable) + { + wearable->writeToAvatar(); + } + } //allow avatar to process updates LLVOAvatar::idleUpdateAppearanceAnimation(); -- cgit v1.2.3 From 14f3b77b9c4103f324d24625bd30dd106ab1817f Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 16 Apr 2010 12:19:30 +0100 Subject: strengthen the fakey blur in the fakey ssreflections. (transplanted from 940e02cbe4fa2f996d11500392e71f3a00e1cfed) --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 158eef9319..5fb86dd92d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -299,7 +299,7 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*9.0*(1.0-spec.a)*(checkerboard-0.5); ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index dbccb7fb8b..1fd54b5607 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -298,7 +298,7 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*9.0*(1.0-spec.a)*(checkerboard-0.5); ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index ef81ed1308..45d921d861 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -301,7 +301,7 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*9.0*(1.0-spec.a)*(checkerboard-0.5); ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. -- cgit v1.2.3 From 71b0a63c8df29d5d69b777306dcf6280fd98886a Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 16 Apr 2010 13:00:01 -0500 Subject: Optimize LLViewerJointMesh::updateFaceData --- indra/llcommon/llstrider.h | 2 +- indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/llviewerjointmesh.cpp | 88 +++++++++++++++++++++++++++++-------- 3 files changed, 71 insertions(+), 21 deletions(-) diff --git a/indra/llcommon/llstrider.h b/indra/llcommon/llstrider.h index 369b06b48a..44ea80a36b 100644 --- a/indra/llcommon/llstrider.h +++ b/indra/llcommon/llstrider.h @@ -51,7 +51,7 @@ public: void setStride (S32 skipBytes) { mSkip = (skipBytes ? skipBytes : sizeof(Object));} void skip(const U32 index) { mBytep += mSkip*index;} - + U32 getSkip() const { return mSkip; } Object* get() { return mObjectp; } Object* operator->() { return mObjectp; } Object& operator *() { return *mObjectp; } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 7ab85ae3e4..b509b363b7 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -123,7 +123,7 @@ void LLDrawPoolAvatar::prerender() if (sShaderLevel > 0) { - sBufferUsage = GL_STATIC_DRAW_ARB; + sBufferUsage = GL_DYNAMIC_DRAW_ARB; } else { diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 92029d10f6..90a5a29bb4 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -661,6 +661,8 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 //----------------------------------------------------------------------------- // updateFaceData() //----------------------------------------------------------------------------- +static LLFastTimer::DeclareTimer FTM_AVATAR_FACE("Avatar Face"); + void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) { mFace = face; @@ -670,6 +672,8 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w return; } + LLFastTimer t(FTM_AVATAR_FACE); + LLStrider<LLVector3> verticesp; LLStrider<LLVector3> normalsp; LLStrider<LLVector2> tex_coordsp; @@ -688,30 +692,76 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w face->mVertexBuffer->getIndexStrider(indicesp); stop_glerror(); - for (U16 i = 0; i < mMesh->getNumVertices(); i++) + verticesp += mMesh->mFaceVertexOffset; + tex_coordsp += mMesh->mFaceVertexOffset; + normalsp += mMesh->mFaceVertexOffset; + vertex_weightsp += mMesh->mFaceVertexOffset; + clothing_weightsp += mMesh->mFaceVertexOffset; + + U32* __restrict v = (U32*) verticesp.get(); + const U32 vert_skip = verticesp.getSkip()/sizeof(U32); + + U32* __restrict tc = (U32*) tex_coordsp.get(); + const U32 tc_skip = tex_coordsp.getSkip()/sizeof(U32); + + U32* __restrict n = (U32*) normalsp.get(); + const U32 n_skip = normalsp.getSkip()/sizeof(U32); + + U32* __restrict vw = (U32*) vertex_weightsp.get(); + const U32 vw_skip = vertex_weightsp.getSkip()/sizeof(U32); + + + U32* __restrict cw = (U32*) clothing_weightsp.get(); + const U32 cw_skip = vertex_weightsp.getSkip()/sizeof(U32); + + const U32* __restrict coords = (U32*) mMesh->getCoords(); + const U32* __restrict tex_coords = (U32*) mMesh->getTexCoords(); + const U32* __restrict normals = (U32*) mMesh->getNormals(); + const U32* __restrict weights = (U32*) mMesh->getWeights(); + const U32* __restrict cloth_weights = (U32*) mMesh->getClothingWeights(); + + const U32 num_verts = mMesh->getNumVertices(); + + U32 i = 0; + do { - verticesp[mMesh->mFaceVertexOffset + i] = *(mMesh->getCoords() + i); - tex_coordsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getTexCoords() + i); - normalsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getNormals() + i); - vertex_weightsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getWeights() + i); - if (damp_wind) - { - clothing_weightsp[mMesh->mFaceVertexOffset + i] = LLVector4(0,0,0,0); - } - else - { - clothing_weightsp[mMesh->mFaceVertexOffset + i] = (*(mMesh->getClothingWeights() + i)); - } + v[0] = *(coords++); + v[1] = *(coords++); + v[2] = *(coords++); + v += vert_skip; + + tc[0] = *(tex_coords++); + tc[1] = *(tex_coords++); + tc += tc_skip; + + n[0] = *(normals++); + n[1] = *(normals++); + n[2] = *(normals++); + n += n_skip; + + vw[0] = *(weights++); + vw += vw_skip; + + cw[0] = *(cloth_weights++); + cw[1] = *(cloth_weights++); + cw[2] = *(cloth_weights++); + cw[3] = *(cloth_weights++); + cw += cw_skip; } + while (++i < num_verts); + + const U32 idx_count = mMesh->getNumFaces()*3; - for (S32 i = 0; i < mMesh->getNumFaces(); i++) + U16* __restrict idx = indicesp.get(); + S32* __restrict src_idx = (S32*) mMesh->getFaces(); + + i = 0; + + do { - for (U32 j = 0; j < 3; j++) - { - U32 k = i*3+j+mMesh->mFaceIndexOffset; - indicesp[k] = mMesh->getFaces()[i][j] + mMesh->mFaceVertexOffset; - } + *(idx++) = *(src_idx++); } + while (++i < idx_count); } } } -- cgit v1.2.3 From 12499cebcba81175ae5d92926f5ec89632f00926 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 16 Apr 2010 15:53:26 -0500 Subject: Fix for busted optimizations. --- indra/newview/lldrawpoolavatar.cpp | 4 +--- indra/newview/llviewerjointmesh.cpp | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index b509b363b7..b3942d559a 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -881,9 +881,7 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const LLVertexBufferAvatar::LLVertexBufferAvatar() : LLVertexBuffer(sDataMask, - LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0 ? - GL_DYNAMIC_DRAW_ARB : - GL_STREAM_DRAW_ARB) + GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets { } diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 90a5a29bb4..db2279d925 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -752,14 +752,18 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w const U32 idx_count = mMesh->getNumFaces()*3; + indicesp += mMesh->mFaceIndexOffset; + U16* __restrict idx = indicesp.get(); S32* __restrict src_idx = (S32*) mMesh->getFaces(); i = 0; + const S32 offset = (S32) mMesh->mFaceVertexOffset; + do { - *(idx++) = *(src_idx++); + *(idx++) = *(src_idx++)+offset; } while (++i < idx_count); } -- cgit v1.2.3 From 8b88b093b9b59ba530e5e716609390fd00015efa Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 19 Apr 2010 23:31:38 -0500 Subject: Fix for ridiculous bug that causes all sitting avatars to rebuild their geometry every frame. --- indra/newview/lldrawable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 390e950d75..03eee12707 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -533,7 +533,7 @@ F32 LLDrawable::updateXform(BOOL undamped) { // snap to final position dist_squared = 0.0f; - if (!isRoot()) + if (getVOVolume() && !isRoot()) { //child prim snapping to some position, needs a rebuild gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); } -- cgit v1.2.3 From 1651dd9c5b98923716a80ea476ec47360748f343 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 19 Apr 2010 23:32:27 -0500 Subject: Remove foot shadows, renaming foot shadow pass to impostor pass. --- indra/newview/lldrawpoolavatar.cpp | 12 ++++-------- indra/newview/lldrawpoolavatar.h | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index b3942d559a..c4581b2c78 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -353,7 +353,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) switch (pass) { case 0: - beginFootShadow(); + beginImpostor(); break; case 1: beginRigid(); @@ -380,7 +380,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) switch (pass) { case 0: - endFootShadow(); + endImpostor(); break; case 1: endRigid(); @@ -394,7 +394,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) } } -void LLDrawPoolAvatar::beginFootShadow() +void LLDrawPoolAvatar::beginImpostor() { if (!LLPipeline::sReflectionRender) { @@ -406,7 +406,7 @@ void LLDrawPoolAvatar::beginFootShadow() diffuse_channel = 0; } -void LLDrawPoolAvatar::endFootShadow() +void LLDrawPoolAvatar::endImpostor() { gPipeline.enableLightsDynamic(); } @@ -718,10 +718,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } avatarp->renderImpostor(LLColor4U(255,255,255,255), diffuse_channel); } - else if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS) && !LLPipeline::sRenderDeferred) - { - avatarp->renderFootShadows(); - } return; } diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index c43aa9b1e3..45f694ccd9 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -88,12 +88,12 @@ public: /*virtual*/ void renderShadow(S32 pass); void beginRigid(); - void beginFootShadow(); + void beginImpostor(); void beginSkinned(); void beginRigged(); void endRigid(); - void endFootShadow(); + void endImpostor(); void endSkinned(); void endRigged(); -- cgit v1.2.3 From e994b9dcee82b510dc881e2b14d053a27fe35472 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 19 Apr 2010 23:33:34 -0500 Subject: Remove foot shadows from llvoavatar and add terse update to LLViewerJointMesh::updateFaceData. --- indra/newview/llviewerjoint.cpp | 4 +- indra/newview/llviewerjoint.h | 2 +- indra/newview/llviewerjointmesh.cpp | 121 +++++++++++-------- indra/newview/llviewerjointmesh.h | 2 +- indra/newview/llvoavatar.cpp | 231 ++++++------------------------------ indra/newview/llvoavatar.h | 5 +- 6 files changed, 110 insertions(+), 255 deletions(-) diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index 95f05b5f5f..8f2006b431 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -440,13 +440,13 @@ void LLViewerJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix } } -void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) +void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) { for (child_list_t::iterator iter = mChildren.begin(); iter != mChildren.end(); ++iter) { LLViewerJoint* joint = (LLViewerJoint*)(*iter); - joint->updateFaceData(face, pixel_area, damp_wind); + joint->updateFaceData(face, pixel_area, damp_wind, terse_update); } } diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h index 0d3092a044..67bd7786c3 100644 --- a/indra/newview/llviewerjoint.h +++ b/indra/newview/llviewerjoint.h @@ -126,7 +126,7 @@ public: PickName getPickName() { return mPickName; } virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); + virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); virtual BOOL updateLOD(F32 pixel_area, BOOL activate); virtual void updateJointGeometry(); virtual void dump(); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index db2279d925..fb6cc8d790 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -663,7 +663,7 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 //----------------------------------------------------------------------------- static LLFastTimer::DeclareTimer FTM_AVATAR_FACE("Avatar Face"); -void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) +void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) { mFace = face; @@ -698,22 +698,6 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w vertex_weightsp += mMesh->mFaceVertexOffset; clothing_weightsp += mMesh->mFaceVertexOffset; - U32* __restrict v = (U32*) verticesp.get(); - const U32 vert_skip = verticesp.getSkip()/sizeof(U32); - - U32* __restrict tc = (U32*) tex_coordsp.get(); - const U32 tc_skip = tex_coordsp.getSkip()/sizeof(U32); - - U32* __restrict n = (U32*) normalsp.get(); - const U32 n_skip = normalsp.getSkip()/sizeof(U32); - - U32* __restrict vw = (U32*) vertex_weightsp.get(); - const U32 vw_skip = vertex_weightsp.getSkip()/sizeof(U32); - - - U32* __restrict cw = (U32*) clothing_weightsp.get(); - const U32 cw_skip = vertex_weightsp.getSkip()/sizeof(U32); - const U32* __restrict coords = (U32*) mMesh->getCoords(); const U32* __restrict tex_coords = (U32*) mMesh->getTexCoords(); const U32* __restrict normals = (U32*) mMesh->getNormals(); @@ -723,49 +707,84 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w const U32 num_verts = mMesh->getNumVertices(); U32 i = 0; - do + + const U32 skip = verticesp.getSkip()/sizeof(U32); + + U32* __restrict v = (U32*) verticesp.get(); + U32* __restrict n = (U32*) normalsp.get(); + + if (terse_update) { - v[0] = *(coords++); - v[1] = *(coords++); - v[2] = *(coords++); - v += vert_skip; - - tc[0] = *(tex_coords++); - tc[1] = *(tex_coords++); - tc += tc_skip; - - n[0] = *(normals++); - n[1] = *(normals++); - n[2] = *(normals++); - n += n_skip; - - vw[0] = *(weights++); - vw += vw_skip; - - cw[0] = *(cloth_weights++); - cw[1] = *(cloth_weights++); - cw[2] = *(cloth_weights++); - cw[3] = *(cloth_weights++); - cw += cw_skip; + for (S32 i = num_verts; i > 0; --i) + { + //morph target application only, only update positions and normals + v[0] = coords[0]; + v[1] = coords[1]; + v[2] = coords[2]; + coords += 3; + v += skip; + } + + for (S32 i = num_verts; i > 0; --i) + { + n[0] = normals[0]; + n[1] = normals[1]; + n[2] = normals[2]; + normals += 3; + n += skip; + } } - while (++i < num_verts); + else + { - const U32 idx_count = mMesh->getNumFaces()*3; + U32* __restrict tc = (U32*) tex_coordsp.get(); + U32* __restrict vw = (U32*) vertex_weightsp.get(); + U32* __restrict cw = (U32*) clothing_weightsp.get(); + + do + { + v[0] = *(coords++); + v[1] = *(coords++); + v[2] = *(coords++); + v += skip; + + tc[0] = *(tex_coords++); + tc[1] = *(tex_coords++); + tc += skip; + + n[0] = *(normals++); + n[1] = *(normals++); + n[2] = *(normals++); + n += skip; + + vw[0] = *(weights++); + vw += skip; + + cw[0] = *(cloth_weights++); + cw[1] = *(cloth_weights++); + cw[2] = *(cloth_weights++); + cw[3] = *(cloth_weights++); + cw += skip; + } + while (++i < num_verts); - indicesp += mMesh->mFaceIndexOffset; + const U32 idx_count = mMesh->getNumFaces()*3; - U16* __restrict idx = indicesp.get(); - S32* __restrict src_idx = (S32*) mMesh->getFaces(); + indicesp += mMesh->mFaceIndexOffset; - i = 0; + U16* __restrict idx = indicesp.get(); + S32* __restrict src_idx = (S32*) mMesh->getFaces(); - const S32 offset = (S32) mMesh->mFaceVertexOffset; + i = 0; - do - { - *(idx++) = *(src_idx++)+offset; + const S32 offset = (S32) mMesh->mFaceVertexOffset; + + do + { + *(idx++) = *(src_idx++)+offset; + } + while (++i < idx_count); } - while (++i < idx_count); } } } diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index d62b0ada85..3b8d9c82b8 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -140,7 +140,7 @@ public: /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ); /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); + /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); /*virtual*/ void updateJointGeometry(); /*virtual*/ void dump(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 33ea0199b6..e30a211185 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -693,10 +693,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mBakedTextureDatas[i].mTextureIndex = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)i); } - mDirtyMesh = TRUE; // Dirty geometry, need to regenerate. + mDirtyMesh = 2; // Dirty geometry, need to regenerate. mMeshTexturesDirty = FALSE; - mShadow0Facep = NULL; - mShadow1Facep = NULL; mHeadp = NULL; mIsBuilt = FALSE; @@ -732,12 +730,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mRippleTimeLast = 0.f; - mShadowImagep = LLViewerTextureManager::getFetchedTextureFromFile("foot_shadow.j2c"); - - // GL NOT ACTIVE HERE - //gGL.getTexUnit(0)->bind(mShadowImagep.get()); - //mShadowImagep->setAddressMode(LLTexUnit::TAM_CLAMP); - mInAir = FALSE; mStepOnLand = TRUE; @@ -1923,7 +1915,7 @@ void LLVOAvatar::updateMeshData() } if(num_vertices < 1)//skip empty meshes { - break ; + continue ; } if(last_v_num > 0)//put the last inserted part into next vertex buffer. { @@ -1945,6 +1937,8 @@ void LLVOAvatar::updateMeshData() // resize immediately facep->setSize(num_vertices, num_indices); + bool terse_update = false; + if(facep->mVertexBuffer.isNull()) { facep->mVertexBuffer = new LLVertexBufferAvatar(); @@ -1952,7 +1946,15 @@ void LLVOAvatar::updateMeshData() } else { - facep->mVertexBuffer->resizeBuffer(num_vertices, num_indices) ; + if (facep->mVertexBuffer->getRequestedIndices() == num_indices && + facep->mVertexBuffer->getRequestedVerts() == num_vertices) + { + terse_update = true; + } + else + { + facep->mVertexBuffer->resizeBuffer(num_vertices, num_indices) ; + } } facep->setGeomIndex(0); @@ -1967,7 +1969,7 @@ void LLVOAvatar::updateMeshData() for(S32 k = j ; k < part_index ; k++) { - mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR); + mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR, terse_update); } stop_glerror(); @@ -2320,12 +2322,6 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) LLJoint::sNumUpdates = 0; LLJoint::sNumTouches = 0; - // *NOTE: this is necessary for the floating name text above your head. - if (mDrawable.notNull()) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_SHADOW, TRUE); - } - BOOL visible = isVisible() || mNeedsAnimUpdate; // update attachments positions @@ -3778,12 +3774,19 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) return num_indices; } - if (mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) + LLFace* face = mDrawable->getFace(0); + + bool needs_rebuild = !face || face->mVertexBuffer.isNull(); + + if (needs_rebuild || mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) { //LOD changed or new mesh created, allocate new vertex buffer if needed - updateMeshData(); - mDirtyMesh = FALSE; - mNeedsSkin = TRUE; - mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); + if (needs_rebuild || mDirtyMesh >= 2 || mVisibilityRank <= 4) + { + updateMeshData(); + mDirtyMesh = 0; + mNeedsSkin = TRUE; + mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); + } } if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) <= 0) @@ -4031,54 +4034,6 @@ U32 LLVOAvatar::renderRigid() return num_indices; } -U32 LLVOAvatar::renderFootShadows() -{ - U32 num_indices = 0; - - if (!mIsBuilt) - { - return 0; - } - - if (isSelf() && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead())) - { - return 0; - } - - if (!mIsBuilt) - { - return 0; - } - - // Don't render foot shadows if your lower body is completely invisible. - // (non-humanoid avatars rule!) - if (!isTextureVisible(TEX_LOWER_BAKED)) - { - return 0; - } - - // Update the shadow, tractor, and text label geometry. - if (mDrawable->isState(LLDrawable::REBUILD_SHADOW) && !isImpostor()) - { - updateShadowFaces(); - mDrawable->clearState(LLDrawable::REBUILD_SHADOW); - } - - U32 foot_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_TEXCOORD0; - - LLGLDepthTest test(GL_TRUE, GL_FALSE); - //render foot shadows - LLGLEnable blend(GL_BLEND); - gGL.getTexUnit(0)->bind(mShadowImagep, TRUE); - glColor4fv(mShadow0Facep->getRenderColor().mV); - mShadow0Facep->renderIndexed(foot_mask); - glColor4fv(mShadow1Facep->getRenderColor().mV); - mShadow1Facep->renderIndexed(foot_mask); - - return num_indices; -} - U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) { if (!mImpostor.isComplete()) @@ -4199,11 +4154,6 @@ void LLVOAvatar::updateTextures() { setDebugText(llformat("%4.0f:%4.0f", fsqrtf(mMinPixelArea),fsqrtf(mMaxPixelArea))); } - - if( render_avatar ) - { - mShadowImagep->addTextureStats(mPixelArea); - } } @@ -5347,7 +5297,7 @@ BOOL LLVOAvatar::updateJointLODs() if (res) { sNumLODChangesThisFrame++; - dirtyMesh(); + dirtyMesh(2); return TRUE; } } @@ -5371,18 +5321,9 @@ LLDrawable *LLVOAvatar::createDrawable(LLPipeline *pipeline) mDrawable->addFace(poolp, NULL); mDrawable->setRenderType(LLPipeline::RENDER_TYPE_AVATAR); - LLFace *facep; - - // Add faces for the foot shadows - facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep); - mShadow0Facep = facep; - - facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep); - mShadow1Facep = facep; - mNumInitFaces = mDrawable->getNumFaces() ; - dirtyMesh(); + dirtyMesh(2); return mDrawable; } @@ -5421,107 +5362,6 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) return TRUE; } -//----------------------------------------------------------------------------- -// updateShadowFaces() -//----------------------------------------------------------------------------- -void LLVOAvatar::updateShadowFaces() -{ - LLFace *face0p = mShadow0Facep; - LLFace *face1p = mShadow1Facep; - - // - // render avatar shadows - // - if (mInAir || mUpdatePeriod >= IMPOSTOR_PERIOD) - { - face0p->setSize(0, 0); - face1p->setSize(0, 0); - return; - } - - LLSprite sprite(mShadowImagep.notNull() ? mShadowImagep->getID() : LLUUID::null); - sprite.setFollow(FALSE); - const F32 cos_angle = gSky.getSunDirection().mV[2]; - F32 cos_elev = sqrt(1 - cos_angle * cos_angle); - if (cos_angle < 0) cos_elev = -cos_elev; - sprite.setSize(0.4f + cos_elev * 0.8f, 0.3f); - LLVector3 sun_vec = gSky.mVOSkyp ? gSky.mVOSkyp->getToSun() : LLVector3(0.f, 0.f, 0.f); - - if (mShadowImagep->hasGLTexture()) - { - LLVector3 normal; - LLVector3d shadow_pos; - LLVector3 shadow_pos_agent; - F32 foot_height; - - if (mFootLeftp) - { - LLVector3 joint_world_pos = mFootLeftp->getWorldPosition(); - // this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now - // but we make an explicit ray trace call in expectation of future improvements - resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos), - gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); - shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos); - foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ]; - - // Pull sprite in direction of surface normal - shadow_pos_agent += normal * SHADOW_OFFSET_AMT; - - // Render sprite - sprite.setNormal(normal); - if (isSelf() && gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) - { - sprite.setColor(0.f, 0.f, 0.f, 0.f); - } - else - { - sprite.setColor(0.f, 0.f, 0.f, clamp_rescale(foot_height, MIN_SHADOW_HEIGHT, MAX_SHADOW_HEIGHT, 0.5f, 0.f)); - } - sprite.setPosition(shadow_pos_agent); - - LLVector3 foot_to_knee = mKneeLeftp->getWorldPosition() - joint_world_pos; - //foot_to_knee.normalize(); - foot_to_knee -= projected_vec(foot_to_knee, sun_vec); - sprite.setYaw(azimuth(sun_vec - foot_to_knee)); - - sprite.updateFace(*face0p); - } - - if (mFootRightp) - { - LLVector3 joint_world_pos = mFootRightp->getWorldPosition(); - // this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now - // but we make an explicit ray trace call in expectation of future improvements - resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos), - gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); - shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos); - foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ]; - - // Pull sprite in direction of surface normal - shadow_pos_agent += normal * SHADOW_OFFSET_AMT; - - // Render sprite - sprite.setNormal(normal); - if (isSelf() && gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) - { - sprite.setColor(0.f, 0.f, 0.f, 0.f); - } - else - { - sprite.setColor(0.f, 0.f, 0.f, clamp_rescale(foot_height, MIN_SHADOW_HEIGHT, MAX_SHADOW_HEIGHT, 0.5f, 0.f)); - } - sprite.setPosition(shadow_pos_agent); - - LLVector3 foot_to_knee = mKneeRightp->getWorldPosition() - joint_world_pos; - //foot_to_knee.normalize(); - foot_to_knee -= projected_vec(foot_to_knee, sun_vec); - sprite.setYaw(azimuth(sun_vec - foot_to_knee)); - - sprite.updateFace(*face1p); - } - } -} - //----------------------------------------------------------------------------- // updateSexDependentLayerSets() //----------------------------------------------------------------------------- @@ -5535,9 +5375,9 @@ void LLVOAvatar::updateSexDependentLayerSets( BOOL upload_bake ) //----------------------------------------------------------------------------- // dirtyMesh() //----------------------------------------------------------------------------- -void LLVOAvatar::dirtyMesh() +void LLVOAvatar::dirtyMesh(S32 priority) { - mDirtyMesh = TRUE; + mDirtyMesh = llmax(mDirtyMesh, priority); } //----------------------------------------------------------------------------- @@ -7696,18 +7536,15 @@ BOOL LLVOAvatar::updateLOD() BOOL res = updateJointLODs(); LLFace* facep = mDrawable->getFace(0); - if (facep->mVertexBuffer.isNull() || - (LLVertexBuffer::sEnableVBOs && - ((facep->mVertexBuffer->getUsage() == GL_STATIC_DRAW ? TRUE : FALSE) != - (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE)))) + if (facep->mVertexBuffer.isNull()) { - mDirtyMesh = TRUE; + dirtyMesh(2); } - if (mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) + if (mDirtyMesh >= 2 || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) { //LOD changed or new mesh created, allocate new vertex buffer if needed updateMeshData(); - mDirtyMesh = FALSE; + mDirtyMesh = 0; mNeedsSkin = TRUE; mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index d0ad2b727b..19e2c23ddd 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -336,7 +336,6 @@ private: **/ public: - U32 renderFootShadows(); U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); U32 renderRigid(); U32 renderSkinned(EAvatarRenderPass pass); @@ -565,13 +564,13 @@ private: public: void updateMeshTextures(); void updateSexDependentLayerSets(BOOL upload_bake); - void dirtyMesh(); // Dirty the avatar mesh + void dirtyMesh(S32 priority = 1); // Dirty the avatar mesh void updateMeshData(); protected: void releaseMeshData(); virtual void restoreMeshData(); private: - BOOL mDirtyMesh; + S32 mDirtyMesh; // 0 -- not dirty, 1 -- morphed, 2 -- LOD BOOL mMeshTexturesDirty; typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t; -- cgit v1.2.3 From a0cff3f011cd2c55ab63d5104169953f741a85f0 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 20 Apr 2010 13:41:19 +0100 Subject: Try to fix a (correct) gcc whine about the child hiding the parent's dirtyMesh() method. What I can't figure out is why gcc doesn't complain in render-pipeline, where the problem is the same. (transplanted from cba9bf2cf5194da14105cc28e792f908ef672864) --- indra/newview/llvoavatar.cpp | 5 ++++- indra/newview/llvoavatar.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 52b32e07c6..8c1546d47f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5378,11 +5378,14 @@ void LLVOAvatar::updateSexDependentLayerSets( BOOL upload_bake ) //----------------------------------------------------------------------------- // dirtyMesh() //----------------------------------------------------------------------------- +void LLVOAvatar::dirtyMesh() +{ + dirtyMesh(1); +} void LLVOAvatar::dirtyMesh(S32 priority) { mDirtyMesh = llmax(mDirtyMesh, priority); } - //----------------------------------------------------------------------------- // hideSkirt() //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index b81725f106..a851b7a150 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -565,12 +565,13 @@ private: public: void updateMeshTextures(); void updateSexDependentLayerSets(BOOL upload_bake); - void dirtyMesh(S32 priority = 1); // Dirty the avatar mesh + void dirtyMesh(); // Dirty the avatar mesh void updateMeshData(); protected: void releaseMeshData(); virtual void restoreMeshData(); private: + void dirtyMesh(S32 priority); // Dirty the avatar mesh, with priority S32 mDirtyMesh; // 0 -- not dirty, 1 -- morphed, 2 -- LOD BOOL mMeshTexturesDirty; -- cgit v1.2.3 From a49b1f5e00ae1a03469de5fae4b36233a0442b54 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 20 Apr 2010 11:38:07 -0500 Subject: Make assert_glerror not a hotspot. --- indra/llrender/llgl.cpp | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 97019d48c4..2ee7b16cf3 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1039,23 +1039,8 @@ void flush_glerror() glGetError(); } -void assert_glerror() +void do_assert_glerror() { - if (!gGLActive) - { - //llwarns << "GL used while not active!" << llendl; - - if (gDebugSession) - { - //ll_fail("GL used while not active"); - } - } - - if (gNoRender || !gDebugGL) - { - return; - } - if (!gGLManager.mInited) { LL_ERRS("RenderInit") << "GL not initialized" << LL_ENDL; @@ -1107,6 +1092,25 @@ void assert_glerror() } } +void assert_glerror() +{ + if (!gGLActive) + { + //llwarns << "GL used while not active!" << llendl; + + if (gDebugSession) + { + //ll_fail("GL used while not active"); + } + } + + if (!gNoRender && gDebugGL) + { + do_assert_glerror(); + } +} + + void clear_glerror() { // Create or update texture to be used with this data -- cgit v1.2.3 From d40b29345118ee9e80baf132fc68dc3e367e4c07 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 20 Apr 2010 11:38:38 -0500 Subject: Better branch prediction for markVisible. --- indra/newview/pipeline.cpp | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 02dc013ca4..cb656b4fbc 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1973,31 +1973,29 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_VISIBLE); - if(!drawablep || drawablep->isDead()) + if(drawablep && !drawablep->isDead()) { - return; - } - - if (drawablep->isSpatialBridge()) - { - LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; - - if (root && root->getParent() && root->getVObj() && root->getVObj()->isAttachment()) + if (drawablep->isSpatialBridge()) { - LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); - if (av && av->isImpostor()) + LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; + + if (root->getVObj()->isAttachment()) { - return; + LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); + if (av && av->isImpostor()) + { + return; + } } + sCull->pushBridge((LLSpatialBridge*) drawablep); + } + else + { + sCull->pushDrawable(drawablep); } - sCull->pushBridge((LLSpatialBridge*) drawablep); - } - else - { - sCull->pushDrawable(drawablep); - } - drawablep->setVisible(camera); + drawablep->setVisible(camera); + } } void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion) -- cgit v1.2.3 From 707fca6abad1eb322fd0204d895d465f720fba13 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 20 Apr 2010 11:49:20 -0500 Subject: Fix for bad if on calling updateMeshData --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 09b9da444f..9c14f1aa35 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3779,9 +3779,9 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) LLFace* face = mDrawable->getFace(0); - bool needs_rebuild = !face || face->mVertexBuffer.isNull(); + bool needs_rebuild = !face || face->mVertexBuffer.isNull() || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY); - if (needs_rebuild || mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) + if (needs_rebuild || mDirtyMesh) { //LOD changed or new mesh created, allocate new vertex buffer if needed if (needs_rebuild || mDirtyMesh >= 2 || mVisibilityRank <= 4) { -- cgit v1.2.3 From c4fd211cd85febb80158a8540e4ac625387aa515 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 20 Apr 2010 19:12:52 +0100 Subject: follow-up fix to ede2c9f28dd5 optimization. for all I know, this fix nerfs the delicate branch optimization, BUT there was a real crash there. :/ --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index cb656b4fbc..f54b72ec32 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1979,7 +1979,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; - if (root->getVObj()->isAttachment()) + if (root && root->getVObj()->isAttachment()) { LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); if (av && av->isImpostor()) -- cgit v1.2.3 From 5344d4b2fd89893288243c9a76413a19f90d6f56 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 20 Apr 2010 22:47:32 +0100 Subject: Backed out changeset e13b292907c5 This didn't help. I'll try another approach. --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f54b72ec32..cb656b4fbc 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1979,7 +1979,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; - if (root && root->getVObj()->isAttachment()) + if (root->getVObj()->isAttachment()) { LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); if (av && av->isImpostor()) -- cgit v1.2.3 From cb1ece05ddb71218de4c35df520937ffdda83434 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 20 Apr 2010 22:50:58 +0100 Subject: Another try at finding the new markVisible() crasher without de-optimizing it too badly. Sprinkle it with asserts for the sanity checks we've started to skip, see which one (ones?) fires. --- indra/newview/pipeline.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index cb656b4fbc..368e78dc43 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1978,9 +1978,11 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) if (drawablep->isSpatialBridge()) { LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; - + llassert(root); if (root->getVObj()->isAttachment()) { + llassert(root->getParent()); + llassert(root->getParent()->getVObj()); LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); if (av && av->isImpostor()) { -- cgit v1.2.3 From db73037c2882af70a09ac768ddb3748d811c767a Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 21 Apr 2010 11:24:16 +0100 Subject: Make markVisible as safe as it was, but hopefully not as slow as it was. This is also sprinkled with asserts so we can see which of the NULL tests are - or aren't - needed, if it's really so important to skip them. --- indra/newview/pipeline.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 368e78dc43..318d5d5ca1 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1977,16 +1977,25 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { if (drawablep->isSpatialBridge()) { - LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; - llassert(root); - if (root->getVObj()->isAttachment()) + const LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; + llassert(root); // trying to catch a bad assumption + if (root && // // this test may not be needed, see above + root->getVObj()->isAttachment()) { - llassert(root->getParent()); - llassert(root->getParent()->getVObj()); - LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); - if (av && av->isImpostor()) + LLDrawable* rootparent = root->getParent(); + llassert(rootparent); // trying to catch a bad assumption + if (rootparent) // this test may not be needed, see above { - return; + LLViewerObject *vobj = rootparent->getVObj(); + llassert(vobj); // trying to catch a bad assumption + if (vobj) // this test may not be needed, see above + { + const LLVOAvatar* av = vobj->asAvatar(); + if (av && av->isImpostor()) + { + return; + } + } } } sCull->pushBridge((LLSpatialBridge*) drawablep); -- cgit v1.2.3 From ba294e9ad95e8db491ea19c8a370e88a31814c9d Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 21 Apr 2010 14:24:44 +0100 Subject: ssreflections: if we're going to (pretend to) take 4 diffuse samples, then take them in a diamond pattern instead of all in a line. this also slightly simplifies(?) the shader. (transplanted from 7b334c22ece4e98565c5d182690ab9ca4c2526c6) --- .../app_settings/shaders/class1/deferred/softenLightF.glsl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 5fb86dd92d..01d18cdcde 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -299,17 +299,14 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - vec2 checkoffset = normalize(ref2d)*9.0*(1.0-spec.a)*(checkerboard-0.5); - ref2d += checkoffset; + float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); + ref2d += vec2(checkoffset, checkoffset); ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. // We average two samples of diffuse (not of anything else) per // pixel to try to reduce aliasing some more. - // --------------------- - // ^ ^ ^ ^ ^ - // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) - vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + - texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + + texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); -- cgit v1.2.3 From e188693f126455ac1e74fbab42ddc76b63bc167b Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 21 Apr 2010 14:27:54 +0100 Subject: port class1 ssreflections tweaks to class2 and class3 (transplanted from 19036fc277d88c364e957019a66b4cdf4cce8b53) --- .../app_settings/shaders/class2/deferred/softenLightF.glsl | 11 ++++------- .../app_settings/shaders/class3/deferred/softenLightF.glsl | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 1fd54b5607..2982cd3e09 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -298,17 +298,14 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - vec2 checkoffset = normalize(ref2d)*9.0*(1.0-spec.a)*(checkerboard-0.5); - ref2d += checkoffset; + float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); + ref2d += vec2(checkoffset, checkoffset); ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. // We average two samples of diffuse (not of anything else) per // pixel to try to reduce aliasing some more. - // --------------------- - // ^ ^ ^ ^ ^ - // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) - vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + - texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + + texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; float refshad = texture2DRect(lightMap, ref2d).r; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 45d921d861..e1e035411b 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -301,17 +301,14 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - vec2 checkoffset = normalize(ref2d)*9.0*(1.0-spec.a)*(checkerboard-0.5); - ref2d += checkoffset; + float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); + ref2d += vec2(checkoffset, checkoffset); ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. // We average two samples of diffuse (not of anything else) per // pixel to try to reduce aliasing some more. - // --------------------- - // ^ ^ ^ ^ ^ - // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) - vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + - texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + + texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; float refshad = texture2DRect(lightMap, ref2d).r; -- cgit v1.2.3 From 4d204d4903fdf8f4ea083f752a27d185dad63ce6 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Wed, 21 Apr 2010 15:40:13 +0100 Subject: tidy-up the graphics prefs panel a bit, after the merge from viewer-trunk disrupted it. --- indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index ab5e4ef5cd..68a0db3b89 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -597,7 +597,7 @@ follows="left|top" height="12" layout="topleft" - left_delta="-230" + left_delta="-260" name="AvatarRenderingText" top_pad="8" width="128"> @@ -642,6 +642,7 @@ follows="left|top" height="12" layout="topleft" + left="358" left_pad="-30" name="TerrainDetailText" top="488" -- cgit v1.2.3 From 8dda4d48f9b51976eede5e1777d753cf6dfb8586 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 21 Apr 2010 16:50:00 -0500 Subject: Rigged attachments FTW! --- indra/newview/llvoavatar.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 51a78fc125..e2650d22b0 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3705,7 +3705,15 @@ U32 LLVOAvatar::renderSkinnedAttachments() U16 offset = 0; LLMatrix4 mat_vert = skin->mBindShapeMatrix; - LLMatrix3 mat_normal; + glh::matrix4f m((F32*) mat_vert.mMatrix); + m = m.inverse().transpose(); + + F32 mat3[] = + { m.m[0], m.m[1], m.m[2], + m.m[4], m.m[5], m.m[6], + m.m[8], m.m[9], m.m[10] }; + + LLMatrix3 mat_normal(mat3); face->getGeometryVolume(*volume, i, mat_vert, mat_normal, offset, true); buff = face->mVertexBuffer; @@ -3729,8 +3737,8 @@ U32 LLVOAvatar::renderSkinnedAttachments() LLJoint* joint = getJoint(skin->mJointNames[i]); if (joint) { - mat[i*2+0] = skin->mInvBindMatrix[i]; - mat[i*2+1] = joint->getWorldMatrix(); + mat[i] = skin->mInvBindMatrix[i]; + mat[i] *= joint->getWorldMatrix(); } } @@ -3750,9 +3758,9 @@ U32 LLVOAvatar::renderSkinnedAttachments() S32 offset = face->getIndicesStart(); U32 count = face->getIndicesCount(); - glPointSize(8.f); - buff->drawRange(LLRender::POINTS, start, end, count, offset); - glPointSize(1.f); + gGL.getTexUnit(0)->bind(face->getTexture()); + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); + } } } -- cgit v1.2.3 From 07856a0640ba5c881571952f6c67d40fe5651ebb Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 21 Apr 2010 16:50:15 -0500 Subject: Make attached lights not render when disabled in deferred rendering. --- indra/newview/pipeline.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index cb656b4fbc..d80f749e56 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1979,7 +1979,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; - if (root->getVObj()->isAttachment()) + if (root && root->getVObj() && root->getVObj()->isAttachment()) { LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); if (av && av->isImpostor()) @@ -6736,6 +6736,15 @@ void LLPipeline::renderDeferredLighting() continue; } + if (volume->isAttachment()) + { + if (!sRenderAttachedLights) + { + continue; + } + } + + LLVector3 center = drawablep->getPositionAgent(); F32* c = center.mV; F32 s = volume->getLightRadius()*1.5f; -- cgit v1.2.3 From bf8bcfe4f76f1805a908af0368e334261b764591 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 22 Apr 2010 00:14:06 -0500 Subject: Deferred shading for rigged attachments. --- indra/newview/lldrawpoolavatar.cpp | 98 +++++++++++++++++++++++++++---------- indra/newview/lldrawpoolavatar.h | 4 ++ indra/newview/llviewershadermgr.cpp | 27 ++++++++++ indra/newview/llviewershadermgr.h | 2 + indra/newview/llvoavatar.cpp | 4 +- 5 files changed, 106 insertions(+), 29 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index c4581b2c78..4b7de97101 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -53,8 +53,9 @@ static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK; static U32 sBufferUsage = GL_STREAM_DRAW_ARB; static U32 sShaderLevel = 0; -static LLGLSLShader* sVertexProgram = NULL; + +LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL; BOOL LLDrawPoolAvatar::sSkipOpaque = FALSE; BOOL LLDrawPoolAvatar::sSkipTransparent = FALSE; @@ -176,6 +177,9 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) case 2: beginDeferredSkinned(); break; + case 3: + beginDeferredRigged(); + break; } } @@ -202,6 +206,8 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) case 2: endDeferredSkinned(); break; + case 3: + endDeferredRigged(); } } @@ -248,41 +254,58 @@ void LLDrawPoolAvatar::renderPostDeferred(S32 pass) S32 LLDrawPoolAvatar::getNumShadowPasses() { - return 1; + return 2; } void LLDrawPoolAvatar::beginShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); - sVertexProgram = &gDeferredAvatarShadowProgram; - if (sShaderLevel > 0) + + if (pass == 0) { - gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; - } - gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); - - glColor4f(1,1,1,1); + sVertexProgram = &gDeferredAvatarShadowProgram; + if (sShaderLevel > 0) + { + gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; + } + gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); + + glColor4f(1,1,1,1); - if ((sShaderLevel > 0)) // for hardware blending + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); + } + } + else { - sRenderingSkinned = TRUE; + sVertexProgram = &gDeferredAttachmentShadowProgram; sVertexProgram->bind(); - enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } - } void LLDrawPoolAvatar::endShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); - if (sShaderLevel > 0) + if (pass == 0) { - sRenderingSkinned = FALSE; + if (sShaderLevel > 0) + { + sRenderingSkinned = FALSE; + sVertexProgram->unbind(); + disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); + } + } + else + { + LLVertexBuffer::unbind(); sVertexProgram->unbind(); - disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); + LLVertexBuffer::sWeight4Loc = -1; + sVertexProgram = NULL; } - - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } void LLDrawPoolAvatar::renderShadow(S32 pass) @@ -312,13 +335,19 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) return; } - if (sShaderLevel > 0) + if (pass == 0) { - gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; - } - - avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); + if (sShaderLevel > 0) + { + gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; + } + avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); + } + else + { + avatarp->renderSkinnedAttachments(); + } } S32 LLDrawPoolAvatar::getNumPasses() @@ -578,7 +607,7 @@ void LLDrawPoolAvatar::endSkinned() void LLDrawPoolAvatar::beginRigged() { - sVertexProgram = NULL; + sVertexProgram = &gSkinnedObjectSimpleProgram; gSkinnedObjectSimpleProgram.bind(); LLVertexBuffer::sWeight4Loc = gSkinnedObjectSimpleProgram.getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } @@ -591,6 +620,21 @@ void LLDrawPoolAvatar::endRigged() LLVertexBuffer::sWeight4Loc = -1; } +void LLDrawPoolAvatar::beginDeferredRigged() +{ + sVertexProgram = &gDeferredSkinnedDiffuseProgram; + sVertexProgram->bind(); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endDeferredRigged() +{ + LLVertexBuffer::unbind(); + sVertexProgram->unbind(); + LLVertexBuffer::sWeight4Loc = -1; + sVertexProgram = NULL; +} + void LLDrawPoolAvatar::beginDeferredSkinned() { sShaderLevel = mVertexShaderLevel; @@ -893,16 +937,16 @@ void LLVertexBufferAvatar::setupVertexBuffer(U32 data_mask) const glNormalPointer(GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_NORMAL])); glTexCoordPointer(2,GL_FLOAT, mStride, (void*)(base + mOffsets[TYPE_TEXCOORD0])); - set_vertex_weights(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT], mStride, (F32*)(base + mOffsets[TYPE_WEIGHT])); + set_vertex_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT], mStride, (F32*)(base + mOffsets[TYPE_WEIGHT])); if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_BUMP) { - set_binormals(sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL], mStride, (LLVector3*)(base + mOffsets[TYPE_BINORMAL])); + set_binormals(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL], mStride, (LLVector3*)(base + mOffsets[TYPE_BINORMAL])); } if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_CLOTH) { - set_vertex_clothing_weights(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING], mStride, (LLVector4*)(base + mOffsets[TYPE_CLOTHWEIGHT])); + set_vertex_clothing_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING], mStride, (LLVector4*)(base + mOffsets[TYPE_CLOTHWEIGHT])); } } else diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 45f694ccd9..b42cc54622 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -36,6 +36,7 @@ #include "lldrawpool.h" class LLVOAvatar; +class LLGLSLShader; class LLDrawPoolAvatar : public LLFacePool { @@ -100,10 +101,12 @@ public: void beginDeferredImpostor(); void beginDeferredRigid(); void beginDeferredSkinned(); + void beginDeferredRigged(); void endDeferredImpostor(); void endDeferredRigid(); void endDeferredSkinned(); + void endDeferredRigged(); /*virtual*/ LLViewerTexture *getDebugTexture(); /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display @@ -112,6 +115,7 @@ public: static BOOL sSkipOpaque; static BOOL sSkipTransparent; + static LLGLSLShader* sVertexProgram; }; class LLVertexBufferAvatar : public LLVertexBuffer diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 8a68dd6ea7..d978e856a6 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -110,6 +110,7 @@ LLGLSLShader gDeferredImpostorProgram; LLGLSLShader gDeferredEdgeProgram; LLGLSLShader gDeferredWaterProgram; LLGLSLShader gDeferredDiffuseProgram; +LLGLSLShader gDeferredSkinnedDiffuseProgram; LLGLSLShader gDeferredBumpProgram; LLGLSLShader gDeferredTerrainProgram; LLGLSLShader gDeferredTreeProgram; @@ -124,6 +125,7 @@ LLGLSLShader gDeferredBlurLightProgram; LLGLSLShader gDeferredSoftenProgram; LLGLSLShader gDeferredShadowProgram; LLGLSLShader gDeferredAvatarShadowProgram; +LLGLSLShader gDeferredAttachmentShadowProgram; LLGLSLShader gDeferredAlphaProgram; LLGLSLShader gDeferredFullbrightProgram; LLGLSLShader gDeferredGIProgram; @@ -575,6 +577,7 @@ void LLViewerShaderMgr::unloadShaders() gPostNightVisionProgram.unload(); gDeferredDiffuseProgram.unload(); + gDeferredSkinnedDiffuseProgram.unload(); mVertexShaderLevel[SHADER_LIGHTING] = 0; mVertexShaderLevel[SHADER_OBJECT] = 0; @@ -889,6 +892,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredTreeProgram.unload(); gDeferredDiffuseProgram.unload(); + gDeferredSkinnedDiffuseProgram.unload(); gDeferredBumpProgram.unload(); gDeferredImpostorProgram.unload(); gDeferredTerrainProgram.unload(); @@ -901,6 +905,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSoftenProgram.unload(); gDeferredShadowProgram.unload(); gDeferredAvatarShadowProgram.unload(); + gDeferredAttachmentShadowProgram.unload(); gDeferredAvatarProgram.unload(); gDeferredAvatarAlphaProgram.unload(); gDeferredAlphaProgram.unload(); @@ -929,6 +934,17 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredDiffuseProgram.createShader(NULL, NULL); } + if (success) + { + gDeferredSkinnedDiffuseProgram.mName = "Deferred Skinned Diffuse Shader"; + gDeferredSkinnedDiffuseProgram.mFeatures.hasObjectSkinning = true; + gDeferredSkinnedDiffuseProgram.mShaderFiles.clear(); + gDeferredSkinnedDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredSkinnedDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredSkinnedDiffuseProgram.createShader(NULL, NULL); + } + if (success) { gDeferredBumpProgram.mName = "Deferred Bump Shader"; @@ -1104,6 +1120,17 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredAvatarShadowProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); } + if (success) + { + gDeferredAttachmentShadowProgram.mName = "Deferred Attachment Shadow Shader"; + gDeferredAttachmentShadowProgram.mFeatures.hasObjectSkinning = true; + gDeferredAttachmentShadowProgram.mShaderFiles.clear(); + gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAttachmentShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredAttachmentShadowProgram.createShader(NULL, NULL); + } + if (success) { gTerrainProgram.mName = "Deferred Terrain Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 83a650cdbc..b279a59777 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -346,6 +346,7 @@ extern LLGLSLShader gDeferredImpostorProgram; extern LLGLSLShader gDeferredEdgeProgram; extern LLGLSLShader gDeferredWaterProgram; extern LLGLSLShader gDeferredDiffuseProgram; +extern LLGLSLShader gDeferredSkinnedDiffuseProgram; extern LLGLSLShader gDeferredBumpProgram; extern LLGLSLShader gDeferredTerrainProgram; extern LLGLSLShader gDeferredTreeProgram; @@ -363,6 +364,7 @@ extern LLGLSLShader gDeferredShadowProgram; extern LLGLSLShader gDeferredPostGIProgram; extern LLGLSLShader gDeferredPostProgram; extern LLGLSLShader gDeferredAvatarShadowProgram; +extern LLGLSLShader gDeferredAttachmentShadowProgram; extern LLGLSLShader gDeferredAlphaProgram; extern LLGLSLShader gDeferredFullbrightProgram; extern LLGLSLShader gDeferredAvatarAlphaProgram; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e2650d22b0..7cdbebf4d1 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3742,11 +3742,11 @@ U32 LLVOAvatar::renderSkinnedAttachments() } } - gSkinnedObjectSimpleProgram.uniformMatrix4fv("matrixPalette", + LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette", skin->mJointNames.size(), FALSE, (GLfloat*) mat[0].mMatrix); - gSkinnedObjectSimpleProgram.uniformMatrix4fv("matrixPalette[0]", + LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette[0]", skin->mJointNames.size(), FALSE, (GLfloat*) mat[0].mMatrix); -- cgit v1.2.3 From 2c07b128520ccbd748a8bf3d9dcdbbf3a7099ee3 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 22 Apr 2010 14:52:02 +0100 Subject: Stop asserting one of the markDirty paths which really happens in the wild. --- indra/newview/pipeline.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 44c95a4fd6..a36f6831c3 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1983,8 +1983,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) root->getVObj()->isAttachment()) { LLDrawable* rootparent = root->getParent(); - llassert(rootparent); // trying to catch a bad assumption - if (rootparent) // this test may not be needed, see above + if (rootparent) // this IS sometimes NULL { LLViewerObject *vobj = rootparent->getVObj(); llassert(vobj); // trying to catch a bad assumption -- cgit v1.2.3 From 8496f2673971d0b3ba0f22623d7007cd163f8b02 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 22 Apr 2010 16:28:33 +0100 Subject: Let GL errors be caught on Linux - don't know why this was disabled. --- indra/llrender/llgl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 2ee7b16cf3..7ff68fe34b 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1041,7 +1041,7 @@ void flush_glerror() void do_assert_glerror() { - if (!gGLManager.mInited) + if (LL_UNLIKELY(!gGLManager.mInited)) { LL_ERRS("RenderInit") << "GL not initialized" << LL_ENDL; } @@ -1049,10 +1049,9 @@ void do_assert_glerror() GLenum error; error = glGetError(); BOOL quit = FALSE; - while (error) + while (LL_UNLIKELY(error)) { quit = TRUE; -#ifndef LL_LINUX // *FIX: ! This should be an error for linux as well. GLubyte const * gl_error_msg = gluErrorString(error); if (NULL != gl_error_msg) { @@ -1076,7 +1075,6 @@ void do_assert_glerror() } } error = glGetError(); -#endif } if (quit) -- cgit v1.2.3 From c074404d9dbaa7ccdbd863e4a9e7e3eff97e7816 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 22 Apr 2010 14:44:34 -0500 Subject: Que? --- indra/llrender/llvertexbuffer.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 668e9e55f9..7fa47cd171 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -271,9 +271,22 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi return; } + U16* idx = ((U16*) getIndicesPointer())+indices_offset; + + if (gDebugGL && !useVBOs()) + { + for (U32 i = 0; i < count; ++i) + { + if (idx[i] < start || idx[i] > end) + { + llerrs << "Index out of range: " << idx[i] << " not in [" << start << ", " << end << "]" << llendl; + } + } + } + stop_glerror(); glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT, - ((U16*) getIndicesPointer()) + indices_offset); + idx); stop_glerror(); } -- cgit v1.2.3 From 12e0a745dd97b7bd5a10ee01dec3e5d3055b515c Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Thu, 22 Apr 2010 21:33:10 +0100 Subject: ssreflections: dampen/blur ssreflections rather more. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 3 ++- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 3 ++- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 01d18cdcde..bf5dd4155c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -299,7 +299,7 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); + float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); ref2d += vec2(checkoffset, checkoffset); ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. @@ -324,6 +324,7 @@ void main() float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); + ssshiny *= 0.3; // dampen it even more // add the two types of shiny together col += (ssshiny + dumbshiny) * spec.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 2982cd3e09..28cfc6322e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -298,7 +298,7 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); + float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); ref2d += vec2(checkoffset, checkoffset); ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. @@ -324,6 +324,7 @@ void main() float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); + ssshiny *= 0.3; // dampen it even more // add the two types of shiny together col += (ssshiny + dumbshiny) * spec.rgb; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index e1e035411b..9f94b9e8ea 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -301,7 +301,8 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); + float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); + ref2d += vec2(checkoffset, checkoffset); ref2d += tc.xy; // use as offset from destination // Get attributes from the 2D guess point. @@ -327,6 +328,7 @@ void main() float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); + ssshiny *= 0.3; // dampen it even more // add the two types of shiny together col += (ssshiny + dumbshiny) * spec.rgb; -- cgit v1.2.3 From bd216c96498585ca01e1634877d4b184f20fa45f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 22 Apr 2010 16:52:05 -0500 Subject: Fix for shadows from skyboxes hitting the ground. --- indra/llmath/llcamera.h | 2 +- indra/newview/pipeline.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index 0c81067919..d6c5f7bbb1 100644 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -143,7 +143,7 @@ private: public: LLVector3 mAgentFrustum[8]; //8 corners of 6-plane frustum F32 mFrustumCornerDist; //distance to corner of frustum against far clip plane - LLPlane getAgentPlane(U32 idx) { return mAgentPlanes[idx].p; } + LLPlane& getAgentPlane(U32 idx) { return mAgentPlanes[idx].p; } public: LLCamera(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a36f6831c3..5a173d8460 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8118,6 +8118,14 @@ void LLPipeline::generateSunShadow(LLCamera& camera) LLVector3 n = gSavedSettings.getVector3("RenderShadowNearDist"); //F32 nearDist[] = { n.mV[0], n.mV[1], n.mV[2], n.mV[2] }; + //put together a universal "near clip" plane for shadow frusta + LLPlane shadow_near_clip; + { + LLVector3 p = gAgent.getPositionAgent(); + p += mSunDir * gSavedSettings.getF32("RenderFarClip")*2.f; + shadow_near_clip.setVec(p, mSunDir); + } + LLVector3 lightDir = -mSunDir; lightDir.normVec(); @@ -8551,7 +8559,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera) LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); - shadow_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR); + //shadow_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR); + shadow_cam.getAgentPlane(LLCamera::AGENT_PLANE_NEAR).set(shadow_near_clip); //translate and scale to from [-1, 1] to [0, 1] glh::matrix4f trans(0.5f, 0.f, 0.f, 0.5f, -- cgit v1.2.3 From 5715a9269b66de59ee59637fbb09e9430bfb244f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Thu, 22 Apr 2010 23:16:39 -0500 Subject: Fix for broken shader loading behavior when Debug GL enabled. --- indra/llrender/llshadermgr.cpp | 29 +++++++++++++++++------------ indra/newview/lldrawpoolavatar.cpp | 13 ++++++++++++- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 8fc7163b83..17fc7fe120 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -391,26 +391,31 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade LL_WARNS("ShaderLoading") << "GL ERROR in glCreateShaderObjectARB: " << error << LL_ENDL; } } - else + + //load source + glShaderSourceARB(ret, count, (const GLcharARB**) text, NULL); + + if (gDebugGL) { - //load source - glShaderSourceARB(ret, count, (const GLcharARB**) text, NULL); error = glGetError(); if (error != GL_NO_ERROR) { LL_WARNS("ShaderLoading") << "GL ERROR in glShaderSourceARB: " << error << LL_ENDL; } - else + } + + //compile source + glCompileShaderARB(ret); + + if (gDebugGL) + { + error = glGetError(); + if (error != GL_NO_ERROR) { - //compile source - glCompileShaderARB(ret); - error = glGetError(); - if (error != GL_NO_ERROR) - { - LL_WARNS("ShaderLoading") << "GL ERROR in glCompileShaderARB: " << error << LL_ENDL; - } + LL_WARNS("ShaderLoading") << "GL ERROR in glCompileShaderARB: " << error << LL_ENDL; } } + //free memory for (GLuint i = 0; i < count; i++) { @@ -421,7 +426,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade //check for errors GLint success = GL_TRUE; glGetObjectParameterivARB(ret, GL_OBJECT_COMPILE_STATUS_ARB, &success); - if (gDebugGL) + if (gDebugGL || success == GL_FALSE) { error = glGetError(); if (error != GL_NO_ERROR || success == GL_FALSE) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 4b7de97101..62226383a4 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -352,7 +352,18 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) S32 LLDrawPoolAvatar::getNumPasses() { - return LLPipeline::sImpostorRender ? 1 : 4; + if (LLPipeline::sImpostorRender) + { + return 1; + } + else if (getVertexShaderLevel() > 0) + { + return 4; + } + else + { + return 3; + } } void LLDrawPoolAvatar::render(S32 pass) -- cgit v1.2.3 From 95ca4315e3791fd9748edb5fe0d76719de6854ae Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Fri, 23 Apr 2010 00:38:10 -0500 Subject: Fix for stupid shader loading mistake. --- indra/llrender/llshadermgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 17fc7fe120..0f54ebeb69 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -321,7 +321,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type) { - GLenum error; + GLenum error = GL_NO_ERROR; if (gDebugGL) { error = glGetError(); -- cgit v1.2.3 From f972cc4be952abc943f9d289533c9951ce4dc839 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 23 Apr 2010 13:37:03 +0100 Subject: Restore a bit of the non-deferred renderer's sun/moon waterglow in deferred rendering. This also adds a slight pinch of glow to shiny sun-spots. So be it. (transplanted from 5a0d9e5b5cfb2ecd96685f0275ab8e999ab86263) --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 4 +++- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 4 +++- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index bf5dd4155c..65540ad6fe 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -270,6 +270,7 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float scol = max(scol_ambocc.r, diffuse.a); float ambocc = scol_ambocc.g; + float glowresult = 0.0; calcAtmospherics(pos.xyz, ambocc); @@ -285,6 +286,7 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + glowresult = 0.08 * dot(dumbshiny.rgb, spec.rgb); // screen-space cheap fakey reflection map // @@ -334,5 +336,5 @@ void main() col = scaleSoftClip(col); gl_FragColor.rgb = col; - gl_FragColor.a = 0.0; + gl_FragColor.a = glowresult; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 28cfc6322e..67ef3d5280 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -269,6 +269,7 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float scol = max(scol_ambocc.r, diffuse.a); float ambocc = scol_ambocc.g; + float glowresult = 0.0; calcAtmospherics(pos.xyz, ambocc); @@ -284,6 +285,7 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + glowresult = 0.08 * dot(dumbshiny.rgb, spec.rgb); // screen-space cheap fakey reflection map // @@ -334,5 +336,5 @@ void main() col = scaleSoftClip(col); gl_FragColor.rgb = col; - gl_FragColor.a = 0.0; + gl_FragColor.a = glowresult; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 9f94b9e8ea..b5c6693d3b 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -272,6 +272,7 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float scol = max(scol_ambocc.r, diffuse.a); float ambocc = scol_ambocc.g; + float glowresult = 0.0; calcAtmospherics(pos.xyz, ambocc); @@ -287,6 +288,7 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; + glowresult = 0.08 * dot(dumbshiny.rgb, spec.rgb); // screen-space cheap fakey reflection map // @@ -340,7 +342,7 @@ void main() gl_FragColor.rgb = col; //gl_FragColor.rgb = gi_col.rgb; - gl_FragColor.a = 0.0; + gl_FragColor.a = glowresult; //gl_FragColor.rg = scol_ambocc.rg; //gl_FragColor.rgb = texture2DRect(lightMap, vary_fragcoord.xy).rgb; -- cgit v1.2.3 From f313196363085de2eb8f3a4fd33abeb5617204c4 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 23 Apr 2010 17:35:32 +0100 Subject: Backed out changeset 90f0ce75b2d7 --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 4 +--- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 4 +--- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 65540ad6fe..bf5dd4155c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -270,7 +270,6 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float scol = max(scol_ambocc.r, diffuse.a); float ambocc = scol_ambocc.g; - float glowresult = 0.0; calcAtmospherics(pos.xyz, ambocc); @@ -286,7 +285,6 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; - glowresult = 0.08 * dot(dumbshiny.rgb, spec.rgb); // screen-space cheap fakey reflection map // @@ -336,5 +334,5 @@ void main() col = scaleSoftClip(col); gl_FragColor.rgb = col; - gl_FragColor.a = glowresult; + gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 67ef3d5280..28cfc6322e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -269,7 +269,6 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float scol = max(scol_ambocc.r, diffuse.a); float ambocc = scol_ambocc.g; - float glowresult = 0.0; calcAtmospherics(pos.xyz, ambocc); @@ -285,7 +284,6 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; - glowresult = 0.08 * dot(dumbshiny.rgb, spec.rgb); // screen-space cheap fakey reflection map // @@ -336,5 +334,5 @@ void main() col = scaleSoftClip(col); gl_FragColor.rgb = col; - gl_FragColor.a = glowresult; + gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index b5c6693d3b..9f94b9e8ea 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -272,7 +272,6 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float scol = max(scol_ambocc.r, diffuse.a); float ambocc = scol_ambocc.g; - float glowresult = 0.0; calcAtmospherics(pos.xyz, ambocc); @@ -288,7 +287,6 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; - glowresult = 0.08 * dot(dumbshiny.rgb, spec.rgb); // screen-space cheap fakey reflection map // @@ -342,7 +340,7 @@ void main() gl_FragColor.rgb = col; //gl_FragColor.rgb = gi_col.rgb; - gl_FragColor.a = glowresult; + gl_FragColor.a = 0.0; //gl_FragColor.rg = scol_ambocc.rg; //gl_FragColor.rgb = texture2DRect(lightMap, vary_fragcoord.xy).rgb; -- cgit v1.2.3 From 64112134be2a4b46c7ade1483e3d968ea1e3e81f Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Mon, 26 Apr 2010 14:42:06 +0100 Subject: EXT-7060 default auto alpha masking to ON for deferred rendering (only deferred rendering) --- indra/newview/app_settings/settings.xml | 15 +++++++++++++-- indra/newview/lldrawpoolalpha.cpp | 2 +- indra/newview/llface.cpp | 20 ++++++++++++++++++++ indra/newview/llface.h | 2 +- indra/newview/llspatialpartition.h | 2 -- indra/newview/llviewercontrol.cpp | 3 ++- indra/newview/llviewerdisplay.cpp | 3 ++- indra/newview/llvovolume.cpp | 21 +++------------------ indra/newview/pipeline.cpp | 3 ++- indra/newview/pipeline.h | 3 ++- indra/newview/skins/default/xui/en/menu_viewer.xml | 18 ++++++++++++++---- 11 files changed, 60 insertions(+), 32 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8abb0f7106..a820d82f6f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6996,10 +6996,10 @@ <key>Value</key> <real>256.0</real> </map> - <key>RenderFastAlpha</key> + <key>RenderAutoMaskAlphaNonDeferred</key> <map> <key>Comment</key> - <string>Use alpha masks where appropriate.</string> + <string>Use alpha masks where appropriate, in the non-deferred (non-'Lighting and Shadows') graphics mode</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7007,6 +7007,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>RenderAutoMaskAlphaDeferred</key> + <map> + <key>Comment</key> + <string>Use alpha masks where appropriate, in the deferred ('Lighting and Shadows') graphics mode</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>RenderFastUI</key> <map> <key>Comment</key> diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 7fd7cd3910..def463cb41 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -182,7 +182,7 @@ void LLDrawPoolAlpha::render(S32 pass) gGL.setColorMask(true, true); - if (LLPipeline::sFastAlpha && !deferred_render) + if (LLPipeline::sAutoMaskAlphaNonDeferred && !deferred_render) { mColorSFactor = LLRender::BF_ONE; // } mColorDFactor = LLRender::BF_ZERO; // } these are like disabling blend on the color channels, but we're still blending on the alpha channel so that we can suppress glow diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index bc3e04db18..7816418dc2 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -883,6 +883,26 @@ void LLFace::updateRebuildFlags() } } + +bool LLFace::canRenderAsMask() +{ + const LLTextureEntry* te = getTextureEntry(); + return ( + ( + (LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaDeferred) || + + (!LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaNonDeferred) + ) // do we want masks at all? + && + (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha + !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid + (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask + + getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily recalculated but expensive) + ); +} + + static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom"); BOOL LLFace::getGeometryVolume(const LLVolume& volume, diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 06ec043c76..bbf8de04bc 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -139,10 +139,10 @@ public: void unsetFaceColor(); // switch back to material color const LLColor4& getFaceColor() const { return mFaceColor; } const LLColor4& getRenderColor() const; - //for volumes void updateRebuildFlags(); + bool canRenderAsMask(); // logic helper BOOL getGeometryVolume(const LLVolume& volume, const S32 &f, const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index b5e5967374..67c33d5b0f 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -628,8 +628,6 @@ class LLVolumeGeometryManager: public LLGeometryManager virtual void getGeometry(LLSpatialGroup* group); void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); - private: - bool canRenderAsMask(LLFace* facep); // logic helper }; //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 3fa6b0c8c2..33fb3d0f0f 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -532,7 +532,8 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _2)); gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _2)); gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); - gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _2)); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 5be5dc0444..18558425ac 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -596,7 +596,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLPipeline::sUseOcclusion = 3; } - LLPipeline::sFastAlpha = gSavedSettings.getBOOL("RenderFastAlpha"); + LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred"); + LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred"); LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip"); LLVOAvatar::sMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible"); LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate"); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 56fb42bb89..96f69b3676 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3042,9 +3042,7 @@ F32 LLVOVolume::getBinRadius() { LLFace* face = mDrawable->getFace(i); if (face->getPoolType() == LLDrawPool::POOL_ALPHA && - (!LLPipeline::sFastAlpha || - face->getFaceColor().mV[3] != 1.f || - !face->getTexture()->getIsAlphaMask())) + !face->canRenderAsMask()) { alpha_wrap = TRUE; break; @@ -3417,19 +3415,6 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); -bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) -{ - const LLTextureEntry* te = facep->getTextureEntry(); - return ( - LLPipeline::sFastAlpha && // do we want masks at all? - - (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha - !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid - (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - - facep->getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily calculated but expensive) - ); -} void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { @@ -3576,7 +3561,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (canRenderAsMask(facep)) + if (facep->canRenderAsMask()) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3930,7 +3915,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (is_alpha) { // can we safely treat this as an alpha mask? - if (canRenderAsMask(facep)) + if (facep->canRenderAsMask()) { if (te->getFullbright()) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5a173d8460..3df9a119bf 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -271,7 +271,8 @@ BOOL LLPipeline::sRenderHighlight = TRUE; BOOL LLPipeline::sForceOldBakedUpload = FALSE; S32 LLPipeline::sUseOcclusion = 0; BOOL LLPipeline::sDelayVBUpdate = TRUE; -BOOL LLPipeline::sFastAlpha = TRUE; +BOOL LLPipeline::sAutoMaskAlphaDeferred = TRUE; +BOOL LLPipeline::sAutoMaskAlphaNonDeferred = FALSE; BOOL LLPipeline::sDisableShaders = FALSE; BOOL LLPipeline::sRenderBump = TRUE; BOOL LLPipeline::sUseTriStrips = TRUE; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 8bdc635d05..be878ae667 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -450,7 +450,8 @@ public: static BOOL sForceOldBakedUpload; // If true will not use capabilities to upload baked textures. static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write static BOOL sDelayVBUpdate; - static BOOL sFastAlpha; + static BOOL sAutoMaskAlphaDeferred; + static BOOL sAutoMaskAlphaNonDeferred; static BOOL sDisableShaders; // if TRUE, rendering will be done without shaders static BOOL sRenderBump; static BOOL sUseTriStrips; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index bb57464741..6a5f9ed8f8 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2148,14 +2148,24 @@ parameter="RenderDebugPipeline" /> </menu_item_check> <menu_item_check - label="Fast Alpha" - name="Fast Alpha"> + label="Automatic Alpha Masks (deferred)" + name="Automatic Alpha Masks (deferred)"> <menu_item_check.on_check function="CheckControl" - parameter="RenderFastAlpha" /> + parameter="RenderAutoMaskAlphaDeferred" /> <menu_item_check.on_click function="ToggleControl" - parameter="RenderFastAlpha" /> + parameter="RenderAutoMaskAlphaDeferred" /> + </menu_item_check> + <menu_item_check + label="Automatic Alpha Masks (non-deferred)" + name="Automatic Alpha Masks (non-deferred)"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderAutoMaskAlphaNonDeferred" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="RenderAutoMaskAlphaNonDeferred" /> </menu_item_check> <menu_item_check label="Animation Textures" -- cgit v1.2.3 From 79f38a961dff09451fb1eac5f4ead1c2f36727a8 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 26 Apr 2010 11:55:48 -0500 Subject: Make LLPipeline::getVisiblePointCloud not a hot spot. Reviewed by Palmer. --- indra/newview/pipeline.cpp | 217 ++++++++++++++++++++++++++++----------------- 1 file changed, 137 insertions(+), 80 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5a173d8460..1369956eab 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7686,115 +7686,172 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLPipeline::sShadowRender = FALSE; } - +static LLFastTimer::DeclareTimer FTM_VISIBLE_CLOUD("Visible Cloud"); BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir) { + LLFastTimer t(FTM_VISIBLE_CLOUD); //get point cloud of intersection of frust and min, max - //get set of planes - std::vector<LLPlane> ps; - if (getVisibleExtents(camera, min, max)) { return FALSE; } - ps.push_back(LLPlane(min, LLVector3(-1,0,0))); - ps.push_back(LLPlane(min, LLVector3(0,-1,0))); - ps.push_back(LLPlane(min, LLVector3(0,0,-1))); - ps.push_back(LLPlane(max, LLVector3(1,0,0))); - ps.push_back(LLPlane(max, LLVector3(0,1,0))); - ps.push_back(LLPlane(max, LLVector3(0,0,1))); + //get set of planes on bounding box + std::vector<LLPlane> bp; + + bp.push_back(LLPlane(min, LLVector3(-1,0,0))); + bp.push_back(LLPlane(min, LLVector3(0,-1,0))); + bp.push_back(LLPlane(min, LLVector3(0,0,-1))); + bp.push_back(LLPlane(max, LLVector3(1,0,0))); + bp.push_back(LLPlane(max, LLVector3(0,1,0))); + bp.push_back(LLPlane(max, LLVector3(0,0,1))); + + //potential points + std::vector<LLVector3> pp; + + //add corners of AABB + pp.push_back(LLVector3(min.mV[0], min.mV[1], min.mV[2])); + pp.push_back(LLVector3(max.mV[0], min.mV[1], min.mV[2])); + pp.push_back(LLVector3(min.mV[0], max.mV[1], min.mV[2])); + pp.push_back(LLVector3(max.mV[0], max.mV[1], min.mV[2])); + pp.push_back(LLVector3(min.mV[0], min.mV[1], max.mV[2])); + pp.push_back(LLVector3(max.mV[0], min.mV[1], max.mV[2])); + pp.push_back(LLVector3(min.mV[0], max.mV[1], max.mV[2])); + pp.push_back(LLVector3(max.mV[0], max.mV[1], max.mV[2])); - /*if (!light_dir.isExactlyZero()) + //add corners of camera frustum + for (U32 i = 0; i < 8; i++) { - LLPlane ucp; - LLPlane mcp; + pp.push_back(camera.mAgentFrustum[i]); + } - F32 maxd = -1.f; - F32 mind = 1.f; - for (U32 i = 0; i < ps.size(); ++i) - { //pick the plane most aligned to lightDir for user clip plane - LLVector3 n(ps[i].mV); - F32 da = n*light_dir; - if (da > maxd) - { - maxd = da; - ucp = ps[i]; - } + //bounding box line segments + U32 bs[] = + { + 0,1, + 1,3, + 3,2, + 2,0, + + 4,5, + 5,7, + 7,6, + 6,4, + + 0,4, + 1,5, + 3,7, + 2,6 + }; + + for (U32 i = 0; i < 12; i++) + { //for each line segment in bounding box + for (U32 j = 0; j < 6; j++) + { //for each plane in camera frustum + const LLPlane& cp = camera.getAgentPlane(j); + const LLVector3& v1 = pp[bs[i*2+0]]; + const LLVector3& v2 = pp[bs[i*2+1]]; + const LLVector3 n(cp.mV); + + LLVector3 line = v1-v2; + + F32 d1 = line*n; + F32 d2 = -cp.dist(v2); + + F32 t = d2/d1; - if (da < mind) + if (t > 0.f && t < 1.f) { - mind = da; - mcp = ps[i]; + LLVector3 intersect = v2+line*t; + pp.push_back(intersect); } } - - camera.setUserClipPlane(ucp); + } - ps.clear(); - ps.push_back(ucp); - ps.push_back(mcp); - }*/ - - for (U32 i = 0; i < 6; i++) + //camera frustum line segments + const U32 fs[] = { - ps.push_back(camera.getAgentPlane(i)); - } + 0,1, + 1,2, + 2,3, + 3,1, - //get set of points where planes intersect and points are not above any plane - fp.clear(); - - for (U32 i = 0; i < ps.size(); ++i) + 4,5, + 5,6, + 6,7, + 7,4, + + 0,4, + 1,5, + 2,6, + 3,7 + }; + + LLVector3 center = (max+min)*0.5f; + LLVector3 size = (max-min)*0.5f; + + for (U32 i = 0; i < 12; i++) { - for (U32 j = 0; j < ps.size(); ++j) + for (U32 j = 0; j < 6; ++j) { - for (U32 k = 0; k < ps.size(); ++k) - { - if (i == j || - i == k || - k == j) - { - continue; - } + const LLVector3& v1 = pp[fs[i*2+0]+8]; + const LLVector3& v2 = pp[fs[i*2+1]+8]; + const LLPlane& cp = bp[j]; + const LLVector3 n(cp.mV); - LLVector3 n1,n2,n3; - F32 d1,d2,d3; + LLVector3 line = v1-v2; - n1.setVec(ps[i].mV); - n2.setVec(ps[j].mV); - n3.setVec(ps[k].mV); + F32 d1 = line*n; + F32 d2 = -cp.dist(v2); - d1 = ps[i].mV[3]; - d2 = ps[j].mV[3]; - d3 = ps[k].mV[3]; - - //get point of intersection of 3 planes "p" - LLVector3 p = (-d1*(n2%n3)-d2*(n3%n1)-d3*(n1%n2))/(n1*(n2%n3)); - - if (llround(p*n1+d1, 0.1f) == 0.f && - llround(p*n2+d2, 0.1f) == 0.f && - llround(p*n3+d3, 0.1f) == 0.f) - { //point is on all three planes - BOOL found = TRUE; - for (U32 l = 0; l < ps.size() && found; ++l) - { - if (llround(ps[l].dist(p), 0.1f) > 0.0f) - { //point is above some plane, not contained - found = FALSE; - } - } + F32 t = d2/d1; - if (found) - { - fp.push_back(p); - } - } - } + if (t > 0.f && t < 1.f) + { + LLVector3 intersect = v2+line*t; + pp.push_back(intersect); + } } } + LLVector3 ext[] = { min-LLVector3(0.05f,0.05f,0.05f), + max+LLVector3(0.05f,0.05f,0.05f) }; + + for (U32 i = 0; i < pp.size(); ++i) + { + bool found = true; + + const F32* p = pp[i].mV; + + for (U32 j = 0; j < 3; ++j) + { + if (p[j] < ext[0].mV[j] || + p[j] > ext[1].mV[j]) + { + found = false; + break; + } + } + + for (U32 j = 0; j < 6; ++j) + { + const LLPlane& cp = camera.getAgentPlane(j); + F32 dist = cp.dist(pp[i]); + if (dist > 0.05f) //point is above some plane, not contained + { + found = false; + break; + } + } + + if (found) + { + fp.push_back(pp[i]); + } + } + if (fp.empty()) { return FALSE; -- cgit v1.2.3 From 809b6879e1d89ff3bc565f3144e4cb625ccdd185 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 26 Apr 2010 17:35:52 -0500 Subject: Use 10.5 sdk --- indra/cmake/Variables.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index bfaf3f4f26..f181e5b6fd 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -81,13 +81,13 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # otherwise CMAKE_OSX_SYSROOT will be overridden here. We can't just check # for it being unset, as it gets set to the system default :( - # Default to building against the 10.4 SDK if no deployment target is + # Default to building against the 10.5 SDK if no deployment target is # specified. if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) # NOTE: setting -isysroot is NOT adequate: http://lists.apple.com/archives/Xcode-users/2007/Oct/msg00696.html # see http://public.kitware.com/Bug/view.php?id=9959 + poppy - set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.4) + set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5) endif (NOT CMAKE_OSX_DEPLOYMENT_TARGET) # GCC 4.2 is incompatible with the MacOSX 10.4 SDK -- cgit v1.2.3 From c0a2a44a44c5d6db39cfa5fdb5630578d4c2d267 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Mon, 26 Apr 2010 21:33:18 -0500 Subject: Fix for mac build. --- indra/llplugin/slplugin/slplugin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index 7d6dde1a58..b989e321f1 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -273,7 +273,7 @@ int main(int argc, char **argv) } // Check for a change in this process's frontmost window. - if(FrontWindow() != front_window) + if(ActiveNonFloatingWindow() != front_window) { ProcessSerialNumber self = { 0, kCurrentProcess }; ProcessSerialNumber parent = { 0, kNoProcess }; @@ -299,7 +299,7 @@ int main(int argc, char **argv) } } - if((FrontWindow() != NULL) && (front_window == NULL)) + if((ActiveNonFloatingWindow() != NULL) && (front_window == NULL)) { // Opening the first window @@ -311,7 +311,7 @@ int main(int argc, char **argv) if(layer_group) { - SetWindowGroup(FrontWindow(), layer_group); + SetWindowGroup(ActiveNonFloatingWindow(), layer_group); } if(parent_is_front_process) @@ -320,9 +320,9 @@ int main(int argc, char **argv) (void) SetFrontProcess( &self ); } - ActivateWindow(FrontWindow(), true); + ActivateWindow(ActiveNonFloatingWindow(), true); } - else if((FrontWindow() == NULL) && (front_window != NULL)) + else if((ActiveNonFloatingWindow() == NULL) && (front_window != NULL)) { // Closing the last window @@ -342,7 +342,7 @@ int main(int argc, char **argv) window_hack_state = 2; } - front_window = FrontWindow(); + front_window = ActiveNonFloatingWindow(); } } -- cgit v1.2.3 From 9d88673a29cd5b6ae3cadb442ff1fa850ce606bc Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 27 Apr 2010 00:13:51 -0500 Subject: Stop z-fighting in glow pass. --- indra/newview/lldrawpoolsimple.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index ca7a1b47c2..c8e6f95ab6 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -55,6 +55,10 @@ void LLDrawPoolGlow::render(S32 pass) LLFastTimer t(FTM_RENDER_GLOW); LLGLEnable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); + gGL.flush(); + /// Get rid of z-fighting with non-glow pass. + LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(-1.0f, -1.0f); gGL.setSceneBlendType(LLRender::BT_ADD); U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); -- cgit v1.2.3 From 07c0389f50ccef13ad2699e149dc4b87de3dbd70 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 27 Apr 2010 01:50:06 -0500 Subject: Proper byte ordering when decoding skin weights. --- indra/llmath/llvolume.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index fdd48b9e9e..9d2d157c76 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2028,8 +2028,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) while (joint != END_INFLUENCES) { U16 influence = weights[idx++]; - influence = influence << 8; - influence |= weights[idx++]; + influence |= ((U16) weights[idx++] << 8); F32 w = llmin((F32) influence / 65535.f, 0.99999f); face.mWeights[cur_vertex].mV[cur_influence++] = (F32) joint + w; -- cgit v1.2.3 From 31a358ac1dd059f62547aa0a0f7b708333045d58 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 27 Apr 2010 02:53:50 -0500 Subject: Fix for crash when logging in next to folks wearing rigged attachments. --- indra/newview/llface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 7816418dc2..7866e49bae 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1365,7 +1365,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, *binormals++ = binormal; } - if (rebuild_weights) + if (rebuild_weights && vf.mWeights.size() > i) { *weights++ = vf.mWeights[i]; } -- cgit v1.2.3 From d71716aa6dde434b6356cfe85e3a8fce376056dd Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Wed, 28 Apr 2010 02:53:12 -0500 Subject: Make LLVolume::createSide a little faster. --- indra/llmath/llvolume.cpp | 82 ++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 9d2d157c76..5ffc61ce9c 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -87,6 +87,8 @@ const F32 SKEW_MAX = 0.95f; const F32 SCULPT_MIN_AREA = 0.002f; const S32 SCULPT_MIN_AREA_DETAIL = 1; +#define GEN_TRI_STRIP 0 + BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm) { LLVector3 test = (pt2-pt1)%(pt3-pt2); @@ -5079,7 +5081,9 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) if (!partial_build) { +#if GEN_TRI_STRIP mTriStrip.clear(); +#endif S32 idxs[] = {0,1,(grid_size+1)+1,(grid_size+1)+1,(grid_size+1),0}; for(S32 gx = 0;gx<grid_size;gx++) { @@ -5093,6 +5097,7 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) mIndices.push_back(vtop+(gy*(grid_size+1))+gx+idxs[i]); } +#if GEN_TRI_STRIP if (gy == 0) { mTriStrip.push_back((gx+1)*(grid_size+1)); @@ -5108,6 +5113,7 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) { mTriStrip.push_back(gy+1+gx*(grid_size+1)); } +#endif } else { @@ -5116,6 +5122,7 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) mIndices.push_back(vtop+(gy*(grid_size+1))+gx+idxs[i]); } +#if GEN_TRI_STRIP if (gy == 0) { mTriStrip.push_back(gx*(grid_size+1)); @@ -5130,15 +5137,18 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) { mTriStrip.push_back(gy+1+(gx+1)*(grid_size+1)); } +#endif } } } +#if GEN_TRI_STRIP if (mTriStrip.size()%2 == 1) { mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } +#endif } return TRUE; @@ -5508,6 +5518,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) mIndices[3*i+v2] = i + 1; } +#if GEN_TRI_STRIP //make tri strip if (mTypeMask & OPEN_MASK) { @@ -5550,6 +5561,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } } +#endif } return TRUE; @@ -5557,6 +5569,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) void LLVolumeFace::makeTriStrip() { +#if GEN_TRI_STRIP for (U32 i = 0; i < mIndices.size(); i+=3) { U16 i0 = mIndices[i]; @@ -5585,6 +5598,7 @@ void LLVolumeFace::makeTriStrip() { mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } +#endif } void LLVolumeFace::createBinormals() @@ -5710,12 +5724,6 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mHasBinormals = FALSE; } - - LLVector3& face_min = mExtents[0]; - LLVector3& face_max = mExtents[1]; - - mCenter.clearVec(); - S32 begin_stex = llfloor( profile[mBeginS].mV[2] ); S32 num_s = ((mTypeMask & INNER_MASK) && (mTypeMask & FLAT_MASK) && mNumS > 2) ? mNumS/2 : mNumS; @@ -5771,15 +5779,6 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mVertices[cur_vertex].mNormal = LLVector3(0,0,0); mVertices[cur_vertex].mBinormal = LLVector3(0,0,0); - - if (cur_vertex == 0) - { - face_min = face_max = mesh[i].mPos; - } - else - { - update_min_max(face_min, face_max, mesh[i].mPos); - } cur_vertex++; @@ -5813,12 +5812,22 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mVertices[cur_vertex].mNormal = LLVector3(0,0,0); mVertices[cur_vertex].mBinormal = LLVector3(0,0,0); - update_min_max(face_min,face_max,mesh[i].mPos); - cur_vertex++; } } + + //get bounding box for this side + LLVector3& face_min = mExtents[0]; + LLVector3& face_max = mExtents[1]; + mCenter.clearVec(); + + face_min = face_max = mVertices[0].mPosition; + for (U32 i = 1; i < mVertices.size(); ++i) + { + update_min_max(face_min, face_max, mVertices[i].mPosition); + } + mCenter = (face_min + face_max) * 0.5f; S32 cur_index = 0; @@ -5827,13 +5836,17 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) if (!partial_build) { +#if GEN_TRI_STRIP mTriStrip.clear(); +#endif // Now we generate the indices. for (t = 0; t < (mNumT-1); t++) { +#if GEN_TRI_STRIP //prepend terminating index to strip mTriStrip.push_back(mNumS*t); +#endif for (s = 0; s < (mNumS-1); s++) { @@ -5844,6 +5857,7 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mIndices[cur_index++] = s+1 + mNumS*t; //bottom right mIndices[cur_index++] = s+1 + mNumS*(t+1); //top right +#if GEN_TRI_STRIP if (s == 0) { mTriStrip.push_back(s+mNumS*t); @@ -5851,6 +5865,7 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } mTriStrip.push_back(s+1+mNumS*t); mTriStrip.push_back(s+1+mNumS*(t+1)); +#endif mEdge[cur_edge++] = (mNumS-1)*2*t+s*2+1; //bottom left/top right neighbor face if (t < mNumT-2) { //top right/top left neighbor face @@ -5892,44 +5907,37 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } mEdge[cur_edge++] = (mNumS-1)*2*t+s*2; //top right/bottom left neighbor face } +#if GEN_TRI_STRIP //append terminating vertex to strip mTriStrip.push_back(mNumS-1+mNumS*(t+1)); +#endif } +#if GEN_TRI_STRIP if (mTriStrip.size()%2 == 1) { mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } +#endif } //generate normals for (U32 i = 0; i < mIndices.size()/3; i++) //for each triangle { - const S32 i0 = mIndices[i*3+0]; - const S32 i1 = mIndices[i*3+1]; - const S32 i2 = mIndices[i*3+2]; - const VertexData& v0 = mVertices[i0]; - const VertexData& v1 = mVertices[i1]; - const VertexData& v2 = mVertices[i2]; + const U16* idx = &(mIndices[i*3]); + + VertexData* v[] = + { &mVertices[idx[0]], &mVertices[idx[1]], &mVertices[idx[2]] }; //calculate triangle normal - LLVector3 norm = (v0.mPosition-v1.mPosition) % (v0.mPosition-v2.mPosition); + LLVector3 norm = (v[0]->mPosition-v[1]->mPosition) % (v[0]->mPosition-v[2]->mPosition); - for (U32 j = 0; j < 3; j++) - { //add triangle normal to vertices - const S32 idx = mIndices[i*3+j]; - mVertices[idx].mNormal += norm; // * (weight_sum - d[j])/weight_sum; - } + v[0]->mNormal += norm; + v[1]->mNormal += norm; + v[2]->mNormal += norm; //even out quad contributions - if ((i & 1) == 0) - { - mVertices[i2].mNormal += norm; - } - else - { - mVertices[i1].mNormal += norm; - } + v[i%2+1]->mNormal += norm; } // adjust normals based on wrapping and stitching -- cgit v1.2.3 From 4f46e777a501ff0bfedaf657ac6decdeba8acbe5 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 30 Apr 2010 09:45:44 +0100 Subject: EXT-7149 objects with white color and varied texture do not appear shiny with deferred rendering (transplanted from 778a5a83ef4e5e70652fbc00f2e1f8375e587afc) --- indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index 5895ebda84..59b1720578 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -11,8 +11,9 @@ varying vec3 vary_normal; void main() { - vec3 col = texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; - gl_FragData[0] = vec4(gl_Color.rgb*col, 0.0); - gl_FragData[1] = vec4(col*(gl_Color.a*1.5), gl_Color.a); + vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; + gl_FragData[0] = vec4(col, 0.0); + gl_FragData[1] = vec4(gl_Color.aaa*1.5, gl_Color.a); // spec + //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); } -- cgit v1.2.3 From 41afe80984ee6d0363032193ea4a5d3eb867b3b1 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 30 Apr 2010 10:40:27 +0100 Subject: more tweakery for EXT-7149 objects with white color and varied texture do not appear shiny with deferred rendering (transplanted from 36680184ec50ecf5fff92ee33db711b7512d923a) --- indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index 59b1720578..112103956d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -13,7 +13,7 @@ void main() { vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = vec4(gl_Color.aaa*1.5, gl_Color.a); // spec + gl_FragData[1] = gl_Color.aaaa; // spec //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); } -- cgit v1.2.3 From cf258fa9defe5559678aa8417233f0e7882b7c32 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 30 Apr 2010 11:58:45 +0100 Subject: expand EXT-7149 fix to include bumpyshiny. (transplanted from 57e136beedee9122dbbf46a1d91f6514f058b829) --- indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl index 1c29dae5f7..6e38caf5ef 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl @@ -14,14 +14,15 @@ varying vec3 vary_mat2; void main() { - vec3 col = texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; + vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; vec3 norm = texture2D(bumpMap, gl_TexCoord[0].xy).rgb * 2.0 - 1.0; vec3 tnorm = vec3(dot(norm,vary_mat0), - dot(norm,vary_mat1), - dot(norm,vary_mat2)); + dot(norm,vary_mat1), + dot(norm,vary_mat2)); - gl_FragData[0] = vec4(gl_Color.rgb*col, 0.0); - gl_FragData[1] = vec4(col*gl_Color.a, gl_Color.a); + gl_FragData[0] = vec4(col, 0.0); + gl_FragData[1] = gl_Color.aaaa; // spec + //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested gl_FragData[2] = vec4(normalize(tnorm)*0.5+0.5, 0.0); } -- cgit v1.2.3 From b0fa1e011f14356b3634f39d32f43e244b6f1298 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Fri, 30 Apr 2010 13:50:59 +0100 Subject: EXT-7162 90% transparent textures are invisible when Lighting and Shadows are enabled (transplanted from 0aaf4b4676f27560cc436d0ff74b7d812a1e6662) --- indra/llrender/llimagegl.cpp | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 00f0fd5b9a..2f02ccf30b 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1653,6 +1653,7 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h) } U32 length = w * h; + U32 alphatotal = 0; U32 sample[16]; memset(sample, 0, sizeof(U32)*16); @@ -1672,11 +1673,15 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h) const GLubyte* current = rowstart; for (U32 x = 0; x < w; x+=2) { - U32 s1 = current[0]; - U32 s2 = current[w * mAlphaStride]; + const U32 s1 = current[0]; + alphatotal += s1; + const U32 s2 = current[w * mAlphaStride]; + alphatotal += s2; current += mAlphaStride; - U32 s3 = current[0]; - U32 s4 = current[w * mAlphaStride]; + const U32 s3 = current[0]; + alphatotal += s3; + const U32 s4 = current[w * mAlphaStride]; + alphatotal += s4; current += mAlphaStride; ++sample[s1/16]; @@ -1684,19 +1689,23 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h) ++sample[s3/16]; ++sample[s4/16]; - sample[(s1+s2+s3+s4)/(16 * 4)] += 4; + const U32 asum = (s1+s2+s3+s4); + alphatotal += asum; + sample[asum/(16*4)] += 4; } rowstart += 2 * w * mAlphaStride; } - length += length; + length *= 2; // we sampled everything twice, essentially } else { const GLubyte* current = ((const GLubyte*) data_in) + mAlphaOffset; for (U32 i = 0; i < length; i++) { - ++sample[*current/16]; + const U32 s1 = *current; + alphatotal += s1; + ++sample[s1/16]; current += mAlphaStride; } } @@ -1704,15 +1713,31 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h) // if more than 1/16th of alpha samples are mid-range, this // shouldn't be treated as a 1-bit mask + // also, if all of the alpha samples are clumped on one half + // of the range (but not at an absolute extreme), then consider + // this to be an intentional effect and don't treat as a mask. + U32 midrangetotal = 0; for (U32 i = 4; i < 11; i++) { midrangetotal += sample[i]; } + U32 lowerhalftotal = 0; + for (U32 i = 0; i < 8; i++) + { + lowerhalftotal += sample[i]; + } + U32 upperhalftotal = 0; + for (U32 i = 8; i < 16; i++) + { + upperhalftotal += sample[i]; + } - if (midrangetotal > length/16) + if (midrangetotal > length/16 || // lots of midrange, or + (lowerhalftotal == length && alphatotal != 0) || // all close to transparent but not all totally transparent, or + (upperhalftotal == length && alphatotal != 255*length)) // all close to opaque but not all totally opaque { - mIsMask = FALSE; + mIsMask = FALSE; // not suitable for masking } else { -- cgit v1.2.3 From f324787a70b8fccc7a8ea202805bf726fba765a7 Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 1 May 2010 00:45:44 -0500 Subject: Rigged attachment integration WIP. --- indra/llrender/llglslshader.cpp | 2 +- .../shaders/class1/deferred/diffuseV.glsl | 2 +- indra/newview/lldrawpool.cpp | 5 - indra/newview/lldrawpool.h | 2 - indra/newview/lldrawpoolavatar.cpp | 244 ++++++++++++++++++++- indra/newview/lldrawpoolavatar.h | 42 +++- indra/newview/lldrawpoolbump.cpp | 54 +++-- indra/newview/lldrawpoolbump.h | 4 + indra/newview/llface.cpp | 5 + indra/newview/llface.h | 1 + indra/newview/llviewerobject.cpp | 19 ++ indra/newview/llviewerobject.h | 1 + indra/newview/llviewershadermgr.cpp | 27 ++- indra/newview/llviewershadermgr.h | 1 + indra/newview/llvoavatar.cpp | 99 +-------- indra/newview/llvovolume.cpp | 66 +++++- 16 files changed, 440 insertions(+), 134 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 949057df04..9256e3959c 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -124,7 +124,7 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes, { GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second); LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL; - if (mShaderLevel > 0) + if (shaderhandle > 0) { attachObject(shaderhandle); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl index 44468cdfa2..b458842657 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl @@ -13,7 +13,7 @@ void main() gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - vary_normal = normalize(gl_NormalMatrix * gl_Normal); + vary_nomral = normalize(gl_NormalMatrix * gl_Normal); gl_FrontColor = gl_Color; } diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index ae30af3647..a99b80d618 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -248,11 +248,6 @@ void LLFacePool::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures { } -BOOL LLFacePool::moveFace(LLFace *face, LLDrawPool *poolp, BOOL copy_data) -{ - return TRUE; -} - // static S32 LLFacePool::drawLoop(face_array_t& face_list) { diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 67870c10e9..e46d503db3 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -187,8 +187,6 @@ public: virtual void resetDrawOrders(); void resetAll(); - BOOL moveFace(LLFace *face, LLDrawPool *poolp, BOOL copy_data = FALSE); - void destroy(); void buildEdges(); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 62226383a4..02c7e3bb6f 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -39,13 +39,17 @@ #include "m3math.h" #include "lldrawable.h" +#include "lldrawpoolbump.h" #include "llface.h" +#include "llmeshrepository.h" #include "llsky.h" #include "llviewercamera.h" #include "llviewerregion.h" #include "noise.h" #include "pipeline.h" #include "llviewershadermgr.h" +#include "llvovolume.h" +#include "llvolume.h" #include "llappviewer.h" #include "llrendersphere.h" #include "llviewerpartsim.h" @@ -94,6 +98,8 @@ static BOOL sRenderingSkinned = FALSE; S32 normal_channel = -1; S32 specular_channel = -1; S32 diffuse_channel = -1; +S32 cube_channel = -1; + static LLFastTimer::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow"); @@ -358,7 +364,7 @@ S32 LLDrawPoolAvatar::getNumPasses() } else if (getVertexShaderLevel() > 0) { - return 4; + return 5; } else { @@ -402,7 +408,10 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) beginSkinned(); break; case 3: - beginRigged(); + beginRiggedSimple(); + break; + case 4: + beginRiggedShinySimple(); break; } } @@ -429,7 +438,10 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) endSkinned(); break; case 3: - endRigged(); + endRiggedSimple(); + break; + case 4: + endRiggedShinySimple(); break; } } @@ -616,14 +628,15 @@ void LLDrawPoolAvatar::endSkinned() gGL.getTexUnit(0)->activate(); } -void LLDrawPoolAvatar::beginRigged() +void LLDrawPoolAvatar::beginRiggedSimple() { sVertexProgram = &gSkinnedObjectSimpleProgram; + diffuse_channel = 0; gSkinnedObjectSimpleProgram.bind(); LLVertexBuffer::sWeight4Loc = gSkinnedObjectSimpleProgram.getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } -void LLDrawPoolAvatar::endRigged() +void LLDrawPoolAvatar::endRiggedSimple() { sVertexProgram = NULL; LLVertexBuffer::unbind(); @@ -631,6 +644,23 @@ void LLDrawPoolAvatar::endRigged() LLVertexBuffer::sWeight4Loc = -1; } +void LLDrawPoolAvatar::beginRiggedShinySimple() +{ + sVertexProgram = &gSkinnedObjectShinySimpleProgram; + sVertexProgram->bind(); + LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, diffuse_channel, cube_channel, false); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endRiggedShinySimple() +{ + LLVertexBuffer::unbind(); + LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, diffuse_channel, cube_channel, false); + sVertexProgram->unbind(); + sVertexProgram = NULL; + LLVertexBuffer::sWeight4Loc = -1; +} + void LLDrawPoolAvatar::beginDeferredRigged() { sVertexProgram = &gDeferredSkinnedDiffuseProgram; @@ -790,9 +820,16 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) if (pass == 3) { - avatarp->renderSkinnedAttachments(); + renderRiggedSimple(avatarp); + return; + } + + if (pass == 4) + { + renderRiggedShinySimple(avatarp); return; } + if (sShaderLevel > 0) { @@ -830,13 +867,146 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } } +void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face, U32 data_mask) +{ + LLVertexBuffer* buff = face->mVertexBuffer; + + if (!buff || + !buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) || + buff->getRequestedVerts() != vol_face.mVertices.size()) + { + face->setGeomIndex(0); + face->setIndicesIndex(0); + face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size()); + + face->mVertexBuffer = new LLVertexBuffer(data_mask, 0); + face->mVertexBuffer->allocateBuffer(vol_face.mVertices.size(), vol_face.mIndices.size(), true); + + U16 offset = 0; + + LLMatrix4 mat_vert = skin->mBindShapeMatrix; + glh::matrix4f m((F32*) mat_vert.mMatrix); + m = m.inverse().transpose(); + + F32 mat3[] = + { m.m[0], m.m[1], m.m[2], + m.m[4], m.m[5], m.m[6], + m.m[8], m.m[9], m.m[10] }; + + LLMatrix3 mat_normal(mat3); + + face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true); + buff = face->mVertexBuffer; + } +} + +void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask) +{ + for (U32 i = 0; i < mRiggedFace[type].size(); ++i) + { + LLFace* face = mRiggedFace[type][i]; + LLDrawable* drawable = face->getDrawable(); + if (!drawable) + { + continue; + } + + LLVOVolume* vobj = drawable->getVOVolume(); + + if (!vobj) + { + continue; + } + + LLVolume* volume = vobj->getVolume(); + S32 te = face->getTEOffset(); + + if (!volume || volume->getNumVolumeFaces() <= te) + { + continue; + } + + LLUUID mesh_id = volume->getParams().getSculptID(); + if (mesh_id.isNull()) + { + continue; + } + + const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id); + if (!skin) + { + continue; + } + + const LLVolumeFace& vol_face = volume->getVolumeFace(te); + updateRiggedFaceVertexBuffer(face, skin, volume, vol_face, data_mask); + + LLVertexBuffer* buff = face->mVertexBuffer; + + if (buff) + { + LLMatrix4 mat[64]; + + for (U32 i = 0; i < skin->mJointNames.size(); ++i) + { + LLJoint* joint = avatar->getJoint(skin->mJointNames[i]); + if (joint) + { + mat[i] = skin->mInvBindMatrix[i]; + mat[i] *= joint->getWorldMatrix(); + } + } + + LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette", + skin->mJointNames.size(), + FALSE, + (GLfloat*) mat[0].mMatrix); + LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette[0]", + skin->mJointNames.size(), + FALSE, + (GLfloat*) mat[0].mMatrix); + + buff->setBuffer(data_mask); + + U16 start = face->getGeomStart(); + U16 end = start + face->getGeomCount()-1; + S32 offset = face->getIndicesStart(); + U32 count = face->getIndicesCount(); + + gGL.getTexUnit(0)->bind(face->getTexture()); + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); + } + } +} + +void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar) +{ + const U32 data_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_NORMAL | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4; + + renderRigged(avatar, RIGGED_SIMPLE, data_mask); +} + + +void LLDrawPoolAvatar::renderRiggedShinySimple(LLVOAvatar* avatar) +{ + const U32 data_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_NORMAL | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4; + + renderRigged(avatar, RIGGED_SHINY_SIMPLE, data_mask); +} + //----------------------------------------------------------------------------- // renderForSelect() //----------------------------------------------------------------------------- void LLDrawPoolAvatar::renderForSelect() { - - if (mDrawFace.empty()) { return; @@ -930,6 +1100,64 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const return LLColor3(0.f, 1.f, 0.f); } +void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) +{ + if (facep->getReferenceIndex() != -1) + { + llerrs << "Tried to add a rigged face that's referenced elsewhere." << llendl; + } + + if (type >= NUM_RIGGED_PASSES) + { + llerrs << "Invalid rigged face type." << llendl; + } + + facep->setReferenceIndex(mRiggedFace[type].size()); + facep->mDrawPoolp = this; + mRiggedFace[type].push_back(facep); +} + +void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep, U32 type) +{ + S32 index = facep->getReferenceIndex(); + if (index == -1) + { + llerrs << "Tried to remove rigged face with invalid index." << llendl; + } + + if (type > RIGGED_UNKNOWN) + { + llerrs << "Invalid rigged face type." << llendl; + } + + facep->setReferenceIndex(-1); + facep->mDrawPoolp = NULL; + + if (type == RIGGED_UNKNOWN) + { + for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) + { + if (mRiggedFace[i].size() > index && mRiggedFace[i][index] == facep) + { + type = i; + break; + } + } + } + + if (type >= NUM_RIGGED_PASSES) + { + llerrs << "Could not find face for removal from current drawpool." << llendl; + } + + mRiggedFace[type].erase(mRiggedFace[type].begin()+index); + + for (S32 i = index; i < mRiggedFace[type].size(); ++i) + { //bump indexes of currently held faces down after removal + mRiggedFace[type][i]->setReferenceIndex(i); + } +} + LLVertexBufferAvatar::LLVertexBufferAvatar() : LLVertexBuffer(sDataMask, GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index b42cc54622..0ebb035f2a 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -37,6 +37,11 @@ class LLVOAvatar; class LLGLSLShader; +class LLFace; +class LLMeshSkinInfo; +class LLVolume; +class LLVolumeFace; + class LLDrawPoolAvatar : public LLFacePool { @@ -91,12 +96,14 @@ public: void beginRigid(); void beginImpostor(); void beginSkinned(); - void beginRigged(); - + void beginRiggedSimple(); + void beginRiggedShinySimple(); + void endRigid(); void endImpostor(); void endSkinned(); - void endRigged(); + void endRiggedSimple(); + void endRiggedShinySimple(); void beginDeferredImpostor(); void beginDeferredRigid(); @@ -108,11 +115,40 @@ public: void endDeferredSkinned(); void endDeferredRigged(); + void updateRiggedFaceVertexBuffer(LLFace* facep, + const LLMeshSkinInfo* skin, + LLVolume* volume, + const LLVolumeFace& vol_face, + U32 data_mask); + + void renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask); + void renderRiggedSimple(LLVOAvatar* avatar); + void renderRiggedShinySimple(LLVOAvatar* avatar); + /*virtual*/ LLViewerTexture *getDebugTexture(); /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display void renderAvatars(LLVOAvatar *single_avatar, S32 pass = -1); // renders only one avatar if single_avatar is not null. + typedef enum + { + RIGGED_SIMPLE = 0, + RIGGED_SHINY_SIMPLE, + RIGGED_SHINY_FULLBRIGHT, + RIGGED_SHINY_BUMP, + RIGGED_BUMP, + RIGGED_FULLBRIGHT, + RIGGED_ALPHA, + NUM_RIGGED_PASSES, + RIGGED_UNKNOWN, + } eRiggedPass; + + + void addRiggedFace(LLFace* facep, U32 type); + void removeRiggedFace(LLFace* facep, U32 type = RIGGED_UNKNOWN); + + std::vector<LLFace*> mRiggedFace[NUM_RIGGED_PASSES]; + static BOOL sSkipOpaque; static BOOL sSkipTransparent; static LLGLSLShader* sVertexProgram; diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 8f3e775976..2f449fa42f 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -323,30 +323,43 @@ void LLDrawPoolBump::beginShiny(bool invisible) sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD0; } - if (LLPipeline::sUnderWaterRender) + if (getVertexShaderLevel() > 0) { - shader = &gObjectShinyWaterProgram; + if (LLPipeline::sUnderWaterRender) + { + shader = &gObjectShinyWaterProgram; + } + else + { + shader = &gObjectShinyProgram; + } + shader->bind(); } else { - shader = &gObjectShinyProgram; + shader = NULL; } + bindCubeMap(shader, mVertexShaderLevel, diffuse_channel, cube_channel, invisible); +} + +//static +void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel, bool invisible) +{ LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; if( cube_map ) { - if (!invisible && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 0 ) + if (!invisible && shader ) { LLMatrix4 mat; mat.initRows(LLVector4(gGLModelView+0), LLVector4(gGLModelView+4), LLVector4(gGLModelView+8), LLVector4(gGLModelView+12)); - shader->bind(); LLVector3 vec = LLVector3(gShinyOrigin) * mat; LLVector4 vec4(vec, gShinyOrigin.mV[3]); shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV); - if (mVertexShaderLevel > 1) + if (shader_level > 1) { cube_map->setMatrix(1); // Make sure that texture coord generation happens for tex unit 1, as that's the one we use for @@ -408,22 +421,16 @@ void LLDrawPoolBump::renderShiny(bool invisible) } } -void LLDrawPoolBump::endShiny(bool invisible) +//static +void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel, bool invisible) { - LLFastTimer t(FTM_RENDER_SHINY); - if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))|| - (invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY))) - { - return; - } - LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; if( cube_map ) { cube_map->disable(); cube_map->restoreMatrix(); - if (!invisible && mVertexShaderLevel > 1) + if (!invisible && shader_level > 1) { shader->disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); @@ -434,7 +441,6 @@ void LLDrawPoolBump::endShiny(bool invisible) shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); } } - shader->unbind(); } } gGL.getTexUnit(diffuse_channel)->disable(); @@ -442,6 +448,22 @@ void LLDrawPoolBump::endShiny(bool invisible) gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); +} + +void LLDrawPoolBump::endShiny(bool invisible) +{ + LLFastTimer t(FTM_RENDER_SHINY); + if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))|| + (invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY))) + { + return; + } + + unbindCubeMap(shader, mVertexShaderLevel, diffuse_channel, cube_channel, invisible); + if (shader) + { + shader->unbind(); + } diffuse_channel = -1; cube_channel = 0; diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index 2019f1df26..89bbefe778 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -41,6 +41,7 @@ class LLImageRaw; class LLSpatialGroup; class LLDrawInfo; +class LLGLSLShader; class LLViewerFetchedTexture; class LLDrawPoolBump : public LLRenderPass @@ -79,6 +80,9 @@ public: void renderBump(); void endBump(); + static void bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel, bool invisible); + static void unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel, bool invisible); + virtual S32 getNumDeferredPasses(); /*virtual*/ void beginDeferredPass(S32 pass); /*virtual*/ void endDeferredPass(S32 pass); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 7866e49bae..0e0b8447ca 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -205,7 +205,12 @@ void LLFace::destroy() if (mDrawPoolp) { LLFastTimer t(FTM_DESTROY_DRAWPOOL); + + if (this->isState(LLFace::RIGGED) && mDrawPoolp->getType() == LLDrawPool::POOL_AVATAR) mDrawPoolp->removeFace(this); + + + mDrawPoolp = NULL; } diff --git a/indra/newview/llface.h b/indra/newview/llface.h index bbf8de04bc..2b8fdf2e58 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -234,6 +234,7 @@ public: private: friend class LLGeometryManager; friend class LLVolumeGeometryManager; + friend class LLDrawPoolAvatar; U32 mState; LLFacePool* mDrawPoolp; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6bd3ceb8a8..3aecd0175d 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5219,6 +5219,25 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif return ; } +//virtual +LLVOAvatar* LLViewerObject::getAvatar() const +{ + if (isAttachment()) + { + LLViewerObject* vobj = (LLViewerObject*) getParent(); + + while (vobj && !vobj->asAvatar()) + { + vobj = (LLViewerObject*) vobj->getParent(); + } + + return (LLVOAvatar*) vobj; + } + + return NULL; +} + + class ObjectPhysicsProperties : public LLHTTPNode { public: diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 594d7a0827..0fd0cbfa60 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -181,6 +181,7 @@ public: void setOnActiveList(BOOL on_active) { mOnActiveList = on_active; } virtual BOOL isAttachment() const { return FALSE; } + virtual LLVOAvatar* getAvatar() const; //get the avatar this object is attached to, or NULL if object is not an attachment virtual BOOL isHUDAttachment() const { return FALSE; } virtual void updateRadius() {}; virtual F32 getVObjRadius() const; // default implemenation is mDrawable->getRadius() diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index d978e856a6..fe68d6eaa4 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -79,6 +79,7 @@ LLGLSLShader gObjectShinyWaterProgram; //object hardware skinning shaders LLGLSLShader gSkinnedObjectSimpleProgram; +LLGLSLShader gSkinnedObjectShinySimpleProgram; //environment shaders LLGLSLShader gTerrainProgram; @@ -154,6 +155,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gObjectFullbrightProgram); mShaderList.push_back(&gObjectFullbrightShinyProgram); mShaderList.push_back(&gSkinnedObjectSimpleProgram); + mShaderList.push_back(&gSkinnedObjectShinySimpleProgram); mShaderList.push_back(&gTerrainProgram); mShaderList.push_back(&gTerrainWaterProgram); mShaderList.push_back(&gObjectSimpleWaterProgram); @@ -505,6 +507,9 @@ void LLViewerShaderMgr::setShaders() if (!loadShadersDeferred()) { gSavedSettings.setBOOL("RenderDeferred", FALSE); + reentrance = false; + setShaders(); + return; } #endif } @@ -557,6 +562,8 @@ void LLViewerShaderMgr::unloadShaders() gObjectShinyWaterProgram.unload(); gSkinnedObjectSimpleProgram.unload(); + gSkinnedObjectShinySimpleProgram.unload(); + gWaterProgram.unload(); gUnderWaterProgram.unload(); @@ -917,7 +924,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredGIProgram.unload(); gDeferredGIFinalProgram.unload(); gDeferredWaterProgram.unload(); - return FALSE; + return TRUE; } mVertexShaderLevel[SHADER_AVATAR] = 1; @@ -1251,6 +1258,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightProgram.unload(); gObjectFullbrightWaterProgram.unload(); gSkinnedObjectSimpleProgram.unload(); + gSkinnedObjectShinySimpleProgram.unload(); + return FALSE; } @@ -1376,6 +1385,22 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gSkinnedObjectSimpleProgram.createShader(NULL, NULL); } + if (success) + { + gSkinnedObjectShinySimpleProgram.mName = "Skinned Shiny Simple Shader"; + gSkinnedObjectShinySimpleProgram.mFeatures.calculatesLighting = true; + gSkinnedObjectShinySimpleProgram.mFeatures.calculatesAtmospherics = true; + gSkinnedObjectShinySimpleProgram.mFeatures.hasGamma = true; + gSkinnedObjectShinySimpleProgram.mFeatures.hasAtmospherics = true; + gSkinnedObjectShinySimpleProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectShinySimpleProgram.mFeatures.isShiny = true; + gSkinnedObjectShinySimpleProgram.mShaderFiles.clear(); + gSkinnedObjectShinySimpleProgram.mShaderFiles.push_back(make_pair("objects/shinySimpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gSkinnedObjectShinySimpleProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSkinnedObjectShinySimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gSkinnedObjectShinySimpleProgram.createShader(NULL, &mShinyUniforms); + } + if( !success ) { mVertexShaderLevel[SHADER_OBJECT] = 0; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index b279a59777..beac5462e2 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -315,6 +315,7 @@ extern LLGLSLShader gObjectShinyProgram; extern LLGLSLShader gObjectShinyWaterProgram; extern LLGLSLShader gSkinnedObjectSimpleProgram; +extern LLGLSLShader gSkinnedObjectShinySimpleProgram; //environment shaders extern LLGLSLShader gTerrainProgram; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7cdbebf4d1..c51a7d9cbb 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3642,7 +3642,7 @@ bool LLVOAvatar::shouldAlphaMask() U32 LLVOAvatar::renderSkinnedAttachments() { - U32 num_indices = 0; + /*U32 num_indices = 0; const U32 data_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | @@ -3670,107 +3670,14 @@ U32 LLVOAvatar::renderSkinnedAttachments() LLFace* face = drawable->getFace(i); if (face->isState(LLFace::RIGGED)) { - LLVolume* volume = attached_object->getVolume(); - if (!volume || volume->getNumVolumeFaces() <= i) - { - continue; - } - - const LLVolumeFace& vol_face = volume->getVolumeFace(i); - - const LLMeshSkinInfo* skin = NULL; - LLVertexBuffer* buff = face->mVertexBuffer; - LLUUID mesh_id = volume->getParams().getSculptID();; - - if (!buff || - !buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) || - buff->getRequestedVerts() != vol_face.mVertices.size()) - { - face->mVertexBuffer = NULL; - face->mLastVertexBuffer = NULL; - buff = NULL; - - if (mesh_id.notNull()) - { - skin = gMeshRepo.getSkinInfo(mesh_id); - if (skin) - { - face->mVertexBuffer = new LLVertexBuffer(data_mask, 0); - face->mVertexBuffer->allocateBuffer(vol_face.mVertices.size(), vol_face.mIndices.size(), true); - - face->setGeomIndex(0); - face->setIndicesIndex(0); - face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size()); - - U16 offset = 0; - - LLMatrix4 mat_vert = skin->mBindShapeMatrix; - glh::matrix4f m((F32*) mat_vert.mMatrix); - m = m.inverse().transpose(); - - F32 mat3[] = - { m.m[0], m.m[1], m.m[2], - m.m[4], m.m[5], m.m[6], - m.m[8], m.m[9], m.m[10] }; - - LLMatrix3 mat_normal(mat3); - - face->getGeometryVolume(*volume, i, mat_vert, mat_normal, offset, true); - buff = face->mVertexBuffer; - } - } - } - if (buff && mesh_id.notNull()) - { - if (!skin) - { - skin = gMeshRepo.getSkinInfo(mesh_id); - } - - if (skin) - { - LLMatrix4 mat[64]; - - for (U32 i = 0; i < skin->mJointNames.size(); ++i) - { - LLJoint* joint = getJoint(skin->mJointNames[i]); - if (joint) - { - mat[i] = skin->mInvBindMatrix[i]; - mat[i] *= joint->getWorldMatrix(); - } - } - - LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette", - skin->mJointNames.size(), - FALSE, - (GLfloat*) mat[0].mMatrix); - LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette[0]", - skin->mJointNames.size(), - FALSE, - (GLfloat*) mat[0].mMatrix); - - buff->setBuffer(data_mask); - - U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount()-1; - S32 offset = face->getIndicesStart(); - U32 count = face->getIndicesCount(); - - gGL.getTexUnit(0)->bind(face->getTexture()); - buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); - - } - } - } - } } } } } - return num_indices; + return num_indices;*/ + return 0; } //----------------------------------------------------------------------------- diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 96f69b3676..e49b33bd80 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -52,6 +52,7 @@ #include "object_flags.h" #include "llagentconstants.h" #include "lldrawable.h" +#include "lldrawpoolavatar.h" #include "lldrawpoolbump.h" #include "llface.h" #include "llspatialpartition.h" @@ -73,6 +74,8 @@ #include "llmeshrepository.h" #include "llagent.h" #include "llviewermediafocus.h" +#include "llvoavatar.h" + const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; @@ -3415,6 +3418,33 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); +LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj) +{ + LLVOAvatar* avatar = vobj->getAvatar(); + + if (avatar) + { + LLDrawable* drawable = avatar->mDrawable; + if (drawable && drawable->getNumFaces() > 0) + { + LLFace* face = drawable->getFace(0); + if (face) + { + LLDrawPool* drawpool = face->getPool(); + if (drawpool) + { + if (drawpool->getType() == LLDrawPool::POOL_AVATAR) + { + return (LLDrawPoolAvatar*) drawpool; + } + } + } + } + } + + return NULL; +} + void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { @@ -3499,13 +3529,47 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) facep->mVertexBuffer = NULL; facep->mLastVertexBuffer = NULL; facep->setState(LLFace::RIGGED); + + //get drawpool of avatar with rigged face + LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj); + + if (pool) + { + const LLTextureEntry* te = facep->getTextureEntry(); + + //remove face from old pool if it exists + LLDrawPool* old_pool = facep->getPool(); + if (old_pool && old_pool->getType() == LLDrawPool::POOL_AVATAR) + { + ((LLDrawPoolAvatar*) old_pool)->removeRiggedFace(facep); + } + + //add face to new pool + if (te->getShiny()) + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SHINY_SIMPLE); + } + else + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE); + } + } + } continue; } else { - facep->clearState(LLFace::RIGGED); + if (facep->isState(LLFace::RIGGED)) + { //face is not rigged but used to be, remove from rigged face pool + LLDrawPoolAvatar* pool = (LLDrawPoolAvatar*) facep->getPool(); + if (pool) + { + pool->removeRiggedFace(facep); + } + facep->clearState(LLFace::RIGGED); + } } if (cur_total > max_total || facep->getIndicesCount() <= 0 || facep->getGeomCount() <= 0) -- cgit v1.2.3 From 2f95a549a365ca2bedf7824014a687b3af88e20f Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 1 May 2010 01:55:21 -0500 Subject: Fullbrigt skinned and fix for silly crash from not removing face references. --- .../shaders/class1/objects/shinyV.glsl | 2 +- indra/newview/lldrawpoolavatar.cpp | 40 +++++++++++++++++++++- indra/newview/lldrawpoolavatar.h | 5 ++- indra/newview/llface.cpp | 13 ++++--- indra/newview/llviewershadermgr.cpp | 19 ++++++++++ indra/newview/llviewershadermgr.h | 1 + indra/newview/llvovolume.cpp | 9 ++++- 7 files changed, 81 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl index c2e1ddf734..101458c438 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl @@ -12,7 +12,7 @@ uniform vec4 origin; void main() { //transform vertex - gl_Position = ftransform(); //gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = ftransform(); vec4 pos = (gl_ModelViewMatrix * gl_Vertex); vec3 norm = normalize(gl_NormalMatrix * gl_Normal); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 02c7e3bb6f..9463be6059 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -364,7 +364,7 @@ S32 LLDrawPoolAvatar::getNumPasses() } else if (getVertexShaderLevel() > 0) { - return 5; + return 6; } else { @@ -411,6 +411,9 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) beginRiggedSimple(); break; case 4: + beginRiggedFullbright(); + break; + case 5: beginRiggedShinySimple(); break; } @@ -441,6 +444,9 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) endRiggedSimple(); break; case 4: + endRiggedFullbright(); + break; + case 5: endRiggedShinySimple(); break; } @@ -644,6 +650,22 @@ void LLDrawPoolAvatar::endRiggedSimple() LLVertexBuffer::sWeight4Loc = -1; } +void LLDrawPoolAvatar::beginRiggedFullbright() +{ + sVertexProgram = &gSkinnedObjectFullbrightProgram; + diffuse_channel = 0; + gSkinnedObjectFullbrightProgram.bind(); + LLVertexBuffer::sWeight4Loc = gSkinnedObjectFullbrightProgram.getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endRiggedFullbright() +{ + sVertexProgram = NULL; + LLVertexBuffer::unbind(); + gSkinnedObjectFullbrightProgram.unbind(); + LLVertexBuffer::sWeight4Loc = -1; +} + void LLDrawPoolAvatar::beginRiggedShinySimple() { sVertexProgram = &gSkinnedObjectShinySimpleProgram; @@ -825,6 +847,12 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } if (pass == 4) + { + renderRiggedFullbright(avatarp); + return; + } + + if (pass == 5) { renderRiggedShinySimple(avatarp); return; @@ -990,6 +1018,16 @@ void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar) renderRigged(avatar, RIGGED_SIMPLE, data_mask); } +void LLDrawPoolAvatar::renderRiggedFullbright(LLVOAvatar* avatar) +{ + const U32 data_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4; + + renderRigged(avatar, RIGGED_FULLBRIGHT, data_mask); +} + void LLDrawPoolAvatar::renderRiggedShinySimple(LLVOAvatar* avatar) { diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 0ebb035f2a..8443069376 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -97,12 +97,14 @@ public: void beginImpostor(); void beginSkinned(); void beginRiggedSimple(); + void beginRiggedFullbright(); void beginRiggedShinySimple(); void endRigid(); void endImpostor(); void endSkinned(); void endRiggedSimple(); + void endRiggedFullbright(); void endRiggedShinySimple(); void beginDeferredImpostor(); @@ -123,6 +125,7 @@ public: void renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask); void renderRiggedSimple(LLVOAvatar* avatar); + void renderRiggedFullbright(LLVOAvatar* avatar); void renderRiggedShinySimple(LLVOAvatar* avatar); /*virtual*/ LLViewerTexture *getDebugTexture(); @@ -133,11 +136,11 @@ public: typedef enum { RIGGED_SIMPLE = 0, + RIGGED_FULLBRIGHT, RIGGED_SHINY_SIMPLE, RIGGED_SHINY_FULLBRIGHT, RIGGED_SHINY_BUMP, RIGGED_BUMP, - RIGGED_FULLBRIGHT, RIGGED_ALPHA, NUM_RIGGED_PASSES, RIGGED_UNKNOWN, diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 0e0b8447ca..9df692e787 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -41,6 +41,7 @@ #include "m3math.h" #include "v3color.h" +#include "lldrawpoolavatar.h" #include "lldrawpoolbump.h" #include "llgl.h" #include "llrender.h" @@ -207,10 +208,14 @@ void LLFace::destroy() LLFastTimer t(FTM_DESTROY_DRAWPOOL); if (this->isState(LLFace::RIGGED) && mDrawPoolp->getType() == LLDrawPool::POOL_AVATAR) - mDrawPoolp->removeFace(this); - - - + { + ((LLDrawPoolAvatar*) mDrawPoolp)->removeRiggedFace(this); + } + else + { + mDrawPoolp->removeFace(this); + } + mDrawPoolp = NULL; } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index fe68d6eaa4..3cc5b4357a 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -79,6 +79,7 @@ LLGLSLShader gObjectShinyWaterProgram; //object hardware skinning shaders LLGLSLShader gSkinnedObjectSimpleProgram; +LLGLSLShader gSkinnedObjectFullbrightProgram; LLGLSLShader gSkinnedObjectShinySimpleProgram; //environment shaders @@ -155,6 +156,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gObjectFullbrightProgram); mShaderList.push_back(&gObjectFullbrightShinyProgram); mShaderList.push_back(&gSkinnedObjectSimpleProgram); + mShaderList.push_back(&gSkinnedObjectFullbrightProgram); mShaderList.push_back(&gSkinnedObjectShinySimpleProgram); mShaderList.push_back(&gTerrainProgram); mShaderList.push_back(&gTerrainWaterProgram); @@ -562,6 +564,7 @@ void LLViewerShaderMgr::unloadShaders() gObjectShinyWaterProgram.unload(); gSkinnedObjectSimpleProgram.unload(); + gSkinnedObjectFullbrightProgram.unload(); gSkinnedObjectShinySimpleProgram.unload(); @@ -1258,6 +1261,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightProgram.unload(); gObjectFullbrightWaterProgram.unload(); gSkinnedObjectSimpleProgram.unload(); + gSkinnedObjectFullbrightProgram.unload(); gSkinnedObjectShinySimpleProgram.unload(); return FALSE; @@ -1385,6 +1389,21 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gSkinnedObjectSimpleProgram.createShader(NULL, NULL); } + if (success) + { + gSkinnedObjectFullbrightProgram.mName = "Skinned Fullbright Shader"; + gSkinnedObjectFullbrightProgram.mFeatures.calculatesAtmospherics = true; + gSkinnedObjectFullbrightProgram.mFeatures.hasGamma = true; + gSkinnedObjectFullbrightProgram.mFeatures.hasTransport = true; + gSkinnedObjectFullbrightProgram.mFeatures.isFullbright = true; + gSkinnedObjectFullbrightProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectFullbrightProgram.mShaderFiles.clear(); + gSkinnedObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gSkinnedObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSkinnedObjectFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gSkinnedObjectFullbrightProgram.createShader(NULL, NULL); + } + if (success) { gSkinnedObjectShinySimpleProgram.mName = "Skinned Shiny Simple Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index beac5462e2..b4fc336bf3 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -315,6 +315,7 @@ extern LLGLSLShader gObjectShinyProgram; extern LLGLSLShader gObjectShinyWaterProgram; extern LLGLSLShader gSkinnedObjectSimpleProgram; +extern LLGLSLShader gSkinnedObjectFullbrightProgram; extern LLGLSLShader gSkinnedObjectShinySimpleProgram; //environment shaders diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e49b33bd80..3449c05be8 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3551,7 +3551,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } else { - pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE); + if (te->getFullbright()) + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT); + } + else + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE); + } } } -- cgit v1.2.3 From dc15fc5ba0fcf9907d834b523e6622d800d7ed4e Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sat, 1 May 2010 02:56:23 -0500 Subject: Fullbright shiny skinned. --- indra/newview/lldrawpoolavatar.cpp | 45 +++++++++++++++++++++++++++++++++++-- indra/newview/lldrawpoolavatar.h | 11 +++++---- indra/newview/llviewershadermgr.cpp | 20 +++++++++++++++++ indra/newview/llviewershadermgr.h | 1 + indra/newview/llvovolume.cpp | 9 +++++++- 5 files changed, 79 insertions(+), 7 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 9463be6059..8227e8ede2 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -364,7 +364,7 @@ S32 LLDrawPoolAvatar::getNumPasses() } else if (getVertexShaderLevel() > 0) { - return 6; + return 7; } else { @@ -416,6 +416,9 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) case 5: beginRiggedShinySimple(); break; + case 6: + beginRiggedFullbrightShiny(); + break; } } @@ -449,6 +452,9 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) case 5: endRiggedShinySimple(); break; + case 6: + endRiggedFullbrightShiny(); + break; } } @@ -683,6 +689,24 @@ void LLDrawPoolAvatar::endRiggedShinySimple() LLVertexBuffer::sWeight4Loc = -1; } +void LLDrawPoolAvatar::beginRiggedFullbrightShiny() +{ + sVertexProgram = &gSkinnedObjectFullbrightShinyProgram; + sVertexProgram->bind(); + LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, diffuse_channel, cube_channel, false); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endRiggedFullbrightShiny() +{ + LLVertexBuffer::unbind(); + LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, diffuse_channel, cube_channel, false); + sVertexProgram->unbind(); + sVertexProgram = NULL; + LLVertexBuffer::sWeight4Loc = -1; +} + + void LLDrawPoolAvatar::beginDeferredRigged() { sVertexProgram = &gDeferredSkinnedDiffuseProgram; @@ -858,6 +882,12 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } + if (pass == 6) + { + renderRiggedFullbrightShiny(avatarp); + return; + } + if (sShaderLevel > 0) { @@ -1037,7 +1067,18 @@ void LLDrawPoolAvatar::renderRiggedShinySimple(LLVOAvatar* avatar) LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_WEIGHT4; - renderRigged(avatar, RIGGED_SHINY_SIMPLE, data_mask); + renderRigged(avatar, RIGGED_SHINY, data_mask); +} + +void LLDrawPoolAvatar::renderRiggedFullbrightShiny(LLVOAvatar* avatar) +{ + const U32 data_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_NORMAL | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4; + + renderRigged(avatar, RIGGED_FULLBRIGHT_SHINY, data_mask); } //----------------------------------------------------------------------------- diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 8443069376..d758bb07f0 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -98,6 +98,7 @@ public: void beginSkinned(); void beginRiggedSimple(); void beginRiggedFullbright(); + void beginRiggedFullbrightShiny(); void beginRiggedShinySimple(); void endRigid(); @@ -105,6 +106,7 @@ public: void endSkinned(); void endRiggedSimple(); void endRiggedFullbright(); + void endRiggedFullbrightShiny(); void endRiggedShinySimple(); void beginDeferredImpostor(); @@ -127,6 +129,7 @@ public: void renderRiggedSimple(LLVOAvatar* avatar); void renderRiggedFullbright(LLVOAvatar* avatar); void renderRiggedShinySimple(LLVOAvatar* avatar); + void renderRiggedFullbrightShiny(LLVOAvatar* avatar); /*virtual*/ LLViewerTexture *getDebugTexture(); /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display @@ -137,11 +140,11 @@ public: { RIGGED_SIMPLE = 0, RIGGED_FULLBRIGHT, - RIGGED_SHINY_SIMPLE, - RIGGED_SHINY_FULLBRIGHT, - RIGGED_SHINY_BUMP, - RIGGED_BUMP, + RIGGED_SHINY, + RIGGED_FULLBRIGHT_SHINY, + RIGGED_GLOW, RIGGED_ALPHA, + RIGGED_FULLBRIGHT_ALPHA, NUM_RIGGED_PASSES, RIGGED_UNKNOWN, } eRiggedPass; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 3cc5b4357a..eafc52748e 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -80,6 +80,7 @@ LLGLSLShader gObjectShinyWaterProgram; //object hardware skinning shaders LLGLSLShader gSkinnedObjectSimpleProgram; LLGLSLShader gSkinnedObjectFullbrightProgram; +LLGLSLShader gSkinnedObjectFullbrightShinyProgram; LLGLSLShader gSkinnedObjectShinySimpleProgram; //environment shaders @@ -157,6 +158,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gObjectFullbrightShinyProgram); mShaderList.push_back(&gSkinnedObjectSimpleProgram); mShaderList.push_back(&gSkinnedObjectFullbrightProgram); + mShaderList.push_back(&gSkinnedObjectFullbrightShinyProgram); mShaderList.push_back(&gSkinnedObjectShinySimpleProgram); mShaderList.push_back(&gTerrainProgram); mShaderList.push_back(&gTerrainWaterProgram); @@ -565,6 +567,7 @@ void LLViewerShaderMgr::unloadShaders() gSkinnedObjectSimpleProgram.unload(); gSkinnedObjectFullbrightProgram.unload(); + gSkinnedObjectFullbrightShinyProgram.unload(); gSkinnedObjectShinySimpleProgram.unload(); @@ -1262,6 +1265,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightWaterProgram.unload(); gSkinnedObjectSimpleProgram.unload(); gSkinnedObjectFullbrightProgram.unload(); + gSkinnedObjectFullbrightShinyProgram.unload(); gSkinnedObjectShinySimpleProgram.unload(); return FALSE; @@ -1404,6 +1408,22 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gSkinnedObjectFullbrightProgram.createShader(NULL, NULL); } + if (success) + { + gSkinnedObjectFullbrightShinyProgram.mName = "Skinned Fullbright Shiny Shader"; + gSkinnedObjectFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; + gSkinnedObjectFullbrightShinyProgram.mFeatures.hasGamma = true; + gSkinnedObjectFullbrightShinyProgram.mFeatures.hasTransport = true; + gSkinnedObjectFullbrightShinyProgram.mFeatures.isShiny = true; + gSkinnedObjectFullbrightShinyProgram.mFeatures.isFullbright = true; + gSkinnedObjectFullbrightShinyProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectFullbrightShinyProgram.mShaderFiles.clear(); + gSkinnedObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gSkinnedObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSkinnedObjectFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gSkinnedObjectFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); + } + if (success) { gSkinnedObjectShinySimpleProgram.mName = "Skinned Shiny Simple Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index b4fc336bf3..bb28cd7ec2 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -316,6 +316,7 @@ extern LLGLSLShader gObjectShinyWaterProgram; extern LLGLSLShader gSkinnedObjectSimpleProgram; extern LLGLSLShader gSkinnedObjectFullbrightProgram; +extern LLGLSLShader gSkinnedObjectFullbrightShinyProgram; extern LLGLSLShader gSkinnedObjectShinySimpleProgram; //environment shaders diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3449c05be8..43252c553c 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3547,7 +3547,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //add face to new pool if (te->getShiny()) { - pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SHINY_SIMPLE); + if (te->getFullbright()) + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_SHINY); + } + else + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SHINY); + } } else { -- cgit v1.2.3 From 58defe76b0eed6f773b961e8ba5cd3aeb856467a Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Sun, 2 May 2010 00:28:30 -0500 Subject: Rigged glow. --- indra/newview/lldrawpoolavatar.cpp | 214 +++++++++++++++++++++++++++++++------ indra/newview/lldrawpoolavatar.h | 13 ++- indra/newview/llface.h | 2 + indra/newview/llvovolume.cpp | 21 +++- 4 files changed, 212 insertions(+), 38 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 8227e8ede2..866aea42c4 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -364,7 +364,7 @@ S32 LLDrawPoolAvatar::getNumPasses() } else if (getVertexShaderLevel() > 0) { - return 7; + return 10; } else { @@ -419,6 +419,15 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) case 6: beginRiggedFullbrightShiny(); break; + case 7: + beginRiggedAlpha(); + break; + case 8: + beginRiggedFullbrightAlpha(); + break; + case 9: + beginRiggedGlow(); + break; } } @@ -455,6 +464,15 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) case 6: endRiggedFullbrightShiny(); break; + case 7: + endRiggedAlpha(); + break; + case 8: + endRiggedFullbrightAlpha(); + break; + case 9: + endRiggedGlow(); + break; } } @@ -656,6 +674,55 @@ void LLDrawPoolAvatar::endRiggedSimple() LLVertexBuffer::sWeight4Loc = -1; } +void LLDrawPoolAvatar::beginRiggedAlpha() +{ + sVertexProgram = &gSkinnedObjectSimpleProgram; + diffuse_channel = 0; + sVertexProgram->bind(); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endRiggedAlpha() +{ + sVertexProgram->unbind(); + sVertexProgram = NULL; + LLVertexBuffer::unbind(); + LLVertexBuffer::sWeight4Loc = -1; +} + + +void LLDrawPoolAvatar::beginRiggedFullbrightAlpha() +{ + sVertexProgram = &gSkinnedObjectFullbrightProgram; + diffuse_channel = 0; + sVertexProgram->bind(); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endRiggedFullbrightAlpha() +{ + sVertexProgram->unbind(); + sVertexProgram = NULL; + LLVertexBuffer::unbind(); + LLVertexBuffer::sWeight4Loc = -1; +} + +void LLDrawPoolAvatar::beginRiggedGlow() +{ + sVertexProgram = &gSkinnedObjectFullbrightProgram; + diffuse_channel = 0; + sVertexProgram->bind(); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endRiggedGlow() +{ + sVertexProgram->unbind(); + sVertexProgram = NULL; + LLVertexBuffer::unbind(); + LLVertexBuffer::sWeight4Loc = -1; +} + void LLDrawPoolAvatar::beginRiggedFullbright() { sVertexProgram = &gSkinnedObjectFullbrightProgram; @@ -888,6 +955,48 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } + if (pass >= 7 && pass <= 9) + { + LLGLEnable blend(GL_BLEND); + + gGL.setColorMask(true, true); + gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, + LLRender::BF_ONE_MINUS_SOURCE_ALPHA, + LLRender::BF_ZERO, + LLRender::BF_ONE_MINUS_SOURCE_ALPHA); + + + if (pass == 7) + { + renderRiggedAlpha(avatarp); + return; + } + + if (pass == 8) + { + renderRiggedFullbrightAlpha(avatarp); + return; + } + } + + if (pass == 9) + { + LLGLEnable blend(GL_BLEND); + LLGLDisable test(GL_ALPHA_TEST); + gGL.flush(); + + LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(-1.0f, -1.0f); + gGL.setSceneBlendType(LLRender::BT_ADD); + + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + gGL.setColorMask(false, true); + + renderRiggedGlow(avatarp); + gGL.setColorMask(true, false); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + } + if (sShaderLevel > 0) { @@ -958,7 +1067,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLFace* face, const LLMeshSk } } -void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask) +void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask, bool glow) { for (U32 i = 0; i < mRiggedFace[type].size(); ++i) { @@ -1031,6 +1140,11 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, const U32 data S32 offset = face->getIndicesStart(); U32 count = face->getIndicesCount(); + if (glow) + { + glColor4f(0,0,0,face->getTextureEntry()->getGlow()); + } + gGL.getTexUnit(0)->bind(face->getTexture()); buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); } @@ -1081,6 +1195,39 @@ void LLDrawPoolAvatar::renderRiggedFullbrightShiny(LLVOAvatar* avatar) renderRigged(avatar, RIGGED_FULLBRIGHT_SHINY, data_mask); } +void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar) +{ + const U32 data_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_NORMAL | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4; + + renderRigged(avatar, RIGGED_ALPHA, data_mask); +} + +void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar) +{ + const U32 data_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4; + + renderRigged(avatar, RIGGED_FULLBRIGHT_ALPHA, data_mask); +} + +void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar) +{ + const U32 data_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_WEIGHT4; + + renderRigged(avatar, RIGGED_GLOW, data_mask, true); +} + + + + //----------------------------------------------------------------------------- // renderForSelect() //----------------------------------------------------------------------------- @@ -1181,60 +1328,57 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) { - if (facep->getReferenceIndex() != -1) + if (facep->mRiggedIndex.empty()) { - llerrs << "Tried to add a rigged face that's referenced elsewhere." << llendl; - } + facep->mRiggedIndex.resize(LLDrawPoolAvatar::NUM_RIGGED_PASSES); + for (U32 i = 0; i < facep->mRiggedIndex.size(); ++i) + { + facep->mRiggedIndex[i] = -1; + } + } if (type >= NUM_RIGGED_PASSES) { llerrs << "Invalid rigged face type." << llendl; } - facep->setReferenceIndex(mRiggedFace[type].size()); + if (facep->mRiggedIndex[type] != -1) + { + llerrs << "Tried to add a rigged face that's referenced elsewhere." << llendl; + } + + + facep->mRiggedIndex[type] = mRiggedFace[type].size(); facep->mDrawPoolp = this; mRiggedFace[type].push_back(facep); } -void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep, U32 type) +void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep) { - S32 index = facep->getReferenceIndex(); - if (index == -1) - { - llerrs << "Tried to remove rigged face with invalid index." << llendl; - } - - if (type > RIGGED_UNKNOWN) - { - llerrs << "Invalid rigged face type." << llendl; - } - - facep->setReferenceIndex(-1); + facep->mDrawPoolp = NULL; - if (type == RIGGED_UNKNOWN) + for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) { - for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) + S32 index = facep->mRiggedIndex[i]; + + if (index > -1) { if (mRiggedFace[i].size() > index && mRiggedFace[i][index] == facep) { - type = i; - break; + facep->mRiggedIndex[i] = -1; + mRiggedFace[i].erase(mRiggedFace[i].begin()+index); + for (U32 j = index; j < mRiggedFace[i].size(); ++j) + { //bump indexes down for faces referenced after erased face + mRiggedFace[i][j]->mRiggedIndex[i] = j; + } + } + else + { + llerrs << "Face reference data corrupt for rigged type " << i << llendl; } } } - - if (type >= NUM_RIGGED_PASSES) - { - llerrs << "Could not find face for removal from current drawpool." << llendl; - } - - mRiggedFace[type].erase(mRiggedFace[type].begin()+index); - - for (S32 i = index; i < mRiggedFace[type].size(); ++i) - { //bump indexes of currently held faces down after removal - mRiggedFace[type][i]->setReferenceIndex(i); - } } LLVertexBufferAvatar::LLVertexBufferAvatar() diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index d758bb07f0..59f9cf7ddb 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -100,6 +100,9 @@ public: void beginRiggedFullbright(); void beginRiggedFullbrightShiny(); void beginRiggedShinySimple(); + void beginRiggedAlpha(); + void beginRiggedFullbrightAlpha(); + void beginRiggedGlow(); void endRigid(); void endImpostor(); @@ -108,6 +111,9 @@ public: void endRiggedFullbright(); void endRiggedFullbrightShiny(); void endRiggedShinySimple(); + void endRiggedAlpha(); + void endRiggedFullbrightAlpha(); + void endRiggedGlow(); void beginDeferredImpostor(); void beginDeferredRigid(); @@ -125,11 +131,14 @@ public: const LLVolumeFace& vol_face, U32 data_mask); - void renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask); + void renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask, bool glow = false); void renderRiggedSimple(LLVOAvatar* avatar); + void renderRiggedAlpha(LLVOAvatar* avatar); + void renderRiggedFullbrightAlpha(LLVOAvatar* avatar); void renderRiggedFullbright(LLVOAvatar* avatar); void renderRiggedShinySimple(LLVOAvatar* avatar); void renderRiggedFullbrightShiny(LLVOAvatar* avatar); + void renderRiggedGlow(LLVOAvatar* avatar); /*virtual*/ LLViewerTexture *getDebugTexture(); /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display @@ -151,7 +160,7 @@ public: void addRiggedFace(LLFace* facep, U32 type); - void removeRiggedFace(LLFace* facep, U32 type = RIGGED_UNKNOWN); + void removeRiggedFace(LLFace* facep); std::vector<LLFace*> mRiggedFace[NUM_RIGGED_PASSES]; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 2b8fdf2e58..f9e9c3e078 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -260,6 +260,8 @@ private: S32 mTEOffset; S32 mReferenceIndex; + std::vector<S32> mRiggedIndex; + F32 mVSize; F32 mPixelArea; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 43252c553c..e263f8d937 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3545,7 +3545,21 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } //add face to new pool - if (te->getShiny()) + LLViewerTexture* tex = facep->getTexture(); + U32 type = gPipeline.getPoolTypeFromTE(te, tex); + + if (type == LLDrawPool::POOL_ALPHA) + { + if (te->getFullbright()) + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA); + } + else + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_ALPHA); + } + } + else if (te->getShiny()) { if (te->getFullbright()) { @@ -3567,6 +3581,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE); } } + + if (te->getGlow()) + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_GLOW); + } } } -- cgit v1.2.3 From eb283701afc7ecbe3009a9fb75be1dcb222a383b Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 4 May 2010 00:45:28 -0500 Subject: Deferred pipeline integration of rigged attachments and cleanup. --- indra/llrender/llvertexbuffer.h | 2 +- .../shaders/class1/deferred/alphaF.glsl | 5 +- .../shaders/class1/deferred/alphaV.glsl | 2 +- .../shaders/class1/deferred/avatarAlphaV.glsl | 4 +- .../shaders/class1/deferred/diffuseV.glsl | 2 +- .../shaders/class2/deferred/alphaF.glsl | 2 +- indra/newview/lldrawpoolavatar.cpp | 302 +++++++++++++++------ indra/newview/lldrawpoolavatar.h | 51 +++- indra/newview/lldrawpoolbump.cpp | 27 +- indra/newview/lldrawpoolbump.h | 7 +- indra/newview/llviewershadermgr.cpp | 36 ++- indra/newview/llviewershadermgr.h | 2 + indra/newview/llvovolume.cpp | 15 + 13 files changed, 359 insertions(+), 98 deletions(-) diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 225237215c..d1700aa54a 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -190,7 +190,7 @@ public: U8* getIndicesPointer() const { return useVBOs() ? NULL : mMappedIndexData; } U8* getVerticesPointer() const { return useVBOs() ? NULL : mMappedData; } S32 getStride() const { return mStride; } - S32 getTypeMask() const { return mTypeMask; } + U32 getTypeMask() const { return mTypeMask; } BOOL hasDataType(S32 type) const { return ((1 << type) & getTypeMask()) ? TRUE : FALSE; } S32 getSize() const { return mNumVerts*mStride; } S32 getIndicesSize() const { return mNumIndices * sizeof(U16); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index fea2e16090..6f027de6a2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -22,7 +22,6 @@ varying vec3 vary_ambient; varying vec3 vary_directional; varying vec3 vary_fragcoord; varying vec3 vary_position; -varying vec3 vary_light; uniform mat4 inv_proj; @@ -55,8 +54,8 @@ void main() color.rgb = scaleSoftClip(color.rgb); - //gl_FragColor = gl_Color; - gl_FragColor = color; + gl_FragColor = gl_Color; + //gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); //gl_FragColor = vec4(1,0,1,1)*shadow; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 04e556c11a..43200f1b07 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -36,7 +36,7 @@ void main() vec4 pos = (gl_ModelViewMatrix * gl_Vertex); vec3 norm = normalize(gl_NormalMatrix * gl_Normal); - vary_position = pos.xyz + norm.xyz * (-pos.z/64.0*shadow_offset+shadow_bias); + vary_position = pos.xyz; calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index 650fbcc3f5..da1dafda36 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -17,7 +17,7 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec4 vary_position; +varying vec3 vary_position; varying vec3 vary_ambient; varying vec3 vary_directional; varying vec3 vary_normal; @@ -41,7 +41,7 @@ void main() norm = normalize(norm); gl_Position = gl_ProjectionMatrix * pos; - vary_position = pos; + vary_position = pos.xyz; vary_normal = norm; calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl index b458842657..44468cdfa2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl @@ -13,7 +13,7 @@ void main() gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - vary_nomral = normalize(gl_NormalMatrix * gl_Normal); + vary_normal = normalize(gl_NormalMatrix * gl_Normal); gl_FrontColor = gl_Color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 665fe16b43..fa6b4e2afb 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -115,7 +115,7 @@ void main() //gl_FragColor = gl_Color; gl_FragColor = color; - //gl_FragColor = vec4(1,0,1,1)*shadow; + //gl_FragColor = vec4(1,shadow,1,1); } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 866aea42c4..ac599caa5b 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -63,6 +63,8 @@ LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL; BOOL LLDrawPoolAvatar::sSkipOpaque = FALSE; BOOL LLDrawPoolAvatar::sSkipTransparent = FALSE; +static bool is_deferred_render = false; + extern BOOL gUseGLPick; F32 CLOTHING_GRAVITY_EFFECT = 0.7f; @@ -100,6 +102,18 @@ S32 specular_channel = -1; S32 diffuse_channel = -1; S32 cube_channel = -1; +static const U32 rigged_data_mask[] = { + LLDrawPoolAvatar::RIGGED_SIMPLE_MASK, + LLDrawPoolAvatar::RIGGED_FULLBRIGHT_MASK, + LLDrawPoolAvatar::RIGGED_SHINY_MASK, + LLDrawPoolAvatar::RIGGED_FULLBRIGHT_SHINY_MASK, + LLDrawPoolAvatar::RIGGED_GLOW_MASK, + LLDrawPoolAvatar::RIGGED_ALPHA_MASK, + LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA_MASK, + LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP_MASK, + LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE_MASK, +}; + static LLFastTimer::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow"); @@ -155,21 +169,17 @@ LLMatrix4& LLDrawPoolAvatar::getModelView() //----------------------------------------------------------------------------- -S32 LLDrawPoolAvatar::getNumDeferredPasses() -{ - return getNumPasses(); -} void LLDrawPoolAvatar::beginDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); sSkipTransparent = TRUE; - + is_deferred_render = true; + if (LLPipeline::sImpostorRender) - { - beginDeferredSkinned(); - return; + { //impostor pass does not have rigid or impostor rendering + pass += 2; } switch (pass) @@ -184,7 +194,10 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) beginDeferredSkinned(); break; case 3: - beginDeferredRigged(); + beginDeferredRiggedSimple(); + break; + case 4: + beginDeferredRiggedBump(); break; } } @@ -194,11 +207,11 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) LLFastTimer t(FTM_RENDER_CHARACTERS); sSkipTransparent = FALSE; + is_deferred_render = false; if (LLPipeline::sImpostorRender) { - endDeferredSkinned(); - return; + pass += 2; } switch (pass) @@ -213,7 +226,11 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) endDeferredSkinned(); break; case 3: - endDeferredRigged(); + endDeferredRiggedSimple(); + break; + case 4: + endDeferredRiggedBump(); + break; } } @@ -224,10 +241,35 @@ void LLDrawPoolAvatar::renderDeferred(S32 pass) S32 LLDrawPoolAvatar::getNumPostDeferredPasses() { - return 1; + return 6; } void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) +{ + switch (pass) + { + case 0: + beginPostDeferredAlpha(); + break; + case 1: + beginRiggedFullbright(); + break; + case 2: + beginRiggedFullbrightShiny(); + break; + case 3: + beginDeferredRiggedAlpha(); + break; + case 4: + beginRiggedFullbrightAlpha(); + break; + case 5: + beginRiggedGlow(); + break; + } +} + +void LLDrawPoolAvatar::beginPostDeferredAlpha() { sSkipOpaque = TRUE; sShaderLevel = mVertexShaderLevel; @@ -240,7 +282,49 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); } +void LLDrawPoolAvatar::beginDeferredRiggedAlpha() +{ + sVertexProgram = &gDeferredSkinnedAlphaProgram; + gPipeline.bindDeferredShader(*sVertexProgram); + diffuse_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); + gPipeline.enableLightsDynamic(); +} + +void LLDrawPoolAvatar::endDeferredRiggedAlpha() +{ + LLVertexBuffer::unbind(); + gPipeline.unbindDeferredShader(*sVertexProgram); + LLVertexBuffer::sWeight4Loc = -1; + sVertexProgram = NULL; +} + void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) +{ + switch (pass) + { + case 0: + endPostDeferredAlpha(); + break; + case 1: + endRiggedFullbright(); + break; + case 2: + endRiggedFullbrightShiny(); + break; + case 3: + endDeferredRiggedAlpha(); + break; + case 4: + endRiggedFullbrightAlpha(); + break; + case 5: + endRiggedGlow(); + break; + } +} + +void LLDrawPoolAvatar::endPostDeferredAlpha() { // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = FALSE; @@ -254,7 +338,17 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) void LLDrawPoolAvatar::renderPostDeferred(S32 pass) { - render(2); //pass 2 = skinned + const S32 actual_pass[] = + { //map post deferred pass numbers to what render() expects + 2, //skinned + 4, // rigged fullbright + 6, //rigged fullbright shiny + 7, //rigged alpha + 8, //rigged fullbright alpha + 9, //rigged glow + }; + + render(actual_pass[pass]); } @@ -288,6 +382,7 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) else { sVertexProgram = &gDeferredAttachmentShadowProgram; + diffuse_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } @@ -352,7 +447,12 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) } else { - avatarp->renderSkinnedAttachments(); + renderRigged(avatarp, RIGGED_SIMPLE); + renderRigged(avatarp, RIGGED_ALPHA); + renderRigged(avatarp, RIGGED_FULLBRIGHT); + renderRigged(avatarp, RIGGED_FULLBRIGHT_SHINY); + renderRigged(avatarp, RIGGED_SHINY); + renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA); } } @@ -360,7 +460,7 @@ S32 LLDrawPoolAvatar::getNumPasses() { if (LLPipeline::sImpostorRender) { - return 1; + return 8; } else if (getVertexShaderLevel() > 0) { @@ -372,6 +472,19 @@ S32 LLDrawPoolAvatar::getNumPasses() } } +S32 LLDrawPoolAvatar::getNumDeferredPasses() +{ + if (LLPipeline::sImpostorRender) + { + return 3; + } + else + { + return 5; + } +} + + void LLDrawPoolAvatar::render(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); @@ -391,9 +504,8 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) LLVertexBuffer::unbind(); if (LLPipeline::sImpostorRender) - { - beginSkinned(); - return; + { //impostor render does not have impostors or rigid rendering + pass += 2; } switch (pass) @@ -437,8 +549,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) if (LLPipeline::sImpostorRender) { - endSkinned(); - return; + pass += 2; } switch (pass) @@ -536,8 +647,8 @@ void LLDrawPoolAvatar::beginDeferredImpostor() sVertexProgram = &gDeferredImpostorProgram; - normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); + normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); diffuse_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); @@ -774,18 +885,40 @@ void LLDrawPoolAvatar::endRiggedFullbrightShiny() } -void LLDrawPoolAvatar::beginDeferredRigged() +void LLDrawPoolAvatar::beginDeferredRiggedSimple() { sVertexProgram = &gDeferredSkinnedDiffuseProgram; + diffuse_channel = 0; + sVertexProgram->bind(); + LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); +} + +void LLDrawPoolAvatar::endDeferredRiggedSimple() +{ + LLVertexBuffer::unbind(); + sVertexProgram->unbind(); + LLVertexBuffer::sWeight4Loc = -1; + sVertexProgram = NULL; +} + +void LLDrawPoolAvatar::beginDeferredRiggedBump() +{ + sVertexProgram = &gDeferredSkinnedBumpProgram; sVertexProgram->bind(); + normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP); + diffuse_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } -void LLDrawPoolAvatar::endDeferredRigged() +void LLDrawPoolAvatar::endDeferredRiggedBump() { LLVertexBuffer::unbind(); + sVertexProgram->disableTexture(LLViewerShaderMgr::BUMP_MAP); + sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->unbind(); LLVertexBuffer::sWeight4Loc = -1; + normal_channel = -1; + diffuse_channel = -1; sVertexProgram = NULL; } @@ -933,13 +1066,28 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) if (pass == 3) { - renderRiggedSimple(avatarp); + if (is_deferred_render) + { + renderDeferredRiggedSimple(avatarp); + } + else + { + renderRiggedSimple(avatarp); + } return; } if (pass == 4) { - renderRiggedFullbright(avatarp); + if (is_deferred_render) + { + renderDeferredRiggedBump(avatarp); + } + else + { + renderRiggedFullbright(avatarp); + } + return; } @@ -995,6 +1143,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) renderRiggedGlow(avatarp); gGL.setColorMask(true, false); gGL.setSceneBlendType(LLRender::BT_ALPHA); + return; } @@ -1034,12 +1183,21 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } } -void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face, U32 data_mask) +void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face) { + U32 data_mask = 0; + for (U32 i = 0; i < face->mRiggedIndex.size(); ++i) + { + if (face->mRiggedIndex[i] > -1) + { + data_mask |= rigged_data_mask[i]; + } + } + LLVertexBuffer* buff = face->mVertexBuffer; if (!buff || - !buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) || + buff->getTypeMask() != data_mask || buff->getRequestedVerts() != vol_face.mVertices.size()) { face->setGeomIndex(0); @@ -1067,7 +1225,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLFace* face, const LLMeshSk } } -void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask, bool glow) +void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) { for (U32 i = 0; i < mRiggedFace[type].size(); ++i) { @@ -1106,8 +1264,10 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, const U32 data } const LLVolumeFace& vol_face = volume->getVolumeFace(te); - updateRiggedFaceVertexBuffer(face, skin, volume, vol_face, data_mask); + updateRiggedFaceVertexBuffer(face, skin, volume, vol_face); + U32 data_mask = rigged_data_mask[type]; + LLVertexBuffer* buff = face->mVertexBuffer; if (buff) @@ -1145,84 +1305,72 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, const U32 data glColor4f(0,0,0,face->getTextureEntry()->getGlow()); } - gGL.getTexUnit(0)->bind(face->getTexture()); - buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); + gGL.getTexUnit(diffuse_channel)->bind(face->getTexture()); + if (normal_channel > -1) + { + LLDrawPoolBump::bindBumpMap(face, normal_channel); + } + + if (face->mTextureMatrix) + { + glMatrixMode(GL_TEXTURE); + glLoadMatrixf((F32*) face->mTextureMatrix->mMatrix); + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + } + else + { + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); + } } } } -void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar) +void LLDrawPoolAvatar::renderDeferredRiggedSimple(LLVOAvatar* avatar) { - const U32 data_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_NORMAL | - LLVertexBuffer::MAP_TEXCOORD0 | - LLVertexBuffer::MAP_COLOR | - LLVertexBuffer::MAP_WEIGHT4; + renderRigged(avatar, RIGGED_DEFERRED_SIMPLE); +} - renderRigged(avatar, RIGGED_SIMPLE, data_mask); +void LLDrawPoolAvatar::renderDeferredRiggedBump(LLVOAvatar* avatar) +{ + renderRigged(avatar, RIGGED_DEFERRED_BUMP); } -void LLDrawPoolAvatar::renderRiggedFullbright(LLVOAvatar* avatar) +void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar) { - const U32 data_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_TEXCOORD0 | - LLVertexBuffer::MAP_COLOR | - LLVertexBuffer::MAP_WEIGHT4; + renderRigged(avatar, RIGGED_SIMPLE); +} - renderRigged(avatar, RIGGED_FULLBRIGHT, data_mask); +void LLDrawPoolAvatar::renderRiggedFullbright(LLVOAvatar* avatar) +{ + renderRigged(avatar, RIGGED_FULLBRIGHT); } void LLDrawPoolAvatar::renderRiggedShinySimple(LLVOAvatar* avatar) { - const U32 data_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_NORMAL | - LLVertexBuffer::MAP_TEXCOORD0 | - LLVertexBuffer::MAP_COLOR | - LLVertexBuffer::MAP_WEIGHT4; - - renderRigged(avatar, RIGGED_SHINY, data_mask); + renderRigged(avatar, RIGGED_SHINY); } void LLDrawPoolAvatar::renderRiggedFullbrightShiny(LLVOAvatar* avatar) { - const U32 data_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_NORMAL | - LLVertexBuffer::MAP_TEXCOORD0 | - LLVertexBuffer::MAP_COLOR | - LLVertexBuffer::MAP_WEIGHT4; - - renderRigged(avatar, RIGGED_FULLBRIGHT_SHINY, data_mask); + renderRigged(avatar, RIGGED_FULLBRIGHT_SHINY); } void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar) { - const U32 data_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_NORMAL | - LLVertexBuffer::MAP_TEXCOORD0 | - LLVertexBuffer::MAP_COLOR | - LLVertexBuffer::MAP_WEIGHT4; - - renderRigged(avatar, RIGGED_ALPHA, data_mask); + renderRigged(avatar, RIGGED_ALPHA); } void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar) { - const U32 data_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_TEXCOORD0 | - LLVertexBuffer::MAP_COLOR | - LLVertexBuffer::MAP_WEIGHT4; - - renderRigged(avatar, RIGGED_FULLBRIGHT_ALPHA, data_mask); + renderRigged(avatar, RIGGED_FULLBRIGHT_ALPHA); } void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar) { - const U32 data_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_TEXCOORD0 | - LLVertexBuffer::MAP_WEIGHT4; - - renderRigged(avatar, RIGGED_GLOW, data_mask, true); + renderRigged(avatar, RIGGED_GLOW, true); } diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 59f9cf7ddb..bab6f01480 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -103,6 +103,8 @@ public: void beginRiggedAlpha(); void beginRiggedFullbrightAlpha(); void beginRiggedGlow(); + void beginPostDeferredAlpha(); + void beginDeferredRiggedAlpha(); void endRigid(); void endImpostor(); @@ -114,24 +116,27 @@ public: void endRiggedAlpha(); void endRiggedFullbrightAlpha(); void endRiggedGlow(); + void endPostDeferredAlpha(); + void endDeferredRiggedAlpha(); void beginDeferredImpostor(); void beginDeferredRigid(); void beginDeferredSkinned(); - void beginDeferredRigged(); + void beginDeferredRiggedSimple(); + void beginDeferredRiggedBump(); void endDeferredImpostor(); void endDeferredRigid(); void endDeferredSkinned(); - void endDeferredRigged(); + void endDeferredRiggedSimple(); + void endDeferredRiggedBump(); void updateRiggedFaceVertexBuffer(LLFace* facep, const LLMeshSkinInfo* skin, LLVolume* volume, - const LLVolumeFace& vol_face, - U32 data_mask); + const LLVolumeFace& vol_face); - void renderRigged(LLVOAvatar* avatar, U32 type, const U32 data_mask, bool glow = false); + void renderRigged(LLVOAvatar* avatar, U32 type, bool glow = false); void renderRiggedSimple(LLVOAvatar* avatar); void renderRiggedAlpha(LLVOAvatar* avatar); void renderRiggedFullbrightAlpha(LLVOAvatar* avatar); @@ -139,6 +144,8 @@ public: void renderRiggedShinySimple(LLVOAvatar* avatar); void renderRiggedFullbrightShiny(LLVOAvatar* avatar); void renderRiggedGlow(LLVOAvatar* avatar); + void renderDeferredRiggedSimple(LLVOAvatar* avatar); + void renderDeferredRiggedBump(LLVOAvatar* avatar); /*virtual*/ LLViewerTexture *getDebugTexture(); /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display @@ -154,11 +161,43 @@ public: RIGGED_GLOW, RIGGED_ALPHA, RIGGED_FULLBRIGHT_ALPHA, + RIGGED_DEFERRED_BUMP, + RIGGED_DEFERRED_SIMPLE, NUM_RIGGED_PASSES, RIGGED_UNKNOWN, } eRiggedPass; - + typedef enum + { + RIGGED_SIMPLE_MASK = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_NORMAL | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4, + RIGGED_FULLBRIGHT_MASK = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4, + RIGGED_SHINY_MASK = RIGGED_SIMPLE_MASK, + RIGGED_FULLBRIGHT_SHINY_MASK = RIGGED_SIMPLE_MASK, + RIGGED_GLOW_MASK = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_WEIGHT4, + RIGGED_ALPHA_MASK = RIGGED_SIMPLE_MASK, + RIGGED_FULLBRIGHT_ALPHA_MASK = RIGGED_FULLBRIGHT_MASK, + RIGGED_DEFERRED_BUMP_MASK = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_NORMAL | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_BINORMAL | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4, + RIGGED_DEFERRED_SIMPLE_MASK = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_NORMAL | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_WEIGHT4, + } eRiggedDataMask; + void addRiggedFace(LLFace* facep, U32 type); void removeRiggedFace(LLFace* facep); diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 2f449fa42f..906615ade8 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -591,18 +591,37 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL // static BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params, S32 channel) { - LLViewerTexture* bump = NULL; - U8 bump_code = params.mBump; + return bindBumpMap(bump_code, params.mTexture, params.mVSize, channel); +} + +//static +BOOL LLDrawPoolBump::bindBumpMap(LLFace* face, S32 channel) +{ + const LLTextureEntry* te = face->getTextureEntry(); + if (te) + { + U8 bump_code = te->getBumpmap(); + return bindBumpMap(bump_code, face->getTexture(), face->getVirtualSize(), channel); + } + + return FALSE; +} + +//static +BOOL LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, F32 vsize, S32 channel) +{ //Note: texture atlas does not support bump texture now. - LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(params.mTexture) ; + LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(texture) ; if(!tex) { //if the texture is not a fetched texture return FALSE; } + LLViewerTexture* bump = NULL; + switch( bump_code ) { case BE_NO_BUMP: @@ -616,7 +635,7 @@ BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params, S32 channel) if( bump_code < LLStandardBumpmap::sStandardBumpmapCount ) { bump = gStandardBumpmapList[bump_code].mImage; - gBumpImageList.addTextureStats(bump_code, tex->getID(), params.mVSize); + gBumpImageList.addTextureStats(bump_code, tex->getID(), vsize); } break; } diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index 89bbefe778..127c9efe85 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -93,7 +93,12 @@ public: /*virtual*/ void endPostDeferredPass(S32 pass); /*virtual*/ void renderPostDeferred(S32 pass); - BOOL bindBumpMap(LLDrawInfo& params, S32 channel = -2); + static BOOL bindBumpMap(LLDrawInfo& params, S32 channel = -2); + static BOOL bindBumpMap(LLFace* face, S32 channel = -2); + +private: + static BOOL bindBumpMap(U8 bump_code, LLViewerTexture* tex, F32 vsize, S32 channel); + }; enum EBumpEffect diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index eafc52748e..e64fdfc0b4 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -114,6 +114,8 @@ LLGLSLShader gDeferredEdgeProgram; LLGLSLShader gDeferredWaterProgram; LLGLSLShader gDeferredDiffuseProgram; LLGLSLShader gDeferredSkinnedDiffuseProgram; +LLGLSLShader gDeferredSkinnedBumpProgram; +LLGLSLShader gDeferredSkinnedAlphaProgram; LLGLSLShader gDeferredBumpProgram; LLGLSLShader gDeferredTerrainProgram; LLGLSLShader gDeferredTreeProgram; @@ -173,6 +175,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredLightProgram); mShaderList.push_back(&gDeferredMultiLightProgram); mShaderList.push_back(&gDeferredAlphaProgram); + mShaderList.push_back(&gDeferredSkinnedAlphaProgram); mShaderList.push_back(&gDeferredFullbrightProgram); mShaderList.push_back(&gDeferredPostGIProgram); mShaderList.push_back(&gDeferredEdgeProgram); @@ -591,6 +594,8 @@ void LLViewerShaderMgr::unloadShaders() gDeferredDiffuseProgram.unload(); gDeferredSkinnedDiffuseProgram.unload(); + gDeferredSkinnedBumpProgram.unload(); + gDeferredSkinnedAlphaProgram.unload(); mVertexShaderLevel[SHADER_LIGHTING] = 0; mVertexShaderLevel[SHADER_OBJECT] = 0; @@ -906,6 +911,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTreeProgram.unload(); gDeferredDiffuseProgram.unload(); gDeferredSkinnedDiffuseProgram.unload(); + gDeferredSkinnedBumpProgram.unload(); + gDeferredSkinnedAlphaProgram.unload(); gDeferredBumpProgram.unload(); gDeferredImpostorProgram.unload(); gDeferredTerrainProgram.unload(); @@ -958,6 +965,33 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredSkinnedDiffuseProgram.createShader(NULL, NULL); } + if (success) + { + gDeferredSkinnedBumpProgram.mName = "Deferred Skinned Bump Shader"; + gDeferredSkinnedBumpProgram.mFeatures.hasObjectSkinning = true; + gDeferredSkinnedBumpProgram.mShaderFiles.clear(); + gDeferredSkinnedBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredSkinnedBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredSkinnedBumpProgram.createShader(NULL, NULL); + } + + if (success) + { + gDeferredSkinnedAlphaProgram.mName = "Deferred Skinned Alpha Shader"; + gDeferredSkinnedAlphaProgram.mFeatures.hasObjectSkinning = true; + gDeferredSkinnedAlphaProgram.mFeatures.calculatesLighting = true; + gDeferredSkinnedAlphaProgram.mFeatures.calculatesAtmospherics = true; + gDeferredSkinnedAlphaProgram.mFeatures.hasGamma = true; + gDeferredSkinnedAlphaProgram.mFeatures.hasAtmospherics = true; + gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = true; + gDeferredSkinnedAlphaProgram.mShaderFiles.clear(); + gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); + } + if (success) { gDeferredBumpProgram.mName = "Deferred Bump Shader"; @@ -1176,7 +1210,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true; gDeferredAvatarAlphaProgram.mShaderFiles.clear(); gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarAlphaProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); } diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index bb28cd7ec2..da16a38427 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -350,6 +350,8 @@ extern LLGLSLShader gDeferredEdgeProgram; extern LLGLSLShader gDeferredWaterProgram; extern LLGLSLShader gDeferredDiffuseProgram; extern LLGLSLShader gDeferredSkinnedDiffuseProgram; +extern LLGLSLShader gDeferredSkinnedBumpProgram; +extern LLGLSLShader gDeferredSkinnedAlphaProgram; extern LLGLSLShader gDeferredBumpProgram; extern LLGLSLShader gDeferredTerrainProgram; extern LLGLSLShader gDeferredTreeProgram; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e263f8d937..220634897e 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3586,6 +3586,21 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_GLOW); } + + if (LLPipeline::sRenderDeferred) + { + if (type != LLDrawPool::POOL_ALPHA && !te->getFullbright()) + { + if (te->getBumpmap()) + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP); + } + else + { + pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE); + } + } + } } } -- cgit v1.2.3 From fd0b287be34f0d90b02c332494c96769c6ebb912 Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 4 May 2010 10:25:26 +0100 Subject: EXT-7168 Fix the tying of the deferred prefs UI to the featuretable. (transplanted from 3196941d73f122f5dbe42aa0ffdc28a2470ea089) --- indra/newview/llfloaterpreference.cpp | 35 +++++++++++++++++++++++++++++++++-- indra/newview/llviewershadermgr.cpp | 3 ++- indra/newview/pipeline.cpp | 9 +++++---- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 00292eecb4..de92b953fb 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -862,18 +862,22 @@ void LLFloaterPreference::refreshEnabledState() //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseFBO") && + LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && shaders) { - BOOL enabled = ctrl_wind_light->get() ? TRUE : FALSE; + BOOL enabled = (ctrl_wind_light->get()) ? TRUE : FALSE; ctrl_deferred->setEnabled(enabled); LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO"); LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail"); - enabled = enabled && (ctrl_deferred->get() ? TRUE : FALSE); + enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); ctrl_ssao->setEnabled(enabled); + + enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); + ctrl_shadow->setEnabled(enabled); } @@ -940,7 +944,34 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); } + + // disabled deferred + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")) + { + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); + } + + // disabled deferred SSAO + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO")) + { + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + } + // disabled deferred shadows + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail")) + { + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + } + // disabled reflections if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) { diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index e64fdfc0b4..49eeffe228 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -391,7 +391,8 @@ void LLViewerShaderMgr::setShaders() S32 water_class = 2; S32 deferred_class = 0; - if (gSavedSettings.getBOOL("RenderDeferred")) + if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + gSavedSettings.getBOOL("RenderDeferred")) { if (gSavedSettings.getS32("RenderShadowDetail") > 0) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6abe1041f7..2e2b2c02c3 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -633,10 +633,11 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) void LLPipeline::updateRenderDeferred() { BOOL deferred = (gSavedSettings.getBOOL("RenderDeferred") && - LLRenderTarget::sUseFBO && - gSavedSettings.getBOOL("VertexShaderEnable") && - gSavedSettings.getBOOL("RenderAvatarVP") && - gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE; + LLRenderTarget::sUseFBO && + LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + gSavedSettings.getBOOL("VertexShaderEnable") && + gSavedSettings.getBOOL("RenderAvatarVP") && + gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE; sRenderDeferred = deferred; } -- cgit v1.2.3 From ddad6dd5ea88705a0b7db603e1785715593624de Mon Sep 17 00:00:00 2001 From: Tofu Linden <tofu.linden@lindenlab.com> Date: Tue, 4 May 2010 14:55:02 +0100 Subject: EXT-7161 Fullbright has no effect on shiny & bump mapped prim while Lighting and Shadows are enabled. (transplanted from 6f25e5a4f0e0d7bbe1ed3e14e7da4d371e290c67) --- indra/newview/llvovolume.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 220634897e..f71c3ce418 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4060,13 +4060,13 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else if (LLPipeline::sRenderDeferred) { - if (te->getBumpmap()) + if (te->getFullbright()) { - registerFace(group, facep, LLRenderPass::PASS_BUMP); + registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); } - else if (te->getFullbright()) + else if (te->getBumpmap()) { - registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); + registerFace(group, facep, LLRenderPass::PASS_BUMP); } else { -- cgit v1.2.3 From 744f2e4951fc6fc1a1f08e97fc446e909c1fe39e Mon Sep 17 00:00:00 2001 From: Dave Parks <davep@lindenlab.com> Date: Tue, 4 May 2010 12:14:47 -0500 Subject: Cleanup from review. --- indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 3 +-- indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/llvovolume.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 6f027de6a2..7d18ae5036 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -54,8 +54,7 @@ void main() color.rgb = scaleSoftClip(color.rgb); - gl_FragColor = gl_Color; - //gl_FragColor = color; + gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); //gl_FragColor = vec4(1,0,1,1)*shadow; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ac599caa5b..a49cf8781e 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1103,7 +1103,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - if (pass >= 7 && pass <= 9) + if (pass >= 7 && pass < 9) { LLGLEnable blend(GL_BLEND); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 220634897e..1ed8da85a8 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3418,7 +3418,7 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); -LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj) +static LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj) { LLVOAvatar* avatar = vobj->getAvatar(); -- cgit v1.2.3