History

Merge branch 'master' of git://github.com/highfidelity/hifi into bloom

Olivier Prat committed 9 years ago

Commit fcf1c302 parents 055270d ff36cbf454 files · +14270 −6319Browse files

Showing the changes to scripts/developer (9 of 454 files). Show all

Unified · Split

9 files
  1. scripts/developer/debugging/debugHaze.qml +185 −0
  2. scripts/developer/debugging/debugWindow.js +4 −0
  3. scripts/developer/debugging/surfaceGeometryPass.qml +64 −0
  4. scripts/developer/tests/avatarToWorldTests.js +0 −2
  5. scripts/developer/tests/hazeTestInitialPose.js +5 −0
  6. scripts/developer/utilities/render/configSlider/ConfigSlider.qml +24 −18
  7. scripts/developer/utilities/render/debugDeferredLighting.js +0 −49
  8. scripts/developer/utilities/render/deferredLighting.qml +234 −170
  9. scripts/developer/utilities/render/luci.js +102 −0
scripts/developer/debugging/debugHaze.qml+185−0
@@ -0,0 +1,185 @@
1//
2// haze.qml
3// developer/utilities/render
4//
5// Nissim Hadar, created on 9/8/2017.
6// Copyright 2017 High Fidelity, Inc.
7//
8// Distributed under the Apache License, Version 2.0.
9// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
10//
11import QtQuick 2.5
12import QtQuick.Controls 1.4
13import "../utilities/render/configSlider"
14
15Item {
16 id: root
17 property var hazeModel: Render.getConfig("RenderMainView.HazeModel")
18
19 Column {
20 spacing: 8
21
22 Row {
23 CheckBox {
24 text: "Haze Active"
25 checked: root.hazeModel["isHazeActive"]
26 onCheckedChanged: {
27 root.hazeModel["isHazeActive"] = checked;
28 }
29 }
30
31 CheckBox {
32 text: "Modulated Color"
33 checked: root.hazeModel["isModulateColorActive"]
34 onCheckedChanged: {
35 root.hazeModel["isModulateColorActive"] = checked;
36 }
37 }
38 }
39 CheckBox {
40 text: "Altitude Based"
41 checked: root.hazeModel["isAltitudeBased"]
42 onCheckedChanged: {
43 root.hazeModel["isAltitudeBased"] = checked;
44 }
45 }
46
47 ConfigSlider {
48 label: "Range"
49 integral: false
50 config: root.hazeModel
51 property: "hazeRange_m"
52 max: 10000
53 min: 5
54 width: 280
55 }
56
57 ConfigSlider {
58 label: "Altitude"
59 integral: false
60 config: root.hazeModel
61 property: "hazeAltitude_m"
62 max: 2000
63 min: 5
64 width: 280
65 }
66
67 ConfigSlider {
68 label: "Haze Color R"
69 integral: false
70 config: root.hazeModel
71 property: "hazeColor.r"
72 max: 1.0
73 min: 0.0
74 width: 280
75 }
76
77 ConfigSlider {
78 label: "Haze Color G"
79 integral: false
80 config: root.hazeModel
81 property: "hazeColor.g"
82 max: 1.0
83 min: 0.0
84 width: 280
85 }
86
87 ConfigSlider {
88 label: "Haze Color B"
89 integral: false
90 config: root.hazeModel
91 property: "hazeColor.b"
92 max: 1.0
93 min: 0.0
94 width: 280
95 }
96
97 ConfigSlider {
98 label: "Sun R"
99 integral: false
100 config: root.hazeModel
101 property: "hazeGlareColor.r"
102 max: 1.0
103 min: 0.0
104 width: 280
105 }
106
107 ConfigSlider {
108 label: "Sun G"
109 integral: false
110 config: root.hazeModel
111 property: "hazeGlareColor.g"
112 max: 1.0
113 min: 0.0
114 width: 280
115 }
116
117 ConfigSlider {
118 label: "Sun B"
119 integral: false
120 config: root.hazeModel
121 property: "hazeGlareColor.b"
122 max: 1.0
123 min: 0.0
124 width: 280
125 }
126
127 ConfigSlider {
128 label: "Sun glare angle"
129 integral: false
130 config: root.hazeModel
131 property: "hazeGlareAngle_degs"
132 max: 70.0
133 min: 0.0
134 width: 280
135 }
136
137 ConfigSlider {
138 label: "Base"
139 integral: false
140 config: root.hazeModel
141 property: "hazeBaseReference"
142 max: 500.0
143 min: -500.0
144 width: 280
145 }
146
147 ConfigSlider {
148 label: "BG Blend"
149 integral: false
150 config: root.hazeModel
151 property: "hazeBackgroundBlend"
152 max: 1.0
153 min: 0.0
154 width: 280
155 }
156
157 CheckBox {
158 text: "Keylight Attenuation"
159 checked: root.hazeModel["isKeyLightAttenuationActive"]
160 onCheckedChanged: {
161 root.hazeModel["isKeyLightAttenuationActive"] = checked;
162 }
163 }
164
165 ConfigSlider {
166 label: "Range"
167 integral: false
168 config: root.hazeModel
169 property: "hazeKeyLightRange_m"
170 max: 10000
171 min: 5
172 width: 280
173 }
174
175 ConfigSlider {
176 label: "Altitude"
177 integral: false
178 config: root.hazeModel
179 property: "hazeKeyLightAltitude_m"
180 max: 2000
181 min: 5
182 width: 280
183 }
184 }
185}
scripts/developer/debugging/debugWindow.js+4−0
@@ -53,4 +53,8 @@ ScriptDiscoveryService.clearDebugWindow.connect(function() { · 52 unmodified lines
53 window.clearDebugWindow();53 window.clearDebugWindow();
54});54});
55 55
56Script.scriptEnding.connect(function () {
57 window.close();
58})
59
56}());60}());
scripts/developer/debugging/surfaceGeometryPass.qml+64−0
@@ -0,0 +1,64 @@
1//
2// surfaceGeometryPass.qml
3//
4// Created by Sam Gateau on 6/6/2016
5// Copyright 2016 High Fidelity, Inc.
6//
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
9//
10import QtQuick 2.5
11import QtQuick.Controls 1.4
12import "configSlider"
13
14Column {
15 spacing: 8
16 Column {
17 id: surfaceGeometry
18 spacing: 10
19
20 Column{
21 ConfigSlider {
22 label: qsTr("Depth Threshold [cm]")
23 integral: false
24 config: Render.getConfig("RenderMainView.SurfaceGeometry")
25 property: "depthThreshold"
26 max: 5.0
27 min: 0.0
28 }
29 Repeater {
30 model: [
31 "Basis Scale:basisScale:2.0:false",
32 "Curvature Scale:curvatureScale:100.0:false",
33 ]
34 ConfigSlider {
35 label: qsTr(modelData.split(":")[0])
36 integral: (modelData.split(":")[3] == 'true')
37 config: Render.getConfig("RenderMainView.SurfaceGeometry")
38 property: modelData.split(":")[1]
39 max: modelData.split(":")[2]
40 min: 0.0
41 }
42 }
43 CheckBox {
44 text: "Half Resolution"
45 checked: Render.getConfig("RenderMainView.SurfaceGeometry")["resolutionLevel"]
46 onCheckedChanged: { Render.getConfig("RenderMainView.SurfaceGeometry")["resolutionLevel"] = checked }
47 }
48
49 Repeater {
50 model: [ "Diffusion Scale:RenderMainView.SurfaceGeometry:diffuseFilterScale:2.0",
51 "Diffusion Depth Threshold:RenderMainView.SurfaceGeometry:diffuseDepthThreshold:1.0"
52 ]
53 ConfigSlider {
54 label: qsTr(modelData.split(":")[0])
55 integral: false
56 config: Render.getConfig(modelData.split(":")[1])
57 property: modelData.split(":")[2]
58 max: modelData.split(":")[3]
59 min: 0.0
60 }
61 }
62 }
63 }
64}
scripts/developer/tests/avatarToWorldTests.js+0−2
@@ -1,5 +1,3 @@
1var AVATAR_SELF_ID = "{00000000-0000-0000-0000-000000000001}";
2
3var debugSphereBaseProperties = {1var debugSphereBaseProperties = {
4 type: "Sphere",2 type: "Sphere",
5 dimensions: { x: 0.2, y: 0.2, z: 0.2 },3 dimensions: { x: 0.2, y: 0.2, z: 0.2 },
scripts/developer/tests/hazeTestInitialPose.js+5−0
@@ -0,0 +1,5 @@
1var ORIGIN = {x: -68.7, y: 27.4, z: 487.7};
2var ROT_IDENT = {x: 0, y: 0.901, z: 0, w: 0.434};
3
4MyAvatar.position = ORIGIN;
5MyAvatar.orientation = ROT_IDENT;
scripts/developer/utilities/render/configSlider/ConfigSlider.qml+24−18
@@ -1,6 +1,5 @@
1//1//
2// ConfigSlider.qml2// ConfigSlider.qml
3// examples/utilities/tools/render
4//3//
5// Created by Zach Pomerantz on 2/8/20164// Created by Zach Pomerantz on 2/8/2016
6// Copyright 2016 High Fidelity, Inc.5// Copyright 2016 High Fidelity, Inc.
@@ -8,12 +7,21 @@ · 1 unmodified line
8// Distributed under the Apache License, Version 2.0.7// Distributed under the Apache License, Version 2.0.
9// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html8// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
10//9//
11import QtQuick 2.510
12import QtQuick.Controls 1.411import QtQuick 2.7
12import QtQuick.Controls 1.4 as Original
13import QtQuick.Controls.Styles 1.4
14
15import "qrc:///qml/styles-uit"
16import "qrc:///qml/controls-uit" as HifiControls
17
13 18
14Item {19Item {
20 HifiConstants { id: hifi }
15 id: root21 id: root
16 width: 40022
23 anchors.left: parent.left
24 anchors.right: parent.right
17 height: 2425 height: 24
18 property bool integral: false26 property bool integral: false
19 property var config27 property var config
@@ -28,22 +36,21 @@ Item { · 8 unmodified lines
28 bindingControl.when = true;36 bindingControl.when = true;
29 }37 }
30 38
31 Label {39 HifiControls.Label {
32 id: labelControl40 id: labelControl
33 text: root.label41 text: root.label
42 enabled: true
34 anchors.left: root.left43 anchors.left: root.left
35 anchors.leftMargin: 844 anchors.right: root.horizontalCenter
36 anchors.top: root.top45 anchors.verticalCenter: root.verticalCenter
37 anchors.topMargin: 7
38 }46 }
39 47
40 Label {48 HifiControls.Label {
41 id: labelValue49 id: labelValue
42 text: sliderControl.value.toFixed(root.integral ? 0 : 2)50 text: sliderControl.value.toFixed(root.integral ? 0 : 2)
43 anchors.left: root.left51 anchors.right: root.right
44 anchors.leftMargin: 20052 anchors.bottom: root.bottom
45 anchors.top: root.top53 anchors.bottomMargin: 0
46 anchors.topMargin: 15
47 }54 }
48 55
49 Binding {56 Binding {
@@ -54,14 +61,13 @@ Item { · 4 unmodified lines
54 when: false61 when: false
55 }62 }
56 63
57 Slider {64 HifiControls.Slider {
58 id: sliderControl65 id: sliderControl
59 stepSize: root.integral ? 1.0 : 0.066 stepSize: root.integral ? 1.0 : 0.0
60 width: root.width-13067 anchors.left: root.horizontalCenter
61 height: 20
62 anchors.right: root.right68 anchors.right: root.right
63 anchors.rightMargin: 869 anchors.rightMargin: 0
64 anchors.top: root.top70 anchors.top: root.top
65 anchors.topMargin: 371 anchors.topMargin: 0
66 }72 }
67}73}
scripts/developer/utilities/render/debugDeferredLighting.js+0−49
@@ -1,49 +0,0 @@
1//
2// debugDeferredLighting.js
3//
4// Created by Sam Gateau on 6/6/2016
5// Copyright 2016 High Fidelity, Inc.
6//
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
9//
10
11// Set up the qml ui
12var qml = Script.resolvePath('deferredLighting.qml');
13var window = new OverlayWindow({
14 title: 'Lighting',
15 source: qml,
16 width: 400, height:400,
17});
18window.setPosition(Window.innerWidth - 420, 50);
19window.closed.connect(function() { Script.stop(); });
20
21
22var DDB = Render.RenderDeferredTask.DebugDeferredBuffer;
23DDB.enabled = true;
24DDB.mode = 0;
25
26// Debug buffer sizing
27var resizing = false;
28Controller.mousePressEvent.connect(function (e) {
29 if (shouldStartResizing(e.x)) {
30 resizing = true;
31 }
32});
33Controller.mouseReleaseEvent.connect(function() { resizing = false; });
34Controller.mouseMoveEvent.connect(function (e) { resizing && setDebugBufferSize(e.x); });
35Script.scriptEnding.connect(function () { DDB.enabled = false; });
36
37function shouldStartResizing(eventX) {
38 var x = Math.abs(eventX - Window.innerWidth * (1.0 + DDB.size.x) / 2.0);
39 var mode = DDB.mode;
40 return mode !== 0 && x < 20;
41}
42
43function setDebugBufferSize(x) {
44 x = (2.0 * (x / Window.innerWidth) - 1.0); // scale
45 x = Math.min(Math.max(-1, x), 1); // clamp
46 DDB.size = { x: x, y: -1, z: 1, w: 1 };
47}
48
49
scripts/developer/utilities/render/deferredLighting.qml+234−170
@@ -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.html8// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
9//9//
10import QtQuick 2.510import QtQuick 2.7
11import QtQuick.Controls 1.411import QtQuick.Controls 1.4
12import "configSlider"12import QtQuick.Layouts 1.3
13 13
14Column {14import "qrc:///qml/styles-uit"
15 spacing: 815import "qrc:///qml/controls-uit" as HifiControls
16 property var mainViewTask: Render.getConfig("RenderMainView")16import "configSlider"
17
18Rectangle {
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: 824 property var mainViewTask: Render.getConfig("RenderMainView")
20 Column {25
21 spacing: 1026 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: 1063 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: 10105 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: false132 }
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: 1172 currentIndex: 0
103 model: ListModel {173 model: ListModel {
104 id: cbItems174 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: 200201 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: 200250 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
scripts/developer/utilities/render/luci.js+102−0
@@ -0,0 +1,102 @@
1"use strict";
2
3//
4// Luci.js
5// tablet-engine app
6//
7// Copyright 2017 High Fidelity, Inc.
8//
9// Distributed under the Apache License, Version 2.0.
10// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
11//
12
13(function() {
14 var TABLET_BUTTON_NAME = "LUCI";
15 var QMLAPP_URL = Script.resolvePath("./deferredLighting.qml");
16 var ICON_URL = Script.resolvePath("../../../system/assets/images/luci-i.svg");
17 var ACTIVE_ICON_URL = Script.resolvePath("../../../system/assets/images/luci-a.svg");
18
19
20 var onLuciScreen = false;
21
22 function onClicked() {
23 if (onLuciScreen) {
24 tablet.gotoHomeScreen();
25 } else {
26 tablet.loadQMLSource(QMLAPP_URL);
27 }
28 }
29
30 var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
31 var button = tablet.addButton({
32 text: TABLET_BUTTON_NAME,
33 icon: ICON_URL,
34 activeIcon: ACTIVE_ICON_URL,
35 sortOrder: 1
36 });
37
38 var hasEventBridge = false;
39
40 function wireEventBridge(on) {
41 if (!tablet) {
42 print("Warning in wireEventBridge(): 'tablet' undefined!");
43 return;
44 }
45 if (on) {
46 if (!hasEventBridge) {
47 tablet.fromQml.connect(fromQml);
48 hasEventBridge = true;
49 }
50 } else {
51 if (hasEventBridge) {
52 tablet.fromQml.disconnect(fromQml);
53 hasEventBridge = false;
54 }
55 }
56 }
57
58 function onScreenChanged(type, url) {
59 if (url === QMLAPP_URL) {
60 onLuciScreen = true;
61 } else {
62 onLuciScreen = false;
63 }
64
65 button.editProperties({isActive: onLuciScreen});
66 wireEventBridge(onLuciScreen);
67 }
68
69 function fromQml(message) {
70 }
71
72 button.clicked.connect(onClicked);
73 tablet.screenChanged.connect(onScreenChanged);
74
75 var moveDebugCursor = false;
76 Controller.mousePressEvent.connect(function (e) {
77 if (e.isMiddleButton) {
78 moveDebugCursor = true;
79 setDebugCursor(e.x, e.y);
80 }
81 });
82 Controller.mouseReleaseEvent.connect(function() { moveDebugCursor = false; });
83 Controller.mouseMoveEvent.connect(function (e) { if (moveDebugCursor) setDebugCursor(e.x, e.y); });
84
85
86 Script.scriptEnding.connect(function () {
87 if (onLuciScreen) {
88 tablet.gotoHomeScreen();
89 }
90 button.clicked.disconnect(onClicked);
91 tablet.screenChanged.disconnect(onScreenChanged);
92 tablet.removeButton(button);
93 });
94
95 function setDebugCursor(x, y) {
96 nx = (x / Window.innerWidth);
97 ny = 1.0 - ((y) / (Window.innerHeight - 32));
98
99 Render.getConfig("RenderMainView").getConfig("Antialiasing").debugCursorTexcoord = { x: nx, y: ny };
100 }
101
102}());

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t