From 2545e67b143e90b098519c359bd6113e2784cbce Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 4 Apr 2018 12:27:41 -0700 Subject: [PATCH 1/5] set lastEditedBy in local tree whenever a script adds or edits an entity --- .../entities/src/EntityScriptingInterface.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 2e9b386ba5..37e26a422b 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -241,14 +241,18 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties _activityTracking.addedEntityCount++; + auto nodeList = DependencyManager::get(); + auto sessionID = nodeList->getSessionUUID(); + EntityItemProperties propertiesWithSimID = properties; if (clientOnly) { - auto nodeList = DependencyManager::get(); - const QUuid myNodeID = nodeList->getSessionUUID(); + const QUuid myNodeID = sessionID; propertiesWithSimID.setClientOnly(clientOnly); propertiesWithSimID.setOwningAvatarID(myNodeID); } + propertiesWithSimID.setLastEditedBy(sessionID); + bool scalesWithParent = propertiesWithSimID.getScalesWithParent(); propertiesWithSimID = convertPropertiesFromScriptSemantics(propertiesWithSimID, scalesWithParent); @@ -308,6 +312,11 @@ QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QStrin if (!textures.isEmpty()) { properties.setTextures(textures); } + + auto nodeList = DependencyManager::get(); + auto sessionID = nodeList->getSessionUUID(); + properties.setLastEditedBy(sessionID); + return addEntity(properties); } @@ -363,7 +372,11 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& _activityTracking.editedEntityCount++; + auto nodeList = DependencyManager::get(); + auto sessionID = nodeList->getSessionUUID(); + EntityItemProperties properties = scriptSideProperties; + properties.setLastEditedBy(sessionID); EntityItemID entityID(id); if (!_entityTree) { @@ -379,7 +392,6 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& return; } - auto nodeList = DependencyManager::get(); if (entity->getClientOnly() && entity->getOwningAvatarID() != nodeList->getSessionUUID()) { // don't edit other avatar's avatarEntities return; From 5503c7909aa75753feb26f9004f54f7e6dbc588b Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Fri, 6 Apr 2018 15:18:21 -0700 Subject: [PATCH 2/5] fix materials not disappearing on deletion in certain cases --- libraries/entities/src/MaterialEntityItem.cpp | 9 ++++----- libraries/entities/src/MaterialEntityItem.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libraries/entities/src/MaterialEntityItem.cpp b/libraries/entities/src/MaterialEntityItem.cpp index 8b595bf69d..0f77861ba4 100644 --- a/libraries/entities/src/MaterialEntityItem.cpp +++ b/libraries/entities/src/MaterialEntityItem.cpp @@ -27,6 +27,10 @@ MaterialEntityItem::MaterialEntityItem(const EntityItemID& entityItemID) : Entit _type = EntityTypes::Material; } +MaterialEntityItem::~MaterialEntityItem() { + removeMaterial(); +} + EntityItemProperties MaterialEntityItem::getProperties(EntityPropertyFlags desiredProperties) const { EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class COPY_ENTITY_PROPERTY_TO_PROPERTIES(materialURL, getMaterialURL); @@ -328,11 +332,6 @@ void MaterialEntityItem::postParentFixup() { applyMaterial(); } -void MaterialEntityItem::preDelete() { - EntityItem::preDelete(); - removeMaterial(); -} - void MaterialEntityItem::update(const quint64& now) { if (_retryApply) { applyMaterial(); diff --git a/libraries/entities/src/MaterialEntityItem.h b/libraries/entities/src/MaterialEntityItem.h index f77077a782..e203b707cc 100644 --- a/libraries/entities/src/MaterialEntityItem.h +++ b/libraries/entities/src/MaterialEntityItem.h @@ -21,6 +21,7 @@ public: static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); MaterialEntityItem(const EntityItemID& entityItemID); + ~MaterialEntityItem(); ALLOW_INSTANTIATION // This class can be instantiated @@ -84,7 +85,6 @@ public: void removeMaterial(); void postParentFixup() override; - void preDelete() override; private: // URL for this material. Currently, only JSON format is supported. Set to "userData" to use the user data to live edit a material. From bba47ba2b408bcdff841d1ca90c90577621f143a Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 10 Apr 2018 11:35:24 -0700 Subject: [PATCH 3/5] materials on client only entities --- .../src/RenderableMaterialEntityItem.cpp | 6 ++---- .../src/RenderableMaterialEntityItem.h | 2 -- libraries/entities/src/MaterialEntityItem.cpp | 20 ++----------------- libraries/entities/src/MaterialEntityItem.h | 2 -- 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableMaterialEntityItem.cpp b/libraries/entities-renderer/src/RenderableMaterialEntityItem.cpp index ea8edb8a08..7cea841bf0 100644 --- a/libraries/entities-renderer/src/RenderableMaterialEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableMaterialEntityItem.cpp @@ -18,7 +18,7 @@ bool MaterialEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityP if (entity->getMaterial() != _drawMaterial) { return true; } - if (entity->getParentID() != _parentID || entity->getClientOnly() != _clientOnly || entity->getOwningAvatarID() != _owningAvatarID) { + if (entity->getParentID() != _parentID) { return true; } if (entity->getMaterialMappingPos() != _materialMappingPos || entity->getMaterialMappingScale() != _materialMappingScale || entity->getMaterialMappingRot() != _materialMappingRot) { @@ -31,8 +31,6 @@ void MaterialEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& withWriteLock([&] { _drawMaterial = entity->getMaterial(); _parentID = entity->getParentID(); - _clientOnly = entity->getClientOnly(); - _owningAvatarID = entity->getOwningAvatarID(); _materialMappingPos = entity->getMaterialMappingPos(); _materialMappingScale = entity->getMaterialMappingScale(); _materialMappingRot = entity->getMaterialMappingRot(); @@ -102,7 +100,7 @@ void MaterialEntityRenderer::doRender(RenderArgs* args) { graphics::MaterialPointer drawMaterial; Transform textureTransform; withReadLock([&] { - parentID = _clientOnly ? _owningAvatarID : _parentID; + parentID = _parentID; renderTransform = _renderTransform; drawMaterial = _drawMaterial; textureTransform.setTranslation(glm::vec3(_materialMappingPos, 0)); diff --git a/libraries/entities-renderer/src/RenderableMaterialEntityItem.h b/libraries/entities-renderer/src/RenderableMaterialEntityItem.h index 8de2190a0c..96c720f79f 100644 --- a/libraries/entities-renderer/src/RenderableMaterialEntityItem.h +++ b/libraries/entities-renderer/src/RenderableMaterialEntityItem.h @@ -32,8 +32,6 @@ private: ShapeKey getShapeKey() override; QUuid _parentID; - bool _clientOnly; - QUuid _owningAvatarID; glm::vec2 _materialMappingPos; glm::vec2 _materialMappingScale; float _materialMappingRot; diff --git a/libraries/entities/src/MaterialEntityItem.cpp b/libraries/entities/src/MaterialEntityItem.cpp index 8b595bf69d..a9a5c4d934 100644 --- a/libraries/entities/src/MaterialEntityItem.cpp +++ b/libraries/entities/src/MaterialEntityItem.cpp @@ -249,28 +249,12 @@ void MaterialEntityItem::setParentID(const QUuid& parentID) { } } -void MaterialEntityItem::setClientOnly(bool clientOnly) { - if (getClientOnly() != clientOnly) { - removeMaterial(); - EntityItem::setClientOnly(clientOnly); - applyMaterial(); - } -} - -void MaterialEntityItem::setOwningAvatarID(const QUuid& owningAvatarID) { - if (getOwningAvatarID() != owningAvatarID) { - removeMaterial(); - EntityItem::setOwningAvatarID(owningAvatarID); - applyMaterial(); - } -} - void MaterialEntityItem::removeMaterial() { graphics::MaterialPointer material = getMaterial(); if (!material) { return; } - QUuid parentID = getClientOnly() ? getOwningAvatarID() : getParentID(); + QUuid parentID = getParentID(); if (parentID.isNull()) { return; } @@ -294,7 +278,7 @@ void MaterialEntityItem::removeMaterial() { void MaterialEntityItem::applyMaterial() { _retryApply = false; graphics::MaterialPointer material = getMaterial(); - QUuid parentID = getClientOnly() ? getOwningAvatarID() : getParentID(); + QUuid parentID = getParentID(); if (!material || parentID.isNull()) { return; } diff --git a/libraries/entities/src/MaterialEntityItem.h b/libraries/entities/src/MaterialEntityItem.h index f77077a782..11e6fc0f4d 100644 --- a/libraries/entities/src/MaterialEntityItem.h +++ b/libraries/entities/src/MaterialEntityItem.h @@ -77,8 +77,6 @@ public: void setUserData(const QString& userData) override; void setParentID(const QUuid& parentID) override; - void setClientOnly(bool clientOnly) override; - void setOwningAvatarID(const QUuid& owningAvatarID) override; void applyMaterial(); void removeMaterial(); From 167db14bdb88df1e8e103e92fce0b07685cbab48 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Wed, 11 Apr 2018 00:00:11 -0700 Subject: [PATCH 4/5] restoring the sampler desc layout to fix ktx cache and fixing the bug shadow when turning global shadow on off --- libraries/gpu/src/gpu/Texture.h | 3 +++ libraries/render-utils/src/DeferredLightingEffect.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/gpu/src/gpu/Texture.h b/libraries/gpu/src/gpu/Texture.h index 6793948d13..4d82aba595 100755 --- a/libraries/gpu/src/gpu/Texture.h +++ b/libraries/gpu/src/gpu/Texture.h @@ -128,6 +128,7 @@ public: uint8 _wrapModeV = WRAP_REPEAT; uint8 _wrapModeW = WRAP_REPEAT; + uint8 _mipOffset = 0; uint8 _minMip = 0; uint8 _maxMip = MAX_MIP_LEVEL; @@ -142,6 +143,7 @@ public: _wrapModeU == other._wrapModeU && _wrapModeV == other._wrapModeV && _wrapModeW == other._wrapModeW && + _mipOffset == other._mipOffset && _minMip == other._minMip && _maxMip == other._maxMip; } @@ -164,6 +166,7 @@ public: ComparisonFunction getComparisonFunction() const { return ComparisonFunction(_desc._comparisonFunc); } bool doComparison() const { return getComparisonFunction() != ALWAYS; } + uint8 getMipOffset() const { return _desc._mipOffset; } uint8 getMinMip() const { return _desc._minMip; } uint8 getMaxMip() const { return _desc._maxMip; } diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp index fc35267ddc..956b6c4a58 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.cpp +++ b/libraries/render-utils/src/DeferredLightingEffect.cpp @@ -532,7 +532,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext, } } - auto& program = deferredLightingEffect->_directionalSkyboxLight; + auto program = deferredLightingEffect->_directionalSkyboxLight; LightLocationsPtr locations = deferredLightingEffect->_directionalSkyboxLightLocations; auto keyLight = lightAndShadow.first; From 16f6ac529536e07c524614e9ecc7325c80bcf13f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 11 Apr 2018 13:36:49 -0700 Subject: [PATCH 5/5] use serverless content with baked skybox and help textures --- cmake/externals/serverless-content/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/externals/serverless-content/CMakeLists.txt b/cmake/externals/serverless-content/CMakeLists.txt index adfde4439a..a08b589ec2 100644 --- a/cmake/externals/serverless-content/CMakeLists.txt +++ b/cmake/externals/serverless-content/CMakeLists.txt @@ -4,8 +4,8 @@ set(EXTERNAL_NAME serverless-content) ExternalProject_Add( ${EXTERNAL_NAME} - URL http://cdn.highfidelity.com/content-sets/serverless-tutorial-RC66-v3.zip - URL_MD5 ea608c2e4c90539ab3c1d66acf0e005a + URL http://cdn.highfidelity.com/content-sets/serverless-tutorial-RC66-v4.zip + URL_MD5 d4f42f630986c83427ff39e1fe9908c6 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""