mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-26 01:35:14 +02:00
Switch to app for ambient occlusion debug script
This commit is contained in:
parent
45e0f65972
commit
85a3938cbe
2 changed files with 33 additions and 79 deletions
|
@ -216,13 +216,13 @@ private:
|
||||||
float _blurEdgeSharpness{ 0.0f };
|
float _blurEdgeSharpness{ 0.0f };
|
||||||
|
|
||||||
static const gpu::PipelinePointer& getOcclusionPipeline();
|
static const gpu::PipelinePointer& getOcclusionPipeline();
|
||||||
static const gpu::PipelinePointer& getBilateralBlurPipeline();
|
static const gpu::PipelinePointer& getBilateralBlurPipeline();
|
||||||
static const gpu::PipelinePointer& getMipCreationPipeline();
|
static const gpu::PipelinePointer& getMipCreationPipeline();
|
||||||
static const gpu::PipelinePointer& getGatherPipeline();
|
static const gpu::PipelinePointer& getGatherPipeline();
|
||||||
static const gpu::PipelinePointer& getBuildNormalsPipeline();
|
static const gpu::PipelinePointer& getBuildNormalsPipeline();
|
||||||
|
|
||||||
static gpu::PipelinePointer _occlusionPipeline;
|
static gpu::PipelinePointer _occlusionPipeline;
|
||||||
static gpu::PipelinePointer _bilateralBlurPipeline;
|
static gpu::PipelinePointer _bilateralBlurPipeline;
|
||||||
static gpu::PipelinePointer _mipCreationPipeline;
|
static gpu::PipelinePointer _mipCreationPipeline;
|
||||||
static gpu::PipelinePointer _gatherPipeline;
|
static gpu::PipelinePointer _gatherPipeline;
|
||||||
static gpu::PipelinePointer _buildNormalsPipeline;
|
static gpu::PipelinePointer _buildNormalsPipeline;
|
||||||
|
|
|
@ -12,88 +12,42 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var TABLET_BUTTON_NAME = "AO";
|
var AppUi = Script.require('appUi');
|
||||||
var QMLAPP_URL = Script.resolvePath("./ambientOcclusionPass.qml");
|
|
||||||
|
|
||||||
|
var onMousePressEvent = function (e) {
|
||||||
|
};
|
||||||
|
Controller.mousePressEvent.connect(onMousePressEvent);
|
||||||
|
|
||||||
var onLuciScreen = false;
|
var onMouseReleaseEvent = function () {
|
||||||
|
};
|
||||||
|
Controller.mouseReleaseEvent.connect(onMouseReleaseEvent);
|
||||||
|
|
||||||
function onClicked() {
|
var onMouseMoveEvent = function (e) {
|
||||||
if (onLuciScreen) {
|
};
|
||||||
tablet.gotoHomeScreen();
|
Controller.mouseMoveEvent.connect(onMouseMoveEvent);
|
||||||
} else {
|
|
||||||
tablet.loadQMLSource(QMLAPP_URL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
|
||||||
var button = tablet.addButton({
|
|
||||||
text: TABLET_BUTTON_NAME,
|
|
||||||
sortOrder: 1
|
|
||||||
});
|
|
||||||
|
|
||||||
var hasEventBridge = false;
|
|
||||||
|
|
||||||
function wireEventBridge(on) {
|
|
||||||
if (!tablet) {
|
|
||||||
print("Warning in wireEventBridge(): 'tablet' undefined!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (on) {
|
|
||||||
if (!hasEventBridge) {
|
|
||||||
tablet.fromQml.connect(fromQml);
|
|
||||||
hasEventBridge = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (hasEventBridge) {
|
|
||||||
tablet.fromQml.disconnect(fromQml);
|
|
||||||
hasEventBridge = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onScreenChanged(type, url) {
|
|
||||||
if (url === QMLAPP_URL) {
|
|
||||||
onLuciScreen = true;
|
|
||||||
} else {
|
|
||||||
onLuciScreen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.editProperties({isActive: onLuciScreen});
|
|
||||||
wireEventBridge(onLuciScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
function fromQml(message) {
|
function fromQml(message) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
button.clicked.connect(onClicked);
|
var ui;
|
||||||
tablet.screenChanged.connect(onScreenChanged);
|
function startup() {
|
||||||
|
ui = new AppUi({
|
||||||
var moveDebugCursor = false;
|
buttonName: "AO",
|
||||||
Controller.mousePressEvent.connect(function (e) {
|
home: Script.resolvePath("ambientOcclusionPass.qml"),
|
||||||
if (e.isMiddleButton) {
|
onMessage: fromQml,
|
||||||
moveDebugCursor = true;
|
//normalButton: Script.resolvePath("../../../system/assets/images/ao-i.svg"),
|
||||||
setDebugCursor(e.x, e.y);
|
//activeButton: Script.resolvePath("../../../system/assets/images/ao-a.svg")
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
Controller.mouseReleaseEvent.connect(function() { moveDebugCursor = false; });
|
startup();
|
||||||
Controller.mouseMoveEvent.connect(function (e) { if (moveDebugCursor) setDebugCursor(e.x, e.y); });
|
|
||||||
|
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
if (onLuciScreen) {
|
Controller.mousePressEvent.disconnect(onMousePressEvent);
|
||||||
tablet.gotoHomeScreen();
|
Controller.mouseReleaseEvent.disconnect(onMouseReleaseEvent);
|
||||||
}
|
Controller.mouseMoveEvent.disconnect(onMouseMoveEvent);
|
||||||
button.clicked.disconnect(onClicked);
|
pages.clear();
|
||||||
tablet.screenChanged.disconnect(onScreenChanged);
|
// killEngineInspectorView();
|
||||||
tablet.removeButton(button);
|
// killCullInspectorView();
|
||||||
|
// killEngineLODWindow();
|
||||||
});
|
});
|
||||||
|
|
||||||
function setDebugCursor(x, y) {
|
|
||||||
nx = ((x + 0.5) / Window.innerWidth);
|
|
||||||
ny = 1.0 - ((y + 0.5) / (Window.innerHeight));
|
|
||||||
|
|
||||||
Render.getConfig("RenderMainView").getConfig("DebugAmbientOcclusion").debugCursorTexcoord = { x: nx, y: ny };
|
|
||||||
}
|
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in a new issue