diff --git a/LICENSES/openal-linden.txt b/LICENSES/openal-linden.txt deleted file mode 100644 index ea1595f5f..000000000 --- a/LICENSES/openal-linden.txt +++ /dev/null @@ -1,4 +0,0 @@ -This is a modified version of openal-soft from GIT (56cc03860378e2758370b773b2a6f1b4e086b49a). -The modified source which this was built from is available here: -http://viewer-source-downloads.s3.amazonaws.com/install_pkgs/openal-soft-linden-56cc03860378e2758370b773b2a6f1b4e086b49a.tar.bz2 - diff --git a/indra/cmake/OpenGL.cmake b/indra/cmake/OpenGL.cmake index f8a113f65..5ba730c4a 100644 --- a/indra/cmake/OpenGL.cmake +++ b/indra/cmake/OpenGL.cmake @@ -1,10 +1,10 @@ # -*- cmake -*- include(Prebuilt) -if (NOT STANDALONE) +if (NOT (STANDALONE OR DARWIN)) use_prebuilt_binary(glext) # possible glh_linear should have its own .cmake file instead #use_prebuilt_binary(glh_linear) # actually... not any longer, it's now in git -SG set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) -endif (NOT STANDALONE) +endif () diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 089f8ed38..687e53568 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -153,10 +153,10 @@ const char LAND_LAYER_CODE = 'L'; const char WATER_LAYER_CODE = 'W'; const char WIND_LAYER_CODE = '7'; const char CLOUD_LAYER_CODE = '8'; -// Extended land layer for Aurora Sim +// Extended land layer for Aurora Sim const char AURORA_LAND_LAYER_CODE = 'M'; -const char AURORA_WATER_LAYER_CODE = 'X'; -const char AURORA_WIND_LAYER_CODE = '9'; +const char AURORA_WATER_LAYER_CODE = 'X'; +const char AURORA_WIND_LAYER_CODE = '9'; const char AURORA_CLOUD_LAYER_CODE = ':'; // keys diff --git a/indra/llplugin/llplugininstance.cpp b/indra/llplugin/llplugininstance.cpp index a8da3051a..15e1d347a 100644 --- a/indra/llplugin/llplugininstance.cpp +++ b/indra/llplugin/llplugininstance.cpp @@ -90,7 +90,7 @@ int LLPluginInstance::load(std::string &plugin_file) #if LL_LINUX && defined(LL_STANDALONE) void *dso_handle = dlopen(plugin_file.c_str(), RTLD_NOW | RTLD_GLOBAL); int result = (!dso_handle)?APR_EDSOOPEN:apr_os_dso_handle_put(&mDSOHandle, - dso_handle, AIAPRRootPool::get()()); + dso_handle, LLAPRRootPool::get()()); #else int result = apr_dso_load(&mDSOHandle, plugin_file.c_str(), diff --git a/indra/llplugin/llpluginsharedmemory.cpp b/indra/llplugin/llpluginsharedmemory.cpp index 883d7b634..56a6fe1c9 100644 --- a/indra/llplugin/llpluginsharedmemory.cpp +++ b/indra/llplugin/llpluginsharedmemory.cpp @@ -277,6 +277,14 @@ LLPluginSharedMemoryPlatformImpl::~LLPluginSharedMemoryPlatformImpl() bool LLPluginSharedMemory::map(void) { + llassert(mSize); + if (!mSize) + { + LL_DEBUGS("Plugin") << "Tried to mmap zero length" << LL_ENDL; + return false; + } + llassert(mImpl->mSharedMemoryFD != -1); + llassert(fcntl(mImpl->mSharedMemoryFD, F_GETFL) != -1); mMappedAddress = ::mmap(NULL, mSize, PROT_READ | PROT_WRITE, MAP_SHARED, mImpl->mSharedMemoryFD, 0); if(mMappedAddress == NULL) { diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 48fea8e87..57c229a12 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -68,6 +68,7 @@ BOOL gGLActive = FALSE; std::ofstream gFailLog; +#if !LL_DARWIN //Darwin doesn't load extensions that way! -SG void* gl_get_proc_address(const char *pStr) { void* pPtr = (void*)GLH_EXT_GET_PROC_ADDRESS(pStr); @@ -77,6 +78,7 @@ void* gl_get_proc_address(const char *pStr) } #undef GLH_EXT_GET_PROC_ADDRESS #define GLH_EXT_GET_PROC_ADDRESS(p) gl_get_proc_address(p) +#endif //!LL_DARWIN void ll_init_fail_log(std::string filename) { diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 6647a3390..c3f75acd9 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -58,6 +58,7 @@ using std::string; GLhandleARB LLGLSLShader::sCurBoundShader = 0; LLGLSLShader* LLGLSLShader::sCurBoundShaderPtr = NULL; +S32 LLGLSLShader::sIndexedTextureChannels = 0; bool LLGLSLShader::sNoFixedFunction = false; //UI shader -- declared here so llui_libtest will link properly diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index f05176fd5..e59a89265 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -77,6 +77,7 @@ public: static GLhandleARB sCurBoundShader; static LLGLSLShader* sCurBoundShaderPtr; + static S32 sIndexedTextureChannels; static bool sNoFixedFunction; void unload(); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index dc81d8e85..f4743dd84 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -36,6 +36,8 @@ #include "llfile.h" #include "llrender.h" +#include "llcontrol.h" //for LLCachedControl +#include "lldir.h" //for gDirUtilp #if LL_DARWIN #include "OpenGL/OpenGL.h" @@ -250,7 +252,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; + shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } @@ -289,7 +291,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; + shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } } @@ -313,7 +315,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { return FALSE; } - shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; + shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } else if (features->hasWaterFog) @@ -345,7 +347,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { return FALSE; } - shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; + shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } @@ -364,7 +366,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { return FALSE; } - shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; + shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } @@ -404,7 +406,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; + shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } } @@ -428,7 +430,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { return FALSE; } - shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; + shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } @@ -447,7 +449,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { return FALSE; } - shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; + shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } } @@ -606,7 +608,8 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = strdup(decl.c_str()); } - text[count++] = strdup("varying float vary_texture_index;\n"); + if(texture_index_channels != 1) + text[count++] = strdup("varying float vary_texture_index;\n"); text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n"); text[count++] = strdup("{\n"); @@ -701,6 +704,8 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade } } + std::string error_str; + if (error == GL_NO_ERROR) { //check for errors @@ -714,6 +719,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade //an error occured, print log LL_WARNS("ShaderLoading") << "GLSL Compilation Error: (" << error << ") in " << filename << LL_ENDL; dumpObjectLog(ret); + error_str = get_object_log(ret); std::stringstream ostr; //dump shader source for debugging @@ -732,6 +738,32 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade { ret = 0; } + static const LLCachedControl dump_raw_shaders("ShyotlDumpRawShaders",false); + if(dump_raw_shaders || ret) + { + std::stringstream ostr; + for (GLuint i = 0; i < count; i++) + { + ostr << text[i]; + } + + std::string delim = gDirUtilp->getDirDelimiter(); + std::string shader_name = filename.substr(filename.find_last_of("/")+1); //shader_name.glsl + shader_name = shader_name.substr(0,shader_name.find_last_of(".")); //shader_name + std::string maindir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"shader_dump"+delim); + //mkdir is NOT recursive. Step through the folders one by one. + LLFile::mkdir(maindir); //..Roaming/SecondLife/logs/shader_dump/ + LLFile::mkdir(maindir+="class" + llformat("%i",gpu_class) + delim); //..shader_dump/class1/ + LLFile::mkdir(maindir+=filename.substr(0,filename.find_last_of("/")+1)); //..shader_dump/class1/windlight/ + + LLAPRFile file(maindir + shader_name + (ret ? "" : llformat("_FAILED(%i)",error)) + ".glsl", LL_APR_W); + file.write(ostr.str().c_str(),ostr.str().length()); + if(!error_str.empty()) + { + LLAPRFile file2(maindir + shader_name + "_ERROR" + ".txt", LL_APR_W); + file.write(error_str.c_str(),error_str.length()); + } + } stop_glerror(); //free memory diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5234b8f3e..6d480c2b4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -474,42 +474,7 @@ Boolean Value 0 - - ShyotlRenderVBOStrideMode - - Comment - 0 = Standard behavior -1 = Force strided VBOs -2 = Force unstrided(dense) VBOs - Persist - 1 - Type - U32 - Value - 0 - - ShyotlUseLegacyRenderPath - - Comment - Use deprecated pre-3.x OpenGL api calls. - Persist - 1 - Type - Boolean - Value - 0 - - ShyotlUseLegacyTextureBatching - - Comment - Disable usage of extra samplers in shaders. Decreases batch sizes, however also reduces branching in shaders drastcially. - Persist - 1 - Type - Boolean - Value - 0 - + ResetFocusOnSelfClick Comment diff --git a/indra/newview/app_settings/settings_sh.xml b/indra/newview/app_settings/settings_sh.xml index 1838edac6..4ae81ed52 100644 --- a/indra/newview/app_settings/settings_sh.xml +++ b/indra/newview/app_settings/settings_sh.xml @@ -168,5 +168,84 @@ Value 10.0 + ShyotlRenderVBOStrideMode + + Comment + 0 = Standard behavior +1 = Force strided VBOs +2 = Force unstrided(dense) VBOs + Persist + 1 + Type + U32 + Value + 0 + + ShyotlUseLegacyRenderPath + + Comment + Use deprecated pre-3.x OpenGL api calls. + Persist + 1 + Type + Boolean + Value + 0 + + ShyotlUseLegacyTextureBatching + + Comment + Disable usage of extra samplers in shaders. Decreases batch sizes, however also reduces branching in shaders drastically. + Persist + 1 + Type + Boolean + Value + 0 + + ShyotlUseLegacyDynamicTexture + + Comment + Disable shader path when rendering dynamic textures. + Persist + 1 + Type + Boolean + Value + 0 + + ShyotlUseLegacyTextureBaking + + Comment + Disable shader path when generating baked textures. + Persist + 1 + Type + Boolean + Value + 1 + + ShyotlDumpRawShaders + + Comment + Dump shader data being passed to glShaderSourceARB. + Persist + 1 + Type + Boolean + Value + 0 + + ShyotlDrawOrphanAttachments + + Comment + Render attachments lacking an 'alive' owner. + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl index 056d1a958..3213ea4d6 100644 --- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl @@ -11,6 +11,6 @@ void main() //transform vertex gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex; gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1; + gl_TexCoord[1] = gl_TextureMatrix[0] * gl_MultiTexCoord1; gl_FrontColor = gl_Color; } diff --git a/indra/newview/app_settings/shaders/class2/effects/gaussBlurF.glsl b/indra/newview/app_settings/shaders/class2/effects/gaussBlurF.glsl index f58622ab6..2cdd934e0 100644 --- a/indra/newview/app_settings/shaders/class2/effects/gaussBlurF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/gaussBlurF.glsl @@ -4,28 +4,28 @@ uniform sampler2DRect RenderTexture; uniform int horizontalPass; -uniform float offset[2] = float[2]( 1.3846153846, 3.2307692308 ); -uniform float weight[3] = float[3]( 0.2270270270, 0.3162162162, 0.0702702703 ); +vec2 offset = vec2( 1.3846153846, 3.2307692308 ); +vec3 weight = vec3( 0.2270270270, 0.3162162162, 0.0702702703 ); void main(void) { - vec4 color = texture2DRect(RenderTexture, gl_TexCoord[0].st)*weight[0]; + vec4 color = texture2DRect(RenderTexture, gl_TexCoord[0].st)*weight.x; if(horizontalPass == 1) { - color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset[0],gl_TexCoord[0].y)); - color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset[0],gl_TexCoord[0].y)); - color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset[1],gl_TexCoord[0].y)); - color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset[1],gl_TexCoord[0].y)); + color += weight.y * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset.x,gl_TexCoord[0].y)); + color += weight.y * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset.x,gl_TexCoord[0].y)); + color += weight.z * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset.y,gl_TexCoord[0].y)); + color += weight.z * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset.y,gl_TexCoord[0].y)); } else { - color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset[0])); - color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset[0])); - color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset[1])); - color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset[1])); + color += weight.y * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset.x)); + color += weight.y * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset.x)); + color += weight.z * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset.y)); + color += weight.z * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset.y)); } gl_FragColor = color; -} \ No newline at end of file +} diff --git a/indra/newview/hipporestrequest.cpp b/indra/newview/hipporestrequest.cpp index 52adf6c39..8953dec87 100644 --- a/indra/newview/hipporestrequest.cpp +++ b/indra/newview/hipporestrequest.cpp @@ -327,6 +327,7 @@ int HippoRestRequest::getBlocking(const std::string &url, std::string *result) curl_easy_setopt(curlp, CURLOPT_NOSIGNAL, 1); // don't use SIGALRM for timeouts curl_easy_setopt(curlp, CURLOPT_TIMEOUT, 5); // seconds + curl_easy_setopt(curlp, CURLOPT_CAINFO, gDirUtilp->getCAFile().c_str()); curl_easy_setopt(curlp, CURLOPT_WRITEFUNCTION, curlWrite); curl_easy_setopt(curlp, CURLOPT_WRITEDATA, result); diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 1bacedada..824e7d755 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -265,6 +265,9 @@ void LLAgent::init() // LLDebugVarMessageBox::show("Camera Lag", &CAMERA_FOCUS_HALF_LIFE, 0.5f, 0.01f); *mEffectColor = gSavedSettings.getColor4("EffectColor"); + + gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2)); + gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2)); mInitialized = TRUE; } @@ -2377,6 +2380,15 @@ const LLAgentAccess& LLAgent::getAgentAccess() return *mAgentAccess; } +bool LLAgent::validateMaturity(const LLSD& newvalue) +{ + return mAgentAccess->canSetMaturity(newvalue.asInteger()); +} + +void LLAgent::handleMaturity(const LLSD& newvalue) +{ + sendMaturityPreferenceToServer(newvalue.asInteger()); +} void LLAgent::buildFullname(std::string& name) const { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index b7cdc17ac..2c87d27b7 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -661,6 +661,10 @@ public: static int convertTextToMaturity(char text); bool sendMaturityPreferenceToServer(int preferredMaturity); // ! "U8" instead of "int"? + // Maturity callbacks for PreferredMaturity control variable + void handleMaturity(const LLSD& newvalue); + bool validateMaturity(const LLSD& newvalue); + /** Access diff --git a/indra/newview/llagentaccess.cpp b/indra/newview/llagentaccess.cpp index a43f358e6..8e93c06fc 100644 --- a/indra/newview/llagentaccess.cpp +++ b/indra/newview/llagentaccess.cpp @@ -172,6 +172,7 @@ int LLAgentAccess::convertTextToMaturity(char text) void LLAgentAccess::setMaturity(char text) { mAccess = LLAgentAccess::convertTextToMaturity(text); + llinfos << "Setting agent maturity to " << text << " " << (int)mAccess << llendl; U32 preferred_access = mSavedSettings.getU32("PreferredMaturity"); while (!canSetMaturity(preferred_access)) { diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 886348d1a..e625e1b4c 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1130,6 +1130,9 @@ void LLAgentWearables::makeNewOutfit( if( old_wearable ) { LLViewerInventoryItem* item = gInventory.getItem(getWearableItemID((LLWearableType::EType)index)); + llassert(item); + if (!item) + continue; if (fUseOutfits) { std::string strOrdering = llformat("@%d", item->getWearableType() * 100); diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 664db16b7..77aa8979e 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -259,8 +259,8 @@ void LLDrawPoolAlpha::render(S32 pass) } } - LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy || - (deferred_render && pass == 1) ? GL_TRUE : GL_FALSE); + LLGLDepthTest depth(GL_TRUE, (LLDrawPoolWater::sSkipScreenCopy || + (deferred_render && pass == 1)) ? GL_TRUE : GL_FALSE); if (deferred_render && pass == 1) { diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index f5274e462..d6516c520 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -793,8 +793,7 @@ void LLDrawPoolBump::endBump(U32 pass) else { // Disable texture blending on unit 1 - gGL.getTexUnit(1)->activate(); - gGL.getTexUnit(1)->disable(); + gGL.getTexUnit(1)->disable(); gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT); // Disable texture blending on unit 0 @@ -1375,11 +1374,16 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL } else { - gGL.getTexUnit(1)->activate(); + if (!gPipeline.canUseVertexShaders()) + { + gGL.getTexUnit(1)->activate(); + glMatrixMode(GL_TEXTURE); + glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); + } + gGL.getTexUnit(0)->activate(); glMatrixMode(GL_TEXTURE); glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); gPipeline.mTextureMatrixOps++; - gGL.getTexUnit(0)->activate(); } glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); @@ -1416,9 +1420,14 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL } else { - gGL.getTexUnit(1)->activate(); - glLoadIdentity(); + if (!gPipeline.canUseVertexShaders()) + { + gGL.getTexUnit(1)->activate(); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + } gGL.getTexUnit(0)->activate(); + glMatrixMode(GL_TEXTURE); } glLoadIdentity(); glMatrixMode(GL_MODELVIEW); @@ -1429,7 +1438,7 @@ void LLDrawPoolInvisible::render(S32 pass) { //render invisiprims LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE); - if (gPipeline.canUseVertexShaders()) + if (LLGLSLShader::sNoFixedFunction) { gOcclusionProgram.bind(); } @@ -1441,7 +1450,7 @@ void LLDrawPoolInvisible::render(S32 pass) gGL.setColorMask(true, false); glStencilMask(0xFFFFFFFF); - if (gPipeline.canUseVertexShaders()) + if (LLGLSLShader::sNoFixedFunction) { gOcclusionProgram.unbind(); } diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 5a221b7a8..df65acf70 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -66,13 +66,16 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) : LLFacePool(POOL_TERRAIN), mTexturep(texturep) { + U32 format = GL_ALPHA8; + U32 int_format = GL_ALPHA; + // Hack! sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale"); sDetailMode = gSavedSettings.getS32("RenderTerrainDetail"); mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga", TRUE, LLViewerTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, - GL_ALPHA8, GL_ALPHA, + format, int_format, LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb")); //gGL.getTexUnit(0)->bind(mAlphaRampImagep.get()); @@ -81,7 +84,7 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) : m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c", TRUE, LLViewerTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, - GL_ALPHA8, GL_ALPHA, + format, int_format, LLUUID("38b86f85-2575-52a9-a531-23108d8da837")); //gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get()); diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 5da531216..5453dca8f 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -190,6 +190,7 @@ void LLDrawPoolTree::endShadowPass(S32 pass) static const LLCachedControl render_deferred_offset("RenderDeferredSpotShadowOffset",1.f); static const LLCachedControl render_deferred_bias("RenderDeferredSpotShadowBias",1.f); glPolygonOffset(render_deferred_offset,render_deferred_bias); + gDeferredShadowAlphaMaskProgram.unbind(); } void LLDrawPoolTree::renderTree(BOOL selecting) diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index e6da1e631..35dc24348 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -281,7 +281,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount()) { - if (gPipeline.canUseVertexShaders()) + if (LLGLSLShader::sNoFixedFunction) { gUIProgram.bind(); } @@ -301,7 +301,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() LLFacePool::LLOverrideFaceColor color_override(this, color); face->renderIndexed(); - if (gPipeline.canUseVertexShaders()) + if (LLGLSLShader::sNoFixedFunction) { gUIProgram.unbind(); } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 4a57b390e..bb940839b 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -536,6 +536,8 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) else #endif //MESH_ENABLED { + LLGLEnable poly_offset(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(-1.f,-1.f); mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); #if !LL_RELEASE_FOR_DOWNLOAD LLGLState::checkClientArrays("", LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 94e3a4d73..9bbbf0b8f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -797,7 +797,7 @@ void LLInvFVBridge::addDeleteContextMenuOptions(menuentry_vec_t &items, } // "Remove link" and "Delete" are the same operation. - if (obj && obj->getIsLinkType() && !get_is_item_worn(mUUID)) + if (obj && obj->getIsLinkType() /* && !get_is_item_worn(mUUID)*/) { items.push_back(std::string("Remove Link")); } @@ -4289,7 +4289,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!avatarp->canAttachMoreObjects()) { - disabled_items.push_back(std::string("Object Wea")); + disabled_items.push_back(std::string("Object Wear")); disabled_items.push_back(std::string("Object Add")); disabled_items.push_back(std::string("Attach To")); disabled_items.push_back(std::string("Attach To HUD")); diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp index 1580dad5e..aefc0b4ab 100644 --- a/indra/newview/llinventoryicon.cpp +++ b/indra/newview/llinventoryicon.cpp @@ -68,7 +68,7 @@ LLIconDictionary::LLIconDictionary() addEntry(LLInventoryIcon::ICONNAME_BODYPART_HAIR, new IconEntry("inv_item_hair.tga")); addEntry(LLInventoryIcon::ICONNAME_BODYPART_EYES, new IconEntry("inv_item_eyes.tga")); - addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SHIRT, new IconEntry("inv_item_skirt.tga")); + addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SHIRT, new IconEntry("inv_item_shirt.tga")); addEntry(LLInventoryIcon::ICONNAME_CLOTHING_PANTS, new IconEntry("inv_item_pants.tga")); addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SHOES, new IconEntry("inv_item_shoes.tga")); addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SOCKS, new IconEntry("inv_item_socks.tga")); @@ -82,7 +82,7 @@ LLIconDictionary::LLIconDictionary() addEntry(LLInventoryIcon::ICONNAME_ANIMATION, new IconEntry("inv_item_animation.tga")); addEntry(LLInventoryIcon::ICONNAME_GESTURE, new IconEntry("inv_item_gesture.tga")); - addEntry(LLInventoryIcon::ICONNAME_CLOTHING_PHYSICS, new IconEntry("inv_item_physics.tga")); + addEntry(LLInventoryIcon::ICONNAME_CLOTHING_PHYSICS, new IconEntry("inv_item_physics.tga")); addEntry(LLInventoryIcon::ICONNAME_LINKITEM, new IconEntry("inv_link_item.tga")); addEntry(LLInventoryIcon::ICONNAME_LINKFOLDER, new IconEntry("inv_link_folder.tga")); diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 6e3421f1f..10930b0a5 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -364,7 +364,7 @@ LLVector3 LLManip::getPivotPoint() { if(pivot_as_percent) offset = ((offset * .01f) - LLVector3(.5f,.5f,.5f)).scaleVec(mObjectSelection->getFirstRootObject(TRUE)->getScale()); - return mObjectSelection->getFirstObject()->getPivotPositionAgent() + offset * mObjectSelection->getFirstRootObject(TRUE)->getRotation(); + return mObjectSelection->getFirstRootObject(TRUE)->getPivotPositionAgent() + offset * mObjectSelection->getFirstRootObject(TRUE)->getRotation(); } if(pivot_as_percent) offset = ((offset * .01f) - LLVector3(.5f,.5f,.5f)).scaleVec(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal()); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index bc147fd7d..eb7685007 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -328,6 +328,8 @@ void LLNetMap::draw() LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal); map_center_agent -= gAgentCamera.getCameraPositionAgent(); + map_center_agent.mV[0] *= mScale/LLWorld::getInstance()->getRegionWidthInMeters(); + map_center_agent.mV[1] *= mScale/LLWorld::getInstance()->getRegionWidthInMeters(); gGL.getTexUnit(0)->bind(mObjectImagep); F32 image_half_width = 0.5f*mObjectMapPixels; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 7e340d369..271ea92c4 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1207,7 +1207,7 @@ void LLPanelFace::onClickCopy(void* userdata) LLInventoryItem* itemp = gInventory.getItem(objectp->getTE(i)->getID()); LLUUID tex = tex_params["imageid"]; tex_params["imageid"] = LLUUID::null; - gSavedPerAccountSettings.setLLSD("Image.Settings", tex_params); + //gSavedPerAccountSettings.setLLSD("Image.Settings", tex_params); if (itemp) { LLPermissions perms = itemp->getPermissions(); diff --git a/indra/newview/llpanelgeneral.cpp b/indra/newview/llpanelgeneral.cpp index 24e1c03f8..a238d408d 100644 --- a/indra/newview/llpanelgeneral.cpp +++ b/indra/newview/llpanelgeneral.cpp @@ -154,22 +154,6 @@ void LLPanelGeneral::apply() LLComboBox* crash_behavior_combobox = getChild("crash_behavior_combobox"); gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); - - // if we have no agent, we can't let them choose anything - // if we have an agent, then we only let them choose if they have a choice - bool can_choose = gAgent.getID().notNull() && - (gAgent.isMature() || gAgent.isGodlike()); - - if (can_choose) - { - int preferred_maturity = childGetValue("maturity_desired_combobox").asInteger(); - - if (preferred_maturity != gSavedSettings.getU32("PreferredMaturity")) - { - gSavedSettings.setU32("PreferredMaturity", preferred_maturity); - gAgent.sendMaturityPreferenceToServer(preferred_maturity); - } - } } void LLPanelGeneral::cancel() diff --git a/indra/newview/llsurfacepatch.h b/indra/newview/llsurfacepatch.h index 1f9658d4a..ebfb64c1d 100644 --- a/indra/newview/llsurfacepatch.h +++ b/indra/newview/llsurfacepatch.h @@ -35,7 +35,7 @@ #include "v3math.h" #include "v3dmath.h" -#include "llmemory.h" +#include "llpointer.h" class LLSurface; class LLVOSurfacePatch; diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index c31717779..31b74c081 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -77,6 +77,8 @@ void LLToolComposite::setCurrentTool( LLTool* new_tool ) { if( mCur != new_tool ) { + if(new_tool) + lldebugs << "Current Tool: " << new_tool->getName() << llendl; if( mSelected ) { mCur->handleDeselect(); diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 167d03a5a..b5e764dac 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -738,6 +738,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) } // HACK to avoid assert: error checking system makes sure that the cursor is set during every handleHover. This is actually a no-op since the cursor is hidden. + gViewerWindow->hideCursor(); gViewerWindow->setCursor(UI_CURSOR_ARROW); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (active) [cursor hidden]" << llendl; diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index eaf6c5a68..c407a6cb4 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -80,11 +80,11 @@ LLToolMgr::LLToolMgr() gToolNull = new LLTool(LLStringUtil::null); // Does nothing setCurrentTool(gToolNull); - gBasicToolset = new LLToolset(); - gCameraToolset = new LLToolset(); -// gLandToolset = new LLToolset(); - gMouselookToolset = new LLToolset(); - gFaceEditToolset = new LLToolset(); + gBasicToolset = new LLToolset("Basic"); + gCameraToolset = new LLToolset("Camera"); +// gLandToolset = new LLToolset("Land"); + gMouselookToolset = new LLToolset("MouseLook"); + gFaceEditToolset = new LLToolset("FaceEdit"); } void LLToolMgr::initTools() @@ -149,6 +149,7 @@ void LLToolMgr::setCurrentToolset(LLToolset* current) { mSelectedTool->handleDeselect(); } + lldebugs << "Current tool set: " << current->getName() << llendl; mCurrentToolset = current; // select first tool of new toolset only if toolset changed mCurrentToolset->selectFirstTool(); @@ -164,6 +165,8 @@ LLToolset* LLToolMgr::getCurrentToolset() void LLToolMgr::setCurrentTool( LLTool* tool ) { + if(tool && mBaseTool!=tool) + lldebugs << "Current Tool: " << tool->getName() << llendl; if (mTransientTool) { mTransientTool = NULL; diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index 92647c99d..2abba2220 100644 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -93,7 +93,7 @@ protected: class LLToolset { public: - LLToolset() : mSelectedTool(NULL) {} + LLToolset(const char *name) : mSelectedTool(NULL), mName(name) {} LLTool* getSelectedTool() { return mSelectedTool; } @@ -109,7 +109,9 @@ public: BOOL isToolSelected( S32 index ); + const char* getName() const {return mName;} protected: + const char* mName; LLTool* mSelectedTool; typedef std::vector tool_list_t; tool_list_t mToolList; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 54ccb94dc..d89c17c87 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -652,7 +652,7 @@ void settings_setup_listeners() gSavedSettings.getControl("OctreeMaxNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2)); gSavedSettings.getControl("OctreeAlphaDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); - gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _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/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 481f6538c..aff062881 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -808,7 +808,7 @@ void init_menus() menu->appendSeparator(); menu->append(new LLMenuItemCallGL( "Fake Away Status", &handle_fake_away_status, NULL)); menu->append(new LLMenuItemCallGL( "Force Ground Sit", &handle_force_ground_sit, NULL)); - menu->append(new LLMenuItemCallGL( "Phantom Avatar", &handle_phantom_avatar, NULL)); + menu->append(new LLMenuItemCallGL( "Phantom Avatar", &handle_phantom_avatar, NULL, NULL, 'P', MASK_CONTROL | MASK_ALT)); menu->appendSeparator(); menu->append(new LLMenuItemCallGL( "Animation Override...", &handle_edit_ao, NULL)); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 4bc79c3f3..088cdb7a8 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -32,6 +32,7 @@ #include "llviewerprecompiledheaders.h" +#include //First, because glh_linear #defines equivalent.. which boost uses internally #include "llfeaturemanager.h" #include "llviewershadermgr.h" @@ -351,10 +352,26 @@ void LLViewerShaderMgr::setShaders() return; } + { + const std::string dumpdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"shader_dump")+gDirUtilp->getDirDelimiter(); + boost::filesystem::remove_all(dumpdir); + } + + LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1); + static const LLCachedControl no_texture_indexing("ShyotlUseLegacyTextureBatching",false); + static const LLCachedControl use_legacy_path("ShyotlUseLegacyRenderPath", false); //Legacy does not jive with new batching. + if(no_texture_indexing || use_legacy_path) + LLGLSLShader::sIndexedTextureChannels = 1; + + reentrance = true; + if (gGLManager.mGLVersion < 2.f) + { //NEVER use shaders on a pre 2.0 context + gSavedSettings.setBOOL("VertexShaderEnable", FALSE); + } + //setup preprocessor definitions LLShaderMgr::instance()->mDefinitions["samples"] = llformat("%d", gSavedSettings.getU32("RenderFSAASamples")/*gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples"))*/); LLShaderMgr::instance()->mDefinitions["NUM_TEX_UNITS"] = llformat("%d", gGLManager.mNumTextureImageUnits); - reentrance = true; initAttribsAndUniforms(); gPipeline.releaseGLBuffers(); @@ -619,7 +636,6 @@ BOOL LLViewerShaderMgr::loadBasicShaders() // (in order of shader function call depth for reference purposes, deepest level first) vector< pair > shaders; - shaders.reserve(10); shaders.push_back( make_pair( "windlight/atmosphericsVarsV.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); shaders.push_back( make_pair( "windlight/atmosphericsHelpersV.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); shaders.push_back( make_pair( "lighting/lightFuncV.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); @@ -648,8 +664,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() // (in order of shader function call depth for reference purposes, deepest level first) shaders.clear(); - shaders.reserve(13); - S32 ch = gGLManager.mNumTextureImageUnits-1; + S32 ch = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); static const LLCachedControl no_texture_indexing("ShyotlUseLegacyTextureBatching",false); static const LLCachedControl use_legacy_path("ShyotlUseLegacyRenderPath", false); //Legacy does not jive with new batching. @@ -936,7 +951,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDiffuseProgram.mShaderFiles.clear(); gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredDiffuseProgram.createShader(NULL, NULL); } @@ -947,7 +962,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDiffuseAlphaMaskProgram.mShaderFiles.clear(); gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredDiffuseAlphaMaskProgram.createShader(NULL, NULL); } @@ -1125,11 +1140,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels if (mVertexShaderLevel[SHADER_DEFERRED] < 1) { - gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; } else { //shave off some texture units for shadow maps - gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits - 6; + gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels - 6, 1); } gDeferredAlphaProgram.mShaderFiles.clear(); @@ -1145,7 +1160,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightProgram.mFeatures.calculatesAtmospherics = true; gDeferredFullbrightProgram.mFeatures.hasGamma = true; gDeferredFullbrightProgram.mFeatures.hasTransport = true; - gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredFullbrightProgram.mShaderFiles.clear(); gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -1596,19 +1611,19 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { - gObjectSimpleAlphaMaskProgram.mName = "Simple Alpha Mask Shader"; - gObjectSimpleAlphaMaskProgram.mFeatures.calculatesLighting = true; - gObjectSimpleAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasGamma = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasLighting = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true; - gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectSimpleAlphaMaskProgram.mShaderFiles.clear(); - gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); - gObjectSimpleAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL); + gObjectSimpleWaterProgram.mName = "Simple Water Shader"; + gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true; + gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true; + gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleWaterProgram.mFeatures.hasLighting = true; + gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectSimpleWaterProgram.mShaderFiles.clear(); + gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectSimpleWaterProgram.createShader(NULL, NULL); } if (success) @@ -1625,25 +1640,34 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectBumpProgram.createShader(NULL, NULL); + + if (success) + { //lldrawpoolbump assumes "texture0" has channel 0 and "texture1" has channel 1 + gObjectBumpProgram.bind(); + gObjectBumpProgram.uniform1i("texture0", 0); + gObjectBumpProgram.uniform1i("texture1", 1); + gObjectBumpProgram.unbind(); + } } + if (success) { - gObjectSimpleWaterProgram.mName = "Simple Water Shader"; - gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true; - gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true; - gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleWaterProgram.mFeatures.hasLighting = true; - gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectSimpleWaterProgram.mShaderFiles.clear(); - gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); - gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectSimpleWaterProgram.createShader(NULL, NULL); + gObjectSimpleAlphaMaskProgram.mName = "Simple Alpha Mask Shader"; + gObjectSimpleAlphaMaskProgram.mFeatures.calculatesLighting = true; + gObjectSimpleAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasGamma = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasLighting = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true; + gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectSimpleAlphaMaskProgram.mShaderFiles.clear(); + gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL); } - + if (success) { gObjectSimpleWaterAlphaMaskProgram.mName = "Simple Water Alpha Mask Shader"; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 5de2a805e..36370137e 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -159,7 +159,7 @@ void LLViewerTextureList::doPreloadImages() image->setAddressMode(LLTexUnit::TAM_WRAP); mImagePreloads.insert(image); } - image = LLViewerTextureManager::getFetchedTextureFromFile("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c"/*"transparent.j2c"*/, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, + image = LLViewerTextureManager::getFetchedTextureFromFile("transparent.j2c", MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, 0,0,LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903")); if (image) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2426c75a5..954834d60 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4481,7 +4481,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei gPipeline.resetDrawOrders(); } - if (high_res && (show_ui || !hide_hud)) + if (high_res) { send_agent_resume(); } diff --git a/indra/newview/llvoclouds.cpp b/indra/newview/llvoclouds.cpp index e56c78638..e7278f9bc 100644 --- a/indra/newview/llvoclouds.cpp +++ b/indra/newview/llvoclouds.cpp @@ -213,12 +213,13 @@ void LLVOClouds::getGeometry(S32 te, color.setVec(float_color); facep->setFaceColor(float_color); - - LLVector3 up; - LLVector3 right; - LLVector3 at; + LLVector4a puff_pos_agent; + puff_pos_agent.load3(facep->mCenterLocal.mV); + LLVector4a at; + at.load3(LLViewerCamera::getInstance()->getAtAxis().mV); + LLVector4a up(0, 0, 1); + LLVector4a right; - const LLVector3& puff_pos_agent = facep->mCenterLocal; LLVector2 uvs[4]; uvs[0].setVec(0.f, 1.f); @@ -226,34 +227,43 @@ void LLVOClouds::getGeometry(S32 te, uvs[2].setVec(1.f, 1.f); uvs[3].setVec(1.f, 0.f); - LLVector3 vtx[4]; - - at = LLViewerCamera::getInstance()->getAtAxis(); - right = at % LLVector3(0.f, 0.f, 1.f); - right.normVec(); - up = right % at; - up.normVec(); - right *= 0.5f*CLOUD_PUFF_WIDTH; - up *= 0.5f*CLOUD_PUFF_HEIGHT;; + right.setCross3(at, up); + right.normalize3fast(); + up.setCross3(right, at); + up.normalize3fast(); + right.mul(0.5f*CLOUD_PUFF_WIDTH); + up.mul(0.5f*CLOUD_PUFF_HEIGHT); *colorsp++ = color; *colorsp++ = color; *colorsp++ = color; *colorsp++ = color; - vtx[0] = puff_pos_agent - right + up; - vtx[1] = puff_pos_agent - right - up; - vtx[2] = puff_pos_agent + right + up; - vtx[3] = puff_pos_agent + right - up; + LLVector4a ppapu; + LLVector4a ppamu; + + ppapu.setAdd(puff_pos_agent, up); + ppamu.setSub(puff_pos_agent, up); + + LLVector4a vtx[4]; + vtx[0].setSub(ppapu, right); + vtx[1].setSub(ppamu, right); + vtx[2].setAdd(ppapu, right); + vtx[3].setAdd(ppamu, right); - *(verticesp->mV+3) = 0.f; - *verticesp++ = vtx[0]; - *(verticesp->mV+3) = 0.f; - *verticesp++ = vtx[1]; - *(verticesp->mV+3) = 0.f; - *verticesp++ = vtx[2]; - *(verticesp->mV+3) = 0.f; - *verticesp++ = vtx[3];; + verticesp->set(vtx[0].getF32ptr()); + *((verticesp++)->mV+3) = 0.f; + verticesp->set(vtx[1].getF32ptr()); + *((verticesp++)->mV+3) = 0.f; + verticesp->set(vtx[2].getF32ptr()); + *((verticesp++)->mV+3) = 0.f; + verticesp->set(vtx[3].getF32ptr()); + *((verticesp++)->mV+3) = 0.f; + + //*verticesp++ = puff_pos_agent - right + up; + //*verticesp++ = puff_pos_agent - right - up; + //*verticesp++ = puff_pos_agent + right + up; + //*verticesp++ = puff_pos_agent + right - up; *texcoordsp++ = uvs[0]; *texcoordsp++ = uvs[1]; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 5391d5841..27a333224 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -289,37 +289,54 @@ void LLVOPartGroup::getGeometry(S32 idx, U32 vert_offset = mDrawable->getFace(idx)->getGeomIndex(); - LLVector3 part_pos_agent(part.mPosAgent); - LLVector3 camera_agent = getCameraPosition(); - LLVector3 at = part_pos_agent - camera_agent; - LLVector3 up; - LLVector3 right; + LLVector4a part_pos_agent; + part_pos_agent.load3(part.mPosAgent.mV); + LLVector4a camera_agent; + camera_agent.load3(getCameraPosition().mV); + LLVector4a at; + at.setSub(part_pos_agent, camera_agent); + LLVector4a up(0, 0, 1); + LLVector4a right; - right = at % LLVector3(0.f, 0.f, 1.f); - right.normalize(); - up = right % at; - up.normalize(); + right.setCross3(at, up); + right.normalize3fast(); + up.setCross3(right, at); + up.normalize3fast(); if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK) { - LLVector3 normvel = part.mVelocity; - normvel.normalize(); + LLVector4a normvel; + normvel.load3(part.mVelocity.mV); + normvel.normalize3fast(); LLVector2 up_fracs; - up_fracs.mV[0] = normvel*right; - up_fracs.mV[1] = normvel*up; + up_fracs.mV[0] = normvel.dot3(right).getF32(); + up_fracs.mV[1] = normvel.dot3(up).getF32(); up_fracs.normalize(); - LLVector3 new_up; - LLVector3 new_right; - new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; - new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; + LLVector4a new_up; + LLVector4a new_right; + + //new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; + LLVector4a t = right; + t.mul(up_fracs.mV[0]); + new_up = up; + new_up.mul(up_fracs.mV[1]); + new_up.add(t); + + //new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; + t = right; + t.mul(up_fracs.mV[1]); + new_right = up; + new_right.mul(up_fracs.mV[0]); + t.sub(new_right); + up = new_up; - right = new_right; - up.normalize(); - right.normalize(); + right = t; + up.normalize3fast(); + right.normalize3fast(); } - right *= 0.5f*part.mScale.mV[0]; - up *= 0.5f*part.mScale.mV[1]; + right.mul(0.5f*part.mScale.mV[0]); + up.mul(0.5f*part.mScale.mV[1]); LLVector3 normal = -LLViewerCamera::getInstance()->getXAxis(); @@ -328,14 +345,31 @@ void LLVOPartGroup::getGeometry(S32 idx, // this works because there is actually a 4th float stored after the vertex position which is used as a texture index // also, somebody please VECTORIZE THIS - *(verticesp->mV+3) = 0.f; - *verticesp++ = part_pos_agent + up - right; - *(verticesp->mV+3) = 0.f; - *verticesp++ = part_pos_agent - up - right; - *(verticesp->mV+3) = 0.f; - *verticesp++ = part_pos_agent + up + right; - *(verticesp->mV+3) = 0.f; - *verticesp++ = part_pos_agent - up + right; + LLVector4a ppapu; + LLVector4a ppamu; + + ppapu.setAdd(part_pos_agent, up); + ppamu.setSub(part_pos_agent, up); + + LLVector4a vtx[4]; + vtx[0].setSub(ppapu, right); + vtx[1].setSub(ppamu, right); + vtx[2].setAdd(ppapu, right); + vtx[3].setAdd(ppamu, right); + + verticesp->set(vtx[0].getF32ptr()); + *((verticesp++)->mV+3) = 0.f; + verticesp->set(vtx[1].getF32ptr()); + *((verticesp++)->mV+3) = 0.f; + verticesp->set(vtx[2].getF32ptr()); + *((verticesp++)->mV+3) = 0.f; + verticesp->set(vtx[3].getF32ptr()); + *((verticesp++)->mV+3) = 0.f; + + //*verticesp++ = part_pos_agent + up - right; + //*verticesp++ = part_pos_agent - up - right; + //*verticesp++ = part_pos_agent + up + right; + //*verticesp++ = part_pos_agent - up + right; *colorsp++ = part.mColor; *colorsp++ = part.mColor; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index f07c9c37d..8cbef5bd9 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3924,7 +3924,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: buffer_index = -1; } - S32 texture_index_channels = gGLManager.mNumTextureImageUnits-1; //always reserve one for shiny for now just for simplicity + S32 texture_index_channels = llmax(LLGLSLShader::sIndexedTextureChannels-1,1); //always reserve one for shiny for now just for simplicity static const LLCachedControl no_texture_indexing("ShyotlUseLegacyTextureBatching",false); static const LLCachedControl use_legacy_path("ShyotlUseLegacyRenderPath", false); //Legacy does not jive with new batching. diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index da2644d10..627df591b 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -136,6 +136,12 @@ void LLWorld::destroyClass() LLVOCache::getInstance()->destroyClass() ; } LLViewerPartSim::getInstance()->destroyClass(); + + mDefaultWaterTexturep = NULL ; + for (S32 i = 0; i < 8; i++) + { + mEdgeWaterObjects[i] = NULL; + } } @@ -172,11 +178,11 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host, U32 iindex = 0; U32 jindex = 0; - mWidth = region_size_x; - mWidthInMeters = mWidth * mScale; + mWidth = region_size_x; //MegaRegion + mWidthInMeters = mWidth * mScale; //MegaRegion from_region_handle(region_handle, &iindex, &jindex); - S32 x = (S32)(iindex/256); - S32 y = (S32)(jindex/256); + S32 x = (S32)(iindex/256); //MegaRegion + S32 y = (S32)(jindex/256); //MegaRegion llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; llinfos << "Host: " << host << llendl; @@ -194,6 +200,7 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host, llerrs << "Unable to create new region!" << llendl; } + //Classic clouds regionp->mCloudLayer.create(regionp); regionp->mCloudLayer.setWidth((F32)mWidth); regionp->mCloudLayer.setWindPointer(®ionp->mWind); @@ -597,25 +604,25 @@ void LLWorld::updateVisibilities() { F32 cur_far_clip = LLViewerCamera::getInstance()->getFar(); - LLViewerCamera::getInstance()->setFar(mLandFarClip); - - F32 diagonal_squared = F_SQRT2 * F_SQRT2 * mWidth * mWidth; // Go through the culled list and check for visible regions for (region_list_t::iterator iter = mCulledRegionList.begin(); - iter != mCulledRegionList.end(); ) + iter != mCulledRegionList.end(); ) { region_list_t::iterator curiter = iter++; LLViewerRegion* regionp = *curiter; - F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ(); - F32 radius = 0.5f*(F32) sqrt(height * height + diagonal_squared); - if (!regionp->getLand().hasZData() - || LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) + + LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); + if (part) { - mCulledRegionList.erase(curiter); - mVisibleRegionList.push_back(regionp); + LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); + if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1])) + { + mCulledRegionList.erase(curiter); + mVisibleRegionList.push_back(regionp); + } } - } - + } + // Update all of the visible regions for (region_list_t::iterator iter = mVisibleRegionList.begin(); iter != mVisibleRegionList.end(); ) @@ -627,20 +634,23 @@ void LLWorld::updateVisibilities() continue; } - F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ(); - F32 radius = 0.5f*(F32) sqrt(height * height + diagonal_squared); - if (LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) + LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); + if (part) { - regionp->calculateCameraDistance(); - if (!gNoRender) + LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); + if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1])) { - regionp->getLand().updatePatchVisibilities(gAgent); + regionp->calculateCameraDistance(); + if (!gNoRender) + { + regionp->getLand().updatePatchVisibilities(gAgent); + } + } + else + { + mVisibleRegionList.erase(curiter); + mCulledRegionList.push_back(regionp); } - } - else - { - mVisibleRegionList.erase(curiter); - mCulledRegionList.push_back(regionp); } } diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 0a8996f5d..7672cca2f 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -295,25 +295,25 @@ LLSimInfo* LLWorldMap::simInfoFromPosGlobal(const LLVector3d& pos_global) LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 findhandle) { - std::map::const_iterator it; - for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) - { - const U64 handle = (*it).first; - LLSimInfo* info = (*it).second; - if(handle == findhandle) - { - return info; - } - U32 x = 0, y = 0; - from_region_handle(findhandle, &x, &y); - U32 checkRegionX, checkRegionY; - from_region_handle(handle, &checkRegionX, &checkRegionY); - - if(x >= checkRegionX && x < (checkRegionX + info->getSizeX()) && - y >= checkRegionY && y < (checkRegionY + info->getSizeY())) - { - return info; - } + std::map::const_iterator it; + for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) + { + const U64 handle = (*it).first; + LLSimInfo* info = (*it).second; + if(handle == findhandle) + { + return info; + } + U32 x = 0, y = 0; + from_region_handle(findhandle, &x, &y); + U32 checkRegionX, checkRegionY; + from_region_handle(handle, &checkRegionX, &checkRegionY); + + if(x >= checkRegionX && x < (checkRegionX + info->getSizeX()) && + y >= checkRegionY && y < (checkRegionY + info->getSizeY())) + { + return info; + } } return NULL; } @@ -1154,3 +1154,20 @@ void LLWorldMap::dropImagePriorities() info->dropImagePriority(); } } + +LLPointer LLSimInfo::getLandForSaleImage () +{ + if (mOverlayImage.isNull() && mMapImageID[2].notNull()) + { + // Fetch the image if it hasn't been done yet (unlikely but...) + mOverlayImage = LLViewerTextureManager::getFetchedTexture(mMapImageID[2], MIPMAP_TRUE, LLViewerTexture::BOOST_MAP, LLViewerTexture::LOD_TEXTURE); + mOverlayImage->setAddressMode(LLTexUnit::TAM_CLAMP); + } + if (!mOverlayImage.isNull()) + { + // Boost the fetch level when we try to access that image + mOverlayImage->setBoostLevel(LLViewerTexture::BOOST_MAP); + } + return mOverlayImage; +} + diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index c41bf28c3..c9e6be37e 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -97,6 +97,7 @@ public: void clearImage(); // Clears the reference to the Land for sale image for that region void dropImagePriority(); // Drops the boost level of the Land for sale image for that region + LLPointer getLandForSaleImage(); // Get the overlay image, fetch it if necessary void updateAgentCount(F64 time); // Send an item request for agent count on that region if time's up // Setters void setName(std::string& name) { mName = name; } diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 0edb7765d..3f1a65fbd 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -123,9 +123,10 @@ F32 CONE_SIZE = 0.6f; std::map LLWorldMapView::sStringsMap; -#define SIM_NULL_MAP_SCALE 4 // width in pixels, where we start drawing "null" sims -#define SIM_MAP_AGENT_SCALE 8 // width in pixels, where we start drawing agents -#define SIM_MAP_SCALE 4 // width in pixels, where we start drawing sim tiles +const int SIM_NULL_MAP_SCALE=4; // width in pixels, where we start drawing "null" sims +const int SIM_MAP_AGENT_SCALE=8; // width in pixels, where we start drawing agents +const int SIM_MAP_SCALE=4; // width in pixels, where we start drawing sim tiles +const int SIM_LANDFORSALE_SCALE=32; void LLWorldMapView::initClass() @@ -374,22 +375,17 @@ void LLWorldMapView::draw() // When the view isn't panned, 0,0 = center of rectangle F32 bottom = sPanY + half_height + relative_y; F32 left = sPanX + half_width + relative_x; - F32 top = bottom + sMapScale ; - F32 right = left + sMapScale ; - - // Discard if region is outside the screen rectangle (not visible on screen) - if ((top < 0.f) || (bottom > height) || - (right < 0.f) || (left > width) ) - { - // Drop the "land for sale" fetching priority since it's outside the view rectangle - info->dropImagePriority(); - continue; - } + //F32 top = bottom + sMapScale ; + //F32 right = left + sMapScale ; info->mShowAgentLocations = (sMapScale >= SIM_MAP_AGENT_SCALE); mVisibleRegions.push_back(handle); - info->updateAgentCount(current_time); - + // Update the agent count for that region if we're not too zoomed out already + if (sMapScale >= SIM_MAP_AGENT_SCALE) + { + info->updateAgentCount(current_time); + } + std::string mesg; if (sMapScale < sThresholdA) { @@ -598,16 +594,16 @@ void LLWorldMapView::setVisible(BOOL visible) if (!visible) { for (S32 map = 0; map < MAP_SIM_IMAGE_TYPES; map++) - { + { for (U32 layer_idx=0; layer_idxmMapLayers[map].size(); ++layer_idx) - { + { if (LLWorldMap::getInstance()->mMapLayers[map][layer_idx].LayerDefined) - { + { LLWorldMapLayer *layer = &LLWorldMap::getInstance()->mMapLayers[map][layer_idx]; layer->LayerImage->setBoostLevel(0); - } - } - } + } + } + } for (LLWorldMap::sim_info_map_t::const_iterator it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it) { @@ -705,8 +701,8 @@ void LLWorldMapView::drawTiles(S32 width, S32 height) { gGL.vertex3f(right, top, -1.0f); gGL.end(); - // draw an alpha of 1 where the sims are visible - gGL.flush(); + // draw an alpha of 1 where the sims are visible + gGL.flush(); gGL.setColorMask(false, true); gGL.color4f(1.f, 1.f, 1.f, 1.f); @@ -1207,6 +1203,90 @@ void LLWorldMapView::drawMipmap(S32 width, S32 height) // Render the current level sVisibleTilesLoaded = drawMipmapLevel(width, height, level); + const F32 half_width = F32(width) / 2.0f; + const F32 half_height = F32(height) / 2.0f; + LLVector3d camera_global = gAgentCamera.getCameraPositionGlobal(); + + for (LLWorldMap::sim_info_map_t::const_iterator it = LLWorldMap::getInstance()->getRegionMap().begin(); + it != LLWorldMap::getInstance()->getRegionMap().end(); ++it) + { + U64 handle = it->first; + LLSimInfo* info = it->second; + + LLVector3d origin_global = from_region_handle(handle); + + // Find x and y position relative to camera's center. + LLVector3d rel_region_pos = origin_global - camera_global; + F32 relative_x = (rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * sMapScale; + F32 relative_y = (rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * sMapScale; + + // Coordinates of the sim in pixels in the UI panel + // When the view isn't panned, 0,0 = center of rectangle + F32 bottom = sPanY + half_height + relative_y; + F32 left = sPanX + half_width + relative_x; + F32 top = bottom + sMapScale ; + F32 right = left + sMapScale ; + + // Discard if region is outside the screen rectangle (not visible on screen) + if ((top < 0.f) || (bottom > height) || + (right < 0.f) || (left > width) ) + { + // Drop the "land for sale" fetching priority since it's outside the view rectangle + info->dropImagePriority(); + continue; + } + + if (info->isDown()) + { + // Draw a transparent red square over down sims + gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_SOURCE_ALPHA); + gGL.color4f(0.2f, 0.0f, 0.0f, 0.4f); + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.begin(LLRender::QUADS); + gGL.vertex2f(left, top); + gGL.vertex2f(left, bottom); + gGL.vertex2f(right, bottom); + gGL.vertex2f(right, top); + gGL.end(); + } + + if (gSavedSettings.getBOOL("MapShowLandForSale") && (sMapScale >= SIM_LANDFORSALE_SCALE)) + { + // Draw the overlay image "Land for Sale / Land for Auction" + LLViewerFetchedTexture* overlayimage = info->getLandForSaleImage(); + if (overlayimage) + { + // Inform the fetch mechanism of the size we need + S32 draw_size = llround(sMapScale); + overlayimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY])); + // Draw something whenever we have enough info + if (overlayimage->hasGLTexture() && !overlayimage->isMissingAsset()) + { + //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); + gGL.getTexUnit(0)->bind(overlayimage); + gGL.color4f(1.f, 1.f, 1.f, 1.f); + gGL.begin(LLRender::QUADS); + gGL.texCoord2f(0.f, 1.f); + gGL.vertex3f(left, top, -0.5f); + gGL.texCoord2f(0.f, 0.f); + gGL.vertex3f(left, bottom, -0.5f); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex3f(right, bottom, -0.5f); + gGL.texCoord2f(1.f, 1.f); + gGL.vertex3f(right, top, -0.5f); + gGL.end(); + } + } + } + else + { + // If we're not displaying the "land for sale", drop its fetching priority + info->dropImagePriority(); + } + } + return; } @@ -1893,72 +1973,72 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, { LLItemInfo& event = *it; - if (checkItemHit(x, y, event, id, false)) - { - *hit_type = MAP_ITEM_PG_EVENT; - mItemPicked = TRUE; - gFloaterWorldMap->trackEvent(event); - return; - } - } - } + if (checkItemHit(x, y, event, id, false)) + { + *hit_type = MAP_ITEM_PG_EVENT; + mItemPicked = TRUE; + gFloaterWorldMap->trackEvent(event); + return; + } + } + } static const LLCachedControl map_show_mature_events("MapShowMatureEvents"); if (map_show_mature_events) - { + { for (it = LLWorldMap::getInstance()->mMatureEvents.begin(); it != LLWorldMap::getInstance()->mMatureEvents.end(); ++it) - { + { LLItemInfo& event = *it; - if (checkItemHit(x, y, event, id, false)) - { - *hit_type = MAP_ITEM_MATURE_EVENT; - mItemPicked = TRUE; - gFloaterWorldMap->trackEvent(event); - return; - } - } - } + if (checkItemHit(x, y, event, id, false)) + { + *hit_type = MAP_ITEM_MATURE_EVENT; + mItemPicked = TRUE; + gFloaterWorldMap->trackEvent(event); + return; + } + } + } static const LLCachedControl map_show_adult_events("MapShowAdultEvents"); if (map_show_adult_events) - { + { for (it = LLWorldMap::getInstance()->mAdultEvents.begin(); it != LLWorldMap::getInstance()->mAdultEvents.end(); ++it) - { + { LLItemInfo& event = *it; - if (checkItemHit(x, y, event, id, false)) - { - *hit_type = MAP_ITEM_ADULT_EVENT; - mItemPicked = TRUE; - gFloaterWorldMap->trackEvent(event); - return; - } - } - } + if (checkItemHit(x, y, event, id, false)) + { + *hit_type = MAP_ITEM_ADULT_EVENT; + mItemPicked = TRUE; + gFloaterWorldMap->trackEvent(event); + return; + } + } + } static const LLCachedControl map_show_land_for_sale("MapShowLandForSale"); - if (map_show_land_for_sale) - { + if (map_show_land_for_sale) + { for (it = LLWorldMap::getInstance()->mLandForSale.begin(); it != LLWorldMap::getInstance()->mLandForSale.end(); ++it) - { + { LLItemInfo& land = *it; if (checkItemHit(x, y, land, id, true)) - { - *hit_type = MAP_ITEM_LAND_FOR_SALE; - mItemPicked = TRUE; - return; - } - } + { + *hit_type = MAP_ITEM_LAND_FOR_SALE; + mItemPicked = TRUE; + return; + } + } for (it = LLWorldMap::getInstance()->mLandForSaleAdult.begin(); it != LLWorldMap::getInstance()->mLandForSaleAdult.end(); ++it) - { + { LLItemInfo& land = *it; if (checkItemHit(x, y, land, id, true)) - { - *hit_type = MAP_ITEM_LAND_FOR_SALE_ADULT; - mItemPicked = TRUE; - return; - } + { + *hit_type = MAP_ITEM_LAND_FOR_SALE_ADULT; + mItemPicked = TRUE; + return; + } } } // If we get here, we haven't clicked on an icon diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 91ae2427f..cb208fd9c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1966,11 +1966,10 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl LLGLDepthTest depth(GL_TRUE, GL_FALSE); - bool bound_shader = false; - if (gPipeline.canUseVertexShaders() && LLGLSLShader::sCurBoundShader == 0) + bool bind_shader = LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShader == 0; + if (bind_shader) { //if no shader is currently bound, use the occlusion shader instead of fixed function if we can // (shadow render uses a special shader that clamps to clip planes) - bound_shader = true; gOcclusionProgram.bind(); } @@ -2001,7 +2000,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl } } - if (bound_shader) + if (bind_shader) { gOcclusionProgram.unbind(); } @@ -8099,7 +8098,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLVertexBuffer::unbind(); { - if (!use_shader) + if (!use_shader && LLGLSLShader::sNoFixedFunction) { //occlusion program is general purpose depth-only no-textures gOcclusionProgram.bind(); } @@ -8110,7 +8109,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE); } gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - if (!use_shader) + if (!use_shader && LLGLSLShader::sNoFixedFunction) { gOcclusionProgram.unbind(); } diff --git a/indra/newview/skins/default/textures/Inv_Invalid.png b/indra/newview/skins/default/textures/Inv_Invalid.png new file mode 100644 index 000000000..5d070e467 Binary files /dev/null and b/indra/newview/skins/default/textures/Inv_Invalid.png differ diff --git a/indra/newview/skins/default/textures/inv_item_physics.tga b/indra/newview/skins/default/textures/inv_item_physics.tga new file mode 100644 index 000000000..f1d0e5f19 Binary files /dev/null and b/indra/newview/skins/default/textures/inv_item_physics.tga differ diff --git a/indra/newview/skins/darkorange/textures/8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c b/indra/newview/skins/default/textures/transparent.j2c similarity index 100% rename from indra/newview/skins/darkorange/textures/8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c rename to indra/newview/skins/default/textures/transparent.j2c diff --git a/indra/newview/skins/default/xui/en-us/floater_new_outfit_dialog.xml b/indra/newview/skins/default/xui/en-us/floater_new_outfit_dialog.xml index 1011af97e..f141e6631 100644 --- a/indra/newview/skins/default/xui/en-us/floater_new_outfit_dialog.xml +++ b/indra/newview/skins/default/xui/en-us/floater_new_outfit_dialog.xml @@ -1,12 +1,12 @@ -