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+//
11+import QtQuick 2.5
12+import QtQuick.Controls 1.4
13+import "../utilities/render/configSlider"
14+
15+Item {
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
5353 window.clearDebugWindow();
5454 });
5555
56+Script.scriptEnding.connect(function () {
57+ window.close();
58+})
59+
5660 }());
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+//
10+import QtQuick 2.5
11+import QtQuick.Controls 1.4
12+import "configSlider"
13+
14+Column {
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 @@
1−var AVATAR_SELF_ID = "{00000000-0000-0000-0000-000000000001}";
2−
31 var debugSphereBaseProperties = {
42 type: "Sphere",
53 dimensions: { x: 0.2, y: 0.2, z: 0.2 },
scripts/developer/tests/hazeTestInitialPose.js+5−0
@@ -0,0 +1,5 @@
1+var ORIGIN = {x: -68.7, y: 27.4, z: 487.7};
2+var ROT_IDENT = {x: 0, y: 0.901, z: 0, w: 0.434};
3+
4+MyAvatar.position = ORIGIN;
5+MyAvatar.orientation = ROT_IDENT;
scripts/developer/utilities/render/configSlider/ConfigSlider.qml+24−18
@@ -1,6 +1,5 @@
11 //
22 // ConfigSlider.qml
3−// examples/utilities/tools/render
43 //
54 // Created by Zach Pomerantz on 2/8/2016
65 // Copyright 2016 High Fidelity, Inc.
@@ -8,12 +7,21 @@ · 1 unmodified line
87 // Distributed under the Apache License, Version 2.0.
98 // See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
109 //
11−import QtQuick 2.5
12−import QtQuick.Controls 1.4
10+
11+import QtQuick 2.7
12+import QtQuick.Controls 1.4 as Original
13+import QtQuick.Controls.Styles 1.4
14+
15+import "qrc:///qml/styles-uit"
16+import "qrc:///qml/controls-uit" as HifiControls
17+
1318
1419 Item {
20+ HifiConstants { id: hifi }
1521 id: root
16− width: 400
22+
23+ anchors.left: parent.left
24+ anchors.right: parent.right
1725 height: 24
1826 property bool integral: false
1927 property var config
@@ -28,22 +36,21 @@ Item { · 8 unmodified lines
2836 bindingControl.when = true;
2937 }
3038
31− Label {
39+ HifiControls.Label {
3240 id: labelControl
3341 text: root.label
42+ enabled: true
3443 anchors.left: root.left
35− anchors.leftMargin: 8
36− anchors.top: root.top
37− anchors.topMargin: 7
44+ anchors.right: root.horizontalCenter
45+ anchors.verticalCenter: root.verticalCenter
3846 }
3947
40− Label {
48+ HifiControls.Label {
4149 id: labelValue
4250 text: sliderControl.value.toFixed(root.integral ? 0 : 2)
43− anchors.left: root.left
44− anchors.leftMargin: 200
45− anchors.top: root.top
46− anchors.topMargin: 15
51+ anchors.right: root.right
52+ anchors.bottom: root.bottom
53+ anchors.bottomMargin: 0
4754 }
4855
4956 Binding {
@@ -54,14 +61,13 @@ Item { · 4 unmodified lines
5461 when: false
5562 }
5663
57− Slider {
64+ HifiControls.Slider {
5865 id: sliderControl
5966 stepSize: root.integral ? 1.0 : 0.0
60− width: root.width-130
61− height: 20
67+ anchors.left: root.horizontalCenter
6268 anchors.right: root.right
63− anchors.rightMargin: 8
69+ anchors.rightMargin: 0
6470 anchors.top: root.top
65− anchors.topMargin: 3
71+ anchors.topMargin: 0
6672 }
6773 }
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
12−var qml = Script.resolvePath('deferredLighting.qml');
13−var window = new OverlayWindow({
14− title: 'Lighting',
15− source: qml,
16− width: 400, height:400,
17−});
18−window.setPosition(Window.innerWidth - 420, 50);
19−window.closed.connect(function() { Script.stop(); });
20−
21−
22−var DDB = Render.RenderDeferredTask.DebugDeferredBuffer;
23−DDB.enabled = true;
24−DDB.mode = 0;
25−
26−// Debug buffer sizing
27−var resizing = false;
28−Controller.mousePressEvent.connect(function (e) {
29− if (shouldStartResizing(e.x)) {
30− resizing = true;
31− }
32−});
33−Controller.mouseReleaseEvent.connect(function() { resizing = false; });
34−Controller.mouseMoveEvent.connect(function (e) { resizing && setDebugBufferSize(e.x); });
35−Script.scriptEnding.connect(function () { DDB.enabled = false; });
36−
37−function 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−
43−function 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
77 // Distributed under the Apache License, Version 2.0.
88 // See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
99 //
10−import QtQuick 2.5
10+import QtQuick 2.7
1111 import QtQuick.Controls 1.4
12−import "configSlider"
12+import QtQuick.Layouts 1.3
1313
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
1722
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+ }
3558 }
3659 }
37− }
3860
3961
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+ }
5579 }
5680 }
57− }
5881
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 {}
59104 Column {
60− spacing: 10
105+ anchors.left: parent.left
106+ anchors.right: parent.right
107+ spacing: 10
61108 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
75121 }
76122 }
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+ }
91147 }
92148 }
149+ Separator {}
150+
151+ Item {
152+ height: childrenRect.height
153+ anchors.left: parent.left
154+ anchors.right: parent.right
93155
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;
98168 }
99169
100− ComboBox {
101− anchors.right: root.right
102− currentIndex: 1
170+ HifiControls.ComboBox {
171+ anchors.right: parent.right
172+ currentIndex: 0
103173 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" }
109200 }
110201 width: 200
111− onCurrentIndexChanged: { mainViewTask.getConfig("ToneMapping")["curve"] = currentIndex }
202+ onCurrentIndexChanged: { framebuffer.setDebugMode(currentIndex) }
112203 }
113204 }
114− }
115− Row {
116− id: framebuffer
117− spacing: 10
118205
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
125211
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+ }
130248
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" }
161249 }
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+ }
206271 }
207272 }
208− }
273+ //}
209274 }
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