mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into handControlsWhileLoading
This commit is contained in:
commit
652af860ed
8 changed files with 48 additions and 10 deletions
|
@ -668,6 +668,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
|||
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(clearDomainOctreeDetails()));
|
||||
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &Application::domainConnectionRefused);
|
||||
|
||||
// We could clear ATP assets only when changing domains, but it's possible that the domain you are connected
|
||||
// to has gone down and switched to a new content set, so when you reconnect the cached ATP assets will no longer be valid.
|
||||
connect(&domainHandler, &DomainHandler::disconnectedFromDomain, DependencyManager::get<ScriptCache>().data(), &ScriptCache::clearATPScriptsFromCache);
|
||||
|
||||
// update our location every 5 seconds in the metaverse server, assuming that we are authenticated with one
|
||||
const qint64 DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS = 5 * MSECS_PER_SECOND;
|
||||
|
||||
|
|
|
@ -414,6 +414,7 @@ void OpenGLDisplayPlugin::customizeContext() {
|
|||
_cursorPipeline = gpu::Pipeline::create(program, state);
|
||||
}
|
||||
}
|
||||
updateCompositeFramebuffer();
|
||||
}
|
||||
|
||||
void OpenGLDisplayPlugin::uncustomizeContext() {
|
||||
|
@ -557,10 +558,7 @@ void OpenGLDisplayPlugin::compositeScene() {
|
|||
}
|
||||
|
||||
void OpenGLDisplayPlugin::compositeLayers() {
|
||||
auto renderSize = getRecommendedRenderSize();
|
||||
if (!_compositeFramebuffer || _compositeFramebuffer->getSize() != renderSize) {
|
||||
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("displayPlugin::composite", gpu::Element::COLOR_RGBA_32, renderSize.x, renderSize.y));
|
||||
}
|
||||
updateCompositeFramebuffer();
|
||||
|
||||
{
|
||||
PROFILE_RANGE_EX("compositeScene", 0xff0077ff, (uint64_t)presentCount())
|
||||
|
@ -760,3 +758,10 @@ void OpenGLDisplayPlugin::render(std::function<void(gpu::Batch& batch)> f) {
|
|||
OpenGLDisplayPlugin::~OpenGLDisplayPlugin() {
|
||||
qDebug() << "Destroying OpenGLDisplayPlugin";
|
||||
}
|
||||
|
||||
void OpenGLDisplayPlugin::updateCompositeFramebuffer() {
|
||||
auto renderSize = getRecommendedRenderSize();
|
||||
if (!_compositeFramebuffer || _compositeFramebuffer->getSize() != renderSize) {
|
||||
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("OpenGLDisplayPlugin::composite", gpu::Element::COLOR_RGBA_32, renderSize.x, renderSize.y));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,6 +78,8 @@ protected:
|
|||
glm::uvec2 getSurfaceSize() const;
|
||||
glm::uvec2 getSurfacePixels() const;
|
||||
|
||||
void updateCompositeFramebuffer();
|
||||
|
||||
virtual void compositeLayers();
|
||||
virtual void compositeScene();
|
||||
virtual void compositeOverlay();
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "AccountManager.h"
|
||||
|
||||
const QString HIFI_URL_SCHEME = "hifi";
|
||||
const QString DEFAULT_HIFI_ADDRESS = "hifi://dev-welcome";
|
||||
const QString DEFAULT_HIFI_ADDRESS = "hifi://welcome";
|
||||
const QString SANDBOX_HIFI_ADDRESS = "hifi://localhost";
|
||||
const QString SANDBOX_STATUS_URL = "http://localhost:60332/status";
|
||||
const QString INDEX_PATH = "/";
|
||||
|
|
|
@ -36,6 +36,19 @@ void ScriptCache::clearCache() {
|
|||
_scriptCache.clear();
|
||||
}
|
||||
|
||||
void ScriptCache::clearATPScriptsFromCache() {
|
||||
Lock lock(_containerLock);
|
||||
qCDebug(scriptengine) << "Clearing ATP scripts from ScriptCache";
|
||||
for (auto it = _scriptCache.begin(); it != _scriptCache.end();) {
|
||||
if (it.key().scheme() == "atp") {
|
||||
qCDebug(scriptengine) << "Removing: " << it.key();
|
||||
it = _scriptCache.erase(it);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString ScriptCache::getScript(const QUrl& unnormalizedURL, ScriptUser* scriptUser, bool& isPending, bool reload) {
|
||||
QUrl url = ResourceManager::normalizeURL(unnormalizedURL);
|
||||
QString scriptContents;
|
||||
|
|
|
@ -39,6 +39,7 @@ class ScriptCache : public QObject, public Dependency {
|
|||
|
||||
public:
|
||||
void clearCache();
|
||||
Q_INVOKABLE void clearATPScriptsFromCache();
|
||||
void getScriptContents(const QString& scriptOrURL, contentAvailableCallback contentAvailable, bool forceDownload = false);
|
||||
|
||||
|
||||
|
|
|
@ -377,9 +377,6 @@ void OpenVrDisplayPlugin::init() {
|
|||
}
|
||||
|
||||
bool OpenVrDisplayPlugin::internalActivate() {
|
||||
_openVrDisplayActive = true;
|
||||
_container->setIsOptionChecked(StandingHMDSensorMode, true);
|
||||
|
||||
if (!_system) {
|
||||
_system = acquireOpenVrSystem();
|
||||
}
|
||||
|
@ -388,6 +385,18 @@ bool OpenVrDisplayPlugin::internalActivate() {
|
|||
return false;
|
||||
}
|
||||
|
||||
// If OpenVR isn't running, then the compositor won't be accessible
|
||||
// FIXME find a way to launch the compositor?
|
||||
if (!vr::VRCompositor()) {
|
||||
qWarning() << "Failed to acquire OpenVR compositor";
|
||||
releaseOpenVrSystem();
|
||||
_system = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
_openVrDisplayActive = true;
|
||||
_container->setIsOptionChecked(StandingHMDSensorMode, true);
|
||||
|
||||
_system->GetRecommendedRenderTargetSize(&_renderTargetSize.x, &_renderTargetSize.y);
|
||||
// Recommended render target size is per-eye, so double the X size for
|
||||
// left + right eyes
|
||||
|
|
|
@ -109,8 +109,12 @@ void releaseOpenVrSystem() {
|
|||
vr::Texture_t vrTexture{ (void*)INVALID_GL_TEXTURE_HANDLE, vr::API_OpenGL, vr::ColorSpace_Auto };
|
||||
static vr::VRTextureBounds_t OPENVR_TEXTURE_BOUNDS_LEFT{ 0, 0, 0.5f, 1 };
|
||||
static vr::VRTextureBounds_t OPENVR_TEXTURE_BOUNDS_RIGHT{ 0.5f, 0, 1, 1 };
|
||||
vr::VRCompositor()->Submit(vr::Eye_Left, &vrTexture, &OPENVR_TEXTURE_BOUNDS_LEFT);
|
||||
vr::VRCompositor()->Submit(vr::Eye_Right, &vrTexture, &OPENVR_TEXTURE_BOUNDS_RIGHT);
|
||||
|
||||
auto compositor = vr::VRCompositor();
|
||||
if (compositor) {
|
||||
compositor->Submit(vr::Eye_Left, &vrTexture, &OPENVR_TEXTURE_BOUNDS_LEFT);
|
||||
compositor->Submit(vr::Eye_Right, &vrTexture, &OPENVR_TEXTURE_BOUNDS_RIGHT);
|
||||
}
|
||||
|
||||
vr::VR_Shutdown();
|
||||
_openVrQuitRequested = false;
|
||||
|
|
Loading…
Reference in a new issue