mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-19 00:57:35 +02: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="value">
|
||||
<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>
|
||||
|
||||
|
@ -1445,18 +1455,6 @@
|
|||
</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">
|
||||
<label>Particle</label>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import QtQuick 2.3
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtWebEngine 1.1
|
||||
|
||||
import "../../windows" as Windows
|
||||
|
@ -11,9 +11,7 @@ Windows.Window {
|
|||
HifiConstants { id: hifi }
|
||||
width: 900; height: 700
|
||||
resizable: true
|
||||
anchors.centerIn: parent
|
||||
modality: Qt.ApplicationModal
|
||||
frame: Windows.ModalFrame {}
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -29,7 +29,10 @@ namespace AudioConstants {
|
|||
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
|
||||
/ (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 MIN_SAMPLE_VALUE = std::numeric_limits<AudioSample>::min();
|
||||
const int MAX_SAMPLE_VALUE = std::numeric_limits<AudioSample>::max();
|
||||
}
|
||||
|
|
|
@ -295,14 +295,7 @@ int64_t AudioInjector::injectNextFrame() {
|
|||
|
||||
if (audioMixer) {
|
||||
// send off this audio packet
|
||||
auto bytesWritten = 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;
|
||||
}
|
||||
|
||||
nodeList->sendUnreliablePacket(*_currentPacket, *audioMixer);
|
||||
_outgoingSequenceNumber++;
|
||||
}
|
||||
|
||||
|
@ -321,14 +314,16 @@ int64_t AudioInjector::injectNextFrame() {
|
|||
const int MAX_ALLOWED_FRAMES_TO_FALL_BEHIND = 7;
|
||||
int64_t currentTime = _frameTimer->nsecsElapsed() / 1000;
|
||||
auto currentFrameBasedOnElapsedTime = currentTime / AudioConstants::NETWORK_FRAME_USECS;
|
||||
|
||||
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
|
||||
qDebug() << "AudioInjector::injectNextFrame() skipping ahead, fell behind by " << (currentFrameBasedOnElapsedTime - _nextFrame) << " frames";
|
||||
qDebug() << this << "injectNextFrame() skipping ahead, fell behind by " << (currentFrameBasedOnElapsedTime - _nextFrame) << " frames";
|
||||
_nextFrame = currentFrameBasedOnElapsedTime;
|
||||
_currentSendOffset = _nextFrame * AudioConstants::NETWORK_FRAME_BYTES_PER_CHANNEL * (_options.stereo ? 2 : 1) % _audioData.size();
|
||||
}
|
||||
|
||||
int64_t playNextFrameAt = ++_nextFrame * AudioConstants::NETWORK_FRAME_USECS;
|
||||
|
||||
return std::max(INT64_C(0), playNextFrameAt - currentTime);
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ private:
|
|||
AbstractAudioInterface* _localAudioInterface { nullptr };
|
||||
AudioInjectorLocalBuffer* _localBuffer { nullptr };
|
||||
|
||||
int _nextFrame { 0 };
|
||||
int64_t _nextFrame { 0 };
|
||||
std::unique_ptr<QElapsedTimer> _frameTimer { nullptr };
|
||||
quint16 _outgoingSequenceNumber { 0 };
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ void AudioInjectorManager::run() {
|
|||
if (!injector.isNull()) {
|
||||
// this is an injector that's ready to go, have it send a frame now
|
||||
auto nextCallDelta = injector->injectNextFrame();
|
||||
|
||||
|
||||
if (nextCallDelta >= 0 && !injector->isFinished()) {
|
||||
// re-enqueue the injector with the correct timing
|
||||
_injectors.emplace(usecTimestampNow() + nextCallDelta, injector);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "render/DrawStatus.h"
|
||||
#include "AmbientOcclusionEffect.h"
|
||||
#include "AntialiasingEffect.h"
|
||||
#include "ToneMappingEffect.h"
|
||||
|
||||
#include "RenderDeferredTask.h"
|
||||
|
||||
|
@ -67,20 +68,6 @@ void RenderDeferred::run(const SceneContextPointer& sceneContext, const RenderCo
|
|||
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) {
|
||||
cullFunctor = cullFunctor ? cullFunctor : [](const RenderArgs*, const AABox&){ return true; };
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
#include "render/DrawTask.h"
|
||||
|
||||
#include "ToneMappingEffect.h"
|
||||
|
||||
class SetupDeferred {
|
||||
public:
|
||||
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
|
||||
|
@ -40,32 +38,6 @@ public:
|
|||
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 {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int numDrawn READ getNumDrawn)
|
||||
|
|
|
@ -145,4 +145,19 @@ void ToneMappingEffect::render(RenderArgs* args) {
|
|||
batch.setResourceTexture(ToneMappingEffect_LightingMapSlot, lightingBuffer);
|
||||
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/Pipeline.h>
|
||||
#include <render/DrawTask.h>
|
||||
|
||||
|
||||
class RenderArgs;
|
||||
|
||||
|
@ -50,7 +52,7 @@ private:
|
|||
float _exposure = 0.0f;
|
||||
float _twoPowExposure = 1.0f;
|
||||
glm::vec2 spareA;
|
||||
int _toneCurve = Filmic;
|
||||
int _toneCurve = Gamma22;
|
||||
glm::vec3 spareB;
|
||||
|
||||
Parameters() {}
|
||||
|
@ -61,4 +63,33 @@ private:
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue