| @@ -7,204 +7,268 @@ · 6 unmodified lines |
| 7 | // Distributed under the Apache License, Version 2.0. | 7 | // Distributed under the Apache License, Version 2.0. |
| 8 | // See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html | 8 | // See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html |
| 9 | // | 9 | // |
| 10 | import QtQuick 2.5 | 10 | import QtQuick 2.7 |
| 11 | import QtQuick.Controls 1.4 | 11 | import QtQuick.Controls 1.4 |
| 12 | import "configSlider" | 12 | import QtQuick.Layouts 1.3 |
| 13 | | 13 | |
| 14 | Column { | 14 | import "qrc:///qml/styles-uit" |
| 15 | spacing: 8 | 15 | import "qrc:///qml/controls-uit" as HifiControls |
| 16 | property var mainViewTask: Render.getConfig("RenderMainView") | 16 | import "configSlider" |
| | 17 | |
| | 18 | Rectangle { |
| | 19 | HifiConstants { id: hifi;} |
| | 20 | id: render; |
| | 21 | anchors.margins: hifi.dimensions.contentMargin.x |
| 17 | | 22 | |
| 18 | Row { | 23 | color: hifi.colors.baseGray; |
| 19 | spacing: 8 | 24 | property var mainViewTask: Render.getConfig("RenderMainView") |
| 20 | Column { | 25 | |
| 21 | spacing: 10 | 26 | Column { |
| 22 | Repeater { | 27 | spacing: 5 |
| 23 | model: [ | 28 | anchors.left: parent.left |
| 24 | "Unlit:LightingModel:enableUnlit", | 29 | anchors.right: parent.right |
| 25 | "Emissive:LightingModel:enableEmissive", | 30 | anchors.margins: hifi.dimensions.contentMargin.x |
| 26 | "Lightmap:LightingModel:enableLightmap", | 31 | //padding: hifi.dimensions.contentMargin.x |
| 27 | "Background:LightingModel:enableBackground", | 32 | HifiControls.Label { |
| 28 | "ssao:AmbientOcclusion:enabled", | 33 | text: "Shading" |
| 29 | "Textures:LightingModel:enableMaterialTexturing" | 34 | } |
| 30 | ] | 35 | Row { |
| 31 | CheckBox { | 36 | anchors.left: parent.left |
| 32 | text: modelData.split(":")[0] | 37 | anchors.right: parent.right |
| 33 | checked: mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] | 38 | |
| 34 | onCheckedChanged: { mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } | 39 | spacing: 20 |
| | 40 | Column { |
| | 41 | spacing: 10 |
| | 42 | // padding: 10 |
| | 43 | Repeater { |
| | 44 | model: [ |
| | 45 | "Unlit:LightingModel:enableUnlit", |
| | 46 | "Emissive:LightingModel:enableEmissive", |
| | 47 | "Lightmap:LightingModel:enableLightmap", |
| | 48 | "Background:LightingModel:enableBackground", |
| | 49 | "ssao:AmbientOcclusion:enabled", |
| | 50 | "Textures:LightingModel:enableMaterialTexturing" |
| | 51 | ] |
| | 52 | HifiControls.CheckBox { |
| | 53 | boxSize: 20 |
| | 54 | text: modelData.split(":")[0] |
| | 55 | checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] |
| | 56 | onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } |
| | 57 | } |
| 35 | } | 58 | } |
| 36 | } | 59 | } |
| 37 | } | | |
| 38 | | 60 | |
| 39 | | 61 | |
| 40 | Column { | 62 | Column { |
| 41 | spacing: 10 | 63 | spacing: 10 |
| 42 | Repeater { | 64 | Repeater { |
| 43 | model: [ | 65 | model: [ |
| 44 | "Obscurance:LightingModel:enableObscurance", | 66 | "Obscurance:LightingModel:enableObscurance", |
| 45 | "Scattering:LightingModel:enableScattering", | 67 | "Scattering:LightingModel:enableScattering", |
| 46 | "Diffuse:LightingModel:enableDiffuse", | 68 | "Diffuse:LightingModel:enableDiffuse", |
| 47 | "Specular:LightingModel:enableSpecular", | 69 | "Specular:LightingModel:enableSpecular", |
| 48 | "Albedo:LightingModel:enableAlbedo", | 70 | "Albedo:LightingModel:enableAlbedo", |
| 49 | "Wireframe:LightingModel:enableWireframe" | 71 | "Wireframe:LightingModel:enableWireframe" |
| 50 | ] | 72 | ] |
| 51 | CheckBox { | 73 | HifiControls.CheckBox { |
| 52 | text: modelData.split(":")[0] | 74 | boxSize: 20 |
| 53 | checked: mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] | 75 | text: modelData.split(":")[0] |
| 54 | onCheckedChanged: { mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } | 76 | checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] |
| | 77 | onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } |
| | 78 | } |
| 55 | } | 79 | } |
| 56 | } | 80 | } |
| 57 | } | | |
| 58 | | 81 | |
| | 82 | Column { |
| | 83 | spacing: 10 |
| | 84 | Repeater { |
| | 85 | model: [ |
| | 86 | "Ambient:LightingModel:enableAmbientLight", |
| | 87 | "Directional:LightingModel:enableDirectionalLight", |
| | 88 | "Point:LightingModel:enablePointLight", |
| | 89 | "Spot:LightingModel:enableSpotLight", |
| | 90 | "Light Contour:LightingModel:showLightContour", |
| | 91 | "Zone Stack:DrawZoneStack:enabled", |
| | 92 | "Shadow:RenderShadowTask:enabled" |
| | 93 | ] |
| | 94 | HifiControls.CheckBox { |
| | 95 | boxSize: 20 |
| | 96 | text: modelData.split(":")[0] |
| | 97 | checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] |
| | 98 | onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } |
| | 99 | } |
| | 100 | } |
| | 101 | } |
| | 102 | } |
| | 103 | Separator {} |
| 59 | Column { | 104 | Column { |
| 60 | spacing: 10 | 105 | anchors.left: parent.left |
| | 106 | anchors.right: parent.right |
| | 107 | spacing: 10 |
| 61 | Repeater { | 108 | Repeater { |
| 62 | model: [ | 109 | model: [ "Tone Mapping Exposure:ToneMapping:exposure:5.0:-5.0" |
| 63 | "Ambient:LightingModel:enableAmbientLight", | 110 | ] |
| 64 | "Directional:LightingModel:enableDirectionalLight", | 111 | ConfigSlider { |
| 65 | "Point:LightingModel:enablePointLight", | 112 | label: qsTr(modelData.split(":")[0]) |
| 66 | "Spot:LightingModel:enableSpotLight", | 113 | integral: false |
| 67 | "Light Contour:LightingModel:showLightContour", | 114 | config: render.mainViewTask.getConfig(modelData.split(":")[1]) |
| 68 | "Zone Stack:DrawZoneStack:enabled", | 115 | property: modelData.split(":")[2] |
| 69 | "Shadow:RenderShadowTask:enabled" | 116 | max: modelData.split(":")[3] |
| 70 | ] | 117 | min: modelData.split(":")[4] |
| 71 | CheckBox { | 118 | |
| 72 | text: modelData.split(":")[0] | 119 | anchors.left: parent.left |
| 73 | checked: mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] | 120 | anchors.right: parent.right |
| 74 | onCheckedChanged: { mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } | | |
| 75 | } | 121 | } |
| 76 | } | 122 | } |
| 77 | } | 123 | |
| 78 | } | 124 | Item { |
| 79 | Column { | 125 | height: childrenRect.height |
| 80 | spacing: 10 | 126 | anchors.left: parent.left |
| 81 | Repeater { | 127 | anchors.right: parent.right |
| 82 | model: [ "Tone Mapping Exposure:ToneMapping:exposure:5.0:-5.0" | 128 | |
| 83 | ] | 129 | HifiControls.Label { |
| 84 | ConfigSlider { | 130 | text: "Tone Mapping Curve" |
| 85 | label: qsTr(modelData.split(":")[0]) | 131 | anchors.left: parent.left |
| 86 | integral: false | 132 | } |
| 87 | config: mainViewTask.getConfig(modelData.split(":")[1]) | 133 | |
| 88 | property: modelData.split(":")[2] | 134 | HifiControls.ComboBox { |
| 89 | max: modelData.split(":")[3] | 135 | anchors.right: parent.right |
| 90 | min: modelData.split(":")[4] | 136 | currentIndex: 1 |
| | 137 | model: ListModel { |
| | 138 | id: cbItems |
| | 139 | ListElement { text: "RGB"; color: "Yellow" } |
| | 140 | ListElement { text: "SRGB"; color: "Green" } |
| | 141 | ListElement { text: "Reinhard"; color: "Yellow" } |
| | 142 | ListElement { text: "Filmic"; color: "White" } |
| | 143 | } |
| | 144 | width: 200 |
| | 145 | onCurrentIndexChanged: { render.mainViewTask.getConfig("ToneMapping")["curve"] = currentIndex } |
| | 146 | } |
| 91 | } | 147 | } |
| 92 | } | 148 | } |
| | 149 | Separator {} |
| | 150 | |
| | 151 | Item { |
| | 152 | height: childrenRect.height |
| | 153 | anchors.left: parent.left |
| | 154 | anchors.right: parent.right |
| 93 | | 155 | |
| 94 | Row { | 156 | id: framebuffer |
| 95 | Label { | 157 | |
| 96 | text: "Tone Mapping Curve" | 158 | HifiControls.Label { |
| 97 | anchors.left: root.left | 159 | text: "Debug Framebuffer" |
| | 160 | anchors.left: parent.left |
| | 161 | } |
| | 162 | |
| | 163 | property var config: render.mainViewTask.getConfig("DebugDeferredBuffer") |
| | 164 | |
| | 165 | function setDebugMode(mode) { |
| | 166 | framebuffer.config.enabled = (mode != 0); |
| | 167 | framebuffer.config.mode = mode; |
| 98 | } | 168 | } |
| 99 | | 169 | |
| 100 | ComboBox { | 170 | HifiControls.ComboBox { |
| 101 | anchors.right: root.right | 171 | anchors.right: parent.right |
| 102 | currentIndex: 1 | 172 | currentIndex: 0 |
| 103 | model: ListModel { | 173 | model: ListModel { |
| 104 | id: cbItems | 174 | id: cbItemsFramebuffer |
| 105 | ListElement { text: "RGB"; color: "Yellow" } | 175 | ListElement { text: "Off"; color: "Yellow" } |
| 106 | ListElement { text: "SRGB"; color: "Green" } | 176 | ListElement { text: "Depth"; color: "Green" } |
| 107 | ListElement { text: "Reinhard"; color: "Yellow" } | 177 | ListElement { text: "Albedo"; color: "Yellow" } |
| 108 | ListElement { text: "Filmic"; color: "White" } | 178 | ListElement { text: "Normal"; color: "White" } |
| | 179 | ListElement { text: "Roughness"; color: "White" } |
| | 180 | ListElement { text: "Metallic"; color: "White" } |
| | 181 | ListElement { text: "Emissive"; color: "White" } |
| | 182 | ListElement { text: "Unlit"; color: "White" } |
| | 183 | ListElement { text: "Occlusion"; color: "White" } |
| | 184 | ListElement { text: "Lightmap"; color: "White" } |
| | 185 | ListElement { text: "Scattering"; color: "White" } |
| | 186 | ListElement { text: "Lighting"; color: "White" } |
| | 187 | ListElement { text: "Shadow"; color: "White" } |
| | 188 | ListElement { text: "Linear Depth"; color: "White" } |
| | 189 | ListElement { text: "Half Linear Depth"; color: "White" } |
| | 190 | ListElement { text: "Half Normal"; color: "White" } |
| | 191 | ListElement { text: "Mid Curvature"; color: "White" } |
| | 192 | ListElement { text: "Mid Normal"; color: "White" } |
| | 193 | ListElement { text: "Low Curvature"; color: "White" } |
| | 194 | ListElement { text: "Low Normal"; color: "White" } |
| | 195 | ListElement { text: "Curvature Occlusion"; color: "White" } |
| | 196 | ListElement { text: "Debug Scattering"; color: "White" } |
| | 197 | ListElement { text: "Ambient Occlusion"; color: "White" } |
| | 198 | ListElement { text: "Ambient Occlusion Blurred"; color: "White" } |
| | 199 | ListElement { text: "Custom"; color: "White" } |
| 109 | } | 200 | } |
| 110 | width: 200 | 201 | width: 200 |
| 111 | onCurrentIndexChanged: { mainViewTask.getConfig("ToneMapping")["curve"] = currentIndex } | 202 | onCurrentIndexChanged: { framebuffer.setDebugMode(currentIndex) } |
| 112 | } | 203 | } |
| 113 | } | 204 | } |
| 114 | } | | |
| 115 | Row { | | |
| 116 | id: framebuffer | | |
| 117 | spacing: 10 | | |
| 118 | | 205 | |
| 119 | Label { | 206 | Separator {} |
| 120 | text: "Debug Framebuffer" | 207 | Row { |
| 121 | anchors.left: root.left | 208 | spacing: 10 |
| 122 | } | 209 | Column { |
| 123 | | 210 | spacing: 10 |
| 124 | property var config: mainViewTask.getConfig("DebugDeferredBuffer") | | |
| 125 | | 211 | |
| 126 | function setDebugMode(mode) { | 212 | HifiControls.CheckBox { |
| 127 | framebuffer.config.enabled = (mode != 0); | 213 | boxSize: 20 |
| 128 | framebuffer.config.mode = mode; | 214 | text: "Opaques" |
| 129 | } | 215 | checked: render.mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] |
| | 216 | onCheckedChanged: { render.mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] = checked } |
| | 217 | } |
| | 218 | HifiControls.CheckBox { |
| | 219 | boxSize: 20 |
| | 220 | text: "Transparents" |
| | 221 | checked: render.mainViewTask.getConfig("DrawTransparentBounds")["enabled"] |
| | 222 | onCheckedChanged: { render.mainViewTask.getConfig("DrawTransparentBounds")["enabled"] = checked } |
| | 223 | } |
| | 224 | HifiControls.CheckBox { |
| | 225 | boxSize: 20 |
| | 226 | text: "Opaques in Front" |
| | 227 | checked: render.mainViewTask.getConfig("DrawOverlayInFrontOpaqueBounds")["enabled"] |
| | 228 | onCheckedChanged: { render.mainViewTask.getConfig("DrawOverlayInFrontOpaqueBounds")["enabled"] = checked } |
| | 229 | } |
| | 230 | HifiControls.CheckBox { |
| | 231 | boxSize: 20 |
| | 232 | text: "Transparents in Front" |
| | 233 | checked: render.mainViewTask.getConfig("DrawOverlayInFrontTransparentBounds")["enabled"] |
| | 234 | onCheckedChanged: { render.mainViewTask.getConfig("DrawOverlayInFrontTransparentBounds")["enabled"] = checked } |
| | 235 | } |
| | 236 | HifiControls.CheckBox { |
| | 237 | boxSize: 20 |
| | 238 | text: "Opaques in HUD" |
| | 239 | checked: render.mainViewTask.getConfig("DrawOverlayHUDOpaqueBounds")["enabled"] |
| | 240 | onCheckedChanged: { render.mainViewTask.getConfig("DrawOverlayHUDOpaqueBounds")["enabled"] = checked } |
| | 241 | } |
| | 242 | HifiControls.CheckBox { |
| | 243 | boxSize: 20 |
| | 244 | text: "Transparents in HUD" |
| | 245 | checked: render.mainViewTask.getConfig("DrawOverlayHUDTransparentBounds")["enabled"] |
| | 246 | onCheckedChanged: { render.mainViewTask.getConfig("DrawOverlayHUDTransparentBounds")["enabled"] = checked } |
| | 247 | } |
| 130 | | 248 | |
| 131 | ComboBox { | | |
| 132 | anchors.right: root.right | | |
| 133 | currentIndex: 0 | | |
| 134 | model: ListModel { | | |
| 135 | id: cbItemsFramebuffer | | |
| 136 | ListElement { text: "Off"; color: "Yellow" } | | |
| 137 | ListElement { text: "Depth"; color: "Green" } | | |
| 138 | ListElement { text: "Albedo"; color: "Yellow" } | | |
| 139 | ListElement { text: "Normal"; color: "White" } | | |
| 140 | ListElement { text: "Roughness"; color: "White" } | | |
| 141 | ListElement { text: "Metallic"; color: "White" } | | |
| 142 | ListElement { text: "Emissive"; color: "White" } | | |
| 143 | ListElement { text: "Unlit"; color: "White" } | | |
| 144 | ListElement { text: "Occlusion"; color: "White" } | | |
| 145 | ListElement { text: "Lightmap"; color: "White" } | | |
| 146 | ListElement { text: "Scattering"; color: "White" } | | |
| 147 | ListElement { text: "Lighting"; color: "White" } | | |
| 148 | ListElement { text: "Shadow"; color: "White" } | | |
| 149 | ListElement { text: "Linear Depth"; color: "White" } | | |
| 150 | ListElement { text: "Half Linear Depth"; color: "White" } | | |
| 151 | ListElement { text: "Half Normal"; color: "White" } | | |
| 152 | ListElement { text: "Mid Curvature"; color: "White" } | | |
| 153 | ListElement { text: "Mid Normal"; color: "White" } | | |
| 154 | ListElement { text: "Low Curvature"; color: "White" } | | |
| 155 | ListElement { text: "Low Normal"; color: "White" } | | |
| 156 | ListElement { text: "Curvature Occlusion"; color: "White" } | | |
| 157 | ListElement { text: "Debug Scattering"; color: "White" } | | |
| 158 | ListElement { text: "Ambient Occlusion"; color: "White" } | | |
| 159 | ListElement { text: "Ambient Occlusion Blurred"; color: "White" } | | |
| 160 | ListElement { text: "Custom"; color: "White" } | | |
| 161 | } | 249 | } |
| 162 | width: 200 | 250 | Column { |
| 163 | onCurrentIndexChanged: { framebuffer.setDebugMode(currentIndex) } | 251 | spacing: 10 |
| 164 | } | 252 | HifiControls.CheckBox { |
| 165 | } | 253 | boxSize: 20 |
| 166 | | 254 | text: "Metas" |
| 167 | Row { | 255 | checked: render.mainViewTask.getConfig("DrawMetaBounds")["enabled"] |
| 168 | Column { | 256 | onCheckedChanged: { render.mainViewTask.getConfig("DrawMetaBounds")["enabled"] = checked } |
| 169 | | 257 | } |
| 170 | CheckBox { | 258 | HifiControls.CheckBox { |
| 171 | text: "Opaques" | 259 | boxSize: 20 |
| 172 | checked: mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] | 260 | text: "Lights" |
| 173 | onCheckedChanged: { mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] = checked } | 261 | checked: render.mainViewTask.getConfig("DrawLightBounds")["enabled"] |
| 174 | } | 262 | onCheckedChanged: { render.mainViewTask.getConfig("DrawLightBounds")["enabled"] = checked; } |
| 175 | CheckBox { | 263 | } |
| 176 | text: "Transparents" | 264 | HifiControls.CheckBox { |
| 177 | checked: mainViewTask.getConfig("DrawTransparentBounds")["enabled"] | 265 | boxSize: 20 |
| 178 | onCheckedChanged: { mainViewTask.getConfig("DrawTransparentBounds")["enabled"] = checked } | 266 | text: "Zones" |
| 179 | } | 267 | checked: render.mainViewTask.getConfig("DrawZones")["enabled"] |
| 180 | CheckBox { | 268 | onCheckedChanged: { render.mainViewTask.getConfig("ZoneRenderer")["enabled"] = checked; render.mainViewTask.getConfig("DrawZones")["enabled"] = checked; } |
| 181 | text: "Overlay Opaques" | 269 | } |
| 182 | checked: mainViewTask.getConfig("DrawOverlayOpaqueBounds")["enabled"] | 270 | } |
| 183 | onCheckedChanged: { mainViewTask.getConfig("DrawOverlayOpaqueBounds")["enabled"] = checked } | | |
| 184 | } | | |
| 185 | CheckBox { | | |
| 186 | text: "Overlay Transparents" | | |
| 187 | checked: mainViewTask.getConfig("DrawOverlayTransparentBounds")["enabled"] | | |
| 188 | onCheckedChanged: { mainViewTask.getConfig("DrawOverlayTransparentBounds")["enabled"] = checked } | | |
| 189 | } | | |
| 190 | } | | |
| 191 | Column { | | |
| 192 | CheckBox { | | |
| 193 | text: "Metas" | | |
| 194 | checked: mainViewTask.getConfig("DrawMetaBounds")["enabled"] | | |
| 195 | onCheckedChanged: { mainViewTask.getConfig("DrawMetaBounds")["enabled"] = checked } | | |
| 196 | } | | |
| 197 | CheckBox { | | |
| 198 | text: "Lights" | | |
| 199 | checked: mainViewTask.getConfig("DrawLightBounds")["enabled"] | | |
| 200 | onCheckedChanged: { mainViewTask.getConfig("DrawLightBounds")["enabled"] = checked; } | | |
| 201 | } | | |
| 202 | CheckBox { | | |
| 203 | text: "Zones" | | |
| 204 | checked: mainViewTask.getConfig("DrawZones")["enabled"] | | |
| 205 | onCheckedChanged: { mainViewTask.getConfig("ZoneRenderer")["enabled"] = checked; mainViewTask.getConfig("DrawZones")["enabled"] = checked; } | | |
| 206 | } | 271 | } |
| 207 | } | 272 | } |
| 208 | } | 273 | //} |
| 209 | } | 274 | } |
| 210 | | | |