# Conflicts:
#	indra/newview/app_settings/settings.xml
#	indra/newview/llmeshrepository.cpp
#	indra/newview/llviewermenu.cpp
#	indra/newview/llviewerobjectlist.cpp
#	indra/newview/llvovolume.cpp
#	indra/newview/llworld.cpp
#	indra/newview/pipeline.cpp
#	indra/newview/skins/default/xui/en/notifications.xml
meow-7.2.2
Ansariel 2023-06-27 13:14:11 +02:00
commit fe243a3042
31 changed files with 384 additions and 117 deletions

View File

@ -1146,6 +1146,7 @@ void LLSettingsSky::setSkyIceLevel(F32 ice_level)
void LLSettingsSky::setReflectionProbeAmbiance(F32 ambiance)
{
mCanAutoAdjust = false; // we've now touched this sky in a "new" way, it can no longer auto adjust
setValue(SETTING_REFLECTION_PROBE_AMBIANCE, ambiance);
}

View File

@ -2074,7 +2074,8 @@ LLVolume::LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL ge
mDetail = detail;
mSculptLevel = -2;
mSurfaceArea = 1.f; //only calculated for sculpts, defaults to 1 for all other prims
mIsMeshAssetLoaded = FALSE;
mIsMeshAssetLoaded = false;
mIsMeshAssetUnavaliable = false;
mLODScaleBias.setVec(1,1,1);
mHullPoints = NULL;
mHullIndices = NULL;
@ -2824,14 +2825,32 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
}
BOOL LLVolume::isMeshAssetLoaded()
bool LLVolume::isMeshAssetLoaded()
{
return mIsMeshAssetLoaded;
}
void LLVolume::setMeshAssetLoaded(BOOL loaded)
void LLVolume::setMeshAssetLoaded(bool loaded)
{
mIsMeshAssetLoaded = loaded;
if (loaded)
{
mIsMeshAssetUnavaliable = false;
}
}
void LLVolume::setMeshAssetUnavaliable(bool unavaliable)
{
// Don't set it if at least one lod loaded
if (!mIsMeshAssetLoaded)
{
mIsMeshAssetUnavaliable = unavaliable;
}
}
bool LLVolume::isMeshAssetUnavaliable()
{
return mIsMeshAssetUnavaliable;
}
void LLVolume::copyFacesTo(std::vector<LLVolumeFace> &faces) const

View File

@ -1123,15 +1123,18 @@ private:
bool unpackVolumeFacesInternal(const LLSD& mdl);
public:
virtual void setMeshAssetLoaded(BOOL loaded);
virtual BOOL isMeshAssetLoaded();
virtual void setMeshAssetLoaded(bool loaded);
virtual bool isMeshAssetLoaded();
virtual void setMeshAssetUnavaliable(bool unavaliable);
virtual bool isMeshAssetUnavaliable();
protected:
BOOL mUnique;
F32 mDetail;
S32 mSculptLevel;
F32 mSurfaceArea; //unscaled surface area
BOOL mIsMeshAssetLoaded;
bool mIsMeshAssetLoaded;
bool mIsMeshAssetUnavaliable;
const LLVolumeParams mParams;
LLPath *mPathp;

View File

@ -13668,17 +13668,6 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>3</integer>
</map>
<key>RenderSkyHDRScale</key>
<map>
<key>Comment</key>
<string>Amount to over-brighten sun for HDR effect during the day</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>RenderSkyAutoAdjustLegacy</key>
<map>
<key>Comment</key>
@ -13690,6 +13679,28 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderSkyAutoAdjustAmbientScale</key>
<map>
<key>Comment</key>
<string>Amount to scale ambient when auto-adjusting legacy skies</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.5</real>
</map>
<key>RenderSkyAutoAdjustHDRScale</key>
<map>
<key>Comment</key>
<string>HDR Scale value to use when auto-adjusting legacy skies</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>2.0</real>
</map>
<key>RenderReflectionProbeMaxLocalLightAmbiance</key>
<map>
<key>Comment</key>

View File

@ -110,7 +110,7 @@ void main()
// Combine
vec3 color;
color = (cloudColorSun*(1.-alpha2) + cloudColorAmbient);
color.rgb= max(vec3(0), color.rgb);
color.rgb = clamp(color.rgb, vec3(0), vec3(1));
color.rgb *= 2.0;
/// Gamma correct for WL (soft clip effect).

View File

@ -36,8 +36,6 @@ vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
{
light *= atten.r;
additive = srgb_to_linear(additive*2.0);
// magic 1.25 here is to match the default RenderSkyHDRScale -- this parameter needs to be plumbed into sky settings or something
// so it's available to all shaders that call atmosFragLighting instead of just softenLightF.glsl
additive *= sky_hdr_scale;
light += additive;
return light;

View File

@ -5499,7 +5499,6 @@ public:
static LLTrace::BlockTimerStatHandle FTM_AUDIO_UPDATE("Update Audio");
static LLTrace::BlockTimerStatHandle FTM_CLEANUP("Cleanup");
static LLTrace::BlockTimerStatHandle FTM_CLEANUP_DRAWABLES("Drawables");
static LLTrace::BlockTimerStatHandle FTM_CLEANUP_OBJECTS("Objects");
static LLTrace::BlockTimerStatHandle FTM_IDLE_CB("Idle Callbacks");
static LLTrace::BlockTimerStatHandle FTM_LOD_UPDATE("Update LOD");
static LLTrace::BlockTimerStatHandle FTM_OBJECTLIST_UPDATE("Update Objectlist");
@ -5821,7 +5820,6 @@ void LLAppViewer::idle()
{
LL_RECORD_BLOCK_TIME(FTM_CLEANUP);
{
LL_RECORD_BLOCK_TIME(FTM_CLEANUP_OBJECTS);
gObjectList.cleanDeadObjects();
}
{

View File

@ -174,7 +174,8 @@ void LLFloaterEnvironmentAdjust::refresh()
getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setValue(mLiveSky->getCloudNoiseTextureId());
getChild<LLTextureCtrl>(FIELD_WATER_NORMAL_MAP)->setValue(mLiveWater->getNormalMapID());
getChild<LLUICtrl>(FIELD_REFLECTION_PROBE_AMBIANCE)->setValue(mLiveSky->getReflectionProbeAmbiance());
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
getChild<LLUICtrl>(FIELD_REFLECTION_PROBE_AMBIANCE)->setValue(mLiveSky->getReflectionProbeAmbiance(should_auto_adjust));
LLColor3 glow(mLiveSky->getGlow());
@ -488,7 +489,9 @@ void LLFloaterEnvironmentAdjust::onReflectionProbeAmbianceChanged()
void LLFloaterEnvironmentAdjust::updateGammaLabel()
{
if (!mLiveSky) return;
F32 ambiance = mLiveSky->getReflectionProbeAmbiance();
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
F32 ambiance = mLiveSky->getReflectionProbeAmbiance(should_auto_adjust);
if (ambiance != 0.f)
{
childSetValue("scene_gamma_label", getString("hdr_string"));

View File

@ -182,6 +182,12 @@ void LLFloaterFixedEnvironment::setEditSettingsAndUpdate(const LLSettingsBase::p
syncronizeTabs();
refresh();
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT);
// teach user about HDR settings
if (mSettings && ((LLSettingsSky*)mSettings.get())->canAutoAdjust())
{
LLNotificationsUtil::add("AutoAdjustHDRSky");
}
}
void LLFloaterFixedEnvironment::syncronizeTabs()

View File

@ -4243,7 +4243,7 @@ void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVol
if (sys_volume)
{
sys_volume->copyVolumeFaces(volume);
sys_volume->setMeshAssetLoaded(TRUE);
sys_volume->setMeshAssetLoaded(true);
LLPrimitive::getVolumeManager()->unrefVolume(sys_volume);
}
else
@ -4275,6 +4275,12 @@ void LLMeshRepository::notifyMeshUnavailable(const LLVolumeParams& mesh_params,
{
F32 detail = LLVolumeLODGroup::getVolumeScaleFromDetail(lod);
LLVolume* sys_volume = LLPrimitive::getVolumeManager()->refVolume(mesh_params, detail);
if (sys_volume)
{
sys_volume->setMeshAssetUnavaliable(true);
}
for (LLVOVolume* vobj : obj_iter->second)
{
if (vobj)
@ -4431,6 +4437,37 @@ bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id)
return false;
}
bool LLMeshRepository::hasSkinInfo(const LLUUID& mesh_id)
{
if (mesh_id.isNull())
{
return false;
}
if (mThread->hasSkinInfoInHeader(mesh_id))
{
return true;
}
const LLMeshSkinInfo* skininfo = getSkinInfo(mesh_id);
if (skininfo)
{
return true;
}
return false;
}
bool LLMeshRepository::hasHeader(const LLUUID& mesh_id)
{
if (mesh_id.isNull())
{
return false;
}
return mThread->hasHeader(mesh_id);
}
bool LLMeshRepoThread::hasPhysicsShapeInHeader(const LLUUID& mesh_id)
{
LLMutexLock lock(mHeaderMutex);
@ -4447,6 +4484,30 @@ bool LLMeshRepoThread::hasPhysicsShapeInHeader(const LLUUID& mesh_id)
return false;
}
bool LLMeshRepoThread::hasSkinInfoInHeader(const LLUUID& mesh_id)
{
LLMutexLock lock(mHeaderMutex);
mesh_header_map::iterator iter = mMeshHeader.find(mesh_id);
if (iter != mMeshHeader.end() && iter->second.first > 0)
{
LLMeshHeader& mesh = iter->second.second;
if (mesh.mSkinOffset >= 0
&& mesh.mSkinSize > 0)
{
return true;
}
}
return false;
}
bool LLMeshRepoThread::hasHeader(const LLUUID& mesh_id)
{
LLMutexLock lock(mHeaderMutex);
mesh_header_map::iterator iter = mMeshHeader.find(mesh_id);
return iter != mMeshHeader.end();
}
// <FS:Ansariel> DAE export
LLUUID LLMeshRepository::getCreatorFromHeader(const LLUUID& mesh_id)
{

View File

@ -417,6 +417,8 @@ public:
bool decompositionReceived(const LLUUID& mesh_id, U8* data, S32 data_size);
EMeshProcessingResult physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32 data_size);
bool hasPhysicsShapeInHeader(const LLUUID& mesh_id);
bool hasSkinInfoInHeader(const LLUUID& mesh_id);
bool hasHeader(const LLUUID& mesh_id);
void notifyLoadedMeshes();
S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
@ -681,6 +683,8 @@ public:
LLModel::Decomposition* getDecomposition(const LLUUID& mesh_id);
void fetchPhysicsShape(const LLUUID& mesh_id);
bool hasPhysicsShape(const LLUUID& mesh_id);
bool hasSkinInfo(const LLUUID& mesh_id);
bool hasHeader(const LLUUID& mesh_id);
void buildHull(const LLVolumeParams& params, S32 detail);
void buildPhysicsMesh(LLModel::Decomposition& decomp);

View File

@ -36,6 +36,7 @@
#include "llsettingssky.h"
#include "llenvironment.h"
#include "llatmosphere.h"
#include "llviewercontrol.h"
namespace
{
@ -207,7 +208,9 @@ void LLPanelSettingsSkyAtmosTab::refresh()
F32 moisture_level = mSkySettings->getSkyMoistureLevel();
F32 droplet_radius = mSkySettings->getSkyDropletRadius();
F32 ice_level = mSkySettings->getSkyIceLevel();
F32 rp_ambiance = mSkySettings->getReflectionProbeAmbiance();
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
F32 rp_ambiance = mSkySettings->getReflectionProbeAmbiance(should_auto_adjust);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->setValue(moisture_level);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->setValue(droplet_radius);

View File

@ -117,7 +117,7 @@ void LLReflectionMap::autoAdjustOrigin()
{
int face = -1;
LLVector4a intersection;
LLDrawable* drawable = mGroup->lineSegmentIntersect(bounds[0], corners[i], true, false, true, &face, &intersection);
LLDrawable* drawable = mGroup->lineSegmentIntersect(bounds[0], corners[i], false, false, true, &face, &intersection);
if (drawable != nullptr)
{
hit = true;

View File

@ -924,8 +924,9 @@ void LLReflectionMapManager::updateUniforms()
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance(cloud_shadow_scale, should_auto_adjust);
F32 ambscale = gCubeSnapshot && !isRadiancePass() ? 0.f : 1.f;
F32 radscale = gCubeSnapshot && !isRadiancePass() ? 0.5f : 1.f;
bool is_ambiance_pass = gCubeSnapshot && !isRadiancePass();
F32 ambscale = is_ambiance_pass ? 0.f : 1.f;
F32 radscale = is_ambiance_pass ? 0.5f : 1.f;
for (auto* refmap : mReflectionMaps)
{

View File

@ -719,6 +719,8 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
F32 g = getGamma();
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<F32> auto_adjust_ambient_scale(gSavedSettings, "RenderSkyAutoAdjustAmbientScale", 0.75f);
static LLCachedControl<F32> auto_adjust_hdr_scale(gSavedSettings, "RenderSkyAutoAdjustHDRScale", 2.f);
static LLCachedControl<F32> cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f);
F32 probe_ambiance = getTotalReflectionProbeAmbiance(cloud_shadow_scale);
@ -736,9 +738,9 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
}
else if (psky->canAutoAdjust() && should_auto_adjust)
{ // auto-adjust legacy sky to take advantage of probe ambiance
shader->uniform3fv(LLShaderMgr::AMBIENT, (ambient * 0.5f).mV);
shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, 2.f);
probe_ambiance = 1.f;
shader->uniform3fv(LLShaderMgr::AMBIENT, (ambient * auto_adjust_ambient_scale).mV);
shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, auto_adjust_hdr_scale);
probe_ambiance = 1.f; // NOTE -- must match LLSettingsSky::getReflectionProbeAmbiance value for "auto_adjust" true
}
else
{

View File

@ -785,7 +785,8 @@ void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* c
assert_states_valid(this);
}
void LLSpatialGroup::destroyGL(bool keep_occlusion)
void LLSpatialGroup::destroyGLState(bool keep_occlusion)
{
// <FS:Ansariel> Reset VB during TP
bool is_tree_group = getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_TREE;
@ -1313,45 +1314,11 @@ void drawBoxOutline(const LLVector4a& pos, const LLVector4a& size)
drawBoxOutline(reinterpret_cast<const LLVector3&>(pos), reinterpret_cast<const LLVector3&>(size));
}
class LLOctreeDirty : public OctreeTraveler
{
public:
virtual void visit(const OctreeNode* state)
{
LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
group->destroyGL();
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
if(!drawable)
{
continue;
}
if (drawable->getVObj().notNull() && !group->getSpatialPartition()->mRenderByGroup)
{
gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL);
}
}
for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i)
{
LLSpatialBridge* bridge = *i;
traverse(bridge->mOctree);
}
}
};
void LLSpatialPartition::restoreGL()
{
}
void LLSpatialPartition::resetVertexBuffers()
{
LLOctreeDirty dirty;
dirty.traverse(mOctree);
}
BOOL LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;

View File

@ -306,7 +306,9 @@ public:
BOOL removeObject(LLDrawable *drawablep, BOOL from_octree = FALSE);
BOOL updateInGroup(LLDrawable *drawablep, BOOL immediate = FALSE); // Update position if it's in the group
void shift(const LLVector4a &offset);
void destroyGL(bool keep_occlusion = false);
// TODO: this no longer appears to be called, figure out if it's important and if not remove it
void destroyGLState(bool keep_occlusion = false);
void updateDistance(LLCamera& camera);
F32 getUpdateUrgency() const;
@ -430,7 +432,6 @@ public:
void renderDebug();
void renderIntersectingBBoxes(LLCamera* camera);
void restoreGL();
void resetVertexBuffers();
BOOL getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax);

View File

@ -9817,10 +9817,6 @@ class LLToggleShaderControl : public view_listener_t
BOOL checked = gSavedSettings.getBOOL( control_name );
gSavedSettings.setBOOL( control_name, !checked );
LLPipeline::refreshCachedSettings();
//gPipeline.updateRenderDeferred();
//gPipeline.releaseGLBuffers();
//gPipeline.createGLBuffers();
//gPipeline.resetVertexBuffers();
LLViewerShaderMgr::instance()->setShaders();
return !checked;
}
@ -10972,6 +10968,9 @@ class LLViewHighlightTransparent : public view_listener_t
// [RLVa:KB] - @edit and @viewtransparent
LLDrawPoolAlpha::sShowDebugAlpha = (!LLDrawPoolAlpha::sShowDebugAlpha) && (RlvActions::canHighlightTransparent());
// [/RLVa:KB]
// invisible objects skip building their render batches unless sShowDebugAlpha is true, so rebuild batches whenever toggling this flag
gPipeline.rebuildDrawInfo();
return true;
}
};

View File

@ -436,6 +436,7 @@ void LLViewerObject::markDead()
{
if (!mDead)
{
LL_PROFILE_ZONE_SCOPED;
//LL_INFOS() << "Marking self " << mLocalID << " as dead." << LL_ENDL;
// Root object of this hierarchy unlinks itself.
@ -1206,6 +1207,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
const EObjectUpdateType update_type,
LLDataPacker *dp)
{
LL_PROFILE_ZONE_SCOPED;
LL_DEBUGS_ONCE("SceneLoadTiming") << "Received viewer object data" << LL_ENDL;
LL_DEBUGS("ObjectUpdate") << " mesgsys " << mesgsys << " dp " << dp << " id " << getID() << " update_type " << (S32) update_type << LL_ENDL;

View File

@ -1537,6 +1537,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
{
LL_PROFILE_ZONE_SCOPED;
// Don't ever kill gAgentAvatarp, just force it to the agent's region
// unless region is NULL which is assumed to mean you are logging out.
if ((objectp == gAgentAvatarp) && gAgent.getRegion())
@ -1586,6 +1587,7 @@ void LLViewerObjectList::killAnimatedObjects()
void LLViewerObjectList::killObjects(LLViewerRegion *regionp)
{
LL_PROFILE_ZONE_SCOPED;
LLViewerObject *objectp;
@ -1648,6 +1650,8 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer)
return;
}
LL_PROFILE_ZONE_SCOPED;
// <FS:Beq/> FIRE-30694 DeadObject Spam
S32 num_divergent = 0;
S32 num_removed = 0;

View File

@ -762,6 +762,7 @@ static LLTrace::BlockTimerStatHandle FTM_SAVE_REGION_CACHE("Save Region Cache");
LLViewerRegion::~LLViewerRegion()
{
LL_PROFILE_ZONE_SCOPED;
mDead = TRUE;
mImpl->mActiveSet.clear();
mImpl->mVisibleEntries.clear();
@ -1675,6 +1676,7 @@ void LLViewerRegion::lightIdleUpdate()
void LLViewerRegion::idleUpdate(F32 max_update_time)
{
LL_PROFILE_ZONE_SCOPED;
LLTimer update_timer;
F32 max_time;
@ -1778,6 +1780,10 @@ BOOL LLViewerRegion::isViewerCameraStatic()
void LLViewerRegion::killInvisibleObjects(F32 max_time)
{
#if 1 // TODO: kill this. This is ill-conceived, objects that aren't in the camera frustum should not be deleted from memory.
// because of this, every time you turn around the simulator sends a swarm of full object update messages from cache
// probe misses and objects have to be reloaded from scratch. From some reason, disabling this causes holes to
// appear in the scene when flying back and forth between regions
if(!sVOCacheCullingEnabled)
{
return;
@ -1854,6 +1860,7 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time)
}
return;
#endif
}
void LLViewerRegion::killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& delete_list)

View File

@ -8419,6 +8419,85 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
}
}
bool LLVOAvatar::hasPendingAttachedMeshes()
{
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
{
LLViewerJointAttachment* attachment = iter->second;
if (attachment)
{
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
LLViewerObject* objectp = attachment_iter->get();
if (objectp)
{
LLViewerObject::const_child_list_t& child_list = objectp->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin();
iter1 != child_list.end(); ++iter1)
{
LLViewerObject* objectchild = *iter1;
if (objectchild && objectchild->getVolume())
{
const LLUUID& mesh_id = objectchild->getVolume()->getParams().getSculptID();
if (mesh_id.isNull())
{
// No mesh nor skin info needed
continue;
}
if (objectchild->getVolume()->isMeshAssetUnavaliable())
{
// Mesh failed to load, do not expect it
continue;
}
if (objectchild->mDrawable)
{
LLVOVolume* pvobj = objectchild->mDrawable->getVOVolume();
if (pvobj)
{
if (!pvobj->isMesh())
{
// Not a mesh
continue;
}
if (!objectchild->getVolume()->isMeshAssetLoaded())
{
// Waiting for mesh
return true;
}
const LLMeshSkinInfo* skin_data = pvobj->getSkinInfo();
if (skin_data)
{
// Skin info present, done
continue;
}
if (pvobj->isSkinInfoUnavaliable())
{
// Load failed or info not present, don't expect it
continue;
}
}
// objectchild is not ready
return true;
}
}
}
}
}
}
}
return false;
}
//-----------------------------------------------------------------------------
// detachObject()
//-----------------------------------------------------------------------------
@ -9078,6 +9157,7 @@ BOOL LLVOAvatar::updateIsFullyLoaded()
|| (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC)
|| !mPendingAttachment.empty()
|| (rez_status < 3 && !isFullyBaked())
|| hasPendingAttachedMeshes()
);
}
updateRezzedStatusTimers(rez_status);

View File

@ -962,6 +962,7 @@ public:
virtual BOOL detachObject(LLViewerObject *viewer_object);
static bool getRiggedMeshID( LLViewerObject* pVO, LLUUID& mesh_id );
void cleanupAttachedMesh( LLViewerObject* pVO );
bool hasPendingAttachedMeshes();
static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj);
/*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type ) const;
LLViewerObject * findAttachmentByID( const LLUUID & target_id ) const;

View File

@ -105,7 +105,7 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data)
std::string error, warn;
if (override_mat->fromJSON(gltf_json_str, warn, error))
{
mGLTFMaterial[i] = override_mat;
mGLTFMaterial[side_idx] = override_mat;
}
else
{
@ -126,6 +126,16 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data)
LL_WARNS_IF(sides.size() != 0, "GLTF") << "broken override cache entry" << LL_ENDL;
}
}
llassert(mSides.size() == mGLTFMaterial.size());
#ifdef SHOW_ASSERT
for (auto const & side : mSides)
{
// check that mSides and mGLTFMaterial have exactly the same keys present
llassert(mGLTFMaterial.count(side.first) == 1);
}
#endif
return true;
}
@ -141,8 +151,11 @@ LLSD LLGLTFOverrideCacheEntry::toLLSD() const
data["object_id"] = mObjectId;
data["local_id"] = (LLSD::Integer) mLocalId;
llassert(mSides.size() == mGLTFMaterial.size());
for (auto const & side : mSides)
{
// check that mSides and mGLTFMaterial have exactly the same keys present
llassert(mGLTFMaterial.count(side.first) == 1);
data["sides"].append(LLSD::Integer(side.first));
data["gltf_json"].append(side.second);
}

View File

@ -246,7 +246,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
mColorChanged = FALSE;
mSpotLightPriority = 0.f;
mSkinInfoFailed = false;
mSkinInfoUnavaliable = false;
mSkinInfo = NULL;
mMediaImplList.resize(getNumTEs());
@ -262,6 +262,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
LLVOVolume::~LLVOVolume()
{
LL_PROFILE_ZONE_SCOPED;
delete mTextureAnimp;
mTextureAnimp = NULL;
delete mVolumeImpl;
@ -285,6 +286,7 @@ void LLVOVolume::markDead()
{
if (!mDead)
{
LL_PROFILE_ZONE_SCOPED;
if (getVolume())
{
LLSculptIDSize::instance().rem(getVolume()->getParams().getSculptID());
@ -1289,7 +1291,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
if (mSkinInfo && mSkinInfo->mMeshID != volume_params.getSculptID())
{
mSkinInfo = NULL;
mSkinInfoFailed = false;
mSkinInfoUnavaliable = false;
}
if (!getVolume()->isMeshAssetLoaded())
@ -1302,13 +1304,24 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
}
}
if (!mSkinInfo && !mSkinInfoFailed)
if (!mSkinInfo && !mSkinInfoUnavaliable)
{
const LLMeshSkinInfo* skin_info = gMeshRepo.getSkinInfo(volume_params.getSculptID(), this);
if (skin_info)
{
notifySkinInfoLoaded(skin_info);
}
LLUUID mesh_id = volume_params.getSculptID();
if (gMeshRepo.hasHeader(mesh_id) && !gMeshRepo.hasSkinInfo(mesh_id))
{
// If header is present but has no data about skin,
// no point fetching
mSkinInfoUnavaliable = true;
}
if (!mSkinInfoUnavaliable)
{
const LLMeshSkinInfo* skin_info = gMeshRepo.getSkinInfo(mesh_id, this);
if (skin_info)
{
notifySkinInfoLoaded(skin_info);
}
}
}
}
else // otherwise is sculptie
@ -1343,7 +1356,7 @@ void LLVOVolume::updateSculptTexture()
mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
}
mSkinInfoFailed = false;
mSkinInfoUnavaliable = false;
mSkinInfo = NULL;
}
else
@ -1384,6 +1397,16 @@ void LLVOVolume::notifyMeshLoaded()
mSculptChanged = TRUE;
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY);
if (!mSkinInfo && !mSkinInfoUnavaliable)
{
// Header was loaded, update skin info state from header
LLUUID mesh_id = getVolume()->getParams().getSculptID();
if (!gMeshRepo.hasSkinInfo(mesh_id))
{
mSkinInfoUnavaliable = true;
}
}
LLVOAvatar *av = getAvatar();
if (av && !isAnimatedObject())
{
@ -1401,7 +1424,7 @@ void LLVOVolume::notifyMeshLoaded()
void LLVOVolume::notifySkinInfoLoaded(const LLMeshSkinInfo* skin)
{
mSkinInfoFailed = false;
mSkinInfoUnavaliable = false;
mSkinInfo = skin;
notifyMeshLoaded();
@ -1409,7 +1432,7 @@ void LLVOVolume::notifySkinInfoLoaded(const LLMeshSkinInfo* skin)
void LLVOVolume::notifySkinInfoUnavailable()
{
mSkinInfoFailed = true;
mSkinInfoUnavaliable = true;
mSkinInfo = nullptr;
}
@ -4911,7 +4934,12 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
end_face = face+1;
}
pick_transparent |= isHiglightedOrBeacon();
bool special_cursor = specialHoverCursor();
// we *probably* shouldn't care about special cursor at all, but we *definitely*
// don't care about special cursor for reflection probes -- makes alt-zoom
// go through reflection probes on vehicles
bool special_cursor = mReflectionProbe.isNull() && specialHoverCursor();
for (S32 i = start_face; i < end_face; ++i)
{
if (!special_cursor && !pick_transparent && getTE(i) && getTE(i)->getColor().mV[3] == 0.f)
@ -5876,12 +5904,21 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
//</FS:Beq>
bool is_mesh = vobj->isMesh();
if (is_mesh &&
if (is_mesh)
{
if ((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded())
|| !gMeshRepo.meshRezEnabled())
{
// Waiting for asset to fetch
continue;
}
((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) || !gMeshRepo.meshRezEnabled()))
{
continue;
}
if (!vobj->getSkinInfo() && !vobj->isSkinInfoUnavaliable())
{
// Waiting for skin info to fetch
continue;
}
}
LLVolume* volume = vobj->getVolume();
if (volume)

View File

@ -335,6 +335,7 @@ public:
BOOL setIsFlexible(BOOL is_flexible);
const LLMeshSkinInfo* getSkinInfo() const;
const bool isSkinInfoUnavaliable() const { return mSkinInfoUnavaliable; }
//convenience accessor for mesh ID (which is stored in sculpt id for legacy reasons)
const LLUUID& getMeshID() const { return getVolume()->getParams().getSculptID(); }
@ -492,7 +493,7 @@ private:
LLPointer<LLRiggedVolume> mRiggedVolume;
bool mSkinInfoFailed;
bool mSkinInfoUnavaliable;
LLConstPointer<LLMeshSkinInfo> mSkinInfo;
// statics
public:

View File

@ -145,9 +145,14 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
static const unsigned int vertices_per_quad = 4;
static const unsigned int indices_per_quad = 6;
const S32 size = LLPipeline::sRenderTransparentWater ? 16 : 1;
S32 size_x = LLPipeline::sRenderTransparentWater ? 8 : 1;
S32 size_y = LLPipeline::sRenderTransparentWater ? 8 : 1;
const S32 num_quads = size * size;
const LLVector3& scale = getScale();
size_x *= llmin(llround(scale.mV[0] / 256.f), 8);
size_y *= llmin(llround(scale.mV[1] / 256.f), 8);
const S32 num_quads = size_x * size_y;
face->setSize(vertices_per_quad * num_quads,
indices_per_quad * num_quads);
@ -178,41 +183,37 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
face->mCenterLocal = position_agent;
S32 x, y;
F32 step_x = getScale().mV[0] / size;
F32 step_y = getScale().mV[1] / size;
F32 step_x = getScale().mV[0] / size_x;
F32 step_y = getScale().mV[1] / size_y;
const LLVector3 up(0.f, step_y * 0.5f, 0.f);
const LLVector3 right(step_x * 0.5f, 0.f, 0.f);
const LLVector3 normal(0.f, 0.f, 1.f);
F32 size_inv = 1.f / size;
F32 size_inv_x = 1.f / size_x;
F32 size_inv_y = 1.f / size_y;
F32 z_fudge = 0.f;
if (getIsEdgePatch())
{ //bump edge patches down 10 cm to prevent aliasing along edges
z_fudge = -0.1f;
}
for (y = 0; y < size; y++)
for (y = 0; y < size_y; y++)
{
for (x = 0; x < size; x++)
for (x = 0; x < size_x; x++)
{
S32 toffset = index_offset + 4*(y*size + x);
S32 toffset = index_offset + 4*(y*size_x + x);
position_agent = getPositionAgent() - getScale() * 0.5f;
position_agent.mV[VX] += (x + 0.5f) * step_x;
position_agent.mV[VY] += (y + 0.5f) * step_y;
position_agent.mV[VZ] += z_fudge;
position_agent.mV[VX] = llround(position_agent.mV[VX]);
position_agent.mV[VY] = llround(position_agent.mV[VY]);
*verticesp++ = position_agent - right + up;
*verticesp++ = position_agent - right - up;
*verticesp++ = position_agent + right + up;
*verticesp++ = position_agent + right - up;
*texCoordsp++ = LLVector2(x*size_inv, (y+1)*size_inv);
*texCoordsp++ = LLVector2(x*size_inv, y*size_inv);
*texCoordsp++ = LLVector2((x+1)*size_inv, (y+1)*size_inv);
*texCoordsp++ = LLVector2((x+1)*size_inv, y*size_inv);
*texCoordsp++ = LLVector2(x*size_inv_x, (y+1)*size_inv_y);
*texCoordsp++ = LLVector2(x*size_inv_x, y*size_inv_y);
*texCoordsp++ = LLVector2((x+1)*size_inv_x, (y+1)*size_inv_y);
*texCoordsp++ = LLVector2((x+1)*size_inv_x, y*size_inv_y);
*normalsp++ = normal;
*normalsp++ = normal;

View File

@ -125,7 +125,7 @@ LLWorld::LLWorld() :
mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
gGL.getTexUnit(0)->bind(mDefaultWaterTexturep);
mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
LLViewerRegion::sVOCacheCullingEnabled = gSavedSettings.getBOOL("RequestFullRegionCache") && gSavedSettings.getBOOL("ObjectCacheEnabled");
LLViewerRegion::sVOCacheCullingEnabled = gSavedSettings.getBOOL("RequestFullRegionCache") && gSavedSettings.getBOOL("ObjectCacheEnabled");
}
@ -1120,6 +1120,7 @@ static LLTrace::SampleStatHandle<> sNumActiveCachedObjects("numactivecachedobjec
void LLWorld::updateRegions(F32 max_update_time)
{
LL_PROFILE_ZONE_SCOPED;
LLTimer update_timer;
mNumOfActiveCachedObjects = 0;

View File

@ -10809,10 +10809,37 @@ void LLPipeline::handleShadowDetailChanged()
}
}
void LLPipeline::overrideEnvironmentMap()
class LLOctreeDirty : public OctreeTraveler
{
//mReflectionMapManager.mProbes.clear();
//mReflectionMapManager.addProbe(LLViewerCamera::instance().getOrigin());
public:
virtual void visit(const OctreeNode* state)
{
LLSpatialGroup* group = (LLSpatialGroup*)state->getListener(0);
group->setState(LLSpatialGroup::GEOM_DIRTY);
gPipeline.markRebuild(group);
for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i)
{
LLSpatialBridge* bridge = *i;
traverse(bridge->mOctree);
}
}
};
void LLPipeline::rebuildDrawInfo()
{
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* region = *iter;
LLOctreeDirty dirty;
LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_VOLUME);
dirty.traverse(part->mOctree);
}
}
// <FS:Ansariel> Reset VB during TP

View File

@ -131,6 +131,10 @@ public:
bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples);
bool allocateShadowBuffer(U32 resX, U32 resY);
// rebuild all LLVOVolume render batches
void rebuildDrawInfo();
// Clear LLFace mVertexBuffer pointers
void resetVertexBuffers(LLDrawable* drawable);
// perform a profile of the given avatar
@ -449,7 +453,6 @@ public:
void handleShadowDetailChanged();
LLReflectionMapManager mReflectionMapManager;
void overrideEnvironmentMap();
private:
void unloadShaders();

View File

@ -14022,6 +14022,19 @@ Material successfully created. Asset ID: [ASSET_ID]
yestext="OK"/>
</notification>
<notification
icon="notifytip.tga"
name="AutoAdjustHDRSky"
persist="true"
type="alertmodal">
You are editing a non-HDR sky that has been automatically converted to HDR. To remove HDR and tone mapping, set Reflection Probe Ambiance to zero.
<usetemplate
ignoretext="HDR Sky adjustment warning"
name="okignore"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="EnableAutoFPSWarning"