mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
Merge remote-tracking branch 'upstream/master' into shared
This commit is contained in:
commit
fb8cc27fef
15 changed files with 115 additions and 62 deletions
|
@ -127,7 +127,8 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
|
|||
<< "and machine fingerprint" << nodeConnection.machineFingerprint
|
||||
<< "user" << username
|
||||
<< "reason" << QString(nodeConnection.connectReason ? "SilentDomainDisconnect" : "Connect")
|
||||
<< "previous connection uptime" << nodeConnection.previousConnectionUpTime/USECS_PER_MSEC << "msec";
|
||||
<< "previous connection uptime" << nodeConnection.previousConnectionUpTime/USECS_PER_MSEC << "msec"
|
||||
<< "sysinfo" << nodeConnection.SystemInfo;
|
||||
|
||||
// signal that we just connected a node so the DomainServer can get it a list
|
||||
// and broadcast its presence right away
|
||||
|
|
|
@ -36,6 +36,9 @@ NodeConnectionData NodeConnectionData::fromDataStream(QDataStream& dataStream, c
|
|||
// now the machine fingerprint
|
||||
dataStream >> newHeader.machineFingerprint;
|
||||
|
||||
// and the operating system type
|
||||
dataStream >> newHeader.SystemInfo;
|
||||
|
||||
dataStream >> newHeader.connectReason;
|
||||
|
||||
dataStream >> newHeader.previousConnectionUpTime;
|
||||
|
|
|
@ -31,9 +31,9 @@ public:
|
|||
QString placeName;
|
||||
QString hardwareAddress;
|
||||
QUuid machineFingerprint;
|
||||
QString SystemInfo;
|
||||
quint32 connectReason;
|
||||
quint64 previousConnectionUpTime;
|
||||
|
||||
QByteArray protocolVersion;
|
||||
};
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ class MyAvatar : public Avatar {
|
|||
* @property {number} analogPlusWalkSpeed - The walk speed of your avatar for the "AnalogPlus" control scheme.
|
||||
* <p><strong>Warning:</strong> Setting this value also sets the value of <code>analogPlusSprintSpeed</code> to twice
|
||||
* the value.</p>
|
||||
* @property {number} analogPlusSprintSpeed - The sprint speed of your avatar for the "AnalogPlus" control scheme.
|
||||
* @property {number} analogPlusSprintSpeed - The sprint (run) speed of your avatar for the "AnalogPlus" control scheme.
|
||||
* @property {MyAvatar.SitStandModelType} userRecenterModel - Controls avatar leaning and recentering behavior.
|
||||
* @property {number} isInSittingState - <code>true</code> if your avatar is sitting (avatar leaning is disabled,
|
||||
* recenntering is enabled), <code>false</code> if it is standing (avatar leaning is enabled, and avatar recenters if it
|
||||
|
@ -2198,33 +2198,35 @@ signals:
|
|||
void audioListenerModeChanged();
|
||||
|
||||
/**jsdoc
|
||||
* Notifies when the analogPlusWalkSpeed value is changed.
|
||||
* Triggered when the walk speed set for the "AnalogPlus" control scheme changes.
|
||||
* @function MyAvatar.analogPlusWalkSpeedChanged
|
||||
* @param {float} value - the new avatar walk speed
|
||||
* @param {number} speed - The new walk speed set for the "AnalogPlus" control scheme.
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void analogPlusWalkSpeedChanged(float value);
|
||||
|
||||
/**jsdoc
|
||||
* Notifies when the analogPlusSprintSpeed value is changed.
|
||||
* Triggered when the sprint (run) speed set for the "AnalogPlus" control scheme changes.
|
||||
* @function MyAvatar.analogPlusSprintSpeedChanged
|
||||
* @param {float} value - the new avatar sprint speed
|
||||
* @param {number} speed - The new sprint speed set for the "AnalogPlus" control scheme.
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void analogPlusSprintSpeedChanged(float value);
|
||||
|
||||
/**jsdoc
|
||||
* Notifies when the sprintSpeed value is changed.
|
||||
* Triggered when the sprint (run) speed set for the current control scheme (see
|
||||
* {@link MyAvatar.getControlScheme|getControlScheme}) changes.
|
||||
* @function MyAvatar.sprintSpeedChanged
|
||||
* @param {float} value - the new avatar sprint speed
|
||||
* @param {number} speed -The new sprint speed set for the current control scheme.
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void sprintSpeedChanged(float value);
|
||||
|
||||
/**jsdoc
|
||||
* Notifies when the walkBackwardSpeed value is changed.
|
||||
* Triggered when the walk backward speed set for the current control scheme (see
|
||||
* {@link MyAvatar.getControlScheme|getControlScheme}) changes.
|
||||
* @function MyAvatar.walkBackwardSpeedChanged
|
||||
* @param {float} value - the new avatar walk backward speed
|
||||
* @param {number} speed - The new walk backward speed set for the current control scheme.
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void walkBackwardSpeedChanged(float value);
|
||||
|
|
|
@ -109,6 +109,21 @@ bool Basic2DWindowOpenGLDisplayPlugin::internalActivate() {
|
|||
return Parent::internalActivate();
|
||||
}
|
||||
|
||||
gpu::PipelinePointer Basic2DWindowOpenGLDisplayPlugin::getCompositeScenePipeline() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
return _linearToSRGBPipeline;
|
||||
#endif
|
||||
return _SRGBToLinearPipeline;
|
||||
}
|
||||
|
||||
gpu::Element Basic2DWindowOpenGLDisplayPlugin::getCompositeFBColorSpace() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
return gpu::Element::COLOR_SRGBA_32;
|
||||
#endif
|
||||
return gpu::Element::COLOR_RGBA_32;
|
||||
}
|
||||
|
||||
|
||||
void Basic2DWindowOpenGLDisplayPlugin::compositeExtra() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
|
|
|
@ -37,6 +37,9 @@ public:
|
|||
|
||||
virtual void pluginUpdate() override {};
|
||||
|
||||
virtual gpu::PipelinePointer getCompositeScenePipeline() override;
|
||||
virtual gpu::Element getCompositeFBColorSpace() override;
|
||||
|
||||
protected:
|
||||
mutable bool _isThrottled = false;
|
||||
|
||||
|
|
|
@ -48,12 +48,16 @@
|
|||
#include "CompositorHelper.h"
|
||||
#include "Logging.h"
|
||||
#include "RefreshRateController.h"
|
||||
|
||||
using namespace shader::gpu::program;
|
||||
|
||||
extern QThread* RENDER_THREAD;
|
||||
|
||||
class PresentThread : public QThread, public Dependency {
|
||||
using Mutex = std::mutex;
|
||||
using Condition = std::condition_variable;
|
||||
using Lock = std::unique_lock<Mutex>;
|
||||
|
||||
public:
|
||||
|
||||
PresentThread() {
|
||||
|
@ -380,57 +384,45 @@ void OpenGLDisplayPlugin::customizeContext() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!_presentPipeline) {
|
||||
if (!_drawTexturePipeline) {
|
||||
gpu::StatePointer blendState = gpu::StatePointer(new gpu::State());
|
||||
blendState->setDepthTest(gpu::State::DepthTest(false));
|
||||
blendState->setBlendFunction(true,
|
||||
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
||||
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD,
|
||||
gpu::State::INV_SRC_ALPHA,
|
||||
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD,
|
||||
gpu::State::ONE);
|
||||
|
||||
gpu::StatePointer scissorState = gpu::StatePointer(new gpu::State());
|
||||
scissorState->setDepthTest(gpu::State::DepthTest(false));
|
||||
scissorState->setScissorEnable(true);
|
||||
|
||||
{
|
||||
#ifdef Q_OS_ANDROID
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::gpu::program::DrawTextureGammaLinearToSRGB);
|
||||
#else
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::gpu::program::DrawTexture);
|
||||
#endif
|
||||
_simplePipeline = gpu::Pipeline::create(program, scissorState);
|
||||
}
|
||||
{
|
||||
#ifdef Q_OS_ANDROID
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::gpu::program::DrawTextureGammaLinearToSRGB);
|
||||
#else
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::gpu::program::DrawTextureGammaSRGBToLinear);
|
||||
#endif
|
||||
_presentPipeline = gpu::Pipeline::create(program, scissorState);
|
||||
}
|
||||
_drawTexturePipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTexture), scissorState);
|
||||
|
||||
{
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::gpu::program::DrawTexture);
|
||||
_hudPipeline = gpu::Pipeline::create(program, blendState);
|
||||
}
|
||||
{
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::gpu::program::DrawTextureMirroredX);
|
||||
_mirrorHUDPipeline = gpu::Pipeline::create(program, blendState);
|
||||
}
|
||||
_linearToSRGBPipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTextureGammaLinearToSRGB), scissorState);
|
||||
|
||||
{
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::gpu::program::DrawTransformedTexture);
|
||||
_cursorPipeline = gpu::Pipeline::create(program, blendState);
|
||||
}
|
||||
_SRGBToLinearPipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTextureGammaSRGBToLinear), scissorState);
|
||||
|
||||
_hudPipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTexture), blendState);
|
||||
|
||||
_mirrorHUDPipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTextureMirroredX), blendState);
|
||||
|
||||
_cursorPipeline = gpu::Pipeline::create(gpu::Shader::createProgram(DrawTransformedTexture), blendState);
|
||||
}
|
||||
|
||||
updateCompositeFramebuffer();
|
||||
}
|
||||
|
||||
void OpenGLDisplayPlugin::uncustomizeContext() {
|
||||
_presentPipeline.reset();
|
||||
_cursorPipeline.reset();
|
||||
|
||||
_drawTexturePipeline.reset();
|
||||
_linearToSRGBPipeline.reset();
|
||||
_SRGBToLinearPipeline.reset();
|
||||
_hudPipeline.reset();
|
||||
_mirrorHUDPipeline.reset();
|
||||
_cursorPipeline.reset();
|
||||
_compositeFramebuffer.reset();
|
||||
|
||||
withPresentThreadLock([&] {
|
||||
_currentFrame.reset();
|
||||
_lastFrame = nullptr;
|
||||
|
@ -535,11 +527,9 @@ void OpenGLDisplayPlugin::renderFromTexture(gpu::Batch& batch, const gpu::Textur
|
|||
batch.setStateScissorRect(scissor);
|
||||
batch.setViewportTransform(viewport);
|
||||
batch.setResourceTexture(0, texture);
|
||||
#ifndef USE_GLES
|
||||
batch.setPipeline(_presentPipeline);
|
||||
#else
|
||||
batch.setPipeline(_simplePipeline);
|
||||
#endif
|
||||
|
||||
batch.setPipeline(_drawTexturePipeline);
|
||||
|
||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||
if (copyFbo) {
|
||||
gpu::Vec4i copyFboRect(0, 0, copyFbo->getWidth(), copyFbo->getHeight());
|
||||
|
@ -644,6 +634,11 @@ void OpenGLDisplayPlugin::compositePointer() {
|
|||
});
|
||||
}
|
||||
|
||||
// Overridden by Basic2DWindowDisplayPlugin and OculusDisplayPlugin
|
||||
gpu::PipelinePointer OpenGLDisplayPlugin::getCompositeScenePipeline() {
|
||||
return _drawTexturePipeline;
|
||||
}
|
||||
|
||||
void OpenGLDisplayPlugin::compositeScene() {
|
||||
render([&](gpu::Batch& batch) {
|
||||
batch.enableStereo(false);
|
||||
|
@ -652,7 +647,7 @@ void OpenGLDisplayPlugin::compositeScene() {
|
|||
batch.setStateScissorRect(ivec4(uvec2(), _compositeFramebuffer->getSize()));
|
||||
batch.resetViewTransform();
|
||||
batch.setProjectionTransform(mat4());
|
||||
batch.setPipeline(_simplePipeline);
|
||||
batch.setPipeline(getCompositeScenePipeline());
|
||||
batch.setResourceTexture(0, _currentFrame->framebuffer->getRenderBuffer(0));
|
||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||
});
|
||||
|
@ -924,11 +919,17 @@ void OpenGLDisplayPlugin::render(std::function<void(gpu::Batch& batch)> f) {
|
|||
OpenGLDisplayPlugin::~OpenGLDisplayPlugin() {
|
||||
}
|
||||
|
||||
// Added this to allow desktop composite framebuffer to be RGBA while mobile is SRGBA
|
||||
// Overridden by Basic2DWindowDisplayPlugin
|
||||
// FIXME: Eventually it would be ideal to have both framebuffers be of the same type
|
||||
gpu::Element OpenGLDisplayPlugin::getCompositeFBColorSpace() {
|
||||
return gpu::Element::COLOR_RGBA_32;
|
||||
}
|
||||
|
||||
void OpenGLDisplayPlugin::updateCompositeFramebuffer() {
|
||||
auto renderSize = glm::uvec2(getRecommendedRenderSize());
|
||||
if (!_compositeFramebuffer || _compositeFramebuffer->getSize() != renderSize) {
|
||||
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("OpenGLDisplayPlugin::composite", gpu::Element::COLOR_RGBA_32, renderSize.x, renderSize.y));
|
||||
// _compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("OpenGLDisplayPlugin::composite", gpu::Element::COLOR_SRGBA_32, renderSize.x, renderSize.y));
|
||||
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("OpenGLDisplayPlugin::composite", getCompositeFBColorSpace(), renderSize.x, renderSize.y));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,9 @@ protected:
|
|||
virtual void compositePointer();
|
||||
virtual void compositeExtra() {};
|
||||
|
||||
virtual gpu::PipelinePointer getCompositeScenePipeline();
|
||||
virtual gpu::Element getCompositeFBColorSpace();
|
||||
|
||||
// These functions must only be called on the presentation thread
|
||||
virtual void customizeContext();
|
||||
virtual void uncustomizeContext();
|
||||
|
@ -149,9 +152,11 @@ protected:
|
|||
gpu::PipelinePointer _hudPipeline;
|
||||
gpu::PipelinePointer _mirrorHUDPipeline;
|
||||
gpu::ShaderPointer _mirrorHUDPS;
|
||||
gpu::PipelinePointer _simplePipeline;
|
||||
gpu::PipelinePointer _presentPipeline;
|
||||
gpu::PipelinePointer _drawTexturePipeline;
|
||||
gpu::PipelinePointer _linearToSRGBPipeline;
|
||||
gpu::PipelinePointer _SRGBToLinearPipeline;
|
||||
gpu::PipelinePointer _cursorPipeline;
|
||||
|
||||
gpu::TexturePointer _displayTexture{};
|
||||
float _compositeHUDAlpha { 1.0f };
|
||||
|
||||
|
|
|
@ -418,6 +418,20 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
packetStream << FingerprintUtils::getMachineFingerprint();
|
||||
|
||||
QString systemInfo;
|
||||
#if defined Q_OS_WIN
|
||||
systemInfo = "OS:Windows";
|
||||
#elif defined Q_OS_OSX
|
||||
systemInfo = "OS:OSX";
|
||||
#elif defined Q_OS_LINUX
|
||||
systemInfo = "OS:Linux";
|
||||
#elif defined Q_OS_ANDROID
|
||||
systemInfo = "OS:Android";
|
||||
#else
|
||||
systemInfo = "OS:Unknown";
|
||||
#endif
|
||||
packetStream << systemInfo;
|
||||
|
||||
packetStream << _connectReason;
|
||||
|
||||
if (_nodeDisconnectTimestamp < _nodeConnectTimestamp) {
|
||||
|
|
|
@ -72,7 +72,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
|
|||
return static_cast<PacketVersion>(DomainConnectionDeniedVersion::IncludesExtraInfo);
|
||||
|
||||
case PacketType::DomainConnectRequest:
|
||||
return static_cast<PacketVersion>(DomainConnectRequestVersion::HasReason);
|
||||
return static_cast<PacketVersion>(DomainConnectRequestVersion::HasSystemInfo);
|
||||
|
||||
case PacketType::DomainServerAddedNode:
|
||||
return static_cast<PacketVersion>(DomainServerAddedNodeVersion::PermissionsGrid);
|
||||
|
|
|
@ -346,7 +346,8 @@ enum class DomainConnectRequestVersion : PacketVersion {
|
|||
HasMachineFingerprint,
|
||||
AlwaysHasMachineFingerprint,
|
||||
HasTimestamp,
|
||||
HasReason
|
||||
HasReason,
|
||||
HasSystemInfo
|
||||
};
|
||||
|
||||
enum class DomainConnectionDeniedVersion : PacketVersion {
|
||||
|
|
|
@ -122,22 +122,22 @@ void PickManager::update() {
|
|||
// FIXME: give each type its own expiry
|
||||
// Each type will update at least one pick, regardless of the expiry
|
||||
{
|
||||
PROFILE_RANGE(picks, "StylusPicks");
|
||||
PROFILE_RANGE_EX(picks, "StylusPicks", 0xffff0000, (uint64_t)_totalPickCounts[PickQuery::Stylus]);
|
||||
PerformanceTimer perfTimer("StylusPicks");
|
||||
_updatedPickCounts[PickQuery::Stylus] = _stylusPickCacheOptimizer.update(cachedPicks[PickQuery::Stylus], _nextPickToUpdate[PickQuery::Stylus], expiry, false);
|
||||
}
|
||||
{
|
||||
PROFILE_RANGE(picks, "RayPicks");
|
||||
PROFILE_RANGE_EX(picks, "RayPicks", 0xffff0000, (uint64_t)_totalPickCounts[PickQuery::Ray]);
|
||||
PerformanceTimer perfTimer("RayPicks");
|
||||
_updatedPickCounts[PickQuery::Ray] = _rayPickCacheOptimizer.update(cachedPicks[PickQuery::Ray], _nextPickToUpdate[PickQuery::Ray], expiry, shouldPickHUD);
|
||||
}
|
||||
{
|
||||
PROFILE_RANGE(picks, "ParabolaPick");
|
||||
PerformanceTimer perfTimer("ParabolaPick");
|
||||
PROFILE_RANGE_EX(picks, "ParabolaPicks", 0xffff0000, (uint64_t)_totalPickCounts[PickQuery::Parabola]);
|
||||
PerformanceTimer perfTimer("ParabolaPicks");
|
||||
_updatedPickCounts[PickQuery::Parabola] = _parabolaPickCacheOptimizer.update(cachedPicks[PickQuery::Parabola], _nextPickToUpdate[PickQuery::Parabola], expiry, shouldPickHUD);
|
||||
}
|
||||
{
|
||||
PROFILE_RANGE(picks, "CollisoinPicks");
|
||||
PROFILE_RANGE_EX(picks, "CollisionPicks", 0xffff0000, (uint64_t)_totalPickCounts[PickQuery::Collision]);
|
||||
PerformanceTimer perfTimer("CollisionPicks");
|
||||
_updatedPickCounts[PickQuery::Collision] = _collisionPickCacheOptimizer.update(cachedPicks[PickQuery::Collision], _nextPickToUpdate[PickQuery::Collision], expiry, false);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <QtQml/QQmlEngine>
|
||||
#include <QtQml/QQmlContext>
|
||||
#include <QQuickView>
|
||||
#include <gl/GLHelpers.h>
|
||||
|
||||
#include <PathUtils.h>
|
||||
|
||||
|
@ -28,6 +29,7 @@ DockWidget::DockWidget(const QString& title, QWidget* parent) : QDockWidget(titl
|
|||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
auto qmlEngine = offscreenUi->getSurfaceContext()->engine();
|
||||
_quickView = std::shared_ptr<QQuickView>(new QQuickView(qmlEngine, nullptr), quickViewDeleter);
|
||||
_quickView->setFormat(getDefaultOpenGLSurfaceFormat());
|
||||
QWidget* widget = QWidget::createWindowContainer(_quickView.get());
|
||||
setWidget(widget);
|
||||
QWidget* headerWidget = new QWidget();
|
||||
|
|
|
@ -124,6 +124,10 @@ void OculusDisplayPlugin::uncustomizeContext() {
|
|||
Parent::uncustomizeContext();
|
||||
}
|
||||
|
||||
gpu::PipelinePointer OculusDisplayPlugin::getCompositeScenePipeline() {
|
||||
return _SRGBToLinearPipeline;
|
||||
}
|
||||
|
||||
static const uint64_t FRAME_BUDGET = (11 * USECS_PER_MSEC);
|
||||
static const uint64_t FRAME_OVER_BUDGET = (15 * USECS_PER_MSEC);
|
||||
|
||||
|
@ -163,7 +167,7 @@ void OculusDisplayPlugin::hmdPresent() {
|
|||
batch.setStateScissorRect(ivec4(uvec2(), _outputFramebuffer->getSize()));
|
||||
batch.resetViewTransform();
|
||||
batch.setProjectionTransform(mat4());
|
||||
batch.setPipeline(_presentPipeline);
|
||||
batch.setPipeline(_drawTexturePipeline);
|
||||
batch.setResourceTexture(0, _compositeFramebuffer->getRenderBuffer(0));
|
||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||
});
|
||||
|
|
|
@ -34,6 +34,8 @@ protected:
|
|||
void uncustomizeContext() override;
|
||||
void cycleDebugOutput() override;
|
||||
|
||||
virtual gpu::PipelinePointer getCompositeScenePipeline() override;
|
||||
|
||||
private:
|
||||
static const char* NAME;
|
||||
ovrTextureSwapChain _textureSwapChain;
|
||||
|
|
Loading…
Reference in a new issue