mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 09:48:44 +02:00
bloom ui
This commit is contained in:
parent
3ace52629c
commit
aeb407698d
3 changed files with 20 additions and 7 deletions
|
@ -187,12 +187,17 @@ void BloomDraw::run(const render::RenderContextPointer& renderContext, const Inp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebugBloomConfig::setMode(int mode) {
|
||||||
|
_mode = std::min((int)DebugBloomConfig::MODE_COUNT, std::max(0, mode));
|
||||||
|
emit dirty();
|
||||||
|
}
|
||||||
|
|
||||||
DebugBloom::DebugBloom() {
|
DebugBloom::DebugBloom() {
|
||||||
_params = std::make_shared<gpu::Buffer>(sizeof(glm::vec4), nullptr);
|
_params = std::make_shared<gpu::Buffer>(sizeof(glm::vec4), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugBloom::configure(const Config& config) {
|
void DebugBloom::configure(const Config& config) {
|
||||||
_mode = static_cast<DebugBloomConfig::Mode>(config.mode);
|
_mode = (DebugBloomConfig::Mode) config.getMode();
|
||||||
assert(_mode < DebugBloomConfig::MODE_COUNT);
|
assert(_mode < DebugBloomConfig::MODE_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,6 +206,10 @@ void DebugBloom::run(const render::RenderContextPointer& renderContext, const In
|
||||||
assert(renderContext->args->hasViewFrustum());
|
assert(renderContext->args->hasViewFrustum());
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
|
|
||||||
|
if (_mode == DebugBloomConfig::OFF) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto frameBuffer = inputs.get0();
|
const auto frameBuffer = inputs.get0();
|
||||||
const auto combinedBlurBuffer = inputs.get4();
|
const auto combinedBlurBuffer = inputs.get4();
|
||||||
const auto framebufferSize = frameBuffer->getSize();
|
const auto framebufferSize = frameBuffer->getSize();
|
||||||
|
|
|
@ -87,12 +87,13 @@ private:
|
||||||
|
|
||||||
class DebugBloomConfig : public render::Job::Config {
|
class DebugBloomConfig : public render::Job::Config {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(int mode MEMBER mode NOTIFY dirty)
|
Q_PROPERTY(int mode READ getMode WRITE setMode NOTIFY dirty)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum Mode {
|
enum Mode {
|
||||||
MODE_LEVEL0 = 0,
|
OFF = 0,
|
||||||
|
MODE_LEVEL0,
|
||||||
MODE_LEVEL1,
|
MODE_LEVEL1,
|
||||||
MODE_LEVEL2,
|
MODE_LEVEL2,
|
||||||
MODE_ALL_LEVELS,
|
MODE_ALL_LEVELS,
|
||||||
|
@ -102,7 +103,10 @@ public:
|
||||||
|
|
||||||
DebugBloomConfig() : render::Job::Config(false) {}
|
DebugBloomConfig() : render::Job::Config(false) {}
|
||||||
|
|
||||||
int mode{ MODE_ALL_LEVELS };
|
void setMode(int mode);
|
||||||
|
int getMode() const { return _mode; }
|
||||||
|
|
||||||
|
int _mode{ MODE_ALL_LEVELS };
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dirty();
|
void dirty();
|
||||||
|
|
|
@ -19,15 +19,15 @@ Column {
|
||||||
property var config: Render.getConfig("RenderMainView.DebugBloom")
|
property var config: Render.getConfig("RenderMainView.DebugBloom")
|
||||||
|
|
||||||
function setDebugMode(mode) {
|
function setDebugMode(mode) {
|
||||||
|
console.log("Bloom mode is " + mode)
|
||||||
bloom.config.enabled = (mode != 0);
|
bloom.config.enabled = (mode != 0);
|
||||||
bloom.config.mode = mode;
|
bloom.config.mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Prop.PropEnum {
|
Prop.PropEnum {
|
||||||
label: "Debug Bloom Buffer"
|
label: "Debug Bloom Buffer"
|
||||||
object: config
|
// object: config
|
||||||
property: "mode"
|
// property: "mode"
|
||||||
// valueVar: 0
|
|
||||||
enums: [
|
enums: [
|
||||||
"Off",
|
"Off",
|
||||||
"Lvl 0",
|
"Lvl 0",
|
||||||
|
|
Loading…
Reference in a new issue