| @@ -7,204 +7,268 @@ · 6 unmodified lines |
| 7 | 7 | // Distributed under the Apache License, Version 2.0. |
| 8 | 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 | 11 | import QtQuick.Controls 1.4 |
| 12 | | −import "configSlider" |
| 12 | +import QtQuick.Layouts 1.3 |
| 13 | 13 | |
| 14 | | −Column { |
| 15 | | − spacing: 8 |
| 16 | | − property var mainViewTask: Render.getConfig("RenderMainView") |
| 14 | +import "qrc:///qml/styles-uit" |
| 15 | +import "qrc:///qml/controls-uit" as HifiControls |
| 16 | +import "configSlider" |
| 17 | + |
| 18 | +Rectangle { |
| 19 | + HifiConstants { id: hifi;} |
| 20 | + id: render; |
| 21 | + anchors.margins: hifi.dimensions.contentMargin.x |
| 17 | 22 | |
| 18 | | − Row { |
| 19 | | − spacing: 8 |
| 20 | | − Column { |
| 21 | | − spacing: 10 |
| 22 | | − Repeater { |
| 23 | | − model: [ |
| 24 | | − "Unlit:LightingModel:enableUnlit", |
| 25 | | − "Emissive:LightingModel:enableEmissive", |
| 26 | | − "Lightmap:LightingModel:enableLightmap", |
| 27 | | − "Background:LightingModel:enableBackground", |
| 28 | | − "ssao:AmbientOcclusion:enabled", |
| 29 | | − "Textures:LightingModel:enableMaterialTexturing" |
| 30 | | − ] |
| 31 | | − CheckBox { |
| 32 | | − text: modelData.split(":")[0] |
| 33 | | − checked: mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] |
| 34 | | − onCheckedChanged: { mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } |
| 23 | + color: hifi.colors.baseGray; |
| 24 | + property var mainViewTask: Render.getConfig("RenderMainView") |
| 25 | + |
| 26 | + Column { |
| 27 | + spacing: 5 |
| 28 | + anchors.left: parent.left |
| 29 | + anchors.right: parent.right |
| 30 | + anchors.margins: hifi.dimensions.contentMargin.x |
| 31 | + //padding: hifi.dimensions.contentMargin.x |
| 32 | + HifiControls.Label { |
| 33 | + text: "Shading" |
| 34 | + } |
| 35 | + Row { |
| 36 | + anchors.left: parent.left |
| 37 | + anchors.right: parent.right |
| 38 | + |
| 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 { |
| 41 | | − spacing: 10 |
| 42 | | − Repeater { |
| 43 | | − model: [ |
| 44 | | − "Obscurance:LightingModel:enableObscurance", |
| 45 | | − "Scattering:LightingModel:enableScattering", |
| 46 | | − "Diffuse:LightingModel:enableDiffuse", |
| 47 | | − "Specular:LightingModel:enableSpecular", |
| 48 | | − "Albedo:LightingModel:enableAlbedo", |
| 49 | | − "Wireframe:LightingModel:enableWireframe" |
| 50 | | − ] |
| 51 | | − CheckBox { |
| 52 | | − text: modelData.split(":")[0] |
| 53 | | − checked: mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] |
| 54 | | − onCheckedChanged: { mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } |
| 62 | + Column { |
| 63 | + spacing: 10 |
| 64 | + Repeater { |
| 65 | + model: [ |
| 66 | + "Obscurance:LightingModel:enableObscurance", |
| 67 | + "Scattering:LightingModel:enableScattering", |
| 68 | + "Diffuse:LightingModel:enableDiffuse", |
| 69 | + "Specular:LightingModel:enableSpecular", |
| 70 | + "Albedo:LightingModel:enableAlbedo", |
| 71 | + "Wireframe:LightingModel:enableWireframe" |
| 72 | + ] |
| 73 | + HifiControls.CheckBox { |
| 74 | + boxSize: 20 |
| 75 | + text: modelData.split(":")[0] |
| 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 | 104 | Column { |
| 60 | | − spacing: 10 |
| 105 | + anchors.left: parent.left |
| 106 | + anchors.right: parent.right |
| 107 | + spacing: 10 |
| 61 | 108 | Repeater { |
| 62 | | − model: [ |
| 63 | | − "Ambient:LightingModel:enableAmbientLight", |
| 64 | | − "Directional:LightingModel:enableDirectionalLight", |
| 65 | | − "Point:LightingModel:enablePointLight", |
| 66 | | − "Spot:LightingModel:enableSpotLight", |
| 67 | | − "Light Contour:LightingModel:showLightContour", |
| 68 | | − "Zone Stack:DrawZoneStack:enabled", |
| 69 | | − "Shadow:RenderShadowTask:enabled" |
| 70 | | − ] |
| 71 | | − CheckBox { |
| 72 | | − text: modelData.split(":")[0] |
| 73 | | − checked: mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] |
| 74 | | − onCheckedChanged: { mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } |
| 109 | + model: [ "Tone Mapping Exposure:ToneMapping:exposure:5.0:-5.0" |
| 110 | + ] |
| 111 | + ConfigSlider { |
| 112 | + label: qsTr(modelData.split(":")[0]) |
| 113 | + integral: false |
| 114 | + config: render.mainViewTask.getConfig(modelData.split(":")[1]) |
| 115 | + property: modelData.split(":")[2] |
| 116 | + max: modelData.split(":")[3] |
| 117 | + min: modelData.split(":")[4] |
| 118 | + |
| 119 | + anchors.left: parent.left |
| 120 | + anchors.right: parent.right |
| 75 | 121 | } |
| 76 | 122 | } |
| 77 | | − } |
| 78 | | − } |
| 79 | | − Column { |
| 80 | | − spacing: 10 |
| 81 | | − Repeater { |
| 82 | | − model: [ "Tone Mapping Exposure:ToneMapping:exposure:5.0:-5.0" |
| 83 | | − ] |
| 84 | | − ConfigSlider { |
| 85 | | − label: qsTr(modelData.split(":")[0]) |
| 86 | | − integral: false |
| 87 | | − config: mainViewTask.getConfig(modelData.split(":")[1]) |
| 88 | | − property: modelData.split(":")[2] |
| 89 | | − max: modelData.split(":")[3] |
| 90 | | − min: modelData.split(":")[4] |
| 123 | + |
| 124 | + Item { |
| 125 | + height: childrenRect.height |
| 126 | + anchors.left: parent.left |
| 127 | + anchors.right: parent.right |
| 128 | + |
| 129 | + HifiControls.Label { |
| 130 | + text: "Tone Mapping Curve" |
| 131 | + anchors.left: parent.left |
| 132 | + } |
| 133 | + |
| 134 | + HifiControls.ComboBox { |
| 135 | + anchors.right: parent.right |
| 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 { |
| 95 | | − Label { |
| 96 | | − text: "Tone Mapping Curve" |
| 97 | | − anchors.left: root.left |
| 156 | + id: framebuffer |
| 157 | + |
| 158 | + HifiControls.Label { |
| 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 { |
| 101 | | − anchors.right: root.right |
| 102 | | − currentIndex: 1 |
| 170 | + HifiControls.ComboBox { |
| 171 | + anchors.right: parent.right |
| 172 | + currentIndex: 0 |
| 103 | 173 | model: ListModel { |
| 104 | | − id: cbItems |
| 105 | | − ListElement { text: "RGB"; color: "Yellow" } |
| 106 | | − ListElement { text: "SRGB"; color: "Green" } |
| 107 | | − ListElement { text: "Reinhard"; color: "Yellow" } |
| 108 | | − ListElement { text: "Filmic"; color: "White" } |
| 174 | + id: cbItemsFramebuffer |
| 175 | + ListElement { text: "Off"; color: "Yellow" } |
| 176 | + ListElement { text: "Depth"; color: "Green" } |
| 177 | + ListElement { text: "Albedo"; color: "Yellow" } |
| 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 | 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 { |
| 120 | | − text: "Debug Framebuffer" |
| 121 | | − anchors.left: root.left |
| 122 | | − } |
| 123 | | − |
| 124 | | − property var config: mainViewTask.getConfig("DebugDeferredBuffer") |
| 206 | + Separator {} |
| 207 | + Row { |
| 208 | + spacing: 10 |
| 209 | + Column { |
| 210 | + spacing: 10 |
| 125 | 211 | |
| 126 | | − function setDebugMode(mode) { |
| 127 | | − framebuffer.config.enabled = (mode != 0); |
| 128 | | − framebuffer.config.mode = mode; |
| 129 | | − } |
| 212 | + HifiControls.CheckBox { |
| 213 | + boxSize: 20 |
| 214 | + text: "Opaques" |
| 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 |
| 163 | | − onCurrentIndexChanged: { framebuffer.setDebugMode(currentIndex) } |
| 164 | | − } |
| 165 | | − } |
| 166 | | − |
| 167 | | − Row { |
| 168 | | − Column { |
| 169 | | − |
| 170 | | − CheckBox { |
| 171 | | − text: "Opaques" |
| 172 | | − checked: mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] |
| 173 | | − onCheckedChanged: { mainViewTask.getConfig("DrawOpaqueBounds")["enabled"] = checked } |
| 174 | | − } |
| 175 | | − CheckBox { |
| 176 | | − text: "Transparents" |
| 177 | | − checked: mainViewTask.getConfig("DrawTransparentBounds")["enabled"] |
| 178 | | − onCheckedChanged: { mainViewTask.getConfig("DrawTransparentBounds")["enabled"] = checked } |
| 179 | | − } |
| 180 | | − CheckBox { |
| 181 | | − text: "Overlay Opaques" |
| 182 | | − checked: mainViewTask.getConfig("DrawOverlayOpaqueBounds")["enabled"] |
| 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; } |
| 250 | + Column { |
| 251 | + spacing: 10 |
| 252 | + HifiControls.CheckBox { |
| 253 | + boxSize: 20 |
| 254 | + text: "Metas" |
| 255 | + checked: render.mainViewTask.getConfig("DrawMetaBounds")["enabled"] |
| 256 | + onCheckedChanged: { render.mainViewTask.getConfig("DrawMetaBounds")["enabled"] = checked } |
| 257 | + } |
| 258 | + HifiControls.CheckBox { |
| 259 | + boxSize: 20 |
| 260 | + text: "Lights" |
| 261 | + checked: render.mainViewTask.getConfig("DrawLightBounds")["enabled"] |
| 262 | + onCheckedChanged: { render.mainViewTask.getConfig("DrawLightBounds")["enabled"] = checked; } |
| 263 | + } |
| 264 | + HifiControls.CheckBox { |
| 265 | + boxSize: 20 |
| 266 | + text: "Zones" |
| 267 | + checked: render.mainViewTask.getConfig("DrawZones")["enabled"] |
| 268 | + onCheckedChanged: { render.mainViewTask.getConfig("ZoneRenderer")["enabled"] = checked; render.mainViewTask.getConfig("DrawZones")["enabled"] = checked; } |
| 269 | + } |
| 270 | + } |
| 206 | 271 | } |
| 207 | 272 | } |
| 208 | | − } |
| 273 | + //} |
| 209 | 274 | } |
| 210 | | − |