mirror of
https://github.com/lubosz/overte.git
synced 2025-04-11 06:32:09 +02:00
Adding a toggle button to the developer/Render menu to be able to disable taa and fall back to Fxaa
This commit is contained in:
parent
808fb5a5d9
commit
21e069c90c
4 changed files with 38 additions and 12 deletions
|
@ -47,6 +47,7 @@
|
|||
|
||||
#include "AmbientOcclusionEffect.h"
|
||||
#include "RenderShadowTask.h"
|
||||
#include "AntialiasingEffect.h"
|
||||
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||
#include "SpeechRecognizer.h"
|
||||
|
@ -380,6 +381,25 @@ Menu::Menu() {
|
|||
|
||||
// Developer > Render >>>
|
||||
MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
|
||||
|
||||
action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AntiAliasing, 0, true);
|
||||
connect(action, &QAction::triggered, [action] {
|
||||
auto renderConfig = qApp->getRenderEngine()->getConfiguration();
|
||||
if (renderConfig) {
|
||||
auto mainViewJitterCamConfig = renderConfig->getConfig<JitterSample>("RenderMainView.JitterCam");
|
||||
auto mainViewAntialiasingConfig = renderConfig->getConfig<Antialiasing>("RenderMainView.Antialiasing");
|
||||
if (mainViewJitterCamConfig && mainViewAntialiasingConfig) {
|
||||
if (action->isChecked()) {
|
||||
mainViewJitterCamConfig->play();
|
||||
mainViewAntialiasingConfig->debugFXAAX = 1.0;
|
||||
} else {
|
||||
mainViewJitterCamConfig->none();
|
||||
mainViewAntialiasingConfig->debugFXAAX = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Shadows, 0, true);
|
||||
connect(action, &QAction::triggered, [action] {
|
||||
auto renderConfig = qApp->getRenderEngine()->getConfiguration();
|
||||
|
|
|
@ -210,6 +210,7 @@ namespace MenuOption {
|
|||
const QString DesktopTabletToToolbar = "Desktop Tablet Becomes Toolbar";
|
||||
const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar";
|
||||
const QString Shadows = "Shadows";
|
||||
const QString AntiAliasing = "Temporal Antialiasing (FXAA if disabled)";
|
||||
const QString AmbientOcclusion = "Ambient Occlusion";
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
};
|
||||
|
||||
using Config = JitterSampleConfig;
|
||||
using Output = glm::vec2;
|
||||
using Output = glm::vec2;
|
||||
using JobModel = render::Job::ModelO<JitterSample, Output, Config>;
|
||||
|
||||
void configure(const Config& config);
|
||||
|
@ -95,7 +95,7 @@ class AntialiasingConfig : public render::Job::Config {
|
|||
|
||||
Q_PROPERTY(bool debug MEMBER debug NOTIFY dirty)
|
||||
Q_PROPERTY(float debugX MEMBER debugX NOTIFY dirty)
|
||||
Q_PROPERTY(float debugFXAAX MEMBER debugFXAAX NOTIFY dirty)
|
||||
Q_PROPERTY(bool fxaaOnOff READ debugFXAA WRITE setDebugFXAA NOTIFY dirty)
|
||||
Q_PROPERTY(float debugShowVelocityThreshold MEMBER debugShowVelocityThreshold NOTIFY dirty)
|
||||
Q_PROPERTY(bool showCursorPixel MEMBER showCursorPixel NOTIFY dirty)
|
||||
Q_PROPERTY(glm::vec2 debugCursorTexcoord MEMBER debugCursorTexcoord NOTIFY dirty)
|
||||
|
@ -106,6 +106,10 @@ class AntialiasingConfig : public render::Job::Config {
|
|||
public:
|
||||
AntialiasingConfig() : render::Job::Config(true) {}
|
||||
|
||||
void setDebugFXAA(bool debug) { debugFXAAX = (debug ? 0.0f : 1.0f); emit dirty();}
|
||||
bool debugFXAA() const { return (debugFXAAX == 0.0f ? true : false); }
|
||||
|
||||
|
||||
float blend{ 0.25f };
|
||||
float sharpen{ 0.05f };
|
||||
|
||||
|
|
|
@ -38,21 +38,22 @@ Rectangle {
|
|||
id: fxaaOnOff
|
||||
property bool debugFXAA: false
|
||||
HifiControls.Button {
|
||||
text: {
|
||||
if (fxaaOnOff.debugFXAA) {
|
||||
return "FXAA"
|
||||
} else {
|
||||
return "TAA"
|
||||
}
|
||||
function getTheText() {
|
||||
if (Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff) {
|
||||
return "FXAA"
|
||||
} else {
|
||||
return "TAA"
|
||||
}
|
||||
}
|
||||
text: getTheText()
|
||||
onClicked: {
|
||||
fxaaOnOff.debugFXAA = !fxaaOnOff.debugFXAA
|
||||
if (fxaaOnOff.debugFXAA) {
|
||||
var onOff = !Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff;
|
||||
if (onOff) {
|
||||
Render.getConfig("RenderMainView.JitterCam").none();
|
||||
Render.getConfig("RenderMainView.Antialiasing").debugFXAAX = 0;
|
||||
Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = true;
|
||||
} else {
|
||||
Render.getConfig("RenderMainView.JitterCam").play();
|
||||
Render.getConfig("RenderMainView.Antialiasing").debugFXAAX = 1.0;
|
||||
Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue