From af3d981ad163be12a9d4d66ff7049c04c11067d1 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 18 Apr 2019 17:44:08 -0700 Subject: [PATCH] Bringing the Luci interface into the new Prop framework and moving some tools there too --- .../utilities/lib/jet/qml/TaskPropView.qml | 35 ++-- .../utilities/lib/prop/PropGroup.qml | 121 +----------- .../utilities/lib/prop/style/PiCanvasIcon.qml | 9 +- .../utilities/lib/prop/style/PiCheckBox.qml | 2 - .../lib/prop/style/PiFolderPanel.qml | 24 +-- .../utilities/render/antialiasing.js | 2 +- .../utilities/render/antialiasing.qml | 182 ------------------ .../utilities/render/deferredLighting.qml | 177 +---------------- scripts/developer/utilities/render/luci.qml | 60 +++--- .../utilities/render/luci/Antialiasing.qml | 176 +++++++++++++++++ .../utilities/render/luci/BoundingBoxes.qml | 84 ++++++++ .../utilities/render/luci/Framebuffer.qml | 69 +++++++ .../utilities/render/luci/ShadingModel.qml | 25 +-- .../utilities/render/luci/ToneMapping.qml | 40 ++++ .../developer/utilities/render/luci/qmldir | 6 +- 15 files changed, 449 insertions(+), 563 deletions(-) delete mode 100644 scripts/developer/utilities/render/antialiasing.qml create mode 100644 scripts/developer/utilities/render/luci/Antialiasing.qml create mode 100644 scripts/developer/utilities/render/luci/BoundingBoxes.qml create mode 100644 scripts/developer/utilities/render/luci/Framebuffer.qml create mode 100644 scripts/developer/utilities/render/luci/ToneMapping.qml diff --git a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml index e53932a9f9..0587352b4e 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml @@ -30,9 +30,10 @@ Prop.PropGroup { property var showProps: true property var showSubs: true - property var jobEnabled: true + property var jobEnabled: rootConfig.getConfig(jobPath).enabled + property var jobCpuTime: rootConfig.getConfig(jobPath).cpuRunTime.toPrecision(3) - property var toggleJobActivation: function() { + property var toggleJobActivation: function() { console.log("the button has been pressed and jobEnabled is " + jobEnabled ) jobEnabled = !jobEnabled; rootConfig.getConfig(jobPath).enabled = jobEnabled; @@ -44,29 +45,31 @@ Prop.PropGroup { id: header Prop.PropLabel { text: root.label - //horizontalAlignment: Text.AlignHCenter + horizontalAlignment: Text.AlignHCenter anchors.left: parent.left - anchors.right: enabledIcon.left + anchors.right: cpuTime.left anchors.verticalCenter: parent.verticalCenter - } + } + Prop.PropLabel { + id: cpuTime + visible: root.jobEnabled + width: 50 + text: jobCpuTime + horizontalAlignment: Text.AlignLeft + anchors.rightMargin: 5 + anchors.right:enabledIcon.right + anchors.verticalCenter: parent.verticalCenter + } Prop.PropCanvasIcon { id: enabledIcon - anchors.right: enabledIcon2.left + anchors.right:parent.right anchors.verticalCenter: parent.verticalCenter filled: root.jobEnabled fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorOrangeAccent) icon: 5 iconMouseArea.onClicked: { toggleJobActivation() } } - Prop.PropCanvasIcon { - id: enabledIcon2 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - filled: root.jobEnabled - fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorOrangeAccent) - icon: 7 - iconMouseArea.onClicked: { toggleJobActivation() } - } + } } @@ -78,7 +81,7 @@ Prop.PropGroup { for (var p in props) { propsModel.push({"object": rootConfig.getConfig(jobPath), "property":props[p] }) } - root.updatePropItems(propsModel); + root.updatePropItems(root.propItemsPanel, propsModel); } if (showSubs) { diff --git a/scripts/developer/utilities/lib/prop/PropGroup.qml b/scripts/developer/utilities/lib/prop/PropGroup.qml index 2f15e60a0c..384b50ecad 100644 --- a/scripts/developer/utilities/lib/prop/PropGroup.qml +++ b/scripts/developer/utilities/lib/prop/PropGroup.qml @@ -10,123 +10,14 @@ import QtQuick 2.7 -//Item { +// PropGroup is mostly reusing the look and feel of the PropFolderPanel +// It is populated by calling "updatePropItems" +// or adding manually new Items to the "propItemsPanel" PropFolderPanel { Global { id: global } id: root - - // property var label: "group" - - // property alias isUnfold: headerFolderIcon.icon - // property var indentDepth: 0 - //property alias propItemsPanel: _panelFrameData - // property alias propItemsPanel: propItemsContainer - //property var propItemsPanel: propItemsContainer - - panelFrameData: Component { // default is a column - id: groupPanelFrameData - Column { - id: propItemsContainer - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 0 - anchors.rightMargin: 0 - - clip: true - } - } - - // Panel Header Data Component -/* property Component panelHeaderData: defaultPanelHeaderData - Component { // default is a Label - id: defaultPanelHeaderData - PropLabel { - text: root.label - horizontalAlignment: Text.AlignHCenter - } - } - - // Header Item - Rectangle { - id: header - height: global.slimHeight - anchors.left: parent.left - anchors.right: parent.right - - color: global.colorBackShadow // header of group is darker - - // First in the header, some indentation spacer - Item { - id: indentSpacer - width: (headerFolderIcon.width * root.indentDepth) + global.horizontalMargin // Must be non-zero - height: parent.height - - anchors.verticalCenter: parent.verticalCenter - } - - // Second, the folder button / indicator - Item { - id: headerFolder - anchors.left: indentSpacer.right - width: headerFolderIcon.width * 2 - anchors.verticalCenter: header.verticalCenter - height: parent.height - - PropCanvasIcon { - id: headerFolderIcon - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - fillColor: global.colorOrangeAccent - filled: root.propItemsPanel.height > 4 - iconMouseArea.onClicked: { root.isUnfold = !root.isUnfold } - } - } - - // Next the header container - // by default containing a Label showing the root.label - Loader { - sourceComponent: panelHeaderData - anchors.left: headerFolder.right - anchors.right: header.right - anchors.verticalCenter: header.verticalCenter - height: parent.height - } - } - - // The Panel container - Rectangle { - visible: root.isUnfold - - color: "transparent" - border.color: global.colorBorderLight - border.width: global.valueBorderWidth - radius: global.valueBorderRadius - - anchors.margins: 0 - anchors.left: parent.left - anchors.right: parent.right - anchors.top: header.bottom - anchors.bottom: root.bottom - - Column { - id: propItemsContainer - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 0 - anchors.rightMargin: 0 - - clip: true - - // Where the propItems are added - } - } - - height: header.height + isUnfold * propItemsContainer.height - anchors.margins: 0 - anchors.left: parent.left - anchors.right: parent.right -*/ + property alias propItemsPanel: root.panelFrameContent // Prop Group is designed to author an array of ProItems, they are defined with an array of the tuplets describing each individual item: // [ ..., PropItemInfo, ...] @@ -134,7 +25,8 @@ PropFolderPanel { // type: "PropXXXX", object: JSobject, property: "propName" // } // - function updatePropItems(propItemsModel) { + function updatePropItems(propItemsContainer, propItemsModel) { + root.hasContent = false for (var i = 0; i < propItemsModel.length; i++) { var proItem = propItemsModel[i]; // valid object @@ -191,6 +83,7 @@ PropFolderPanel { }) } break; } + root.hasContent = true } else { console.log('Invalid property: ' + JSON.stringify(proItem)); } diff --git a/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml b/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml index 3feed342b8..2fc3ed10ec 100644 --- a/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml +++ b/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml @@ -79,12 +79,9 @@ Canvas { context.lineTo(width * 0.75, height * 0.25); context.closePath(); } break; - default: {// Down Arrow - /* context.moveTo(0, height * 0.25); - context.lineTo(width, height * 0.25); - context.lineTo(width / 2, height); - context.closePath();*/ - } + default: { + + } } if (filled) { context.fillStyle = fillColor; diff --git a/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml b/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml index 108a763be3..1e1f03669b 100644 --- a/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml +++ b/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml @@ -20,6 +20,4 @@ HifiControls.CheckBox { //anchors.verticalCenter: root.verticalCenter //width: root.width * global.valueAreaWidthScale height: global.slimHeight - - onCheckedChanged: { root.valueVarSetter(checked); } } \ No newline at end of file diff --git a/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml b/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml index b80ab47fc6..d66c0708d3 100644 --- a/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml +++ b/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml @@ -17,6 +17,7 @@ Item { property var label: "panel" property alias isUnfold: headerFolderIcon.icon + property alias hasContent: headerFolderIcon.filled property var indentDepth: 0 // Panel Header Data Component @@ -37,7 +38,7 @@ Item { } } - //property alias panelFrameContent: frame._panelFrameData.data + property alias panelFrameContent: _panelFrameData.item // Header Item Rectangle { @@ -45,13 +46,14 @@ Item { height: global.slimHeight anchors.left: parent.left anchors.right: parent.right + anchors.margins: 0 color: global.colorBackShadow // header of group is darker // First in the header, some indentation spacer Item { id: indentSpacer - width: (headerFolderIcon.width * root.indentDepth) + global.horizontalMargin // Must be non-zero + width: (headerFolderIcon.width * root.indentDepth) + global.horizontalMargin // Must be non-zero height: parent.height anchors.verticalCenter: parent.verticalCenter @@ -70,7 +72,6 @@ Item { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter fillColor: global.colorOrangeAccent - filled: root.frame.height > 4 iconMouseArea.onClicked: { root.isUnfold = !root.isUnfold } } } @@ -81,6 +82,7 @@ Item { sourceComponent: panelHeaderData anchors.left: headerFolder.right anchors.right: header.right + anchors.rightMargin: global.horizontalMargin * 2 anchors.verticalCenter: header.verticalCenter height: parent.height } @@ -104,29 +106,17 @@ Item { // Next the panel frame data Loader { + id: _panelFrameData sourceComponent: panelFrameData anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: 0 anchors.rightMargin: 0 - id: _panelFrameData clip: true } - - /* Column { - id: propItemsContainer - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 0 - anchors.rightMargin: 0 - - clip: true - - // Where the propItems are added - }*/ } - height: header.height + isUnfold * _panelFrameData.height + height: header.height + isUnfold * _panelFrameData.item.height anchors.margins: 0 anchors.left: parent.left anchors.right: parent.right diff --git a/scripts/developer/utilities/render/antialiasing.js b/scripts/developer/utilities/render/antialiasing.js index e915d75e93..5484565b36 100644 --- a/scripts/developer/utilities/render/antialiasing.js +++ b/scripts/developer/utilities/render/antialiasing.js @@ -13,7 +13,7 @@ (function() { var TABLET_BUTTON_NAME = "TAA"; - var QMLAPP_URL = Script.resolvePath("./antialiasing.qml"); + var QMLAPP_URL = Script.resolvePath("./luci/Antialiasing.qml"); var onLuciScreen = false; diff --git a/scripts/developer/utilities/render/antialiasing.qml b/scripts/developer/utilities/render/antialiasing.qml deleted file mode 100644 index 5abfd30935..0000000000 --- a/scripts/developer/utilities/render/antialiasing.qml +++ /dev/null @@ -1,182 +0,0 @@ -// -// Antialiasing.qml -// -// Created by Sam Gateau on 8/14/2017 -// 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 "../lib/plotperf" - -Item { -Rectangle { - id: root; - - HifiConstants { id: hifi; } - color: hifi.colors.baseGray; - - Column { - id: antialiasing - spacing: 20 - padding: 10 - - Column{ - spacing: 10 - - 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; - } - - } - } - } - Separator {} - Row { - 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(); } - } - HifiControls.Button { - text: ">" - 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") - 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") - property: "blend" - max: 1.0 - min: 0.0 - height: 38 - } - - ConfigSlider { - label: qsTr("Post sharpen") - integral: false - config: 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") - 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") - property: "debugShowVelocityThreshold" - max: 50 - min: 0.0 - height: 38 - } - ConfigSlider { - label: qsTr("Debug Orb Zoom") - integral: false - config: Render.getConfig("RenderMainView.Antialiasing") - property: "debugOrbZoom" - max: 32.0 - min: 1.0 - height: 38 - } - } - } -} -} diff --git a/scripts/developer/utilities/render/deferredLighting.qml b/scripts/developer/utilities/render/deferredLighting.qml index 63c2af1b0f..80ca8b09e1 100644 --- a/scripts/developer/utilities/render/deferredLighting.qml +++ b/scripts/developer/utilities/render/deferredLighting.qml @@ -29,57 +29,16 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.margins: hifi.dimensions.contentMargin.x - //padding: hifi.dimensions.contentMargin.x + + HifiControls.Label { text: "Shading" } - ShadingModel { + ShadingModel {} - } - Separator {} - Column { - anchors.left: parent.left - anchors.right: parent.right - spacing: 5 - Repeater { - model: [ "Tone Mapping Exposure:ToneMapping:exposure:5.0:-5.0" - ] - ConfigSlider { - label: qsTr(modelData.split(":")[0]) - integral: false - config: render.mainViewTask.getConfig(modelData.split(":")[1]) - property: modelData.split(":")[2] - max: modelData.split(":")[3] - min: modelData.split(":")[4] + Separator {} + ToneMapping {} - anchors.left: parent.left - anchors.right: parent.right - } - } - Item { - height: childrenRect.height - anchors.left: parent.left - anchors.right: parent.right - - HifiControls.Label { - text: "Tone Mapping Curve" - anchors.left: parent.left - } - - ComboBox { - anchors.right: parent.right - currentIndex: 1 - model: [ - "RGB", - "SRGB", - "Reinhard", - "Filmic", - ] - width: 200 - onCurrentIndexChanged: { render.mainViewTask.getConfig("ToneMapping")["curve"] = currentIndex; } - } - } - } Separator {} Column { anchors.left: parent.left @@ -102,133 +61,11 @@ Rectangle { } } Separator {} + Framebuffer {} - Item { - height: childrenRect.height - anchors.left: parent.left - anchors.right: parent.right - - id: framebuffer - - HifiControls.Label { - text: "Debug Framebuffer" - anchors.left: parent.left - } - - property var config: render.mainViewTask.getConfig("DebugDeferredBuffer") - - function setDebugMode(mode) { - framebuffer.config.enabled = (mode != 0); - framebuffer.config.mode = mode; - } - - ComboBox { - anchors.right: parent.right - currentIndex: 0 - model: ListModel { - id: cbItemsFramebuffer - ListElement { text: "Off"; color: "Yellow" } - ListElement { text: "Depth"; color: "Green" } - ListElement { text: "Albedo"; color: "Yellow" } - ListElement { text: "Normal"; color: "White" } - ListElement { text: "Roughness"; color: "White" } - ListElement { text: "Metallic"; color: "White" } - ListElement { text: "Emissive"; color: "White" } - ListElement { text: "Unlit"; color: "White" } - ListElement { text: "Occlusion"; color: "White" } - ListElement { text: "Lightmap"; color: "White" } - ListElement { text: "Scattering"; color: "White" } - ListElement { text: "Lighting"; color: "White" } - ListElement { text: "Shadow Cascade 0"; color: "White" } - ListElement { text: "Shadow Cascade 1"; color: "White" } - ListElement { text: "Shadow Cascade 2"; color: "White" } - ListElement { text: "Shadow Cascade 3"; color: "White" } - ListElement { text: "Shadow Cascade Indices"; color: "White" } - ListElement { text: "Linear Depth"; color: "White" } - ListElement { text: "Half Linear Depth"; color: "White" } - ListElement { text: "Half Normal"; color: "White" } - ListElement { text: "Mid Curvature"; color: "White" } - ListElement { text: "Mid Normal"; color: "White" } - ListElement { text: "Low Curvature"; color: "White" } - ListElement { text: "Low Normal"; color: "White" } - ListElement { text: "Curvature Occlusion"; color: "White" } - ListElement { text: "Debug Scattering"; color: "White" } - ListElement { text: "Ambient Occlusion"; color: "White" } - ListElement { text: "Ambient Occlusion Blurred"; color: "White" } - ListElement { text: "Ambient Occlusion Normal"; color: "White" } - ListElement { text: "Velocity"; color: "White" } - ListElement { text: "Custom"; color: "White" } - } - width: 200 - onCurrentIndexChanged: { framebuffer.setDebugMode(currentIndex) } - } - } - Separator {} - Row { - spacing: 5 - Column { - spacing: 5 + BoundingBoxes { - HifiControls.CheckBox { - boxSize: 20 - text: "Opaques" - checked: render.mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] = checked } - } - HifiControls.CheckBox { - boxSize: 20 - text: "Transparents" - checked: render.mainViewTask.getConfig("DrawTransparentBounds")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("DrawTransparentBounds")["enabled"] = checked } - } - HifiControls.CheckBox { - boxSize: 20 - text: "Opaques in Front" - checked: render.mainViewTask.getConfig("DrawOverlayInFrontOpaqueBounds")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("DrawOverlayInFrontOpaqueBounds")["enabled"] = checked } - } - HifiControls.CheckBox { - boxSize: 20 - text: "Transparents in Front" - checked: render.mainViewTask.getConfig("DrawOverlayInFrontTransparentBounds")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("DrawOverlayInFrontTransparentBounds")["enabled"] = checked } - } - HifiControls.CheckBox { - boxSize: 20 - text: "Opaques in HUD" - checked: render.mainViewTask.getConfig("DrawOverlayHUDOpaqueBounds")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("DrawOverlayHUDOpaqueBounds")["enabled"] = checked } - } - - } - Column { - spacing: 5 - HifiControls.CheckBox { - boxSize: 20 - text: "Metas" - checked: render.mainViewTask.getConfig("DrawMetaBounds")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("DrawMetaBounds")["enabled"] = checked } - } - HifiControls.CheckBox { - boxSize: 20 - text: "Lights" - checked: render.mainViewTask.getConfig("DrawLightBounds")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("DrawLightBounds")["enabled"] = checked; } - } - HifiControls.CheckBox { - boxSize: 20 - text: "Zones" - checked: render.mainViewTask.getConfig("DrawZones")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("ZoneRenderer")["enabled"] = checked; render.mainViewTask.getConfig("DrawZones")["enabled"] = checked; } - } - HifiControls.CheckBox { - boxSize: 20 - text: "Transparents in HUD" - checked: render.mainViewTask.getConfig("DrawOverlayHUDTransparentBounds")["enabled"] - onCheckedChanged: { render.mainViewTask.getConfig("DrawOverlayHUDTransparentBounds")["enabled"] = checked } - } - } } Separator {} Row { diff --git a/scripts/developer/utilities/render/luci.qml b/scripts/developer/utilities/render/luci.qml index 7bce087fda..6ceee9a8d0 100644 --- a/scripts/developer/utilities/render/luci.qml +++ b/scripts/developer/utilities/render/luci.qml @@ -33,53 +33,43 @@ Rectangle { Column { width: render.width Prop.PropFolderPanel { - id: "shadingModel" label: "Shading Model" panelFrameData: Component { - ShadingModel { - } + ShadingModel {} } } - /* Prop.PropEnum { - label: "Tone Curve" - object: render.mainViewTask.getConfig("ToneMapping") - property: "curve" - enums: [ - "RGB", - "SRGB", - "Reinhard", - "Filmic", - ] - anchors.left: parent.left - anchors.right: parent.right - } */ - Jet.TaskPropView { - id: "theView" - jobPath: "RenderMainView" - label: "Le Render Main View" - - anchors.left: parent.left - anchors.right: parent.right + Prop.PropFolderPanel { + label: "Bounding Boxes" + panelFrameData: Component { + BoundingBoxes {} + } } - Jet.TaskPropView { - id: "the" - jobPath: "RenderMainView.RenderDeferredTask" - label: "Le Render Deferred Job" - - anchors.left: parent.left - anchors.right: parent.right + Prop.PropFolderPanel { + label: "Framebuffer" + panelFrameData: Component { + Framebuffer {} + } + } + Prop.PropFolderPanel { + label: "Tone Mapping" + panelFrameData: Component { + ToneMapping {} + } + } + Prop.PropFolderPanel { + label: "Antialiasing" + panelFrameData: Component { + Antialiasing {} + } } Jet.TaskPropView { id: "le" jobPath: "" label: "Le Render Engine" - anchors.left: parent.left - anchors.right: parent.right + // anchors.left: parent.left + // anchors.right: parent.right } } } - - Component.onCompleted: { - } } \ No newline at end of file diff --git a/scripts/developer/utilities/render/luci/Antialiasing.qml b/scripts/developer/utilities/render/luci/Antialiasing.qml new file mode 100644 index 0000000000..e29bca43eb --- /dev/null +++ b/scripts/developer/utilities/render/luci/Antialiasing.qml @@ -0,0 +1,176 @@ +// +// Antialiasing.qml +// +// Created by Sam Gateau on 8/14/2017 +// 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 "../../lib/plotperf" + + +Column{ + HifiConstants { id: hifi; } + + id: antialiasing + padding: 10 + anchors.left: parent.left + anchors.right: parent.right + + spacing: 10 + + 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; + } + + } + } + } + Separator {} + Row { + 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(); } + } + HifiControls.Button { + text: ">" + 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") + 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") + property: "blend" + max: 1.0 + min: 0.0 + height: 38 + } + + ConfigSlider { + label: qsTr("Post sharpen") + integral: false + config: 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") + 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") + property: "debugShowVelocityThreshold" + max: 50 + min: 0.0 + height: 38 + } + ConfigSlider { + label: qsTr("Debug Orb Zoom") + integral: false + config: Render.getConfig("RenderMainView.Antialiasing") + property: "debugOrbZoom" + max: 32.0 + min: 1.0 + height: 38 + } +} + diff --git a/scripts/developer/utilities/render/luci/BoundingBoxes.qml b/scripts/developer/utilities/render/luci/BoundingBoxes.qml new file mode 100644 index 0000000000..636267729c --- /dev/null +++ b/scripts/developer/utilities/render/luci/BoundingBoxes.qml @@ -0,0 +1,84 @@ +// +// BoundingBoxes.qml +// +// Created by Sam Gateau on 4/18/2019 +// Copyright 2019 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 { + + id: root; + + property var mainViewTask: Render.getConfig("RenderMainView") + + spacing: 5 + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: hifi.dimensions.contentMargin.x + + Row { + anchors.left: parent.left + anchors.right: parent.right + + spacing: 5 + Column { + spacing: 5 + + Prop.PropCheckBox { + text: "Opaques" + checked: root.mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] = checked } + } + Prop.PropCheckBox { + text: "Transparents" + checked: root.mainViewTask.getConfig("DrawTransparentBounds")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("DrawTransparentBounds")["enabled"] = checked } + } + Prop.PropCheckBox { + text: "Metas" + checked: root.mainViewTask.getConfig("DrawMetaBounds")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("DrawMetaBounds")["enabled"] = checked } + } + Prop.PropCheckBox { + text: "Lights" + checked: root.mainViewTask.getConfig("DrawLightBounds")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("DrawLightBounds")["enabled"] = checked; } + } + Prop.PropCheckBox { + text: "Zones" + checked: root.mainViewTask.getConfig("DrawZones")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("ZoneRenderer")["enabled"] = checked; root.mainViewTask.getConfig("DrawZones")["enabled"] = checked; } + } + } + Column { + spacing: 5 + Prop.PropCheckBox { + text: "Opaques in Front" + checked: root.mainViewTask.getConfig("DrawOverlayInFrontOpaqueBounds")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("DrawOverlayInFrontOpaqueBounds")["enabled"] = checked } + } + Prop.PropCheckBox { + text: "Transparents in Front" + checked: root.mainViewTask.getConfig("DrawOverlayInFrontTransparentBounds")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("DrawOverlayInFrontTransparentBounds")["enabled"] = checked } + } + Prop.PropCheckBox { + text: "Opaques in HUD" + checked: root.mainViewTask.getConfig("DrawOverlayHUDOpaqueBounds")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("DrawOverlayHUDOpaqueBounds")["enabled"] = checked } + } + Prop.PropCheckBox { + text: "Transparents in HUD" + checked: root.mainViewTask.getConfig("DrawOverlayHUDTransparentBounds")["enabled"] + onCheckedChanged: { root.mainViewTask.getConfig("DrawOverlayHUDTransparentBounds")["enabled"] = checked } + } + } + } +} diff --git a/scripts/developer/utilities/render/luci/Framebuffer.qml b/scripts/developer/utilities/render/luci/Framebuffer.qml new file mode 100644 index 0000000000..89d5e59002 --- /dev/null +++ b/scripts/developer/utilities/render/luci/Framebuffer.qml @@ -0,0 +1,69 @@ +// +// Framebuffer.qml +// +// Created by Sam Gateau on 4/18/2019 +// Copyright 2019 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: framebuffer + + property var config: Render.getConfig("RenderMainView.DebugDeferredBuffer") + + function setDebugMode(mode) { + framebuffer.config.enabled = (mode != 0); + framebuffer.config.mode = mode; + } + + Prop.PropEnum { + label: "Debug Buffer" + object: config + property: "mode" + valueVar: 0 + enums: [ + "Off", + "Depth", + "Albedo", + "Normal", + "Roughness", + "Metallic", + "Emissive", + "Unlit", + "Occlusion", + "Lightmap", + "Scattering", + "Lighting", + "Shadow Cascade 0", + "Shadow Cascade 1", + "Shadow Cascade 2", + "Shadow Cascade 3", + "Shadow Cascade Indices", + "Linear Depth", + "Half Linear Depth", + "Half Normal", + "Mid Curvature", + "Mid Normal", + "Low Curvature", + "Low Normal", + "Curvature Occlusion", + "Debug Scattering", + "Ambient Occlusion", + "Ambient Occlusion Blurred", + "Ambient Occlusion Normal", + "Velocity", + "Custom", + ] + + valueVarSetter: function (mode) { framebuffer.setDebugMode(mode) } + } +} \ No newline at end of file diff --git a/scripts/developer/utilities/render/luci/ShadingModel.qml b/scripts/developer/utilities/render/luci/ShadingModel.qml index 2c16492e80..78ca7f1740 100644 --- a/scripts/developer/utilities/render/luci/ShadingModel.qml +++ b/scripts/developer/utilities/render/luci/ShadingModel.qml @@ -10,18 +10,8 @@ import QtQuick 2.7 -import stylesUit 1.0 -import controlsUit 1.0 as HifiControls - -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.3 - -import stylesUit 1.0 -import controlsUit 1.0 as HifiControls - import "../../lib/prop" as Prop - Column { id: shadingModel; @@ -32,9 +22,6 @@ Column { anchors.left: parent.left anchors.right: parent.right anchors.margins: hifi.dimensions.contentMargin.x - HifiControls.Label { - text: "Shading" - } Row { anchors.left: parent.left anchors.right: parent.right @@ -54,8 +41,8 @@ Column { ] Prop.PropCheckBox { text: modelData.split(":")[0] - checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] - onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } + checked: shadingModel.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] + onCheckedChanged: { shadingModel.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } } } } @@ -76,8 +63,8 @@ Column { ] Prop.PropCheckBox { text: modelData.split(":")[0] - checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] - onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } + checked: shadingModel.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] + onCheckedChanged: { shadingModel.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } } } } @@ -96,8 +83,8 @@ Column { ] Prop.PropCheckBox { text: modelData.split(":")[0] - checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] - onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } + checked: shadingModel.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] + onCheckedChanged: { shadingModel.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } } } } diff --git a/scripts/developer/utilities/render/luci/ToneMapping.qml b/scripts/developer/utilities/render/luci/ToneMapping.qml new file mode 100644 index 0000000000..a76990e37c --- /dev/null +++ b/scripts/developer/utilities/render/luci/ToneMapping.qml @@ -0,0 +1,40 @@ +// +// ToneMapping.qml +// +// Created by Sam Gateau on 4/17/2019 +// Copyright 2019 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 + Prop.PropScalar { + label: "Exposure" + object: Render.getConfig("RenderMainView.ToneMapping") + property: "exposure" + min: -4 + max: 4 + anchors.left: parent.left + anchors.right: parent.right + } + Prop.PropEnum { + label: "Tone Curve" + object: Render.getConfig("RenderMainView.ToneMapping") + property: "curve" + enums: [ + "RGB", + "SRGB", + "Reinhard", + "Filmic", + ] + anchors.left: parent.left + anchors.right: parent.right + } +} diff --git a/scripts/developer/utilities/render/luci/qmldir b/scripts/developer/utilities/render/luci/qmldir index cf63b1c2b7..c88dfee714 100644 --- a/scripts/developer/utilities/render/luci/qmldir +++ b/scripts/developer/utilities/render/luci/qmldir @@ -1,2 +1,6 @@ -ShadingModel 1.0 ShadingModel.qml \ No newline at end of file +ShadingModel 1.0 ShadingModel.qml +ToneMapping 1.0 ToneMapping.qml +BoundingBoxes 1.0 BoundingBoxes.qml +Framebuffer 1.0 Framebuffer.qml +Antialiasing 1.0 Antialiasing.qml \ No newline at end of file