mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 09:36:18 +02:00
Merge pull request #12882 from samcake/workload
Workload: merging upstream master back
This commit is contained in:
commit
1e82a952b1
9 changed files with 47 additions and 52 deletions
|
@ -4,8 +4,8 @@ set(EXTERNAL_NAME serverless-content)
|
||||||
|
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
${EXTERNAL_NAME}
|
${EXTERNAL_NAME}
|
||||||
URL http://cdn.highfidelity.com/content-sets/serverless-tutorial-RC66-v3.zip
|
URL http://cdn.highfidelity.com/content-sets/serverless-tutorial-RC66-v4.zip
|
||||||
URL_MD5 ea608c2e4c90539ab3c1d66acf0e005a
|
URL_MD5 d4f42f630986c83427ff39e1fe9908c6
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
BUILD_COMMAND ""
|
BUILD_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
|
|
|
@ -18,7 +18,7 @@ bool MaterialEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityP
|
||||||
if (entity->getMaterial() != _drawMaterial) {
|
if (entity->getMaterial() != _drawMaterial) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (entity->getParentID() != _parentID || entity->getClientOnly() != _clientOnly || entity->getOwningAvatarID() != _owningAvatarID) {
|
if (entity->getParentID() != _parentID) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (entity->getMaterialMappingPos() != _materialMappingPos || entity->getMaterialMappingScale() != _materialMappingScale || entity->getMaterialMappingRot() != _materialMappingRot) {
|
if (entity->getMaterialMappingPos() != _materialMappingPos || entity->getMaterialMappingScale() != _materialMappingScale || entity->getMaterialMappingRot() != _materialMappingRot) {
|
||||||
|
@ -31,8 +31,6 @@ void MaterialEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer&
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_drawMaterial = entity->getMaterial();
|
_drawMaterial = entity->getMaterial();
|
||||||
_parentID = entity->getParentID();
|
_parentID = entity->getParentID();
|
||||||
_clientOnly = entity->getClientOnly();
|
|
||||||
_owningAvatarID = entity->getOwningAvatarID();
|
|
||||||
_materialMappingPos = entity->getMaterialMappingPos();
|
_materialMappingPos = entity->getMaterialMappingPos();
|
||||||
_materialMappingScale = entity->getMaterialMappingScale();
|
_materialMappingScale = entity->getMaterialMappingScale();
|
||||||
_materialMappingRot = entity->getMaterialMappingRot();
|
_materialMappingRot = entity->getMaterialMappingRot();
|
||||||
|
@ -102,7 +100,7 @@ void MaterialEntityRenderer::doRender(RenderArgs* args) {
|
||||||
graphics::MaterialPointer drawMaterial;
|
graphics::MaterialPointer drawMaterial;
|
||||||
Transform textureTransform;
|
Transform textureTransform;
|
||||||
withReadLock([&] {
|
withReadLock([&] {
|
||||||
parentID = _clientOnly ? _owningAvatarID : _parentID;
|
parentID = _parentID;
|
||||||
renderTransform = _renderTransform;
|
renderTransform = _renderTransform;
|
||||||
drawMaterial = _drawMaterial;
|
drawMaterial = _drawMaterial;
|
||||||
textureTransform.setTranslation(glm::vec3(_materialMappingPos, 0));
|
textureTransform.setTranslation(glm::vec3(_materialMappingPos, 0));
|
||||||
|
|
|
@ -32,8 +32,6 @@ private:
|
||||||
ShapeKey getShapeKey() override;
|
ShapeKey getShapeKey() override;
|
||||||
|
|
||||||
QUuid _parentID;
|
QUuid _parentID;
|
||||||
bool _clientOnly;
|
|
||||||
QUuid _owningAvatarID;
|
|
||||||
glm::vec2 _materialMappingPos;
|
glm::vec2 _materialMappingPos;
|
||||||
glm::vec2 _materialMappingScale;
|
glm::vec2 _materialMappingScale;
|
||||||
float _materialMappingRot;
|
float _materialMappingRot;
|
||||||
|
|
|
@ -241,14 +241,18 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
|
||||||
|
|
||||||
_activityTracking.addedEntityCount++;
|
_activityTracking.addedEntityCount++;
|
||||||
|
|
||||||
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
auto sessionID = nodeList->getSessionUUID();
|
||||||
|
|
||||||
EntityItemProperties propertiesWithSimID = properties;
|
EntityItemProperties propertiesWithSimID = properties;
|
||||||
if (clientOnly) {
|
if (clientOnly) {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
const QUuid myNodeID = sessionID;
|
||||||
const QUuid myNodeID = nodeList->getSessionUUID();
|
|
||||||
propertiesWithSimID.setClientOnly(clientOnly);
|
propertiesWithSimID.setClientOnly(clientOnly);
|
||||||
propertiesWithSimID.setOwningAvatarID(myNodeID);
|
propertiesWithSimID.setOwningAvatarID(myNodeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
propertiesWithSimID.setLastEditedBy(sessionID);
|
||||||
|
|
||||||
bool scalesWithParent = propertiesWithSimID.getScalesWithParent();
|
bool scalesWithParent = propertiesWithSimID.getScalesWithParent();
|
||||||
|
|
||||||
propertiesWithSimID = convertPropertiesFromScriptSemantics(propertiesWithSimID, scalesWithParent);
|
propertiesWithSimID = convertPropertiesFromScriptSemantics(propertiesWithSimID, scalesWithParent);
|
||||||
|
@ -308,6 +312,11 @@ QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QStrin
|
||||||
if (!textures.isEmpty()) {
|
if (!textures.isEmpty()) {
|
||||||
properties.setTextures(textures);
|
properties.setTextures(textures);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
auto sessionID = nodeList->getSessionUUID();
|
||||||
|
properties.setLastEditedBy(sessionID);
|
||||||
|
|
||||||
return addEntity(properties);
|
return addEntity(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +372,11 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
|
||||||
|
|
||||||
_activityTracking.editedEntityCount++;
|
_activityTracking.editedEntityCount++;
|
||||||
|
|
||||||
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
auto sessionID = nodeList->getSessionUUID();
|
||||||
|
|
||||||
EntityItemProperties properties = scriptSideProperties;
|
EntityItemProperties properties = scriptSideProperties;
|
||||||
|
properties.setLastEditedBy(sessionID);
|
||||||
|
|
||||||
EntityItemID entityID(id);
|
EntityItemID entityID(id);
|
||||||
if (!_entityTree) {
|
if (!_entityTree) {
|
||||||
|
@ -379,7 +392,6 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
|
||||||
if (entity->getClientOnly() && entity->getOwningAvatarID() != nodeList->getSessionUUID()) {
|
if (entity->getClientOnly() && entity->getOwningAvatarID() != nodeList->getSessionUUID()) {
|
||||||
// don't edit other avatar's avatarEntities
|
// don't edit other avatar's avatarEntities
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -27,6 +27,10 @@ MaterialEntityItem::MaterialEntityItem(const EntityItemID& entityItemID) : Entit
|
||||||
_type = EntityTypes::Material;
|
_type = EntityTypes::Material;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MaterialEntityItem::~MaterialEntityItem() {
|
||||||
|
removeMaterial();
|
||||||
|
}
|
||||||
|
|
||||||
EntityItemProperties MaterialEntityItem::getProperties(EntityPropertyFlags desiredProperties) const {
|
EntityItemProperties MaterialEntityItem::getProperties(EntityPropertyFlags desiredProperties) const {
|
||||||
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
|
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(materialURL, getMaterialURL);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(materialURL, getMaterialURL);
|
||||||
|
@ -249,28 +253,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() {
|
void MaterialEntityItem::removeMaterial() {
|
||||||
graphics::MaterialPointer material = getMaterial();
|
graphics::MaterialPointer material = getMaterial();
|
||||||
if (!material) {
|
if (!material) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QUuid parentID = getClientOnly() ? getOwningAvatarID() : getParentID();
|
QUuid parentID = getParentID();
|
||||||
if (parentID.isNull()) {
|
if (parentID.isNull()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -294,7 +282,7 @@ void MaterialEntityItem::removeMaterial() {
|
||||||
void MaterialEntityItem::applyMaterial() {
|
void MaterialEntityItem::applyMaterial() {
|
||||||
_retryApply = false;
|
_retryApply = false;
|
||||||
graphics::MaterialPointer material = getMaterial();
|
graphics::MaterialPointer material = getMaterial();
|
||||||
QUuid parentID = getClientOnly() ? getOwningAvatarID() : getParentID();
|
QUuid parentID = getParentID();
|
||||||
if (!material || parentID.isNull()) {
|
if (!material || parentID.isNull()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -328,11 +316,6 @@ void MaterialEntityItem::postParentFixup() {
|
||||||
applyMaterial();
|
applyMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaterialEntityItem::preDelete() {
|
|
||||||
EntityItem::preDelete();
|
|
||||||
removeMaterial();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaterialEntityItem::update(const quint64& now) {
|
void MaterialEntityItem::update(const quint64& now) {
|
||||||
if (_retryApply) {
|
if (_retryApply) {
|
||||||
applyMaterial();
|
applyMaterial();
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
||||||
|
|
||||||
MaterialEntityItem(const EntityItemID& entityItemID);
|
MaterialEntityItem(const EntityItemID& entityItemID);
|
||||||
|
~MaterialEntityItem();
|
||||||
|
|
||||||
ALLOW_INSTANTIATION // This class can be instantiated
|
ALLOW_INSTANTIATION // This class can be instantiated
|
||||||
|
|
||||||
|
@ -77,14 +78,11 @@ public:
|
||||||
|
|
||||||
void setUserData(const QString& userData) override;
|
void setUserData(const QString& userData) override;
|
||||||
void setParentID(const QUuid& parentID) override;
|
void setParentID(const QUuid& parentID) override;
|
||||||
void setClientOnly(bool clientOnly) override;
|
|
||||||
void setOwningAvatarID(const QUuid& owningAvatarID) override;
|
|
||||||
|
|
||||||
void applyMaterial();
|
void applyMaterial();
|
||||||
void removeMaterial();
|
void removeMaterial();
|
||||||
|
|
||||||
void postParentFixup() override;
|
void postParentFixup() override;
|
||||||
void preDelete() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// URL for this material. Currently, only JSON format is supported. Set to "userData" to use the user data to live edit a material.
|
// URL for this material. Currently, only JSON format is supported. Set to "userData" to use the user data to live edit a material.
|
||||||
|
|
|
@ -128,6 +128,7 @@ public:
|
||||||
uint8 _wrapModeV = WRAP_REPEAT;
|
uint8 _wrapModeV = WRAP_REPEAT;
|
||||||
uint8 _wrapModeW = WRAP_REPEAT;
|
uint8 _wrapModeW = WRAP_REPEAT;
|
||||||
|
|
||||||
|
uint8 _mipOffset = 0;
|
||||||
uint8 _minMip = 0;
|
uint8 _minMip = 0;
|
||||||
uint8 _maxMip = MAX_MIP_LEVEL;
|
uint8 _maxMip = MAX_MIP_LEVEL;
|
||||||
|
|
||||||
|
@ -142,6 +143,7 @@ public:
|
||||||
_wrapModeU == other._wrapModeU &&
|
_wrapModeU == other._wrapModeU &&
|
||||||
_wrapModeV == other._wrapModeV &&
|
_wrapModeV == other._wrapModeV &&
|
||||||
_wrapModeW == other._wrapModeW &&
|
_wrapModeW == other._wrapModeW &&
|
||||||
|
_mipOffset == other._mipOffset &&
|
||||||
_minMip == other._minMip &&
|
_minMip == other._minMip &&
|
||||||
_maxMip == other._maxMip;
|
_maxMip == other._maxMip;
|
||||||
}
|
}
|
||||||
|
@ -164,6 +166,7 @@ public:
|
||||||
ComparisonFunction getComparisonFunction() const { return ComparisonFunction(_desc._comparisonFunc); }
|
ComparisonFunction getComparisonFunction() const { return ComparisonFunction(_desc._comparisonFunc); }
|
||||||
bool doComparison() const { return getComparisonFunction() != ALWAYS; }
|
bool doComparison() const { return getComparisonFunction() != ALWAYS; }
|
||||||
|
|
||||||
|
uint8 getMipOffset() const { return _desc._mipOffset; }
|
||||||
uint8 getMinMip() const { return _desc._minMip; }
|
uint8 getMinMip() const { return _desc._minMip; }
|
||||||
uint8 getMaxMip() const { return _desc._maxMip; }
|
uint8 getMaxMip() const { return _desc._maxMip; }
|
||||||
|
|
||||||
|
|
|
@ -522,11 +522,20 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
|
||||||
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
||||||
assert(lightStage);
|
assert(lightStage);
|
||||||
assert(lightStage->getNumLights() > 0);
|
assert(lightStage->getNumLights() > 0);
|
||||||
|
auto lightAndShadow = lightStage->getCurrentKeyLightAndShadow();
|
||||||
|
const auto& globalShadow = lightAndShadow.second;
|
||||||
|
|
||||||
|
// Bind the shadow buffers
|
||||||
|
if (globalShadow) {
|
||||||
|
for (unsigned int i = 0; i < globalShadow->getCascadeCount(); i++) {
|
||||||
|
batch.setResourceTexture(SHADOW_MAP_UNIT+i, globalShadow->getCascade(i).map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto program = deferredLightingEffect->_directionalSkyboxLight;
|
auto program = deferredLightingEffect->_directionalSkyboxLight;
|
||||||
LightLocationsPtr locations = deferredLightingEffect->_directionalSkyboxLightLocations;
|
LightLocationsPtr locations = deferredLightingEffect->_directionalSkyboxLightLocations;
|
||||||
|
|
||||||
// auto keyLight = lightAndShadow.first;
|
auto keyLight = lightAndShadow.first;
|
||||||
|
|
||||||
graphics::LightPointer ambientLight;
|
graphics::LightPointer ambientLight;
|
||||||
if (lightStage && lightStage->_currentFrame._ambientLights.size()) {
|
if (lightStage && lightStage->_currentFrame._ambientLights.size()) {
|
||||||
|
@ -547,18 +556,6 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deferredLightingEffect->_shadowMapEnabled && keyLightCastShadows) {
|
if (deferredLightingEffect->_shadowMapEnabled && keyLightCastShadows) {
|
||||||
auto lightAndShadow = lightStage->getCurrentKeyLightAndShadow();
|
|
||||||
const auto& globalShadow = lightAndShadow.second;
|
|
||||||
|
|
||||||
// Bind the shadow buffers
|
|
||||||
if (globalShadow) {
|
|
||||||
for (unsigned int i = 0; i < globalShadow->getCascadeCount(); i++) {
|
|
||||||
batch.setResourceTexture(SHADOW_MAP_UNIT + i, globalShadow->getCascade(i).map);
|
|
||||||
}
|
|
||||||
if (locations->shadowTransformBuffer >= 0) {
|
|
||||||
batch.setUniformBuffer(locations->shadowTransformBuffer, globalShadow->getBuffer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the keylight has an ambient Map then use the Skybox version of the pass
|
// If the keylight has an ambient Map then use the Skybox version of the pass
|
||||||
// otherwise use the ambient sphere version
|
// otherwise use the ambient sphere version
|
||||||
|
@ -581,6 +578,12 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (locations->shadowTransformBuffer >= 0) {
|
||||||
|
if (globalShadow) {
|
||||||
|
batch.setUniformBuffer(locations->shadowTransformBuffer, globalShadow->getBuffer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
batch.setPipeline(program);
|
batch.setPipeline(program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,8 +208,8 @@ Rectangle {
|
||||||
anchors.rightMargin: 0
|
anchors.rightMargin: 0
|
||||||
anchors.topMargin: 0
|
anchors.topMargin: 0
|
||||||
minimumValue: 5
|
minimumValue: 5
|
||||||
maximumValue: 50
|
maximumValue: 75
|
||||||
value: 3
|
value: 5
|
||||||
|
|
||||||
onValueChanged: { _workload.broadcastChangeResolution(value) }
|
onValueChanged: { _workload.broadcastChangeResolution(value) }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue