diff --git a/libraries/render-utils/src/AntialiasingEffect.cpp b/libraries/render-utils/src/AntialiasingEffect.cpp index 180e914d60..c9da8373db 100644 --- a/libraries/render-utils/src/AntialiasingEffect.cpp +++ b/libraries/render-utils/src/AntialiasingEffect.cpp @@ -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; @@ -298,29 +305,33 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const }); } - void JitterSampleConfig::setIndex(int current) { _index = (current) % JitterSample::SEQUENCE_LENGTH; emit dirty(); } -int JitterSampleConfig::cycleStopPauseRun() { - _state = (_state + 1) % 3; +void JitterSampleConfig::setState(int state) { + _state = (state) % 3; switch (_state) { - case 0: { - return none(); - break; - } - case 1: { - return pause(); - break; - } - case 2: - default: { - return play(); - break; - } + case 0: { + none(); + break; } + case 1: { + pause(); + break; + } + case 2: + default: { + play(); + break; + } + } + emit dirty(); +} + +int JitterSampleConfig::cycleStopPauseRun() { + setState((_state + 1) % 3); return _state; } diff --git a/libraries/render-utils/src/AntialiasingEffect.h b/libraries/render-utils/src/AntialiasingEffect.h index 7d8bbb44d9..fc25343751 100644 --- a/libraries/render-utils/src/AntialiasingEffect.h +++ b/libraries/render-utils/src/AntialiasingEffect.h @@ -25,6 +25,7 @@ class JitterSampleConfig : public render::Job::Config { Q_PROPERTY(bool freeze MEMBER freeze NOTIFY dirty) Q_PROPERTY(bool stop MEMBER stop NOTIFY dirty) Q_PROPERTY(int index READ getIndex NOTIFY dirty) + Q_PROPERTY(int state READ getState WRITE setState NOTIFY dirty) public: JitterSampleConfig() : render::Job::Config(true) {} @@ -33,6 +34,7 @@ public: bool freeze{ false }; void setIndex(int current); + void setState(int state); public slots: int cycleStopPauseRun(); @@ -86,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) @@ -106,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 }; @@ -195,6 +210,7 @@ private: gpu::PipelinePointer _debugBlendPipeline; TAAParamsBuffer _params; + AntialiasingConfig::Mode _mode{ AntialiasingConfig::TAA }; float _sharpen{ 0.15f }; bool _isSharpenEnabled{ true }; }; diff --git a/libraries/render-utils/src/BloomEffect.cpp b/libraries/render-utils/src/BloomEffect.cpp index e58d07ac33..0c499a9d34 100644 --- a/libraries/render-utils/src/BloomEffect.cpp +++ b/libraries/render-utils/src/BloomEffect.cpp @@ -35,12 +35,13 @@ void BloomThreshold::run(const render::RenderContextPointer& renderContext, cons const auto frameTransform = inputs.get0(); const auto inputFrameBuffer = inputs.get1(); const auto bloomFrame = inputs.get2(); + const auto lightingModel = inputs.get3(); const auto& bloomStage = renderContext->_scene->getStage(); graphics::BloomPointer bloom; if (bloomStage && bloomFrame->_blooms.size()) { bloom = bloomStage->getBloom(bloomFrame->_blooms.front()); } - if (!bloom) { + if (!bloom || (lightingModel && !lightingModel->isBloomEnabled())) { renderContext->taskFlow.abortTask(); return; } @@ -187,12 +188,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() { _params = std::make_shared(sizeof(glm::vec4), nullptr); } void DebugBloom::configure(const Config& config) { - _mode = static_cast(config.mode); + _mode = (DebugBloomConfig::Mode) config.getMode(); assert(_mode < DebugBloomConfig::MODE_COUNT); } @@ -201,6 +207,10 @@ void DebugBloom::run(const render::RenderContextPointer& renderContext, const In assert(renderContext->args->hasViewFrustum()); RenderArgs* args = renderContext->args; + if (_mode == DebugBloomConfig::OFF) { + return; + } + const auto frameBuffer = inputs.get0(); const auto combinedBlurBuffer = inputs.get4(); const auto framebufferSize = frameBuffer->getSize(); diff --git a/libraries/render-utils/src/BloomEffect.h b/libraries/render-utils/src/BloomEffect.h index 07ae2887c9..47558affd9 100644 --- a/libraries/render-utils/src/BloomEffect.h +++ b/libraries/render-utils/src/BloomEffect.h @@ -17,6 +17,7 @@ #include "BloomStage.h" #include "DeferredFrameTransform.h" +#include "LightingModel.h" class BloomConfig : public render::Task::Config { Q_OBJECT @@ -28,7 +29,7 @@ class BloomThresholdConfig : public render::Job::Config { class BloomThreshold { public: - using Inputs = render::VaryingSet3; + using Inputs = render::VaryingSet4; using Outputs = render::VaryingSet3; using Config = BloomThresholdConfig; using JobModel = render::Job::ModelIO; @@ -87,12 +88,13 @@ private: class DebugBloomConfig : public render::Job::Config { Q_OBJECT - Q_PROPERTY(int mode MEMBER mode NOTIFY dirty) + Q_PROPERTY(int mode READ getMode WRITE setMode NOTIFY dirty) public: enum Mode { - MODE_LEVEL0 = 0, + OFF = 0, + MODE_LEVEL0, MODE_LEVEL1, MODE_LEVEL2, MODE_ALL_LEVELS, @@ -102,7 +104,10 @@ public: 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: void dirty(); @@ -127,14 +132,14 @@ private: class BloomEffect { public: - using Inputs = render::VaryingSet3; + using Inputs = render::VaryingSet4; using Config = BloomConfig; - using JobModel = render::Task::ModelI; + using JobModel = render::Task::ModelI; - BloomEffect(); + BloomEffect(); - void configure(const Config& config); - void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs); + void configure(const Config& config); + void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs); }; diff --git a/libraries/render-utils/src/RenderDeferredTask.cpp b/libraries/render-utils/src/RenderDeferredTask.cpp index 4561cf903d..c506f22bc7 100644 --- a/libraries/render-utils/src/RenderDeferredTask.cpp +++ b/libraries/render-utils/src/RenderDeferredTask.cpp @@ -150,8 +150,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren // Prepare deferred, generate the shared Deferred Frame Transform. Only valid with the scaled frame buffer const auto deferredFrameTransform = task.addJob("DeferredFrameTransform", jitter); - const auto opaqueRangeTimer = task.addJob("BeginOpaqueRangeTimer", "DrawOpaques"); - const auto prepareDeferredInputs = PrepareDeferred::Inputs(scaledPrimaryFramebuffer, lightingModel).asVarying(); const auto prepareDeferredOutputs = task.addJob("PrepareDeferred", prepareDeferredInputs); const auto deferredFramebuffer = prepareDeferredOutputs.getN(0); @@ -164,8 +162,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren const auto opaqueInputs = DrawStateSortDeferred::Inputs(opaques, lightingModel, jitter).asVarying(); task.addJob("DrawOpaqueDeferred", opaqueInputs, shapePlumber); - task.addJob("OpaqueRangeTimer", opaqueRangeTimer); - // Opaque all rendered // Linear Depth Pass @@ -216,13 +212,10 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren const auto transparentsInputs = RenderTransparentDeferred::Inputs(transparents, hazeFrame, lightFrame, lightingModel, lightClusters, shadowFrame, jitter).asVarying(); task.addJob("DrawTransparentDeferred", transparentsInputs, shapePlumber); - const auto outlineRangeTimer = task.addJob("BeginHighlightRangeTimer", "Highlight"); - + // Highlight const auto outlineInputs = DrawHighlightTask::Inputs(items, deferredFramebuffer, lightingFramebuffer, deferredFrameTransform, jitter).asVarying(); task.addJob("DrawHighlight", outlineInputs); - task.addJob("HighlightRangeTimer", outlineRangeTimer); - // Layered Over (in front) const auto inFrontOpaquesInputs = DrawLayered3D::Inputs(inFrontOpaque, lightingModel, hazeFrame, jitter).asVarying(); const auto inFrontTransparentsInputs = DrawLayered3D::Inputs(inFrontTransparent, lightingModel, hazeFrame, jitter).asVarying(); @@ -234,7 +227,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren task.addJob("Antialiasing", antialiasingInputs); // Add bloom - const auto bloomInputs = BloomEffect::Inputs(deferredFrameTransform, lightingFramebuffer, bloomFrame).asVarying(); + const auto bloomInputs = BloomEffect::Inputs(deferredFrameTransform, lightingFramebuffer, bloomFrame, lightingModel).asVarying(); task.addJob("Bloom", bloomInputs); const auto destFramebuffer = static_cast(nullptr); diff --git a/scripts/developer/utilities/render/bloom.qml b/scripts/developer/utilities/render/bloom.qml deleted file mode 100644 index 705a9826d6..0000000000 --- a/scripts/developer/utilities/render/bloom.qml +++ /dev/null @@ -1,83 +0,0 @@ -// -// bloom.qml -// developer/utilities/render -// -// Olivier Prat, created on 09/25/2017. -// Copyright 2017 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html -// -import QtQuick 2.5 -import QtQuick.Controls 1.4 -import "configSlider" - -Item { - id: root - property var configDebug: Render.getConfig("RenderMainView.DebugBloom") - - Column { - spacing: 8 - - GroupBox { - title: "Debug" - Row { - ExclusiveGroup { id: debugGroup } - RadioButton { - text : "Off" - checked : !root.configDebug["enabled"] - onCheckedChanged: { - if (checked) { - root.configDebug["enabled"] = false - } - } - exclusiveGroup : debugGroup - } - RadioButton { - text : "Lvl 0" - checked :root.configDebug["enabled"] && root.configDebug["mode"]==0 - onCheckedChanged: { - if (checked) { - root.configDebug["enabled"] = true - root.configDebug["mode"] = 0 - } - } - exclusiveGroup : debugGroup - } - RadioButton { - text : "Lvl 1" - checked : root.configDebug["enabled"] && root.configDebug["mode"]==1 - onCheckedChanged: { - if (checked) { - root.configDebug["enabled"] = true - root.configDebug["mode"] = 1 - } - } - exclusiveGroup : debugGroup - } - RadioButton { - text : "Lvl 2" - checked : root.configDebug["enabled"] && root.configDebug["mode"]==2 - onCheckedChanged: { - if (checked) { - root.configDebug["enabled"] = true - root.configDebug["mode"] = 2 - } - } - exclusiveGroup : debugGroup - } - RadioButton { - text : "All" - checked : root.configDebug["enabled"] && root.configDebug["mode"]==3 - onCheckedChanged: { - if (checked) { - root.configDebug["enabled"] = true - root.configDebug["mode"] = 3 - } - } - exclusiveGroup : debugGroup - } - } - } - } -} diff --git a/scripts/developer/utilities/render/debugBloom.js b/scripts/developer/utilities/render/debugBloom.js index 39629ab0ce..3c5e722a18 100644 --- a/scripts/developer/utilities/render/debugBloom.js +++ b/scripts/developer/utilities/render/debugBloom.js @@ -10,11 +10,8 @@ // // Set up the qml ui -var qml = Script.resolvePath('bloom.qml'); -var window = new OverlayWindow({ - title: 'Bloom', - source: qml, - width: 285, - height: 40, -}); -window.closed.connect(function() { Script.stop(); }); \ No newline at end of file +var window = Desktop.createWindow(Script.resolvePath('./luci/Bloom.qml'), { + title: "Bloom", + presentationMode: Desktop.PresentationMode.NATIVE, + size: {x: 285, y: 40} +}); \ No newline at end of file diff --git a/scripts/developer/utilities/render/deferredLighting.qml b/scripts/developer/utilities/render/deferredLighting.qml deleted file mode 100644 index f2891ddc55..0000000000 --- a/scripts/developer/utilities/render/deferredLighting.qml +++ /dev/null @@ -1,103 +0,0 @@ -// -// deferredLighting.qml -// -// Created by Sam Gateau on 6/6/2016 -// Copyright 2016 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html -// -import QtQuick 2.7 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.3 - -import stylesUit 1.0 -import controlsUit 1.0 as HifiControls -import "configSlider" -import "luci" - -Rectangle { - HifiConstants { id: hifi;} - id: render; - anchors.margins: hifi.dimensions.contentMargin.x - - color: hifi.colors.baseGray; - property var mainViewTask: Render.getConfig("RenderMainView") - - Column { - spacing: 5 - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: hifi.dimensions.contentMargin.x - - - HifiControls.Label { - text: "Shading" - } - ShadingModel {} - - Separator {} - ToneMapping {} - - Separator {} - Column { - anchors.left: parent.left - anchors.right: parent.right - spacing: 5 - Repeater { - model: [ "MSAA:PreparePrimaryBufferForward:numSamples:4:1" - ] - ConfigSlider { - label: qsTr(modelData.split(":")[0]) - integral: true - config: render.mainViewTask.getConfig(modelData.split(":")[1]) - property: modelData.split(":")[2] - max: modelData.split(":")[3] - min: modelData.split(":")[4] - - anchors.left: parent.left - anchors.right: parent.right - } - } - } - Separator {} - Framebuffer {} - - Separator {} - BoundingBoxes { - - } - Separator {} - Row { - HifiControls.Button { - text: "Engine" - // activeFocusOnPress: false - onClicked: { - sendToScript({method: "openEngineView"}); - } - } - HifiControls.Button { - text: "LOD" - // activeFocusOnPress: false - onClicked: { - sendToScript({method: "openEngineLODView"}); - } - } - HifiControls.Button { - text: "Cull" - // activeFocusOnPress: false - onClicked: { - sendToScript({method: "openCullInspectorView"}); - } - } - } - Row { - HifiControls.Button { - text: "Material" - onClicked: { - sendToScript({method: "openMaterialInspectorView"}); - } - } - } - } -} diff --git a/scripts/developer/utilities/render/luci.js b/scripts/developer/utilities/render/luci.js index fd84f55e65..e2e5523ccd 100644 --- a/scripts/developer/utilities/render/luci.js +++ b/scripts/developer/utilities/render/luci.js @@ -1,80 +1,84 @@ -"use strict"; - -// -// Luci.js -// tablet-engine app -// -// Copyright 2017 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// +var MaterialInspector = Script.require('./materialInspector.js'); +var Page = Script.require('./luci/Page.js'); -(function() { - var AppUi = Script.require('appUi'); - - var MaterialInspector = Script.require('./materialInspector.js'); - var Page = Script.require('./luci/Page.js'); - var moveDebugCursor = false; - var onMousePressEvent = function (e) { - if (e.isMiddleButton) { - moveDebugCursor = true; - setDebugCursor(e.x, e.y); - } - }; - Controller.mousePressEvent.connect(onMousePressEvent); - - var onMouseReleaseEvent = function () { - moveDebugCursor = false; - }; - Controller.mouseReleaseEvent.connect(onMouseReleaseEvent); - - var onMouseMoveEvent = function (e) { - if (moveDebugCursor) { - setDebugCursor(e.x, e.y); - } - }; - Controller.mouseMoveEvent.connect(onMouseMoveEvent); - - function setDebugCursor(x, y) { - var nx = 2.0 * (x / Window.innerWidth) - 1.0; - var ny = 1.0 - 2.0 * ((y) / (Window.innerHeight)); - - Render.getConfig("RenderMainView").getConfig("DebugDeferredBuffer").size = { x: nx, y: ny, z: 1.0, w: 1.0 }; - } +function openView() { + //window.closed.connect(function() { Script.stop(); }); var pages = new Pages(); - - pages.addPage('openEngineLODView', 'Render LOD', '../lod.qml', 300, 400); - pages.addPage('openCullInspectorView', 'Cull Inspector', '../luci/Culling.qml', 300, 400); - pages.addPage('openMaterialInspectorView', 'Material Inspector', '../materialInspector.qml', 300, 400, MaterialInspector.setWindow); - function fromQml(message) { if (pages.open(message.method)) { return; } } - var ui; - function startup() { - ui = new AppUi({ - buttonName: "LUCI", - home: Script.resolvePath("deferredLighting.qml"), - additionalAppScreens : Script.resolvePath("engineInspector.qml"), - onMessage: fromQml, - normalButton: Script.resolvePath("../../../system/assets/images/luci-i.svg"), - activeButton: Script.resolvePath("../../../system/assets/images/luci-a.svg") - }); + var luciWindow + function openLuciWindow(window) { + if (luciWindow !== undefined) { + activeWindow.fromQml.disconnect(fromQml); + } + if (window !== undefined) { + window.fromQml.connect(fromQml); + } + luciWindow = window; + + + var moveDebugCursor = false; + var onMousePressEvent = function (e) { + if (e.isMiddleButton) { + moveDebugCursor = true; + setDebugCursor(e.x, e.y); + } + }; + Controller.mousePressEvent.connect(onMousePressEvent); + + var onMouseReleaseEvent = function () { + moveDebugCursor = false; + }; + Controller.mouseReleaseEvent.connect(onMouseReleaseEvent); + + var onMouseMoveEvent = function (e) { + if (moveDebugCursor) { + setDebugCursor(e.x, e.y); + } + }; + Controller.mouseMoveEvent.connect(onMouseMoveEvent); + + function setDebugCursor(x, y) { + var nx = 2.0 * (x / Window.innerWidth) - 1.0; + var ny = 1.0 - 2.0 * ((y) / (Window.innerHeight)); + + Render.getConfig("RenderMainView").getConfig("DebugDeferredBuffer").size = { x: nx, y: ny, z: 1.0, w: 1.0 }; + } + } - startup(); - Script.scriptEnding.connect(function () { + + function closeLuciWindow() { + if (luciWindow !== undefined) { + activeWindow.fromQml.disconnect(fromQml); + } + luciWindow = {}; + Controller.mousePressEvent.disconnect(onMousePressEvent); Controller.mouseReleaseEvent.disconnect(onMouseReleaseEvent); Controller.mouseMoveEvent.disconnect(onMouseMoveEvent); pages.clear(); - }); -}()); + } + + pages.addPage('Luci', 'Luci', '../luci.qml', 300, 420, openLuciWindow, closeLuciWindow); + pages.addPage('openEngineInspectorView', 'Render Engine Inspector', '../engineInspector.qml', 300, 400); + pages.addPage('openEngineLODView', 'Render LOD', '../lod.qml', 300, 400); + pages.addPage('openMaterialInspectorView', 'Material Inspector', '../materialInspector.qml', 300, 400, MaterialInspector.setWindow, MaterialInspector.setWindow); + + pages.open('Luci'); + + + return pages; +} + + +openView(); + diff --git a/scripts/developer/utilities/render/luci.qml b/scripts/developer/utilities/render/luci.qml index d768acb160..71962992b8 100644 --- a/scripts/developer/utilities/render/luci.qml +++ b/scripts/developer/utilities/render/luci.qml @@ -72,6 +72,12 @@ Rectangle { Antialiasing {} } } + Prop.PropFolderPanel { + label: "Bloom" + panelFrameData: Component { + Bloom {} + } + } Prop.PropFolderPanel { label: "Culling" panelFrameData: Component { diff --git a/scripts/developer/utilities/render/luci/Antialiasing.qml b/scripts/developer/utilities/render/luci/Antialiasing.qml index 6d1209157f..2a52dfed46 100644 --- a/scripts/developer/utilities/render/luci/Antialiasing.qml +++ b/scripts/developer/utilities/render/luci/Antialiasing.qml @@ -22,15 +22,12 @@ import "../../lib/prop" as Prop Column{ - HifiConstants { id: hifi; } + id: antialiasing - id: antialiasing - padding: 10 anchors.left: parent.left anchors.right: parent.right - spacing: 10 - Prop.PropScalar { + Prop.PropScalar { label: "MSAA" object: Render.getConfig("RenderMainView.PreparePrimaryBufferForward") property: "numSamples" @@ -38,49 +35,44 @@ Column{ max: 32 integral: true } - Row { - spacing: 10 - id: fxaaOnOff - property bool debugFXAA: false - HifiControls.Button { - function getTheText() { - if (Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff) { - return "FXAA" - } else { - return "TAA" - } - } - text: getTheText() - onClicked: { - var onOff = !Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff; - if (onOff) { - Render.getConfig("RenderMainView.JitterCam").none(); - Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = true; - } else { - Render.getConfig("RenderMainView.JitterCam").play(); - Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = false; - } - - } - } + + Prop.PropEnum { + label: "Deferred AA Method" + object: Render.getConfig("RenderMainView.Antialiasing") + property: "mode" + enums: [ + "Off", + "TAA", + "FXAA", + ] + } + 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" + // min: -1 + // max: 32 + readOnly: true + integral: true + } Row { + visible: (Render.getConfig("RenderMainView.JitterCam").state == 2) spacing: 10 - - HifiControls.Button { - text: { - var state = 2 - (Render.getConfig("RenderMainView.JitterCam").freeze * 1 - Render.getConfig("RenderMainView.JitterCam").stop * 2); - if (state === 2) { - return "Jitter" - } else if (state === 1) { - return "Paused at " + Render.getConfig("RenderMainView.JitterCam").index + "" - } else { - return "No Jitter" - } - } - onClicked: { Render.getConfig("RenderMainView.JitterCam").cycleStopPauseRun(); } - } + HifiControls.Button { text: "<" onClicked: { Render.getConfig("RenderMainView.JitterCam").prev(); } @@ -90,96 +82,75 @@ Column{ onClicked: { Render.getConfig("RenderMainView.JitterCam").next(); } } } - Separator {} - HifiControls.CheckBox { - boxSize: 20 - text: "Constrain color" - checked: Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] - onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] = checked } - } - ConfigSlider { - label: qsTr("Covariance gamma") - integral: false - config: Render.getConfig("RenderMainView.Antialiasing") + Separator {} + Prop.PropBool { + label: "Constrain color" + object: Render.getConfig("RenderMainView.Antialiasing") + property: "constrainColor" + } + Prop.PropScalar { + label: "Covariance gamma" + object: Render.getConfig("RenderMainView.Antialiasing") property: "covarianceGamma" max: 1.5 min: 0.5 - height: 38 - } - Separator {} - HifiControls.CheckBox { - boxSize: 20 - text: "Feedback history color" - checked: Render.getConfig("RenderMainView.Antialiasing")["feedbackColor"] - onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["feedbackColor"] = checked } - } - - ConfigSlider { - label: qsTr("Source blend") - integral: false - config: Render.getConfig("RenderMainView.Antialiasing") + } + Separator {} + Prop.PropBool { + label: "Feedback history color" + object: Render.getConfig("RenderMainView.Antialiasing") + property: "feedbackColor" + } + Prop.PropScalar { + label: "Source blend" + object: Render.getConfig("RenderMainView.Antialiasing") property: "blend" max: 1.0 min: 0.0 - height: 38 } - - ConfigSlider { - label: qsTr("Post sharpen") - integral: false - config: Render.getConfig("RenderMainView.Antialiasing") + Prop.PropScalar { + label: "Post sharpen" + object: Render.getConfig("RenderMainView.Antialiasing") property: "sharpen" max: 1.0 min: 0.0 } - Separator {} - Row { - - spacing: 10 - HifiControls.CheckBox { - boxSize: 20 - text: "Debug" - checked: Render.getConfig("RenderMainView.Antialiasing")["debug"] - onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["debug"] = checked } - } - HifiControls.CheckBox { - boxSize: 20 - text: "Show Debug Cursor" - checked: Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"] - onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"] = checked } - } - } - ConfigSlider { - label: qsTr("Debug Region <") - integral: false - config: Render.getConfig("RenderMainView.Antialiasing") + Separator {} + Prop.PropBool { + label: "Debug" + object: Render.getConfig("RenderMainView.Antialiasing") + property: "debug" + } + Prop.PropBool { + label: "Show Debug Cursor" + object: Render.getConfig("RenderMainView.Antialiasing") + property: "showCursorPixel" + } + Prop.PropScalar { + label: "Debug Region <" + object: Render.getConfig("RenderMainView.Antialiasing") property: "debugX" max: 1.0 min: 0.0 } - HifiControls.CheckBox { - boxSize: 20 - text: "Closest Fragment" - checked: Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"] - onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"] = checked } - } - ConfigSlider { - label: qsTr("Debug Velocity Threshold [pix]") - integral: false - config: Render.getConfig("RenderMainView.Antialiasing") + Prop.PropBool { + label: "Closest Fragment" + object: Render.getConfig("RenderMainView.Antialiasing") + property: "showClosestFragment" + } + Prop.PropScalar { + label: "Debug Velocity Threshold [pix]" + object: Render.getConfig("RenderMainView.Antialiasing") property: "debugShowVelocityThreshold" max: 50 min: 0.0 - height: 38 } - ConfigSlider { - label: qsTr("Debug Orb Zoom") - integral: false - config: Render.getConfig("RenderMainView.Antialiasing") + Prop.PropScalar { + label: "Debug Orb Zoom" + object: Render.getConfig("RenderMainView.Antialiasing") property: "debugOrbZoom" max: 32.0 min: 1.0 - height: 38 - } + } } diff --git a/scripts/developer/utilities/render/luci/Bloom.qml b/scripts/developer/utilities/render/luci/Bloom.qml new file mode 100644 index 0000000000..7db75d94ef --- /dev/null +++ b/scripts/developer/utilities/render/luci/Bloom.qml @@ -0,0 +1,48 @@ +// +// bloom.qml +// +// Olivier Prat, created on 09/25/2017. +// Copyright 2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html +// +import QtQuick 2.7 +import "../../lib/prop" as Prop + +Column { + anchors.left: parent.left + anchors.right: parent.right + + id: bloom + + property var config: Render.getConfig("RenderMainView.DebugBloom") + + Prop.PropBool { + label: "Apply Bloom" + object: Render.getConfig("RenderMainView.LightingModel") + property: "enableBloom" + } + + function setDebugMode(mode) { + console.log("Bloom mode is " + mode) + bloom.config.enabled = (mode != 0); + bloom.config.mode = mode; + } + + Prop.PropEnum { + label: "Debug Bloom Buffer" + // object: config + // property: "mode" + enums: [ + "Off", + "Lvl 0", + "Lvl 1", + "Lvl 2", + "All", + ] + + valueVarSetter: function (mode) { bloom.setDebugMode(mode) } + } +} + diff --git a/scripts/developer/utilities/render/luci/BoundingBoxes.qml b/scripts/developer/utilities/render/luci/BoundingBoxes.qml index 636267729c..6b34e41b4c 100644 --- a/scripts/developer/utilities/render/luci/BoundingBoxes.qml +++ b/scripts/developer/utilities/render/luci/BoundingBoxes.qml @@ -54,7 +54,7 @@ Column { Prop.PropCheckBox { text: "Zones" checked: root.mainViewTask.getConfig("DrawZones")["enabled"] - onCheckedChanged: { root.mainViewTask.getConfig("ZoneRenderer")["enabled"] = checked; root.mainViewTask.getConfig("DrawZones")["enabled"] = checked; } + onCheckedChanged: { root.mainViewTask.getConfig("DrawZones")["enabled"] = checked; } } } Column { diff --git a/scripts/developer/utilities/render/luci/ShadingModel.qml b/scripts/developer/utilities/render/luci/ShadingModel.qml index 78ca7f1740..afeca5a204 100644 --- a/scripts/developer/utilities/render/luci/ShadingModel.qml +++ b/scripts/developer/utilities/render/luci/ShadingModel.qml @@ -35,7 +35,8 @@ Column { "Emissive:LightingModel:enableEmissive", "Lightmap:LightingModel:enableLightmap", "Background:LightingModel:enableBackground", - "Haze:LightingModel:enableHaze", + "Haze:LightingModel:enableHaze", + "Bloom:LightingModel:enableBloom", "AO:LightingModel:enableAmbientOcclusion", "Textures:LightingModel:enableMaterialTexturing" ] diff --git a/scripts/developer/utilities/render/luci/qmldir b/scripts/developer/utilities/render/luci/qmldir index 3ebd9fcd8d..a4059ffcab 100644 --- a/scripts/developer/utilities/render/luci/qmldir +++ b/scripts/developer/utilities/render/luci/qmldir @@ -5,6 +5,7 @@ BoundingBoxes 1.0 BoundingBoxes.qml Framebuffer 1.0 Framebuffer.qml Antialiasing 1.0 Antialiasing.qml Culling 1.0 Culling.qml +Bloom 1.0 Bloom.qml Platform 1.0 Platform.qml RenderSettings 1.0 RenderSettings.qml diff --git a/scripts/developer/utilities/render/luci2.js b/scripts/developer/utilities/render/luci2.js deleted file mode 100644 index e2e5523ccd..0000000000 --- a/scripts/developer/utilities/render/luci2.js +++ /dev/null @@ -1,84 +0,0 @@ - - -var MaterialInspector = Script.require('./materialInspector.js'); -var Page = Script.require('./luci/Page.js'); - - -function openView() { - //window.closed.connect(function() { Script.stop(); }); - - - var pages = new Pages(); - function fromQml(message) { - if (pages.open(message.method)) { - return; - } - } - - var luciWindow - function openLuciWindow(window) { - if (luciWindow !== undefined) { - activeWindow.fromQml.disconnect(fromQml); - } - if (window !== undefined) { - window.fromQml.connect(fromQml); - } - luciWindow = window; - - - var moveDebugCursor = false; - var onMousePressEvent = function (e) { - if (e.isMiddleButton) { - moveDebugCursor = true; - setDebugCursor(e.x, e.y); - } - }; - Controller.mousePressEvent.connect(onMousePressEvent); - - var onMouseReleaseEvent = function () { - moveDebugCursor = false; - }; - Controller.mouseReleaseEvent.connect(onMouseReleaseEvent); - - var onMouseMoveEvent = function (e) { - if (moveDebugCursor) { - setDebugCursor(e.x, e.y); - } - }; - Controller.mouseMoveEvent.connect(onMouseMoveEvent); - - function setDebugCursor(x, y) { - var nx = 2.0 * (x / Window.innerWidth) - 1.0; - var ny = 1.0 - 2.0 * ((y) / (Window.innerHeight)); - - Render.getConfig("RenderMainView").getConfig("DebugDeferredBuffer").size = { x: nx, y: ny, z: 1.0, w: 1.0 }; - } - - } - - function closeLuciWindow() { - if (luciWindow !== undefined) { - activeWindow.fromQml.disconnect(fromQml); - } - luciWindow = {}; - - Controller.mousePressEvent.disconnect(onMousePressEvent); - Controller.mouseReleaseEvent.disconnect(onMouseReleaseEvent); - Controller.mouseMoveEvent.disconnect(onMouseMoveEvent); - pages.clear(); - } - - pages.addPage('Luci', 'Luci', '../luci.qml', 300, 420, openLuciWindow, closeLuciWindow); - pages.addPage('openEngineInspectorView', 'Render Engine Inspector', '../engineInspector.qml', 300, 400); - pages.addPage('openEngineLODView', 'Render LOD', '../lod.qml', 300, 400); - pages.addPage('openMaterialInspectorView', 'Material Inspector', '../materialInspector.qml', 300, 400, MaterialInspector.setWindow, MaterialInspector.setWindow); - - pages.open('Luci'); - - - return pages; -} - - -openView(); -