Merge branch 'DRTVWR-513-maint' of https://bitbucket.org/lindenlab/viewer
commit
fd290b8fdf
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
#include "llmaterial.h"
|
||||
|
||||
#include "../llrender/llglheaders.h"
|
||||
|
||||
/**
|
||||
* Materials cap parameters
|
||||
*/
|
||||
|
|
@ -107,8 +105,6 @@ LLMaterial::LLMaterial()
|
|||
, mSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT)
|
||||
, mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY)
|
||||
, mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
|
||||
, mDiffuseFormatPrimary(GL_RGBA)
|
||||
, mDiffuseBaked(false)
|
||||
, mAlphaMaskCutoff(0)
|
||||
{
|
||||
}
|
||||
|
|
@ -315,20 +311,6 @@ void LLMaterial::setEnvironmentIntensity(U8 intensity)
|
|||
mEnvironmentIntensity = intensity;
|
||||
}
|
||||
|
||||
U8 LLMaterial::getDiffuseAlphaModeRender() const
|
||||
{
|
||||
if (mDiffuseBaked
|
||||
|| mDiffuseFormatPrimary == GL_RGBA
|
||||
|| mDiffuseFormatPrimary == GL_ALPHA)
|
||||
{
|
||||
return mDiffuseAlphaMode;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DIFFUSE_ALPHA_MODE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
U8 LLMaterial::getDiffuseAlphaMode() const
|
||||
{
|
||||
return mDiffuseAlphaMode;
|
||||
|
|
@ -339,26 +321,6 @@ void LLMaterial::setDiffuseAlphaMode(U8 alpha_mode)
|
|||
mDiffuseAlphaMode = alpha_mode;
|
||||
}
|
||||
|
||||
U32 LLMaterial::getDiffuseFormatPrimary() const
|
||||
{
|
||||
return mDiffuseFormatPrimary;
|
||||
}
|
||||
|
||||
void LLMaterial::setDiffuseFormatPrimary(U32 format_primary)
|
||||
{
|
||||
mDiffuseFormatPrimary = format_primary;
|
||||
}
|
||||
|
||||
bool LLMaterial::getIsDiffuseBaked() const
|
||||
{
|
||||
return mDiffuseBaked;
|
||||
}
|
||||
|
||||
void LLMaterial::setDiffuseBaked(bool baked)
|
||||
{
|
||||
mDiffuseBaked = baked;
|
||||
}
|
||||
|
||||
U8 LLMaterial::getAlphaMaskCutoff() const
|
||||
{
|
||||
return mAlphaMaskCutoff;
|
||||
|
|
@ -475,7 +437,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)
|
|||
}
|
||||
else
|
||||
{
|
||||
ret = getDiffuseAlphaModeRender();
|
||||
ret = getDiffuseAlphaMode();
|
||||
}
|
||||
|
||||
llassert(ret < SHADER_COUNT);
|
||||
|
|
|
|||
|
|
@ -115,17 +115,8 @@ public:
|
|||
void setSpecularLightExponent(U8 exponent);
|
||||
U8 getEnvironmentIntensity() const;
|
||||
void setEnvironmentIntensity(U8 intensity);
|
||||
|
||||
// getDiffuseAlphaModeRender takes into account if image supports alpha
|
||||
// and returns value apropriate for render
|
||||
// getDiffuseAlphaMode() returns value as is
|
||||
U8 getDiffuseAlphaModeRender() const;
|
||||
U8 getDiffuseAlphaMode() const;
|
||||
void setDiffuseAlphaMode(U8 alpha_mode);
|
||||
U32 getDiffuseFormatPrimary() const;
|
||||
void setDiffuseFormatPrimary(U32 format_primary);
|
||||
bool getIsDiffuseBaked() const;
|
||||
void setDiffuseBaked(bool baked);
|
||||
U8 getAlphaMaskCutoff() const;
|
||||
void setAlphaMaskCutoff(U8 cutoff);
|
||||
|
||||
|
|
@ -156,8 +147,6 @@ protected:
|
|||
U8 mSpecularLightExponent;
|
||||
U8 mEnvironmentIntensity;
|
||||
U8 mDiffuseAlphaMode;
|
||||
U32 mDiffuseFormatPrimary; // value from texture, LLGLenum, is not included in fromLLSD/asLLSD
|
||||
bool mDiffuseBaked; // is not included in fromLLSD/asLLSD
|
||||
U8 mAlphaMaskCutoff;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1114,6 +1114,15 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
|
|||
|
||||
// Update all of the regions.
|
||||
LLWorld::getInstance()->updateAgentOffset(mAgentOriginGlobal);
|
||||
|
||||
if (regionp->capabilitiesReceived())
|
||||
{
|
||||
LLAppViewer::instance()->updateNameLookupUrl();
|
||||
}
|
||||
else
|
||||
{
|
||||
regionp->setCapabilitiesReceivedCallback([](const LLUUID ®ion_id) {LLAppViewer::instance()->updateNameLookupUrl(); });
|
||||
}
|
||||
}
|
||||
|
||||
// Pass new region along to metrics components that care about this level of detail.
|
||||
|
|
|
|||
|
|
@ -753,6 +753,7 @@ LLAppViewer::LLAppViewer()
|
|||
mPurgeCacheOnExit(false),
|
||||
mPurgeUserDataOnExit(false),
|
||||
mSecondInstance(false),
|
||||
mUpdaterNotFound(false),
|
||||
mSavedFinalSnapshot(false),
|
||||
mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded.
|
||||
mQuitRequested(false),
|
||||
|
|
@ -1371,78 +1372,101 @@ bool LLAppViewer::init()
|
|||
|
||||
gGLActive = FALSE;
|
||||
|
||||
// <FS:Ansariel> Disable updater
|
||||
// <FS:Ansariel> Disable updater
|
||||
//#if LL_RELEASE_FOR_DOWNLOAD
|
||||
// if (!gSavedSettings.getBOOL("CmdLineSkipUpdater"))
|
||||
// {
|
||||
// LLProcess::Params updater;
|
||||
// updater.desc = "updater process";
|
||||
// // Because it's the updater, it MUST persist beyond the lifespan of the
|
||||
// // viewer itself.
|
||||
// updater.autokill = false;
|
||||
// LLProcess::Params updater;
|
||||
// updater.desc = "updater process";
|
||||
// // Because it's the updater, it MUST persist beyond the lifespan of the
|
||||
// // viewer itself.
|
||||
// updater.autokill = false;
|
||||
// std::string updater_file;
|
||||
//#if LL_WINDOWS
|
||||
// updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "SLVersionChecker.exe");
|
||||
// updater_file = "SLVersionChecker.exe";
|
||||
// updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, updater_file);
|
||||
//#elif LL_DARWIN
|
||||
// // explicitly run the system Python interpreter on SLVersionChecker.py
|
||||
// updater.executable = "python";
|
||||
// updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "SLVersionChecker.py"));
|
||||
// // explicitly run the system Python interpreter on SLVersionChecker.py
|
||||
// updater.executable = "python";
|
||||
// updater_file = "SLVersionChecker.py";
|
||||
// updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", updater_file));
|
||||
//#else
|
||||
// updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "SLVersionChecker");
|
||||
// updater_file = "SLVersionChecker";
|
||||
// updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, updater_file);
|
||||
//#endif
|
||||
// // add LEAP mode command-line argument to whichever of these we selected
|
||||
// updater.args.add("leap");
|
||||
// // UpdaterServiceSettings
|
||||
// updater.args.add(stringize(gSavedSettings.getU32("UpdaterServiceSetting")));
|
||||
// // channel
|
||||
// updater.args.add(LLVersionInfo::getChannel());
|
||||
// // testok
|
||||
// updater.args.add(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest")));
|
||||
// // ForceAddressSize
|
||||
// updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize")));
|
||||
//#if LL_WINDOWS && !LL_RELEASE_FOR_DOWNLOAD && !LL_SEND_CRASH_REPORTS
|
||||
// // This is neither a release package, nor crash-reporting enabled test build
|
||||
// // try to run version updater, but don't bother if it fails (file might be missing)
|
||||
// LLLeap *leap_p = LLLeap::create(updater, false);
|
||||
// if (!leap_p)
|
||||
// {
|
||||
// LL_WARNS("LLLeap") << "Failed to run LLLeap" << LL_ENDL;
|
||||
// // add LEAP mode command-line argument to whichever of these we selected
|
||||
// updater.args.add("leap");
|
||||
// // UpdaterServiceSettings
|
||||
// updater.args.add(stringize(gSavedSettings.getU32("UpdaterServiceSetting")));
|
||||
// // channel
|
||||
// updater.args.add(LLVersionInfo::instance().getChannel());
|
||||
// // testok
|
||||
// updater.args.add(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest")));
|
||||
// // ForceAddressSize
|
||||
// updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize")));
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// // Run the updater. An exception from launching the updater should bother us.
|
||||
// LLLeap::create(updater, true);
|
||||
// mUpdaterNotFound = false;
|
||||
// }
|
||||
// catch (...)
|
||||
// {
|
||||
// LLUIString details = LLNotifications::instance().getGlobalString("LLLeapUpdaterFailure");
|
||||
// details.setArg("[UPDATER_APP]", updater_file);
|
||||
// OSMessageBox(
|
||||
// details.getString(),
|
||||
// LLStringUtil::null,
|
||||
// OSMB_OK);
|
||||
// mUpdaterNotFound = true;
|
||||
// }
|
||||
// }
|
||||
//#else
|
||||
// // Run the updater. An exception from launching the updater should bother us.
|
||||
// LLLeap::create(updater, true);
|
||||
//#endif
|
||||
// else
|
||||
// {
|
||||
// LL_WARNS("InitInfo") << "Skipping updater check." << LL_ENDL;
|
||||
// }
|
||||
//
|
||||
// if (mUpdaterNotFound)
|
||||
// {
|
||||
// LL_WARNS("InitInfo") << "Failed to launch updater. Skipping Leap commands." << LL_ENDL;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Iterate over --leap command-line options. But this is a bit tricky: if
|
||||
// // there's only one, it won't be an array at all.
|
||||
// LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand"));
|
||||
// LL_DEBUGS("InitInfo") << "LeapCommand: " << LeapCommand << LL_ENDL;
|
||||
// if (LeapCommand.isDefined() && !LeapCommand.isArray())
|
||||
// {
|
||||
// // If LeapCommand is actually a scalar value, make an array of it.
|
||||
// // Have to do it in two steps because LeapCommand.append(LeapCommand)
|
||||
// // trashes content! :-P
|
||||
// LLSD item(LeapCommand);
|
||||
// LeapCommand.append(item);
|
||||
// }
|
||||
// BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand))
|
||||
// {
|
||||
// LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;
|
||||
// // We don't have any better description of this plugin than the
|
||||
// // user-specified command line. Passing "" causes LLLeap to derive a
|
||||
// // description from the command line itself.
|
||||
// // Suppress LLLeap::Error exception: trust LLLeap's own logging. We
|
||||
// // don't consider any one --leap command mission-critical, so if one
|
||||
// // fails, log it, shrug and carry on.
|
||||
// LLLeap::create("", leap, false); // exception=false
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getS32("QAModeEventHostPort") > 0)
|
||||
// {
|
||||
// LL_WARNS("InitInfo") << "QAModeEventHostPort DEPRECATED: "
|
||||
// << "lleventhost no longer supported as a dynamic library"
|
||||
// << LL_ENDL;
|
||||
// }
|
||||
//#endif //LL_RELEASE_FOR_DOWNLOAD
|
||||
// </FS:Ansariel>
|
||||
|
||||
// Iterate over --leap command-line options. But this is a bit tricky: if
|
||||
// there's only one, it won't be an array at all.
|
||||
LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand"));
|
||||
LL_DEBUGS("InitInfo") << "LeapCommand: " << LeapCommand << LL_ENDL;
|
||||
if (LeapCommand.isDefined() && ! LeapCommand.isArray())
|
||||
{
|
||||
// If LeapCommand is actually a scalar value, make an array of it.
|
||||
// Have to do it in two steps because LeapCommand.append(LeapCommand)
|
||||
// trashes content! :-P
|
||||
LLSD item(LeapCommand);
|
||||
LeapCommand.append(item);
|
||||
}
|
||||
BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand))
|
||||
{
|
||||
LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;
|
||||
// We don't have any better description of this plugin than the
|
||||
// user-specified command line. Passing "" causes LLLeap to derive a
|
||||
// description from the command line itself.
|
||||
// Suppress LLLeap::Error exception: trust LLLeap's own logging. We
|
||||
// don't consider any one --leap command mission-critical, so if one
|
||||
// fails, log it, shrug and carry on.
|
||||
LLLeap::create("", leap, false); // exception=false
|
||||
}
|
||||
|
||||
if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getS32("QAModeEventHostPort") > 0)
|
||||
{
|
||||
LL_WARNS("InitInfo") << "QAModeEventHostPort DEPRECATED: "
|
||||
<< "lleventhost no longer supported as a dynamic library"
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match;
|
||||
|
||||
//EXT-7013 - On windows for some locale (Japanese) standard
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ public:
|
|||
bool quitRequested() { return mQuitRequested; }
|
||||
bool logoutRequestSent() { return mLogoutRequestSent; }
|
||||
bool isSecondInstance() { return mSecondInstance; }
|
||||
bool isUpdaterMissing() { return mUpdaterNotFound; }
|
||||
|
||||
void writeDebugInfo(bool isStatic=true);
|
||||
|
||||
|
|
@ -276,6 +277,7 @@ private:
|
|||
static LLAppViewer* sInstance;
|
||||
|
||||
bool mSecondInstance; // Is this a second instance of the app?
|
||||
bool mUpdaterNotFound; // True when attempt to start updater failed
|
||||
|
||||
std::string mMarkerFileName;
|
||||
LLAPRFile mMarkerFile; // A file created to indicate the app is running.
|
||||
|
|
|
|||
|
|
@ -2317,7 +2317,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
|
|||
|
||||
if (mat)
|
||||
{
|
||||
switch (LLMaterial::eDiffuseAlphaMode(mat->getDiffuseAlphaModeRender()))
|
||||
switch (LLMaterial::eDiffuseAlphaMode(mat->getDiffuseAlphaMode()))
|
||||
{
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_MASK:
|
||||
{
|
||||
|
|
@ -2460,7 +2460,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
|
|||
sVertexProgram->uniform4f(LLShaderMgr::SPECULAR_COLOR, col.mV[0], col.mV[1], col.mV[2], spec);
|
||||
sVertexProgram->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, env);
|
||||
|
||||
if (mat->getDiffuseAlphaModeRender() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
{
|
||||
F32 cutoff = mat->getAlphaMaskCutoff()/255.f;
|
||||
sVertexProgram->setMinimumAlpha(cutoff);
|
||||
|
|
|
|||
|
|
@ -1110,7 +1110,7 @@ void LLEnvironment::onRegionChange()
|
|||
}
|
||||
if (!cur_region->capabilitiesReceived())
|
||||
{
|
||||
cur_region->setCapabilitiesReceivedCallback([](LLUUID region_id) { LLEnvironment::instance().requestRegion(); });
|
||||
cur_region->setCapabilitiesReceivedCallback([](const LLUUID ®ion_id) { LLEnvironment::instance().requestRegion(); });
|
||||
return;
|
||||
}
|
||||
requestRegion();
|
||||
|
|
|
|||
|
|
@ -1235,7 +1235,7 @@ bool LLFace::canRenderAsMask()
|
|||
}
|
||||
|
||||
LLMaterial* mat = te->getMaterialParams();
|
||||
if (mat && mat->getDiffuseAlphaModeRender() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
|
||||
if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1508,7 +1508,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!mat || mat->getDiffuseAlphaModeRender() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
{
|
||||
shiny_in_alpha = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -435,6 +435,8 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
|
|||
else
|
||||
{
|
||||
// The caller didn't pass any flags -- just remove the mute entry entirely.
|
||||
// set flags to notify observers with (flag being present means that something is allowed)
|
||||
localmute.mFlags = LLMute::flagAll;
|
||||
}
|
||||
|
||||
// Always remove the entry from the set -- it will be re-added with new flags if necessary.
|
||||
|
|
@ -458,6 +460,7 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
|
|||
}
|
||||
|
||||
// Must be after erase.
|
||||
notifyObservers();
|
||||
notifyObserversDetailed(localmute);
|
||||
|
||||
// <FS:Ansariel> Return correct return value
|
||||
|
|
@ -474,6 +477,7 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
|
|||
updateRemove(mute);
|
||||
mLegacyMutes.erase(legacy_it);
|
||||
// Must be after erase.
|
||||
notifyObservers();
|
||||
notifyObserversDetailed(mute);
|
||||
|
||||
// <FS:Ansariel> Return correct return value
|
||||
|
|
|
|||
|
|
@ -351,10 +351,14 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& s
|
|||
}
|
||||
}
|
||||
|
||||
void LLOutputMonitorCtrl::onChange()
|
||||
void LLOutputMonitorCtrl::onChangeDetailed(const LLMute& mute)
|
||||
{
|
||||
// check only blocking on voice. EXT-3542
|
||||
mIsMuted = LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat);
|
||||
if (mute.mID == mSpeakerId)
|
||||
{
|
||||
// Check only blocking on voice.
|
||||
// Logic goes in reverse, if flag is set, action is allowed
|
||||
mIsMuted = !(LLMute::flagVoiceChat & mute.mFlags);
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ public:
|
|||
void setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id = LLUUID::null, bool show_other_participants_speaking = false);
|
||||
|
||||
//called by mute list
|
||||
virtual void onChange();
|
||||
virtual void onChange() {};
|
||||
virtual void onChangeDetailed(const LLMute& mute);
|
||||
|
||||
/**
|
||||
* Implementation of LLSpeakingIndicator interface.
|
||||
|
|
|
|||
|
|
@ -581,6 +581,7 @@ void send_viewer_stats(bool include_preferences)
|
|||
fail["failed_resends"] = (S32) gMessageSystem->mFailedResendPackets;
|
||||
fail["off_circuit"] = (S32) gMessageSystem->mOffCircuitPackets;
|
||||
fail["invalid"] = (S32) gMessageSystem->mInvalidOnCircuitPackets;
|
||||
fail["missing_updater"] = (S32) LLAppViewer::instance()->isUpdaterMissing();
|
||||
|
||||
body["stats"]["voice"] = LLVoiceVivoxStats::getInstance()->read();
|
||||
|
||||
|
|
|
|||
|
|
@ -2493,34 +2493,51 @@ bool LLVOVolume::notifyAboutCreatingTexture(LLViewerTexture *texture)
|
|||
|
||||
std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID());
|
||||
|
||||
bool refresh_materials = false;
|
||||
typedef std::map<U8, LLMaterialPtr> map_te_material;
|
||||
map_te_material new_material;
|
||||
|
||||
// RGB textures without alpha channels won't work right with alpha,
|
||||
// we provide format to material for material to decide when to drop alpha
|
||||
for (mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it)
|
||||
{
|
||||
LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te);
|
||||
if (cur_material.notNull()
|
||||
&& LLRender::DIFFUSE_MAP == range_it->second.map)
|
||||
{
|
||||
U32 format = texture->getPrimaryFormat();
|
||||
if (format != cur_material->getDiffuseFormatPrimary())
|
||||
{
|
||||
cur_material->setDiffuseFormatPrimary(format);
|
||||
refresh_materials = true;
|
||||
}
|
||||
}
|
||||
} //for
|
||||
for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it)
|
||||
{
|
||||
LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te);
|
||||
|
||||
if (refresh_materials)
|
||||
{
|
||||
LLViewerObject::refreshMaterials();
|
||||
}
|
||||
//here we just interesting in DIFFUSE_MAP only!
|
||||
if(NULL != cur_material.get() && LLRender::DIFFUSE_MAP == range_it->second.map && GL_RGBA != texture->getPrimaryFormat())
|
||||
{ //ok let's check the diffuse mode
|
||||
switch(cur_material->getDiffuseAlphaMode())
|
||||
{
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND:
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE:
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_MASK:
|
||||
{ //uups... we have non 32 bit texture with LLMaterial::DIFFUSE_ALPHA_MODE_* => LLMaterial::DIFFUSE_ALPHA_MODE_NONE
|
||||
|
||||
LLMaterialPtr mat = NULL;
|
||||
map_te_material::iterator it = new_material.find(range_it->second.te);
|
||||
if(new_material.end() == it) {
|
||||
mat = new LLMaterial(cur_material->asLLSD());
|
||||
new_material.insert(map_te_material::value_type(range_it->second.te, mat));
|
||||
} else {
|
||||
mat = it->second;
|
||||
}
|
||||
|
||||
mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
|
||||
|
||||
} break;
|
||||
} //switch
|
||||
} //if
|
||||
} //for
|
||||
|
||||
//setup new materials
|
||||
for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it)
|
||||
{
|
||||
// These are placeholder materials, they shouldn't be sent to server
|
||||
LLMaterialMgr::getInstance()->setLocalMaterial(getRegion()->getRegionID(), it->second);
|
||||
LLViewerObject::setTEMaterialParams(it->first, it->second);
|
||||
}
|
||||
|
||||
//clear wait-list
|
||||
mWaitingTextureInfo.erase(range.first, range.second);
|
||||
mWaitingTextureInfo.erase(range.first, range.second);
|
||||
|
||||
return refresh_materials;
|
||||
return 0 != new_material.size();
|
||||
}
|
||||
|
||||
bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture)
|
||||
|
|
@ -2530,84 +2547,184 @@ bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture)
|
|||
std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID());
|
||||
if(range.first == range.second) return false;
|
||||
|
||||
bool refresh_materials = false;
|
||||
|
||||
typedef std::map<U8, LLMaterialPtr> map_te_material;
|
||||
map_te_material new_material;
|
||||
|
||||
for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it)
|
||||
{
|
||||
LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te);
|
||||
if (cur_material.isNull())
|
||||
continue;
|
||||
|
||||
if (range_it->second.map == LLRender::DIFFUSE_MAP)
|
||||
{
|
||||
LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te);
|
||||
if (cur_material.notNull()
|
||||
&& LLRender::DIFFUSE_MAP == range_it->second.map)
|
||||
{
|
||||
if (0 != cur_material->getDiffuseFormatPrimary())
|
||||
{
|
||||
cur_material->setDiffuseFormatPrimary(0);
|
||||
refresh_materials = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} //for
|
||||
switch(range_it->second.map)
|
||||
{
|
||||
case LLRender::DIFFUSE_MAP:
|
||||
{
|
||||
if(LLMaterial::DIFFUSE_ALPHA_MODE_NONE != cur_material->getDiffuseAlphaMode())
|
||||
{ //missing texture + !LLMaterial::DIFFUSE_ALPHA_MODE_NONE => LLMaterial::DIFFUSE_ALPHA_MODE_NONE
|
||||
LLMaterialPtr mat = NULL;
|
||||
map_te_material::iterator it = new_material.find(range_it->second.te);
|
||||
if(new_material.end() == it) {
|
||||
mat = new LLMaterial(cur_material->asLLSD());
|
||||
new_material.insert(map_te_material::value_type(range_it->second.te, mat));
|
||||
} else {
|
||||
mat = it->second;
|
||||
}
|
||||
|
||||
if (refresh_materials)
|
||||
{
|
||||
LLViewerObject::refreshMaterials();
|
||||
}
|
||||
mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
|
||||
}
|
||||
} break;
|
||||
case LLRender::NORMAL_MAP:
|
||||
{ //missing texture => reset material texture id
|
||||
LLMaterialPtr mat = NULL;
|
||||
map_te_material::iterator it = new_material.find(range_it->second.te);
|
||||
if(new_material.end() == it) {
|
||||
mat = new LLMaterial(cur_material->asLLSD());
|
||||
new_material.insert(map_te_material::value_type(range_it->second.te, mat));
|
||||
} else {
|
||||
mat = it->second;
|
||||
}
|
||||
|
||||
mat->setNormalID(LLUUID::null);
|
||||
} break;
|
||||
case LLRender::SPECULAR_MAP:
|
||||
{ //missing texture => reset material texture id
|
||||
LLMaterialPtr mat = NULL;
|
||||
map_te_material::iterator it = new_material.find(range_it->second.te);
|
||||
if(new_material.end() == it) {
|
||||
mat = new LLMaterial(cur_material->asLLSD());
|
||||
new_material.insert(map_te_material::value_type(range_it->second.te, mat));
|
||||
} else {
|
||||
mat = it->second;
|
||||
}
|
||||
|
||||
mat->setSpecularID(LLUUID::null);
|
||||
} break;
|
||||
case LLRender::NUM_TEXTURE_CHANNELS:
|
||||
//nothing to do, make compiler happy
|
||||
break;
|
||||
} //switch
|
||||
} //for
|
||||
|
||||
//setup new materials
|
||||
for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it)
|
||||
{
|
||||
LLMaterialMgr::getInstance()->setLocalMaterial(getRegion()->getRegionID(), it->second);
|
||||
LLViewerObject::setTEMaterialParams(it->first, it->second);
|
||||
}
|
||||
|
||||
//clear wait-list
|
||||
mWaitingTextureInfo.erase(range.first, range.second);
|
||||
|
||||
return refresh_materials;
|
||||
return 0 != new_material.size();
|
||||
}
|
||||
|
||||
S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams)
|
||||
{
|
||||
LLMaterialPtr material = pMaterialParams;
|
||||
LLMaterialPtr pMaterial = const_cast<LLMaterialPtr&>(pMaterialParams);
|
||||
|
||||
if (material.notNull())
|
||||
{
|
||||
LLTextureEntry* tex_entry = getTE(te);
|
||||
bool is_baked = tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID());
|
||||
material->setDiffuseBaked(is_baked);
|
||||
if(pMaterialParams)
|
||||
{ //check all of them according to material settings
|
||||
|
||||
LLViewerTexture *img_diffuse = getTEImage(te);
|
||||
llassert(NULL != img_diffuse);
|
||||
LLViewerTexture *img_diffuse = getTEImage(te);
|
||||
LLViewerTexture *img_normal = getTENormalMap(te);
|
||||
LLViewerTexture *img_specular = getTESpecularMap(te);
|
||||
|
||||
//diffuse
|
||||
if (!is_baked && NULL != img_diffuse)
|
||||
{
|
||||
if (0 == img_diffuse->getPrimaryFormat() && !img_diffuse->isMissingAsset())
|
||||
{
|
||||
// we don't have information about this texture, wait for it
|
||||
mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(img_diffuse->getID(), material_info(LLRender::DIFFUSE_MAP, te)));
|
||||
// Temporary assume RGBA image
|
||||
material->setDiffuseFormatPrimary(GL_RGBA);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (img_diffuse->isMissingAsset())
|
||||
{
|
||||
material->setDiffuseFormatPrimary(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
material->setDiffuseFormatPrimary(img_diffuse->getPrimaryFormat());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
material->setDiffuseFormatPrimary(0);
|
||||
}
|
||||
llassert(NULL != img_diffuse);
|
||||
|
||||
LLMaterialPtr new_material = NULL;
|
||||
|
||||
//diffuse
|
||||
if(NULL != img_diffuse)
|
||||
{ //guard
|
||||
if(0 == img_diffuse->getPrimaryFormat() && !img_diffuse->isMissingAsset())
|
||||
{ //ok here we don't have information about texture, let's belief and leave material settings
|
||||
//but we remember this case
|
||||
mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(img_diffuse->getID(), material_info(LLRender::DIFFUSE_MAP, te)));
|
||||
}
|
||||
else
|
||||
{
|
||||
bool bSetDiffuseNone = false;
|
||||
if(img_diffuse->isMissingAsset())
|
||||
{
|
||||
bSetDiffuseNone = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(pMaterialParams->getDiffuseAlphaMode())
|
||||
{
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND:
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE:
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_MASK:
|
||||
{ //all of them modes available only for 32 bit textures
|
||||
LLTextureEntry* tex_entry = getTE(te);
|
||||
bool bIsBakedImageId = false;
|
||||
if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID()))
|
||||
{
|
||||
bIsBakedImageId = true;
|
||||
}
|
||||
if (GL_RGBA != img_diffuse->getPrimaryFormat() && !bIsBakedImageId)
|
||||
{
|
||||
bSetDiffuseNone = true;
|
||||
}
|
||||
} break;
|
||||
}
|
||||
} //else
|
||||
|
||||
|
||||
if(bSetDiffuseNone)
|
||||
{ //upps... we should substitute this material with LLMaterial::DIFFUSE_ALPHA_MODE_NONE
|
||||
new_material = new LLMaterial(pMaterialParams->asLLSD());
|
||||
new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//normal
|
||||
if(LLUUID::null != pMaterialParams->getNormalID())
|
||||
{
|
||||
if(img_normal && img_normal->isMissingAsset() && img_normal->getID() == pMaterialParams->getNormalID())
|
||||
{
|
||||
if(!new_material) {
|
||||
new_material = new LLMaterial(pMaterialParams->asLLSD());
|
||||
}
|
||||
new_material->setNormalID(LLUUID::null);
|
||||
}
|
||||
else if(NULL == img_normal || 0 == img_normal->getPrimaryFormat())
|
||||
{ //ok here we don't have information about texture, let's belief and leave material settings
|
||||
//but we remember this case
|
||||
mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getNormalID(), material_info(LLRender::NORMAL_MAP,te)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//specular
|
||||
if(LLUUID::null != pMaterialParams->getSpecularID())
|
||||
{
|
||||
if(img_specular && img_specular->isMissingAsset() && img_specular->getID() == pMaterialParams->getSpecularID())
|
||||
{
|
||||
if(!new_material) {
|
||||
new_material = new LLMaterial(pMaterialParams->asLLSD());
|
||||
}
|
||||
new_material->setSpecularID(LLUUID::null);
|
||||
}
|
||||
else if(NULL == img_specular || 0 == img_specular->getPrimaryFormat())
|
||||
{ //ok here we don't have information about texture, let's belief and leave material settings
|
||||
//but we remember this case
|
||||
mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getSpecularID(), material_info(LLRender::SPECULAR_MAP, te)));
|
||||
}
|
||||
}
|
||||
|
||||
if(new_material) {
|
||||
pMaterial = new_material;
|
||||
LLMaterialMgr::getInstance()->setLocalMaterial(getRegion()->getRegionID(), pMaterial);
|
||||
}
|
||||
}
|
||||
|
||||
S32 res = LLViewerObject::setTEMaterialParams(te, material);
|
||||
S32 res = LLViewerObject::setTEMaterialParams(te, pMaterial);
|
||||
|
||||
LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((material) ? material->asLLSD() : LLSD("null")) << " res " << res
|
||||
LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterial) ? pMaterial->asLLSD() : LLSD("null")) << " res " << res
|
||||
<< ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" )
|
||||
<< LL_ENDL;
|
||||
setChanged(ALL_CHANGED);
|
||||
|
|
@ -4717,7 +4834,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
|
|||
LLMaterial* mat = te->getMaterialParams();
|
||||
if (mat)
|
||||
{
|
||||
U8 mode = mat->getDiffuseAlphaModeRender();
|
||||
U8 mode = mat->getDiffuseAlphaMode();
|
||||
|
||||
if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE
|
||||
|| mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE
|
||||
|
|
@ -5394,7 +5511,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
|||
}
|
||||
|
||||
draw_info->mAlphaMaskCutoff = mat->getAlphaMaskCutoff() * (1.f / 255.f);
|
||||
draw_info->mDiffuseAlphaMode = mat->getDiffuseAlphaModeRender();
|
||||
draw_info->mDiffuseAlphaMode = mat->getDiffuseAlphaMode();
|
||||
draw_info->mNormalMap = facep->getViewerObject()->getTENormalMap(facep->getTEOffset());
|
||||
}
|
||||
else
|
||||
|
|
@ -5797,7 +5914,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
|
||||
if (mat && LLPipeline::sRenderDeferred)
|
||||
{
|
||||
U8 alpha_mode = mat->getDiffuseAlphaModeRender();
|
||||
U8 alpha_mode = mat->getDiffuseAlphaMode();
|
||||
|
||||
bool is_alpha = type == LLDrawPool::POOL_ALPHA &&
|
||||
(alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND ||
|
||||
|
|
@ -5826,7 +5943,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
else if (mat)
|
||||
{
|
||||
bool is_alpha = type == LLDrawPool::POOL_ALPHA;
|
||||
U8 mode = mat->getDiffuseAlphaModeRender();
|
||||
U8 mode = mat->getDiffuseAlphaMode();
|
||||
bool can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE ||
|
||||
mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;
|
||||
|
||||
|
|
@ -6737,7 +6854,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
bool can_be_shiny = true;
|
||||
if (mat)
|
||||
{
|
||||
U8 mode = mat->getDiffuseAlphaModeRender();
|
||||
U8 mode = mat->getDiffuseAlphaMode();
|
||||
can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE ||
|
||||
mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;
|
||||
}
|
||||
|
|
@ -6759,7 +6876,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
//
|
||||
if (te->getFullbright())
|
||||
{
|
||||
if (mat->getDiffuseAlphaModeRender() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
{
|
||||
if (opaque)
|
||||
{
|
||||
|
|
@ -6844,7 +6961,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
}
|
||||
else if (mat)
|
||||
{
|
||||
U8 mode = mat->getDiffuseAlphaModeRender();
|
||||
U8 mode = mat->getDiffuseAlphaMode();
|
||||
|
||||
is_alpha = (is_alpha || (mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND));
|
||||
|
||||
|
|
@ -6943,7 +7060,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
}
|
||||
else if (fullbright || bake_sunlight)
|
||||
{ //fullbright
|
||||
if (mat && mat->getDiffuseAlphaModeRender() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK);
|
||||
}
|
||||
|
|
@ -6965,7 +7082,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
else
|
||||
{ //all around simple
|
||||
llassert(mask & LLVertexBuffer::MAP_NORMAL);
|
||||
if (mat && mat->getDiffuseAlphaModeRender() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
{ //material alpha mask can be respected in non-deferred
|
||||
registerFace(group, facep, LLRenderPass::PASS_ALPHA_MASK);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ bool LLEnvironmentRequest::initiate(LLEnvironment::environment_apply_fn cb)
|
|||
if (!cur_region->capabilitiesReceived())
|
||||
{
|
||||
LL_INFOS("WindlightCaps") << "Deferring windlight settings request until we've got region caps" << LL_ENDL;
|
||||
cur_region->setCapabilitiesReceivedCallback([cb](LLUUID region_id) { LLEnvironmentRequest::onRegionCapsReceived(region_id, cb); });
|
||||
cur_region->setCapabilitiesReceivedCallback([cb](const LLUUID ®ion_id) { LLEnvironmentRequest::onRegionCapsReceived(region_id, cb); });
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1798,7 +1798,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
|
|||
|
||||
if (alpha && mat)
|
||||
{
|
||||
switch (mat->getDiffuseAlphaModeRender())
|
||||
switch (mat->getDiffuseAlphaMode())
|
||||
{
|
||||
case 1:
|
||||
alpha = true; // Material's alpha mode is set to blend. Toss it into the alpha draw pool.
|
||||
|
|
|
|||
|
|
@ -10283,6 +10283,10 @@ If you continue to have problems, please visit the [SUPPORT_SITE].
|
|||
<global name="UnsupportedRAM">
|
||||
- Your system memory does not meet the minimum requirements.
|
||||
</global>
|
||||
|
||||
<global name="LLLeapUpdaterFailure">
|
||||
Failed to launch updater service [UPDATER_APP]. Please verify the viewer is installed correctly and has the necessary permissions to run. If you continue to experience issues, please visit the [SUPPORT_SITE].
|
||||
</global>
|
||||
|
||||
<!-- these are alert strings from server. the name needs to match entire the server string, and needs to be changed
|
||||
whenever the server string changes -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue