mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
New stuff for better rendering f ui
This commit is contained in:
parent
259ec3ec11
commit
b243475cc9
7 changed files with 80 additions and 29 deletions
|
@ -255,6 +255,7 @@ void Web3DOverlay::loadSourceURL() {
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("InputConfiguration", DependencyManager::get<InputConfiguration>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("InputConfiguration", DependencyManager::get<InputConfiguration>().data());
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("SoundCache", DependencyManager::get<SoundCache>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("SoundCache", DependencyManager::get<SoundCache>().data());
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance());
|
_webSurface->getSurfaceContext()->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance());
|
||||||
|
_webSurface->getSurfaceContext()->setContextProperty("Render", AbstractViewStateInterface::instance()->getRenderEngine()->getConfiguration().get());
|
||||||
|
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("pathToFonts", "../../");
|
_webSurface->getSurfaceContext()->setContextProperty("pathToFonts", "../../");
|
||||||
|
|
||||||
|
|
|
@ -389,6 +389,32 @@ void JitterSampleConfig::setIndex(int current) {
|
||||||
emit dirty();
|
emit dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int JitterSampleConfig::cycleStopPauseRun() {
|
||||||
|
_state = (_state + 1) % 3;
|
||||||
|
switch (_state) {
|
||||||
|
case 0: {
|
||||||
|
stop = true;
|
||||||
|
freeze = false;
|
||||||
|
setIndex(-1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1: {
|
||||||
|
stop = false;
|
||||||
|
freeze = true;
|
||||||
|
setIndex(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
default: {
|
||||||
|
stop = false;
|
||||||
|
freeze = false;
|
||||||
|
setIndex(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _state;
|
||||||
|
}
|
||||||
|
|
||||||
int JitterSampleConfig::pause() {
|
int JitterSampleConfig::pause() {
|
||||||
freeze = true;
|
freeze = true;
|
||||||
emit dirty();
|
emit dirty();
|
||||||
|
@ -447,7 +473,7 @@ JitterSample::SampleSequence::SampleSequence(){
|
||||||
|
|
||||||
void JitterSample::configure(const Config& config) {
|
void JitterSample::configure(const Config& config) {
|
||||||
_freeze = config.freeze;
|
_freeze = config.freeze;
|
||||||
if (_freeze) {
|
if (config.stop || _freeze) {
|
||||||
auto pausedIndex = config.getIndex();
|
auto pausedIndex = config.getIndex();
|
||||||
if (_jitterBuffer->currentIndex != pausedIndex) {
|
if (_jitterBuffer->currentIndex != pausedIndex) {
|
||||||
_jitterBuffer.edit().currentIndex = pausedIndex;
|
_jitterBuffer.edit().currentIndex = pausedIndex;
|
||||||
|
|
|
@ -23,27 +23,31 @@ class JitterSampleConfig : public render::Job::Config {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(float scale MEMBER scale NOTIFY dirty)
|
Q_PROPERTY(float scale MEMBER scale NOTIFY dirty)
|
||||||
Q_PROPERTY(bool freeze MEMBER freeze NOTIFY dirty)
|
Q_PROPERTY(bool freeze MEMBER freeze NOTIFY dirty)
|
||||||
|
Q_PROPERTY(bool stop MEMBER stop NOTIFY dirty)
|
||||||
Q_PROPERTY(int index READ getIndex NOTIFY dirty)
|
Q_PROPERTY(int index READ getIndex NOTIFY dirty)
|
||||||
public:
|
public:
|
||||||
JitterSampleConfig() : render::Job::Config(true) {}
|
JitterSampleConfig() : render::Job::Config(true) {}
|
||||||
|
|
||||||
float scale{ 0.5f };
|
float scale{ 0.5f };
|
||||||
|
bool stop{ false };
|
||||||
bool freeze{ false };
|
bool freeze{ false };
|
||||||
|
|
||||||
void setIndex(int current);
|
void setIndex(int current);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
int cycleStopPauseRun();
|
||||||
int pause();
|
int pause();
|
||||||
int prev();
|
int prev();
|
||||||
int next();
|
int next();
|
||||||
int play();
|
int play();
|
||||||
|
|
||||||
int getIndex() const { return _index; }
|
int getIndex() const { return _index; }
|
||||||
|
int getState() const { return _state; }
|
||||||
signals:
|
signals:
|
||||||
void dirty();
|
void dirty();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int _state{ 0 };
|
||||||
int _index{ 0 };
|
int _index{ 0 };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,5 +49,5 @@ void main() {
|
||||||
nextColor = taa_temporalReprojection(sourceColor, historyColor, fragUV, fragVel, nearFragUV.z, fragJitterPix);
|
nextColor = taa_temporalReprojection(sourceColor, historyColor, fragUV, fragVel, nearFragUV.z, fragJitterPix);
|
||||||
}
|
}
|
||||||
|
|
||||||
outFragColor = vec4(nextColor, 1.0);
|
outFragColor = vec4(taa_resolveColor(nextColor), 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,7 +273,7 @@ vec3 taa_temporalReprojection(vec3 sourceColor, vec3 historyColor, vec2 fragUV,
|
||||||
// output
|
// output
|
||||||
vec3 nextColor = mix(texel1, texel0, k_feedback).xyz;
|
vec3 nextColor = mix(texel1, texel0, k_feedback).xyz;
|
||||||
|
|
||||||
return taa_resolveColor(nextColor);
|
return nextColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
<$declareColorWheel()$>
|
<$declareColorWheel()$>
|
||||||
|
|
Binary file not shown.
|
@ -13,7 +13,7 @@ import QtQuick.Controls 1.4
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
import "../lib/styles-uit"
|
import "../lib/styles-uit"
|
||||||
//import "../../controls-uit" as HifiControls
|
import "../lib/controls-uit" as HifiControls
|
||||||
|
|
||||||
|
|
||||||
import "configSlider"
|
import "configSlider"
|
||||||
|
@ -32,7 +32,7 @@ Rectangle {
|
||||||
Column{
|
Column{
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
ConfigSlider {
|
HifiControls.ConfigSlider {
|
||||||
label: qsTr("Source blend")
|
label: qsTr("Source blend")
|
||||||
integral: false
|
integral: false
|
||||||
config: Render.getConfig("RenderMainView.Antialiasing")
|
config: Render.getConfig("RenderMainView.Antialiasing")
|
||||||
|
@ -48,45 +48,68 @@ Rectangle {
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
}
|
}
|
||||||
|
Separator {}
|
||||||
Row {
|
Row {
|
||||||
spacing: 10
|
spacing: 10
|
||||||
CheckBox {
|
|
||||||
text: "Unjitter"
|
HifiControls.Button {
|
||||||
checked: Render.getConfig("RenderMainView.Antialiasing")["unjitter"]
|
text: {
|
||||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["unjitter"] = checked }
|
var state = 2 - (Render.getConfig("RenderMainView.JitterCam").freeze * 1 - Render.getConfig("RenderMainView.JitterCam").stop * 2);
|
||||||
|
if (state === 2) {
|
||||||
|
return ">>"
|
||||||
|
} else if (state === 1) {
|
||||||
|
return "|" + Render.getConfig("RenderMainView.JitterCam").index + "|"
|
||||||
|
} else {
|
||||||
|
return "[]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onClicked: { Render.getConfig("RenderMainView.JitterCam").cycleStopPauseRun(); }
|
||||||
}
|
}
|
||||||
CheckBox {
|
HifiControls.Button {
|
||||||
text: "Freeze "
|
|
||||||
checked: Render.getConfig("RenderMainView.JitterCam")["freeze"]
|
|
||||||
onCheckedChanged: { Render.getConfig("RenderMainView.JitterCam")["freeze"] = checked }
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
text: Render.getConfig("RenderMainView.JitterCam").index
|
|
||||||
}
|
|
||||||
Button {
|
|
||||||
text: "<"
|
text: "<"
|
||||||
onClicked: { Render.getConfig("RenderMainView.JitterCam").prev(); }
|
onClicked: { Render.getConfig("RenderMainView.JitterCam").prev(); }
|
||||||
}
|
}
|
||||||
Button {
|
HifiControls.Button {
|
||||||
text: ">"
|
text: ">"
|
||||||
onClicked: { Render.getConfig("RenderMainView.JitterCam").next(); }
|
onClicked: { Render.getConfig("RenderMainView.JitterCam").next(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row {
|
Row {
|
||||||
spacing: 10
|
spacing: 10
|
||||||
CheckBox {
|
HifiControls.CheckBox {
|
||||||
|
boxSize: 20
|
||||||
|
text: "Unjitter"
|
||||||
|
checked: Render.getConfig("RenderMainView.Antialiasing")["unjitter"]
|
||||||
|
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["unjitter"] = checked }
|
||||||
|
}
|
||||||
|
HifiControls.CheckBox {
|
||||||
|
boxSize: 20
|
||||||
|
text: "Show Sequence"
|
||||||
|
checked: Render.getConfig("RenderMainView.Antialiasing")["showJitterSequence"]
|
||||||
|
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showJitterSequence"] = checked }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Separator {}
|
||||||
|
Row {
|
||||||
|
spacing: 10
|
||||||
|
HifiControls.CheckBox {
|
||||||
|
boxSize: 20
|
||||||
text: "Constrain color"
|
text: "Constrain color"
|
||||||
checked: Render.getConfig("RenderMainView.Antialiasing")["constrainColor"]
|
checked: Render.getConfig("RenderMainView.Antialiasing")["constrainColor"]
|
||||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] = checked }
|
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] = checked }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row {
|
Row {
|
||||||
CheckBox {
|
|
||||||
|
spacing: 10
|
||||||
|
HifiControls.CheckBox {
|
||||||
|
boxSize: 20
|
||||||
text: "Debug"
|
text: "Debug"
|
||||||
checked: Render.getConfig("RenderMainView.Antialiasing")["debug"]
|
checked: Render.getConfig("RenderMainView.Antialiasing")["debug"]
|
||||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["debug"] = checked }
|
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["debug"] = checked }
|
||||||
}
|
}
|
||||||
CheckBox {
|
HifiControls.CheckBox {
|
||||||
|
boxSize: 20
|
||||||
text: "Show Debug Cursor"
|
text: "Show Debug Cursor"
|
||||||
checked: Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"]
|
checked: Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"]
|
||||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"] = checked }
|
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"] = checked }
|
||||||
|
@ -109,12 +132,9 @@ Rectangle {
|
||||||
min: 0.0
|
min: 0.0
|
||||||
}
|
}
|
||||||
Row {
|
Row {
|
||||||
CheckBox {
|
|
||||||
text: "Jitter Sequence"
|
HifiControls.CheckBox {
|
||||||
checked: Render.getConfig("RenderMainView.Antialiasing")["showJitterSequence"]
|
boxSize: 20
|
||||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showJitterSequence"] = checked }
|
|
||||||
}
|
|
||||||
CheckBox {
|
|
||||||
text: "Closest Fragment"
|
text: "Closest Fragment"
|
||||||
checked: Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"]
|
checked: Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"]
|
||||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"] = checked }
|
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"] = checked }
|
||||||
|
|
Loading…
Reference in a new issue