History

Merge branch 'master' of https://github.com/highfidelity/hifi into workload-master

samcake committed 8 years ago

Commit f8acca72 parents 39edcb6 5be2f0a177 files · +5758 −627Browse files

Showing the changes to scripts/developer (4 of 177 files). Show all

Unified · Split

4 files
  1. scripts/developer/tests/dynamics/dynamicsTests.js +1 −1
  2. scripts/developer/utilities/render/antialiasing.js +99 −0
  3. scripts/developer/utilities/render/antialiasing.qml +177 −0
  4. scripts/developer/utilities/render/deferredLighting.qml +1 −0
scripts/developer/tests/dynamics/dynamicsTests.js+1−1
@@ -186,7 +186,7 @@ · 185 unmodified lines
186186 var prevEntityID = null;
187187 for (var i = 0; i < 7; i++) {
188188 var newID = Entities.addEntity({
189− name: "hinge test " + i,
189+ name: "slider test " + i,
190190 type: "Box",
191191 color: { blue: 128, green: 40 * i, red: 20 },
192192 dimensions: { x: 0.2, y: 0.1, z: 0.2 },
scripts/developer/utilities/render/antialiasing.js+99−0
@@ -0,0 +1,99 @@
1+"use strict";
2+
3+//
4+// gemstoneMagicMaker.js
5+// tablet-sample-app
6+//
7+// Created by Faye Li on Feb 6 2017.
8+// Copyright 2017 High Fidelity, Inc.
9+//
10+// Distributed under the Apache License, Version 2.0.
11+// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
12+//
13+
14+(function() {
15+ var TABLET_BUTTON_NAME = "TAA";
16+ var QMLAPP_URL = Script.resolvePath("./antialiasing.qml");
17+
18+
19+ var onLuciScreen = false;
20+
21+ function onClicked() {
22+ if (onLuciScreen) {
23+ tablet.gotoHomeScreen();
24+ } else {
25+ tablet.loadQMLSource(QMLAPP_URL);
26+ }
27+ }
28+
29+ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
30+ var button = tablet.addButton({
31+ text: TABLET_BUTTON_NAME,
32+ sortOrder: 1
33+ });
34+
35+ var hasEventBridge = false;
36+
37+ function wireEventBridge(on) {
38+ if (!tablet) {
39+ print("Warning in wireEventBridge(): 'tablet' undefined!");
40+ return;
41+ }
42+ if (on) {
43+ if (!hasEventBridge) {
44+ tablet.fromQml.connect(fromQml);
45+ hasEventBridge = true;
46+ }
47+ } else {
48+ if (hasEventBridge) {
49+ tablet.fromQml.disconnect(fromQml);
50+ hasEventBridge = false;
51+ }
52+ }
53+ }
54+
55+ function onScreenChanged(type, url) {
56+ if (url === QMLAPP_URL) {
57+ onLuciScreen = true;
58+ } else {
59+ onLuciScreen = false;
60+ }
61+
62+ button.editProperties({isActive: onLuciScreen});
63+ wireEventBridge(onLuciScreen);
64+ }
65+
66+ function fromQml(message) {
67+ }
68+
69+ button.clicked.connect(onClicked);
70+ tablet.screenChanged.connect(onScreenChanged);
71+
72+ var moveDebugCursor = false;
73+ Controller.mousePressEvent.connect(function (e) {
74+ if (e.isMiddleButton) {
75+ moveDebugCursor = true;
76+ setDebugCursor(e.x, e.y);
77+ }
78+ });
79+ Controller.mouseReleaseEvent.connect(function() { moveDebugCursor = false; });
80+ Controller.mouseMoveEvent.connect(function (e) { if (moveDebugCursor) setDebugCursor(e.x, e.y); });
81+
82+
83+ Script.scriptEnding.connect(function () {
84+ if (onLuciScreen) {
85+ tablet.gotoHomeScreen();
86+ }
87+ button.clicked.disconnect(onClicked);
88+ tablet.screenChanged.disconnect(onScreenChanged);
89+ tablet.removeButton(button);
90+ });
91+
92+ function setDebugCursor(x, y) {
93+ nx = ((x + 0.5) / Window.innerWidth);
94+ ny = 1.0 - ((y + 0.5) / (Window.innerHeight));
95+
96+ Render.getConfig("RenderMainView").getConfig("Antialiasing").debugCursorTexcoord = { x: nx, y: ny };
97+ }
98+
99+}());
scripts/developer/utilities/render/antialiasing.qml+177−0
@@ -0,0 +1,177 @@
1+//
2+// Antialiasing.qml
3+//
4+// Created by Sam Gateau on 8/14/2017
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+import QtQuick 2.7
12+import QtQuick.Controls 1.4
13+import QtQuick.Layouts 1.3
14+
15+import "qrc:///qml/styles-uit"
16+import "qrc:///qml/controls-uit" as HifiControls
17+
18+import "configSlider"
19+import "../lib/plotperf"
20+
21+Item {
22+Rectangle {
23+ id: root;
24+
25+ HifiConstants { id: hifi; }
26+ color: hifi.colors.baseGray;
27+
28+ Column {
29+ id: antialiasing
30+ spacing: 20
31+ padding: 10
32+
33+ Column{
34+ spacing: 10
35+
36+ Row {
37+ spacing: 10
38+ id: fxaaOnOff
39+ property bool debugFXAA: false
40+ HifiControls.Button {
41+ text: {
42+ if (fxaaOnOff.debugFXAA) {
43+ return "FXAA"
44+ } else {
45+ return "TAA"
46+ }
47+ }
48+ onClicked: {
49+ fxaaOnOff.debugFXAA = !fxaaOnOff.debugFXAA
50+ if (fxaaOnOff.debugFXAA) {
51+ Render.getConfig("RenderMainView.JitterCam").none();
52+ Render.getConfig("RenderMainView.Antialiasing").debugFXAAX = 0;
53+ } else {
54+ Render.getConfig("RenderMainView.JitterCam").play();
55+ Render.getConfig("RenderMainView.Antialiasing").debugFXAAX = 1.0;
56+ }
57+
58+ }
59+ }
60+ }
61+ Separator {}
62+ Row {
63+ spacing: 10
64+
65+ HifiControls.Button {
66+ text: {
67+ var state = 2 - (Render.getConfig("RenderMainView.JitterCam").freeze * 1 - Render.getConfig("RenderMainView.JitterCam").stop * 2);
68+ if (state === 2) {
69+ return "Jitter"
70+ } else if (state === 1) {
71+ return "Paused at " + Render.getConfig("RenderMainView.JitterCam").index + ""
72+ } else {
73+ return "No Jitter"
74+ }
75+ }
76+ onClicked: { Render.getConfig("RenderMainView.JitterCam").cycleStopPauseRun(); }
77+ }
78+ HifiControls.Button {
79+ text: "<"
80+ onClicked: { Render.getConfig("RenderMainView.JitterCam").prev(); }
81+ }
82+ HifiControls.Button {
83+ text: ">"
84+ onClicked: { Render.getConfig("RenderMainView.JitterCam").next(); }
85+ }
86+ }
87+ Separator {}
88+ HifiControls.CheckBox {
89+ boxSize: 20
90+ text: "Constrain color"
91+ checked: Render.getConfig("RenderMainView.Antialiasing")["constrainColor"]
92+ onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] = checked }
93+ }
94+ ConfigSlider {
95+ label: qsTr("Covariance gamma")
96+ integral: false
97+ config: Render.getConfig("RenderMainView.Antialiasing")
98+ property: "covarianceGamma"
99+ max: 1.5
100+ min: 0.5
101+ }
102+ Separator {}
103+ HifiControls.CheckBox {
104+ boxSize: 20
105+ text: "Feedback history color"
106+ checked: Render.getConfig("RenderMainView.Antialiasing")["feedbackColor"]
107+ onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["feedbackColor"] = checked }
108+ }
109+
110+ ConfigSlider {
111+ label: qsTr("Source blend")
112+ integral: false
113+ config: Render.getConfig("RenderMainView.Antialiasing")
114+ property: "blend"
115+ max: 1.0
116+ min: 0.0
117+ }
118+
119+ ConfigSlider {
120+ label: qsTr("Post sharpen")
121+ integral: false
122+ config: Render.getConfig("RenderMainView.Antialiasing")
123+ property: "sharpen"
124+ max: 1.0
125+ min: 0.0
126+ }
127+ Separator {}
128+ Row {
129+
130+ spacing: 10
131+ HifiControls.CheckBox {
132+ boxSize: 20
133+ text: "Debug"
134+ checked: Render.getConfig("RenderMainView.Antialiasing")["debug"]
135+ onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["debug"] = checked }
136+ }
137+ HifiControls.CheckBox {
138+ boxSize: 20
139+ text: "Show Debug Cursor"
140+ checked: Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"]
141+ onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"] = checked }
142+ }
143+ }
144+ ConfigSlider {
145+ label: qsTr("Debug Region <")
146+ integral: false
147+ config: Render.getConfig("RenderMainView.Antialiasing")
148+ property: "debugX"
149+ max: 1.0
150+ min: 0.0
151+ }
152+ HifiControls.CheckBox {
153+ boxSize: 20
154+ text: "Closest Fragment"
155+ checked: Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"]
156+ onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"] = checked }
157+ }
158+ ConfigSlider {
159+ label: qsTr("Debug Velocity Threshold [pix]")
160+ integral: false
161+ config: Render.getConfig("RenderMainView.Antialiasing")
162+ property: "debugShowVelocityThreshold"
163+ max: 50
164+ min: 0.0
165+ }
166+ ConfigSlider {
167+ label: qsTr("Debug Orb Zoom")
168+ integral: false
169+ config: Render.getConfig("RenderMainView.Antialiasing")
170+ property: "debugOrbZoom"
171+ max: 32.0
172+ min: 1.0
173+ }
174+ }
175+ }
176+}
177+}
scripts/developer/utilities/render/deferredLighting.qml+1−0
@@ -200,6 +200,7 @@ Rectangle { · 199 unmodified lines
200200 ListElement { text: "Debug Scattering"; color: "White" }
201201 ListElement { text: "Ambient Occlusion"; color: "White" }
202202 ListElement { text: "Ambient Occlusion Blurred"; color: "White" }
203+ ListElement { text: "Velocity"; color: "White" }
203204 ListElement { text: "Custom"; color: "White" }
204205 }
205206 width: 200

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