mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:00:44 +02:00
Exposing the AA mode of the AA job
This commit is contained in:
parent
6cd37ef73c
commit
e1e4d9ac6c
3 changed files with 28 additions and 21 deletions
|
@ -139,6 +139,11 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
void AntialiasingConfig::setAAMode(int mode) {
|
||||||
|
_mode = std::min((int)AntialiasingConfig::MODE_COUNT, std::max(0, mode));
|
||||||
|
emit dirty();
|
||||||
|
}
|
||||||
|
|
||||||
Antialiasing::Antialiasing(bool isSharpenEnabled) :
|
Antialiasing::Antialiasing(bool isSharpenEnabled) :
|
||||||
_isSharpenEnabled{ isSharpenEnabled } {
|
_isSharpenEnabled{ isSharpenEnabled } {
|
||||||
}
|
}
|
||||||
|
@ -189,6 +194,8 @@ const gpu::PipelinePointer& Antialiasing::getDebugBlendPipeline() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Antialiasing::configure(const Config& config) {
|
void Antialiasing::configure(const Config& config) {
|
||||||
|
_mode = (AntialiasingConfig::Mode) config.getAAMode();
|
||||||
|
|
||||||
_sharpen = config.sharpen * 0.25f;
|
_sharpen = config.sharpen * 0.25f;
|
||||||
if (!_isSharpenEnabled) {
|
if (!_isSharpenEnabled) {
|
||||||
_sharpen = 0.0f;
|
_sharpen = 0.0f;
|
||||||
|
|
|
@ -88,6 +88,7 @@ private:
|
||||||
|
|
||||||
class AntialiasingConfig : public render::Job::Config {
|
class AntialiasingConfig : public render::Job::Config {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(int mode READ getAAMode WRITE setAAMode NOTIFY dirty)
|
||||||
Q_PROPERTY(float blend MEMBER blend NOTIFY dirty)
|
Q_PROPERTY(float blend MEMBER blend NOTIFY dirty)
|
||||||
Q_PROPERTY(float sharpen MEMBER sharpen NOTIFY dirty)
|
Q_PROPERTY(float sharpen MEMBER sharpen NOTIFY dirty)
|
||||||
Q_PROPERTY(float covarianceGamma MEMBER covarianceGamma NOTIFY dirty)
|
Q_PROPERTY(float covarianceGamma MEMBER covarianceGamma NOTIFY dirty)
|
||||||
|
@ -108,9 +109,21 @@ class AntialiasingConfig : public render::Job::Config {
|
||||||
public:
|
public:
|
||||||
AntialiasingConfig() : render::Job::Config(true) {}
|
AntialiasingConfig() : render::Job::Config(true) {}
|
||||||
|
|
||||||
|
enum Mode {
|
||||||
|
OFF = 0,
|
||||||
|
TAA,
|
||||||
|
FXAA,
|
||||||
|
MODE_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
void setAAMode(int mode);
|
||||||
|
int getAAMode() const { return _mode; }
|
||||||
|
|
||||||
void setDebugFXAA(bool debug) { debugFXAAX = (debug ? 0.0f : 1.0f); emit dirty();}
|
void setDebugFXAA(bool debug) { debugFXAAX = (debug ? 0.0f : 1.0f); emit dirty();}
|
||||||
bool debugFXAA() const { return (debugFXAAX == 0.0f ? true : false); }
|
bool debugFXAA() const { return (debugFXAAX == 0.0f ? true : false); }
|
||||||
|
|
||||||
|
int _mode{ TAA };
|
||||||
|
|
||||||
float blend{ 0.25f };
|
float blend{ 0.25f };
|
||||||
float sharpen{ 0.05f };
|
float sharpen{ 0.05f };
|
||||||
|
|
||||||
|
@ -197,6 +210,7 @@ private:
|
||||||
gpu::PipelinePointer _debugBlendPipeline;
|
gpu::PipelinePointer _debugBlendPipeline;
|
||||||
|
|
||||||
TAAParamsBuffer _params;
|
TAAParamsBuffer _params;
|
||||||
|
AntialiasingConfig::Mode _mode{ AntialiasingConfig::TAA };
|
||||||
float _sharpen{ 0.15f };
|
float _sharpen{ 0.15f };
|
||||||
bool _isSharpenEnabled{ true };
|
bool _isSharpenEnabled{ true };
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,44 +38,29 @@ Column{
|
||||||
|
|
||||||
Prop.PropEnum {
|
Prop.PropEnum {
|
||||||
label: "Deferred AA Method"
|
label: "Deferred AA Method"
|
||||||
|
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||||
|
property: "mode"
|
||||||
enums: [
|
enums: [
|
||||||
"Off",
|
"Off",
|
||||||
"TAA",
|
"TAA",
|
||||||
"FXAA",
|
"FXAA",
|
||||||
]
|
]
|
||||||
|
|
||||||
valueVarSetter: function (mode) { setAAMode(mode) }
|
|
||||||
valueVarGetter: function () { return Render.getConfig("RenderMainView.JitterCam").state +
|
|
||||||
Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff * 2 }
|
|
||||||
|
|
||||||
function setAAMode(mode) {
|
|
||||||
console.log("Deferred AA mode is " + mode)
|
|
||||||
|
|
||||||
if (mode == 0) {
|
|
||||||
Render.getConfig("RenderMainView.JitterCam").state = 0;
|
|
||||||
Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = false;
|
|
||||||
} else if (mode == 1) {
|
|
||||||
Render.getConfig("RenderMainView.JitterCam").state = 1;
|
|
||||||
Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = false;
|
|
||||||
} else {
|
|
||||||
Render.getConfig("RenderMainView.JitterCam").state = 0;
|
|
||||||
Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Separator {}
|
|
||||||
Prop.PropEnum {
|
Prop.PropEnum {
|
||||||
|
id: jitter
|
||||||
label: "Jitter"
|
label: "Jitter"
|
||||||
object: Render.getConfig("RenderMainView.JitterCam")
|
object: Render.getConfig("RenderMainView.JitterCam")
|
||||||
property: "state"
|
property: "state"
|
||||||
|
|
||||||
enums: [
|
enums: [
|
||||||
"Off",
|
"Off",
|
||||||
"On",
|
"On",
|
||||||
"Paused",
|
"Paused",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Separator {}
|
||||||
|
|
||||||
Prop.PropScalar {
|
Prop.PropScalar {
|
||||||
|
visible: (Render.getConfig("RenderMainView.JitterCam").state == 2)
|
||||||
label: "Sample Index"
|
label: "Sample Index"
|
||||||
object: Render.getConfig("RenderMainView.JitterCam")
|
object: Render.getConfig("RenderMainView.JitterCam")
|
||||||
property: "index"
|
property: "index"
|
||||||
|
@ -85,6 +70,7 @@ Column{
|
||||||
integral: true
|
integral: true
|
||||||
}
|
}
|
||||||
Row {
|
Row {
|
||||||
|
visible: (Render.getConfig("RenderMainView.JitterCam").state == 2)
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
HifiControls.Button {
|
HifiControls.Button {
|
||||||
|
|
Loading…
Reference in a new issue