From 2ceb3d85bd6481179f3c14270169f6013fdf13c4 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 24 Feb 2017 16:03:22 -0800 Subject: [PATCH 1/5] increase max renderable web entity FPS to 30 --- libraries/entities-renderer/src/RenderableWebEntityItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp index 972c23d534..8c30c01e50 100644 --- a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp @@ -113,7 +113,7 @@ bool RenderableWebEntityItem::buildWebSurface(QSharedPointer // FIXME, the max FPS could be better managed by being dynamic (based on the number of current surfaces // and the current rendering load) - _webSurface->setMaxFps(10); + _webSurface->setMaxFps(30); // The lifetime of the QML surface MUST be managed by the main thread // Additionally, we MUST use local variables copied by value, rather than From d18936ea1864063ede40cb8cae4c9a66caa8b038 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 27 Feb 2017 09:43:02 -0800 Subject: [PATCH 2/5] only force youtube web entities to 30 FPS --- .../entities-renderer/src/RenderableWebEntityItem.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp index 8c30c01e50..7cd1b62e3b 100644 --- a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp @@ -113,7 +113,14 @@ bool RenderableWebEntityItem::buildWebSurface(QSharedPointer // FIXME, the max FPS could be better managed by being dynamic (based on the number of current surfaces // and the current rendering load) - _webSurface->setMaxFps(30); + + // We special case YouTube URLs since we know they are videos that we should play with at least 30 FPS. + if (QUrl(_sourceUrl).host().endsWith("youtube.com", Qt::CaseInsensitive)) { + _webSurface->setMaxFps(30); + } else { + _webSurface->setMaxFps(10); + } + // The lifetime of the QML surface MUST be managed by the main thread // Additionally, we MUST use local variables copied by value, rather than From 80af749b6949cbd66ba9309cce51019d611457d7 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 27 Feb 2017 11:09:17 -0800 Subject: [PATCH 3/5] change max FPS for youtube on URL change --- .../src/RenderableWebEntityItem.cpp | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp index 7cd1b62e3b..6c44794c3e 100644 --- a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp @@ -37,6 +37,8 @@ static uint64_t MAX_NO_RENDER_INTERVAL = 30 * USECS_PER_SECOND; static int MAX_WINDOW_SIZE = 4096; static float OPAQUE_ALPHA_THRESHOLD = 0.99f; +static int DEFAULT_MAX_FPS = 10; +static int YOUTUBE_MAX_FPS = 30; EntityItemPointer RenderableWebEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) { EntityItemPointer entity{ new RenderableWebEntityItem(entityID) }; @@ -113,14 +115,7 @@ bool RenderableWebEntityItem::buildWebSurface(QSharedPointer // FIXME, the max FPS could be better managed by being dynamic (based on the number of current surfaces // and the current rendering load) - - // We special case YouTube URLs since we know they are videos that we should play with at least 30 FPS. - if (QUrl(_sourceUrl).host().endsWith("youtube.com", Qt::CaseInsensitive)) { - _webSurface->setMaxFps(30); - } else { - _webSurface->setMaxFps(10); - } - + _webSurface->setMaxFps(DEFAULT_MAX_FPS); // The lifetime of the QML surface MUST be managed by the main thread // Additionally, we MUST use local variables copied by value, rather than @@ -263,12 +258,22 @@ void RenderableWebEntityItem::loadSourceURL() { _sourceUrl.toLower().endsWith(".htm") || _sourceUrl.toLower().endsWith(".html")) { _contentType = htmlContent; _webSurface->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath() + "qml/controls/")); + + // We special case YouTube URLs since we know they are videos that we should play with at least 30 FPS. + if (sourceUrl.host().endsWith("youtube.com", Qt::CaseInsensitive)) { + _webSurface->setMaxFps(YOUTUBE_MAX_FPS); + } else { + _webSurface->setMaxFps(DEFAULT_MAX_FPS); + } + _webSurface->load("WebView.qml", [&](QQmlContext* context, QObject* obj) { context->setContextProperty("eventBridgeJavaScriptToInject", QVariant(_javaScriptToInject)); }); _webSurface->getRootItem()->setProperty("url", _sourceUrl); _webSurface->getRootContext()->setContextProperty("desktop", QVariant()); + + } else { _contentType = qmlContent; _webSurface->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath())); From 8562a294fa0d666f13c26e56b9520924b0782cee Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 28 Feb 2017 13:24:41 -0800 Subject: [PATCH 4/5] cleanup some extra spacing --- libraries/entities-renderer/src/RenderableWebEntityItem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp index 6c44794c3e..d7d7013f59 100644 --- a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp @@ -269,11 +269,10 @@ void RenderableWebEntityItem::loadSourceURL() { _webSurface->load("WebView.qml", [&](QQmlContext* context, QObject* obj) { context->setContextProperty("eventBridgeJavaScriptToInject", QVariant(_javaScriptToInject)); }); + _webSurface->getRootItem()->setProperty("url", _sourceUrl); _webSurface->getRootContext()->setContextProperty("desktop", QVariant()); - - } else { _contentType = qmlContent; _webSurface->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath())); From 148100b26f7b1b359ab4792660ae9de7b1caa4c9 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 28 Feb 2017 15:10:20 -0800 Subject: [PATCH 5/5] fix bug drawing avatar above ground --- interface/src/avatar/SkeletonModel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index 476abf8d4b..88590a6f69 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -179,9 +179,7 @@ void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { _rig->updateFromEyeParameters(eyeParams); } else { - // no need to call Model::updateRig() because otherAvatars get their joint state - // copied directly from AvtarData::_jointData (there are no Rig animations to blend) - _needsUpdateClusterMatrices = true; + Model::updateRig(deltaTime, parentTransform); // This is a little more work than we really want. //