mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
Merge remote-tracking branch 'upstream/master' into plugins
This commit is contained in:
commit
0cbc12af8b
9 changed files with 26 additions and 19 deletions
|
@ -3614,14 +3614,10 @@ void Application::renderRearViewMirror(RenderArgs* renderArgs, const QRect& regi
|
||||||
// set the bounds of rear mirror view
|
// set the bounds of rear mirror view
|
||||||
gpu::Vec4i viewport;
|
gpu::Vec4i viewport;
|
||||||
if (billboard) {
|
if (billboard) {
|
||||||
QSize size = DependencyManager::get<FramebufferCache>()->getFrameBufferSize();
|
|
||||||
viewport = gpu::Vec4i(0, 0, region.width(), region.height());
|
viewport = gpu::Vec4i(0, 0, region.width(), region.height());
|
||||||
} else {
|
} else {
|
||||||
// if not rendering the billboard, the region is in device independent coordinates; must convert to device
|
// if not rendering the billboard, the region is in device independent coordinates; must convert to device
|
||||||
QSize size = DependencyManager::get<FramebufferCache>()->getFrameBufferSize();
|
|
||||||
float ratio = (float)QApplication::desktop()->windowHandle()->devicePixelRatio() * getRenderResolutionScale();
|
float ratio = (float)QApplication::desktop()->windowHandle()->devicePixelRatio() * getRenderResolutionScale();
|
||||||
int x = region.x() * ratio;
|
|
||||||
int y = region.y() * ratio;
|
|
||||||
int width = region.width() * ratio;
|
int width = region.width() * ratio;
|
||||||
int height = region.height() * ratio;
|
int height = region.height() * ratio;
|
||||||
viewport = gpu::Vec4i(0, 0, width, height);
|
viewport = gpu::Vec4i(0, 0, width, height);
|
||||||
|
|
|
@ -452,6 +452,7 @@ Menu::Menu() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MenuWrapper* networkMenu = developerMenu->addMenu("Network");
|
MenuWrapper* networkMenu = developerMenu->addMenu("Network");
|
||||||
|
addActionToQMenuAndActionHash(networkMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()));
|
||||||
addCheckableActionToQMenuAndActionHash(networkMenu, MenuOption::DisableNackPackets, 0, false,
|
addCheckableActionToQMenuAndActionHash(networkMenu, MenuOption::DisableNackPackets, 0, false,
|
||||||
qApp->getEntityEditPacketSender(),
|
qApp->getEntityEditPacketSender(),
|
||||||
SLOT(toggleNackPackets()));
|
SLOT(toggleNackPackets()));
|
||||||
|
|
|
@ -463,7 +463,7 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
const float LOOKING_AT_ME_DURATION = 0.5f; // seconds
|
const float LOOKING_AT_ME_DURATION = 0.5f; // seconds
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
float alpha = LOOKING_AT_ME_ALPHA_START
|
float alpha = LOOKING_AT_ME_ALPHA_START
|
||||||
* (1.0f - ((float)(usecTimestampNow() - getHead()->getLookingAtMeStarted()))
|
* (1.0f - ((float)(now - getHead()->getLookingAtMeStarted()))
|
||||||
/ (LOOKING_AT_ME_DURATION * (float)USECS_PER_SECOND));
|
/ (LOOKING_AT_ME_DURATION * (float)USECS_PER_SECOND));
|
||||||
if (alpha > 0.0f) {
|
if (alpha > 0.0f) {
|
||||||
QSharedPointer<NetworkGeometry> geometry = getHead()->getFaceModel().getGeometry();
|
QSharedPointer<NetworkGeometry> geometry = getHead()->getFaceModel().getGeometry();
|
||||||
|
|
|
@ -91,13 +91,12 @@ private:
|
||||||
|
|
||||||
int _leftBlinkIndex;
|
int _leftBlinkIndex;
|
||||||
int _rightBlinkIndex;
|
int _rightBlinkIndex;
|
||||||
int _leftEyeOpenIndex;
|
|
||||||
int _rightEyeOpenIndex;
|
|
||||||
|
|
||||||
int _leftEyeDownIndex;
|
int _leftEyeDownIndex;
|
||||||
int _rightEyeDownIndex;
|
int _rightEyeDownIndex;
|
||||||
int _leftEyeInIndex;
|
int _leftEyeInIndex;
|
||||||
int _rightEyeInIndex;
|
int _rightEyeInIndex;
|
||||||
|
int _leftEyeOpenIndex;
|
||||||
|
int _rightEyeOpenIndex;
|
||||||
|
|
||||||
int _browDownLeftIndex;
|
int _browDownLeftIndex;
|
||||||
int _browDownRightIndex;
|
int _browDownRightIndex;
|
||||||
|
|
|
@ -518,7 +518,7 @@ void ApplicationCompositor::renderControllerPointers(gpu::Batch& batch) {
|
||||||
glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * palmData->getFingerDirection();
|
glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * palmData->getFingerDirection();
|
||||||
|
|
||||||
// Get the angles, scaled between (-0.5,0.5)
|
// Get the angles, scaled between (-0.5,0.5)
|
||||||
float xAngle = (atan2(direction.z, direction.x) + PI_OVER_TWO);
|
float xAngle = (atan2f(direction.z, direction.x) + PI_OVER_TWO);
|
||||||
float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)PI_OVER_TWO));
|
float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)PI_OVER_TWO));
|
||||||
|
|
||||||
// Get the pixel range over which the xAngle and yAngle are scaled
|
// Get the pixel range over which the xAngle and yAngle are scaled
|
||||||
|
|
|
@ -125,8 +125,10 @@ void AudioStatsDialog::renderStats() {
|
||||||
audioInputBufferLatency = (double)_stats->getAudioInputMsecsReadStats().getWindowAverage();
|
audioInputBufferLatency = (double)_stats->getAudioInputMsecsReadStats().getWindowAverage();
|
||||||
inputRingBufferLatency = (double)_stats->getInputRungBufferMsecsAvailableStats().getWindowAverage();
|
inputRingBufferLatency = (double)_stats->getInputRungBufferMsecsAvailableStats().getWindowAverage();
|
||||||
networkRoundtripLatency = (double) audioMixerNodePointer->getPingMs();
|
networkRoundtripLatency = (double) audioMixerNodePointer->getPingMs();
|
||||||
mixerRingBufferLatency = (double)_stats->getMixerAvatarStreamStats()._framesAvailableAverage * AudioConstants::NETWORK_FRAME_MSECS;
|
mixerRingBufferLatency = (double)_stats->getMixerAvatarStreamStats()._framesAvailableAverage *
|
||||||
outputRingBufferLatency = (double)downstreamAudioStreamStats._framesAvailableAverage * AudioConstants::NETWORK_FRAME_MSECS;
|
(double)AudioConstants::NETWORK_FRAME_MSECS;
|
||||||
|
outputRingBufferLatency = (double)downstreamAudioStreamStats._framesAvailableAverage *
|
||||||
|
(double)AudioConstants::NETWORK_FRAME_MSECS;
|
||||||
audioOutputBufferLatency = (double)_stats->getAudioOutputMsecsUnplayedStats().getWindowAverage();
|
audioOutputBufferLatency = (double)_stats->getAudioOutputMsecsUnplayedStats().getWindowAverage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ void Cube3DOverlay::render(RenderArgs* args) {
|
||||||
|
|
||||||
// TODO: handle registration point??
|
// TODO: handle registration point??
|
||||||
glm::vec3 position = getPosition();
|
glm::vec3 position = getPosition();
|
||||||
glm::vec3 center = getCenter();
|
|
||||||
glm::vec3 dimensions = getDimensions();
|
glm::vec3 dimensions = getDimensions();
|
||||||
glm::quat rotation = getRotation();
|
glm::quat rotation = getRotation();
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include "FboCache.h"
|
#include "FboCache.h"
|
||||||
#include <PerfStat.h>
|
#include <PerfStat.h>
|
||||||
|
#include <NumericalConstants.h>
|
||||||
|
|
||||||
class QMyQuickRenderControl : public QQuickRenderControl {
|
class QMyQuickRenderControl : public QQuickRenderControl {
|
||||||
protected:
|
protected:
|
||||||
|
@ -44,7 +45,10 @@ Q_LOGGING_CATEGORY(offscreenFocus, "hifi.offscreen.focus")
|
||||||
// Time between receiving a request to render the offscreen UI actually triggering
|
// Time between receiving a request to render the offscreen UI actually triggering
|
||||||
// the render. Could possibly be increased depending on the framerate we expect to
|
// the render. Could possibly be increased depending on the framerate we expect to
|
||||||
// achieve.
|
// achieve.
|
||||||
static const int SMALL_INTERVAL = 5;
|
static const int MAX_QML_FRAMERATE = 10;
|
||||||
|
static const int MIN_RENDER_INTERVAL_US = USECS_PER_SECOND / MAX_QML_FRAMERATE;
|
||||||
|
static const int MIN_TIMER_MS = 5;
|
||||||
|
|
||||||
|
|
||||||
OffscreenQmlSurface::OffscreenQmlSurface() :
|
OffscreenQmlSurface::OffscreenQmlSurface() :
|
||||||
_renderControl(new QMyQuickRenderControl), _fboCache(new FboCache) {
|
_renderControl(new QMyQuickRenderControl), _fboCache(new FboCache) {
|
||||||
|
@ -90,7 +94,6 @@ void OffscreenQmlSurface::create(QOpenGLContext* shareContext) {
|
||||||
// When Quick says there is a need to render, we will not render immediately. Instead,
|
// When Quick says there is a need to render, we will not render immediately. Instead,
|
||||||
// a timer with a small interval is used to get better performance.
|
// a timer with a small interval is used to get better performance.
|
||||||
_updateTimer.setSingleShot(true);
|
_updateTimer.setSingleShot(true);
|
||||||
_updateTimer.setInterval(SMALL_INTERVAL);
|
|
||||||
connect(&_updateTimer, &QTimer::timeout, this, &OffscreenQmlSurface::updateQuick);
|
connect(&_updateTimer, &QTimer::timeout, this, &OffscreenQmlSurface::updateQuick);
|
||||||
|
|
||||||
// Now hook up the signals. For simplicy we don't differentiate between
|
// Now hook up the signals. For simplicy we don't differentiate between
|
||||||
|
@ -170,13 +173,18 @@ QObject* OffscreenQmlSurface::load(const QUrl& qmlSource, std::function<void(QQm
|
||||||
|
|
||||||
void OffscreenQmlSurface::requestUpdate() {
|
void OffscreenQmlSurface::requestUpdate() {
|
||||||
_polish = true;
|
_polish = true;
|
||||||
if (!_updateTimer.isActive()) {
|
requestRender();
|
||||||
_updateTimer.start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OffscreenQmlSurface::requestRender() {
|
void OffscreenQmlSurface::requestRender() {
|
||||||
if (!_updateTimer.isActive()) {
|
if (!_updateTimer.isActive()) {
|
||||||
|
auto now = usecTimestampNow();
|
||||||
|
auto lastInterval = now - _lastRenderTime;
|
||||||
|
if (lastInterval > MIN_RENDER_INTERVAL_US) {
|
||||||
|
_updateTimer.setInterval(MIN_TIMER_MS);
|
||||||
|
} else {
|
||||||
|
_updateTimer.setInterval((MIN_RENDER_INTERVAL_US - lastInterval) / USECS_PER_MSEC);
|
||||||
|
}
|
||||||
_updateTimer.start();
|
_updateTimer.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,6 +251,7 @@ void OffscreenQmlSurface::updateQuick() {
|
||||||
if (_paused) {
|
if (_paused) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!makeCurrent()) {
|
if (!makeCurrent()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -270,11 +279,11 @@ void OffscreenQmlSurface::updateQuick() {
|
||||||
// Need a debug context with sync logging to figure out why.
|
// Need a debug context with sync logging to figure out why.
|
||||||
// for now just clear the errors
|
// for now just clear the errors
|
||||||
glGetError();
|
glGetError();
|
||||||
// Q_ASSERT(!glGetError());
|
|
||||||
|
|
||||||
_quickWindow->resetOpenGLState();
|
_quickWindow->resetOpenGLState();
|
||||||
|
|
||||||
QOpenGLFramebufferObject::bindDefault();
|
QOpenGLFramebufferObject::bindDefault();
|
||||||
|
_lastRenderTime = usecTimestampNow();
|
||||||
// Force completion of all the operations before we emit the texture as being ready for use
|
// Force completion of all the operations before we emit the texture as being ready for use
|
||||||
glFinish();
|
glFinish();
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ private:
|
||||||
QQuickItem* _rootItem{ nullptr };
|
QQuickItem* _rootItem{ nullptr };
|
||||||
QTimer _updateTimer;
|
QTimer _updateTimer;
|
||||||
FboCache* _fboCache;
|
FboCache* _fboCache;
|
||||||
|
quint64 _lastRenderTime{ 0 };
|
||||||
bool _polish{ true };
|
bool _polish{ true };
|
||||||
bool _paused{ true };
|
bool _paused{ true };
|
||||||
MouseTranslator _mouseTranslator{ [](const QPointF& p) { return p; } };
|
MouseTranslator _mouseTranslator{ [](const QPointF& p) { return p; } };
|
||||||
|
|
Loading…
Reference in a new issue