3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 07:15:30 +02:00

New stuff for better rendering f ui

This commit is contained in:
samcake 2017-09-01 15:32:23 -07:00
parent 259ec3ec11
commit b243475cc9
7 changed files with 80 additions and 29 deletions
interface/src/ui/overlays
libraries/render-utils/src
scripts/developer/utilities

View file

@ -255,6 +255,7 @@ void Web3DOverlay::loadSourceURL() {
_webSurface->getSurfaceContext()->setContextProperty("InputConfiguration", DependencyManager::get<InputConfiguration>().data());
_webSurface->getSurfaceContext()->setContextProperty("SoundCache", DependencyManager::get<SoundCache>().data());
_webSurface->getSurfaceContext()->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance());
_webSurface->getSurfaceContext()->setContextProperty("Render", AbstractViewStateInterface::instance()->getRenderEngine()->getConfiguration().get());
_webSurface->getSurfaceContext()->setContextProperty("pathToFonts", "../../");

View file

@ -389,6 +389,32 @@ void JitterSampleConfig::setIndex(int current) {
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() {
freeze = true;
emit dirty();
@ -447,7 +473,7 @@ JitterSample::SampleSequence::SampleSequence(){
void JitterSample::configure(const Config& config) {
_freeze = config.freeze;
if (_freeze) {
if (config.stop || _freeze) {
auto pausedIndex = config.getIndex();
if (_jitterBuffer->currentIndex != pausedIndex) {
_jitterBuffer.edit().currentIndex = pausedIndex;

View file

@ -23,27 +23,31 @@ class JitterSampleConfig : public render::Job::Config {
Q_OBJECT
Q_PROPERTY(float scale MEMBER scale 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)
public:
JitterSampleConfig() : render::Job::Config(true) {}
float scale{ 0.5f };
bool stop{ false };
bool freeze{ false };
void setIndex(int current);
public slots:
int cycleStopPauseRun();
int pause();
int prev();
int next();
int play();
int getIndex() const { return _index; }
int getState() const { return _state; }
signals:
void dirty();
private:
int _state{ 0 };
int _index{ 0 };
};

View file

@ -49,5 +49,5 @@ void main() {
nextColor = taa_temporalReprojection(sourceColor, historyColor, fragUV, fragVel, nearFragUV.z, fragJitterPix);
}
outFragColor = vec4(nextColor, 1.0);
outFragColor = vec4(taa_resolveColor(nextColor), 1.0);
}

View file

@ -273,7 +273,7 @@ vec3 taa_temporalReprojection(vec3 sourceColor, vec3 historyColor, vec2 fragUV,
// output
vec3 nextColor = mix(texel1, texel0, k_feedback).xyz;
return taa_resolveColor(nextColor);
return nextColor;
}
<$declareColorWheel()$>

View file

@ -13,7 +13,7 @@ import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import "../lib/styles-uit"
//import "../../controls-uit" as HifiControls
import "../lib/controls-uit" as HifiControls
import "configSlider"
@ -32,7 +32,7 @@ Rectangle {
Column{
spacing: 10
ConfigSlider {
HifiControls.ConfigSlider {
label: qsTr("Source blend")
integral: false
config: Render.getConfig("RenderMainView.Antialiasing")
@ -48,45 +48,68 @@ Rectangle {
max: 1.0
min: 0.0
}
Separator {}
Row {
spacing: 10
CheckBox {
text: "Unjitter"
checked: Render.getConfig("RenderMainView.Antialiasing")["unjitter"]
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["unjitter"] = checked }
HifiControls.Button {
text: {
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 {
text: "Freeze "
checked: Render.getConfig("RenderMainView.JitterCam")["freeze"]
onCheckedChanged: { Render.getConfig("RenderMainView.JitterCam")["freeze"] = checked }
}
Text {
text: Render.getConfig("RenderMainView.JitterCam").index
}
Button {
HifiControls.Button {
text: "<"
onClicked: { Render.getConfig("RenderMainView.JitterCam").prev(); }
}
Button {
HifiControls.Button {
text: ">"
onClicked: { Render.getConfig("RenderMainView.JitterCam").next(); }
}
}
Row {
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"
checked: Render.getConfig("RenderMainView.Antialiasing")["constrainColor"]
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] = checked }
}
}
Row {
CheckBox {
spacing: 10
HifiControls.CheckBox {
boxSize: 20
text: "Debug"
checked: Render.getConfig("RenderMainView.Antialiasing")["debug"]
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["debug"] = checked }
}
CheckBox {
HifiControls.CheckBox {
boxSize: 20
text: "Show Debug Cursor"
checked: Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"]
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"] = checked }
@ -109,12 +132,9 @@ Rectangle {
min: 0.0
}
Row {
CheckBox {
text: "Jitter Sequence"
checked: Render.getConfig("RenderMainView.Antialiasing")["showJitterSequence"]
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showJitterSequence"] = checked }
}
CheckBox {
HifiControls.CheckBox {
boxSize: 20
text: "Closest Fragment"
checked: Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"]
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"] = checked }