From 4841eaddb9dcfe6c6290f430121a6407b4ebe322 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Mon, 24 Jun 2013 10:18:37 -0700 Subject: MATBUG-194 WIP investigate if light func sampling precision is causing whirly's wierdness --- indra/newview/pipeline.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d37b086ae3..9713f963b9 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1400,13 +1400,9 @@ void LLPipeline::createLUTBuffers() ls[y*lightResX+x] = k;*/ } } - - U32 pix_format = GL_R16F; -#if LL_DARWIN // Need to work around limited precision with 10.6.8 and older drivers // - pix_format = GL_R32F; -#endif + U32 pix_format = GL_R32F; LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, pix_format, 1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false); -- cgit v1.2.3 From 53789008221043052360dcff2c1faeb11c64d9f6 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 25 Jun 2013 10:21:59 -0700 Subject: NORSPEC-250 add setting to force higher LUT precision and made LUT cleanup match creation --- indra/newview/app_settings/settings.xml | 12 ++++++++++++ indra/newview/pipeline.cpp | 21 +++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 344079b640..ebb01fb330 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8592,6 +8592,18 @@ + RenderSpecularPrecision + + Comment + Force 32-bit floating point LUT + Persist + 1 + Type + U32 + Value + 0 + + RenderSpecularResX Comment diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9713f963b9..442b0b6d2d 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1201,7 +1201,15 @@ void LLPipeline::releaseLUTBuffers() { if (mLightFunc) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_R16F, 0, 1, &mLightFunc); + U32 use_high_precision = gSavedSettings.getU32("RenderSpecularPrecision"); + + U32 pix_format = use_high_precision ? GL_R32F : GL_R16F; + +#if LL_DARWIN + pix_format = GL_R32F; +#endif + + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, pix_format, 0, 1, &mLightFunc); mLightFunc = 0; } } @@ -1402,7 +1410,16 @@ void LLPipeline::createLUTBuffers() } // Need to work around limited precision with 10.6.8 and older drivers // - U32 pix_format = GL_R32F; + U32 use_high_precision = gSavedSettings.getU32("RenderSpecularPrecision"); + + U32 pix_format = use_high_precision ? GL_R32F : GL_R16F; + +#if LL_DARWIN + // Forced to work around 10.6.8. driver bugs on most every GPU + // + pix_format = GL_R32F; +#endif + LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, pix_format, 1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false); -- cgit v1.2.3 From de4892b3373ef0c4562dba43a05fd19c973e9f30 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 25 Jun 2013 16:25:22 -0700 Subject: NORSPEC-288 remove unassertable asserts from restoring code to condition normals for this fix --- indra/newview/llface.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f021f4ed0f..700b31f8d3 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -817,12 +817,6 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, size.mul(scale); } - // Catch potential badness from normalization before it happens - // - llassert(mat_normal.mMatrix[0].isFinite3() && (mat_normal.mMatrix[0].dot3(mat_normal.mMatrix[0]).getF32() > F_APPROXIMATELY_ZERO)); - llassert(mat_normal.mMatrix[1].isFinite3() && (mat_normal.mMatrix[1].dot3(mat_normal.mMatrix[1]).getF32() > F_APPROXIMATELY_ZERO)); - llassert(mat_normal.mMatrix[2].isFinite3() && (mat_normal.mMatrix[2].dot3(mat_normal.mMatrix[2]).getF32() > F_APPROXIMATELY_ZERO)); - mat_normal.mMatrix[0].normalize3fast(); mat_normal.mMatrix[1].normalize3fast(); mat_normal.mMatrix[2].normalize3fast(); -- cgit v1.2.3 From dd31d9941fe1bfbccdfd0428abbe803b6c495f6c Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 2 Jul 2013 07:39:55 -0700 Subject: NORSPEC-296 make add_media button always available as long as the face is editable --- indra/newview/llfloatertools.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 14923eec3c..7b25291da7 100755 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1328,7 +1328,7 @@ void LLFloaterTools::getMediaState() getChildView("media_tex")->setEnabled(bool_has_media && editable); getChildView("edit_media")->setEnabled(bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); getChildView("delete_media")->setEnabled(bool_has_media && editable ); - getChildView("add_media")->setEnabled(( ! bool_has_media ) && editable ); + getChildView("add_media")->setEnabled(editable); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -1358,7 +1358,7 @@ void LLFloaterTools::getMediaState() getChildView("media_tex")->setEnabled(TRUE); getChildView("edit_media")->setEnabled(LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); getChildView("delete_media")->setEnabled(TRUE); - getChildView("add_media")->setEnabled(FALSE ); + getChildView("add_media")->setEnabled(editable); } media_info->setText(media_title); -- cgit v1.2.3 From 418c8a72c875b30d1e0746422afa3caaa809e37b Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 2 Jul 2013 07:39:55 -0700 Subject: NORSPEC-296 make add_media button always available as long as the face is editable --- indra/newview/llfloatertools.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 14923eec3c..7b25291da7 100755 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1328,7 +1328,7 @@ void LLFloaterTools::getMediaState() getChildView("media_tex")->setEnabled(bool_has_media && editable); getChildView("edit_media")->setEnabled(bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); getChildView("delete_media")->setEnabled(bool_has_media && editable ); - getChildView("add_media")->setEnabled(( ! bool_has_media ) && editable ); + getChildView("add_media")->setEnabled(editable); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -1358,7 +1358,7 @@ void LLFloaterTools::getMediaState() getChildView("media_tex")->setEnabled(TRUE); getChildView("edit_media")->setEnabled(LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); getChildView("delete_media")->setEnabled(TRUE); - getChildView("add_media")->setEnabled(FALSE ); + getChildView("add_media")->setEnabled(editable); } media_info->setText(media_title); -- cgit v1.2.3 From f1c04467f70ce7e5a048614fa7db631cd3a35a00 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 2 Jul 2013 13:12:08 -0700 Subject: NORSPEC-292 fix issues with managing LLNetworkData::PARAMS_LIGHT_IMAGE when demoting spotlights by removing their tex --- indra/newview/llpanelvolume.cpp | 13 ++++++++++++- indra/newview/lltexturectrl.cpp | 13 +++++++++++-- indra/newview/llvovolume.cpp | 6 ++++-- 3 files changed, 27 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 02d363d795..0b501f6a74 100755 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -710,9 +710,20 @@ void LLPanelVolume::onLightCancelColor(const LLSD& data) void LLPanelVolume::onLightCancelTexture(const LLSD& data) { LLTextureCtrl* LightTextureCtrl = getChild("light texture control"); + if (LightTextureCtrl) { - LightTextureCtrl->setImageAssetID(mLightSavedTexture); + LightTextureCtrl->setImageAssetID(LLUUID::null); + } + + LLVOVolume *volobjp = (LLVOVolume *) mObject.get(); + if(volobjp) + { + // Cancel the light texture as requested + // NORSPEC-292 + // + volobjp->setLightTextureID(LLUUID::null); + volobjp->setIsLight(TRUE,TRUE); } } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 4676f7b251..2b1ed5858a 100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -133,7 +133,8 @@ public: PermissionMask getFilterPermMask(); void updateFilterPermMask(); void commitIfImmediateSet(); - + void commitCancel(); + void onFilterEdit(const std::string& search_string ); void setCanApply(bool can_preview, bool can_apply); @@ -706,6 +707,14 @@ void LLFloaterTexturePicker::commitIfImmediateSet() } } +void LLFloaterTexturePicker::commitCancel() +{ + if (!mNoCopyTextureSelected && mOwner && mCanApply) + { + mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CANCEL); + } +} + // static void LLFloaterTexturePicker::onBtnSetToDefault(void* userdata) { @@ -733,7 +742,7 @@ void LLFloaterTexturePicker::onBtnNone(void* userdata) { LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; self->setImageID( LLUUID::null ); - self->commitIfImmediateSet(); + self->commitCancel(); } /* diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 685f854573..d890548710 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2590,6 +2590,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) if (hasLightTexture()) { setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true); + parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true); mLightTexture = NULL; } } @@ -2607,7 +2608,8 @@ void LLVOVolume::setSpotLightParams(LLVector3 params) void LLVOVolume::setIsLight(BOOL is_light) { - if (is_light != getIsLight()) + BOOL was_light = getIsLight(); + if (is_light != was_light) { if (is_light) { @@ -2792,7 +2794,7 @@ void LLVOVolume::updateSpotLightPriority() bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - if (params) + if (params && getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) { return params->isLightSpotlight(); } -- cgit v1.2.3 From c262ef58fab4dcbe8d891f9acba285ddc2c296db Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 2 Jul 2013 13:16:23 -0700 Subject: NORSPEC-292 remove unnecessary call to setIsLight --- indra/newview/llpanelvolume.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 0b501f6a74..a1d60b5b16 100755 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -723,7 +723,6 @@ void LLPanelVolume::onLightCancelTexture(const LLSD& data) // NORSPEC-292 // volobjp->setLightTextureID(LLUUID::null); - volobjp->setIsLight(TRUE,TRUE); } } -- cgit v1.2.3