mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
resolved conflicts
This commit is contained in:
commit
6be550a144
10 changed files with 70 additions and 71 deletions
|
@ -1107,6 +1107,16 @@
|
||||||
<div class="label">Skybox URL</div>
|
<div class="label">Skybox URL</div>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<input type="text" id="property-zone-skybox-url" class="url">
|
<input type="text" id="property-zone-skybox-url" class="url">
|
||||||
|
|
||||||
|
<div class="section-header web-section">
|
||||||
|
<label>Web</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="web-section property">
|
||||||
|
<div class="label">Source URL</div>
|
||||||
|
<div class="value">
|
||||||
|
<input type="text" id="property-web-source-url" class="url">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1445,18 +1455,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="section-header web-section">
|
|
||||||
<label>Web</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="web-section property">
|
|
||||||
<div class="label">Source URL</div>
|
|
||||||
<div class="value">
|
|
||||||
<input type="text" id="property-web-source-url" class="url">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="section-header particle-section">
|
<div class="section-header particle-section">
|
||||||
<label>Particle</label>
|
<label>Particle</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import QtQuick 2.3
|
import QtQuick 2.5
|
||||||
import QtQuick.Controls 1.2
|
import QtQuick.Controls 1.4
|
||||||
import QtWebEngine 1.1
|
import QtWebEngine 1.1
|
||||||
|
|
||||||
import "../../windows" as Windows
|
import "../../windows" as Windows
|
||||||
|
@ -11,9 +11,7 @@ Windows.Window {
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
width: 900; height: 700
|
width: 900; height: 700
|
||||||
resizable: true
|
resizable: true
|
||||||
anchors.centerIn: parent
|
|
||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
frame: Windows.ModalFrame {}
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -29,7 +29,10 @@ namespace AudioConstants {
|
||||||
const int NETWORK_FRAME_SAMPLES_PER_CHANNEL = NETWORK_FRAME_BYTES_PER_CHANNEL / sizeof(AudioSample);
|
const int NETWORK_FRAME_SAMPLES_PER_CHANNEL = NETWORK_FRAME_BYTES_PER_CHANNEL / sizeof(AudioSample);
|
||||||
const float NETWORK_FRAME_MSECS = (AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL
|
const float NETWORK_FRAME_MSECS = (AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL
|
||||||
/ (float)AudioConstants::SAMPLE_RATE) * 1000.0f;
|
/ (float)AudioConstants::SAMPLE_RATE) * 1000.0f;
|
||||||
|
|
||||||
|
// be careful with overflows when using this constant
|
||||||
const int NETWORK_FRAME_USECS = static_cast<int>(NETWORK_FRAME_MSECS * 1000.0f);
|
const int NETWORK_FRAME_USECS = static_cast<int>(NETWORK_FRAME_MSECS * 1000.0f);
|
||||||
|
|
||||||
const int MIN_SAMPLE_VALUE = std::numeric_limits<AudioSample>::min();
|
const int MIN_SAMPLE_VALUE = std::numeric_limits<AudioSample>::min();
|
||||||
const int MAX_SAMPLE_VALUE = std::numeric_limits<AudioSample>::max();
|
const int MAX_SAMPLE_VALUE = std::numeric_limits<AudioSample>::max();
|
||||||
}
|
}
|
||||||
|
|
|
@ -295,14 +295,7 @@ int64_t AudioInjector::injectNextFrame() {
|
||||||
|
|
||||||
if (audioMixer) {
|
if (audioMixer) {
|
||||||
// send off this audio packet
|
// send off this audio packet
|
||||||
auto bytesWritten = nodeList->sendUnreliablePacket(*_currentPacket, *audioMixer);
|
nodeList->sendUnreliablePacket(*_currentPacket, *audioMixer);
|
||||||
if (bytesWritten < 0) {
|
|
||||||
auto currentTime = _frameTimer->nsecsElapsed() / 1000;
|
|
||||||
qDebug() << this << "error sending audio injector packet. NF:"
|
|
||||||
<< _nextFrame << "CT:" << currentTime
|
|
||||||
<< "CF:" << currentTime / AudioConstants::NETWORK_FRAME_USECS;
|
|
||||||
}
|
|
||||||
|
|
||||||
_outgoingSequenceNumber++;
|
_outgoingSequenceNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,14 +314,16 @@ int64_t AudioInjector::injectNextFrame() {
|
||||||
const int MAX_ALLOWED_FRAMES_TO_FALL_BEHIND = 7;
|
const int MAX_ALLOWED_FRAMES_TO_FALL_BEHIND = 7;
|
||||||
int64_t currentTime = _frameTimer->nsecsElapsed() / 1000;
|
int64_t currentTime = _frameTimer->nsecsElapsed() / 1000;
|
||||||
auto currentFrameBasedOnElapsedTime = currentTime / AudioConstants::NETWORK_FRAME_USECS;
|
auto currentFrameBasedOnElapsedTime = currentTime / AudioConstants::NETWORK_FRAME_USECS;
|
||||||
|
|
||||||
if (currentFrameBasedOnElapsedTime - _nextFrame > MAX_ALLOWED_FRAMES_TO_FALL_BEHIND) {
|
if (currentFrameBasedOnElapsedTime - _nextFrame > MAX_ALLOWED_FRAMES_TO_FALL_BEHIND) {
|
||||||
// If we are falling behind by more frames than our threshold, let's skip the frames ahead
|
// If we are falling behind by more frames than our threshold, let's skip the frames ahead
|
||||||
qDebug() << "AudioInjector::injectNextFrame() skipping ahead, fell behind by " << (currentFrameBasedOnElapsedTime - _nextFrame) << " frames";
|
qDebug() << this << "injectNextFrame() skipping ahead, fell behind by " << (currentFrameBasedOnElapsedTime - _nextFrame) << " frames";
|
||||||
_nextFrame = currentFrameBasedOnElapsedTime;
|
_nextFrame = currentFrameBasedOnElapsedTime;
|
||||||
_currentSendOffset = _nextFrame * AudioConstants::NETWORK_FRAME_BYTES_PER_CHANNEL * (_options.stereo ? 2 : 1) % _audioData.size();
|
_currentSendOffset = _nextFrame * AudioConstants::NETWORK_FRAME_BYTES_PER_CHANNEL * (_options.stereo ? 2 : 1) % _audioData.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t playNextFrameAt = ++_nextFrame * AudioConstants::NETWORK_FRAME_USECS;
|
int64_t playNextFrameAt = ++_nextFrame * AudioConstants::NETWORK_FRAME_USECS;
|
||||||
|
|
||||||
return std::max(INT64_C(0), playNextFrameAt - currentTime);
|
return std::max(INT64_C(0), playNextFrameAt - currentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ private:
|
||||||
AbstractAudioInterface* _localAudioInterface { nullptr };
|
AbstractAudioInterface* _localAudioInterface { nullptr };
|
||||||
AudioInjectorLocalBuffer* _localBuffer { nullptr };
|
AudioInjectorLocalBuffer* _localBuffer { nullptr };
|
||||||
|
|
||||||
int _nextFrame { 0 };
|
int64_t _nextFrame { 0 };
|
||||||
std::unique_ptr<QElapsedTimer> _frameTimer { nullptr };
|
std::unique_ptr<QElapsedTimer> _frameTimer { nullptr };
|
||||||
quint16 _outgoingSequenceNumber { 0 };
|
quint16 _outgoingSequenceNumber { 0 };
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ void AudioInjectorManager::run() {
|
||||||
if (!injector.isNull()) {
|
if (!injector.isNull()) {
|
||||||
// this is an injector that's ready to go, have it send a frame now
|
// this is an injector that's ready to go, have it send a frame now
|
||||||
auto nextCallDelta = injector->injectNextFrame();
|
auto nextCallDelta = injector->injectNextFrame();
|
||||||
|
|
||||||
if (nextCallDelta >= 0 && !injector->isFinished()) {
|
if (nextCallDelta >= 0 && !injector->isFinished()) {
|
||||||
// re-enqueue the injector with the correct timing
|
// re-enqueue the injector with the correct timing
|
||||||
_injectors.emplace(usecTimestampNow() + nextCallDelta, injector);
|
_injectors.emplace(usecTimestampNow() + nextCallDelta, injector);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "render/DrawStatus.h"
|
#include "render/DrawStatus.h"
|
||||||
#include "AmbientOcclusionEffect.h"
|
#include "AmbientOcclusionEffect.h"
|
||||||
#include "AntialiasingEffect.h"
|
#include "AntialiasingEffect.h"
|
||||||
|
#include "ToneMappingEffect.h"
|
||||||
|
|
||||||
#include "RenderDeferredTask.h"
|
#include "RenderDeferredTask.h"
|
||||||
|
|
||||||
|
@ -67,20 +68,6 @@ void RenderDeferred::run(const SceneContextPointer& sceneContext, const RenderCo
|
||||||
DependencyManager::get<DeferredLightingEffect>()->render(renderContext);
|
DependencyManager::get<DeferredLightingEffect>()->render(renderContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneMappingDeferred::configure(const Config& config) {
|
|
||||||
if (config.exposure >= 0.0f) {
|
|
||||||
_toneMappingEffect.setExposure(config.exposure);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.curve >= 0) {
|
|
||||||
_toneMappingEffect.setToneCurve((ToneMappingEffect::ToneCurve)config.curve);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ToneMappingDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
|
|
||||||
_toneMappingEffect.render(renderContext->args);
|
|
||||||
}
|
|
||||||
|
|
||||||
RenderDeferredTask::RenderDeferredTask(CullFunctor cullFunctor) {
|
RenderDeferredTask::RenderDeferredTask(CullFunctor cullFunctor) {
|
||||||
cullFunctor = cullFunctor ? cullFunctor : [](const RenderArgs*, const AABox&){ return true; };
|
cullFunctor = cullFunctor ? cullFunctor : [](const RenderArgs*, const AABox&){ return true; };
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
#include "render/DrawTask.h"
|
#include "render/DrawTask.h"
|
||||||
|
|
||||||
#include "ToneMappingEffect.h"
|
|
||||||
|
|
||||||
class SetupDeferred {
|
class SetupDeferred {
|
||||||
public:
|
public:
|
||||||
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
|
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
|
||||||
|
@ -40,32 +38,6 @@ public:
|
||||||
using JobModel = render::Job::Model<RenderDeferred>;
|
using JobModel = render::Job::Model<RenderDeferred>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ToneMappingConfig : public render::Job::Config {
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PROPERTY(bool enabled MEMBER enabled)
|
|
||||||
Q_PROPERTY(float exposure MEMBER exposure NOTIFY dirty);
|
|
||||||
Q_PROPERTY(int curve MEMBER curve NOTIFY dirty);
|
|
||||||
public:
|
|
||||||
ToneMappingConfig() : render::Job::Config(true) {}
|
|
||||||
|
|
||||||
float exposure{ 0.0f };
|
|
||||||
int curve{ 3 };
|
|
||||||
signals:
|
|
||||||
void dirty();
|
|
||||||
};
|
|
||||||
|
|
||||||
class ToneMappingDeferred {
|
|
||||||
public:
|
|
||||||
using Config = ToneMappingConfig;
|
|
||||||
using JobModel = render::Job::Model<ToneMappingDeferred, Config>;
|
|
||||||
|
|
||||||
void configure(const Config& config);
|
|
||||||
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
|
|
||||||
|
|
||||||
ToneMappingEffect _toneMappingEffect;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DrawConfig : public render::Job::Config {
|
class DrawConfig : public render::Job::Config {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(int numDrawn READ getNumDrawn)
|
Q_PROPERTY(int numDrawn READ getNumDrawn)
|
||||||
|
|
|
@ -145,4 +145,19 @@ void ToneMappingEffect::render(RenderArgs* args) {
|
||||||
batch.setResourceTexture(ToneMappingEffect_LightingMapSlot, lightingBuffer);
|
batch.setResourceTexture(ToneMappingEffect_LightingMapSlot, lightingBuffer);
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ToneMappingDeferred::configure(const Config& config) {
|
||||||
|
if (config.exposure >= 0.0f) {
|
||||||
|
_toneMappingEffect.setExposure(config.exposure);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.curve >= 0) {
|
||||||
|
_toneMappingEffect.setToneCurve((ToneMappingEffect::ToneCurve)config.curve);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ToneMappingDeferred::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext) {
|
||||||
|
_toneMappingEffect.render(renderContext->args);
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
#include <gpu/Resource.h>
|
#include <gpu/Resource.h>
|
||||||
#include <gpu/Pipeline.h>
|
#include <gpu/Pipeline.h>
|
||||||
|
#include <render/DrawTask.h>
|
||||||
|
|
||||||
|
|
||||||
class RenderArgs;
|
class RenderArgs;
|
||||||
|
|
||||||
|
@ -50,7 +52,7 @@ private:
|
||||||
float _exposure = 0.0f;
|
float _exposure = 0.0f;
|
||||||
float _twoPowExposure = 1.0f;
|
float _twoPowExposure = 1.0f;
|
||||||
glm::vec2 spareA;
|
glm::vec2 spareA;
|
||||||
int _toneCurve = Filmic;
|
int _toneCurve = Gamma22;
|
||||||
glm::vec3 spareB;
|
glm::vec3 spareB;
|
||||||
|
|
||||||
Parameters() {}
|
Parameters() {}
|
||||||
|
@ -61,4 +63,33 @@ private:
|
||||||
void init();
|
void init();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ToneMappingConfig : public render::Job::Config {
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(bool enabled MEMBER enabled)
|
||||||
|
Q_PROPERTY(float exposure MEMBER exposure WRITE setExposure);
|
||||||
|
Q_PROPERTY(int curve MEMBER curve WRITE setCurve);
|
||||||
|
public:
|
||||||
|
ToneMappingConfig() : render::Job::Config(true) {}
|
||||||
|
|
||||||
|
void setExposure(float newExposure) { exposure = std::max(0.0f, newExposure); emit dirty(); }
|
||||||
|
void setCurve(int newCurve) { curve = std::max((int)ToneMappingEffect::None, std::min((int)ToneMappingEffect::Filmic, newCurve)); emit dirty(); }
|
||||||
|
|
||||||
|
|
||||||
|
float exposure{ 0.0f };
|
||||||
|
int curve{ ToneMappingEffect::Gamma22 };
|
||||||
|
signals:
|
||||||
|
void dirty();
|
||||||
|
};
|
||||||
|
|
||||||
|
class ToneMappingDeferred {
|
||||||
|
public:
|
||||||
|
using Config = ToneMappingConfig;
|
||||||
|
using JobModel = render::Job::Model<ToneMappingDeferred, Config>;
|
||||||
|
|
||||||
|
void configure(const Config& config);
|
||||||
|
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
|
||||||
|
|
||||||
|
ToneMappingEffect _toneMappingEffect;
|
||||||
|
};
|
||||||
|
|
||||||
#endif // hifi_ToneMappingEffect_h
|
#endif // hifi_ToneMappingEffect_h
|
||||||
|
|
Loading…
Reference in a new issue