mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 02:14:26 +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
|
||||
|
||||
void AntialiasingConfig::setAAMode(int mode) {
|
||||
_mode = std::min((int)AntialiasingConfig::MODE_COUNT, std::max(0, mode));
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
Antialiasing::Antialiasing(bool isSharpenEnabled) :
|
||||
_isSharpenEnabled{ isSharpenEnabled } {
|
||||
}
|
||||
|
@ -189,6 +194,8 @@ const gpu::PipelinePointer& Antialiasing::getDebugBlendPipeline() {
|
|||
}
|
||||
|
||||
void Antialiasing::configure(const Config& config) {
|
||||
_mode = (AntialiasingConfig::Mode) config.getAAMode();
|
||||
|
||||
_sharpen = config.sharpen * 0.25f;
|
||||
if (!_isSharpenEnabled) {
|
||||
_sharpen = 0.0f;
|
||||
|
|
|
@ -88,6 +88,7 @@ private:
|
|||
|
||||
class AntialiasingConfig : public render::Job::Config {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int mode READ getAAMode WRITE setAAMode NOTIFY dirty)
|
||||
Q_PROPERTY(float blend MEMBER blend NOTIFY dirty)
|
||||
Q_PROPERTY(float sharpen MEMBER sharpen NOTIFY dirty)
|
||||
Q_PROPERTY(float covarianceGamma MEMBER covarianceGamma NOTIFY dirty)
|
||||
|
@ -108,9 +109,21 @@ class AntialiasingConfig : public render::Job::Config {
|
|||
public:
|
||||
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();}
|
||||
bool debugFXAA() const { return (debugFXAAX == 0.0f ? true : false); }
|
||||
|
||||
int _mode{ TAA };
|
||||
|
||||
float blend{ 0.25f };
|
||||
float sharpen{ 0.05f };
|
||||
|
||||
|
@ -197,6 +210,7 @@ private:
|
|||
gpu::PipelinePointer _debugBlendPipeline;
|
||||
|
||||
TAAParamsBuffer _params;
|
||||
AntialiasingConfig::Mode _mode{ AntialiasingConfig::TAA };
|
||||
float _sharpen{ 0.15f };
|
||||
bool _isSharpenEnabled{ true };
|
||||
};
|
||||
|
|
|
@ -38,44 +38,29 @@ Column{
|
|||
|
||||
Prop.PropEnum {
|
||||
label: "Deferred AA Method"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "mode"
|
||||
enums: [
|
||||
"Off",
|
||||
"TAA",
|
||||
"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 {
|
||||
id: jitter
|
||||
label: "Jitter"
|
||||
object: Render.getConfig("RenderMainView.JitterCam")
|
||||
property: "state"
|
||||
|
||||
enums: [
|
||||
"Off",
|
||||
"On",
|
||||
"Paused",
|
||||
]
|
||||
}
|
||||
Separator {}
|
||||
|
||||
Prop.PropScalar {
|
||||
visible: (Render.getConfig("RenderMainView.JitterCam").state == 2)
|
||||
label: "Sample Index"
|
||||
object: Render.getConfig("RenderMainView.JitterCam")
|
||||
property: "index"
|
||||
|
@ -85,6 +70,7 @@ Column{
|
|||
integral: true
|
||||
}
|
||||
Row {
|
||||
visible: (Render.getConfig("RenderMainView.JitterCam").state == 2)
|
||||
spacing: 10
|
||||
|
||||
HifiControls.Button {
|
||||
|
|
Loading…
Reference in a new issue