mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge pull request #16131 from samcake/yellow
BUGZ-1114: Fixing Luci issues related to zone not rendering and other minor clean up
This commit is contained in:
commit
ffc6d4a1e2
16 changed files with 284 additions and 491 deletions
|
@ -139,6 +139,11 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const
|
|||
}
|
||||
#else
|
||||
|
||||
void AntialiasingConfig::setAAMode(int mode) {
|
||||
_mode = std::min((int)AntialiasingConfig::MODE_COUNT, std::max(0, mode));
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
Antialiasing::Antialiasing(bool isSharpenEnabled) :
|
||||
_isSharpenEnabled{ isSharpenEnabled } {
|
||||
}
|
||||
|
@ -189,6 +194,8 @@ const gpu::PipelinePointer& Antialiasing::getDebugBlendPipeline() {
|
|||
}
|
||||
|
||||
void Antialiasing::configure(const Config& config) {
|
||||
_mode = (AntialiasingConfig::Mode) config.getAAMode();
|
||||
|
||||
_sharpen = config.sharpen * 0.25f;
|
||||
if (!_isSharpenEnabled) {
|
||||
_sharpen = 0.0f;
|
||||
|
@ -298,29 +305,33 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
void JitterSampleConfig::setIndex(int current) {
|
||||
_index = (current) % JitterSample::SEQUENCE_LENGTH;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
int JitterSampleConfig::cycleStopPauseRun() {
|
||||
_state = (_state + 1) % 3;
|
||||
void JitterSampleConfig::setState(int state) {
|
||||
_state = (state) % 3;
|
||||
switch (_state) {
|
||||
case 0: {
|
||||
return none();
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
return pause();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
default: {
|
||||
return play();
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
none();
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
pause();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
default: {
|
||||
play();
|
||||
break;
|
||||
}
|
||||
}
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
int JitterSampleConfig::cycleStopPauseRun() {
|
||||
setState((_state + 1) % 3);
|
||||
return _state;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ class JitterSampleConfig : public render::Job::Config {
|
|||
Q_PROPERTY(bool freeze MEMBER freeze NOTIFY dirty)
|
||||
Q_PROPERTY(bool stop MEMBER stop NOTIFY dirty)
|
||||
Q_PROPERTY(int index READ getIndex NOTIFY dirty)
|
||||
Q_PROPERTY(int state READ getState WRITE setState NOTIFY dirty)
|
||||
public:
|
||||
JitterSampleConfig() : render::Job::Config(true) {}
|
||||
|
||||
|
@ -33,6 +34,7 @@ public:
|
|||
bool freeze{ false };
|
||||
|
||||
void setIndex(int current);
|
||||
void setState(int state);
|
||||
|
||||
public slots:
|
||||
int cycleStopPauseRun();
|
||||
|
@ -86,6 +88,7 @@ private:
|
|||
|
||||
class AntialiasingConfig : public render::Job::Config {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int mode READ getAAMode WRITE setAAMode NOTIFY dirty)
|
||||
Q_PROPERTY(float blend MEMBER blend NOTIFY dirty)
|
||||
Q_PROPERTY(float sharpen MEMBER sharpen NOTIFY dirty)
|
||||
Q_PROPERTY(float covarianceGamma MEMBER covarianceGamma NOTIFY dirty)
|
||||
|
@ -106,9 +109,21 @@ class AntialiasingConfig : public render::Job::Config {
|
|||
public:
|
||||
AntialiasingConfig() : render::Job::Config(true) {}
|
||||
|
||||
enum Mode {
|
||||
OFF = 0,
|
||||
TAA,
|
||||
FXAA,
|
||||
MODE_COUNT
|
||||
};
|
||||
|
||||
void setAAMode(int mode);
|
||||
int getAAMode() const { return _mode; }
|
||||
|
||||
void setDebugFXAA(bool debug) { debugFXAAX = (debug ? 0.0f : 1.0f); emit dirty();}
|
||||
bool debugFXAA() const { return (debugFXAAX == 0.0f ? true : false); }
|
||||
|
||||
int _mode{ TAA };
|
||||
|
||||
float blend{ 0.25f };
|
||||
float sharpen{ 0.05f };
|
||||
|
||||
|
@ -195,6 +210,7 @@ private:
|
|||
gpu::PipelinePointer _debugBlendPipeline;
|
||||
|
||||
TAAParamsBuffer _params;
|
||||
AntialiasingConfig::Mode _mode{ AntialiasingConfig::TAA };
|
||||
float _sharpen{ 0.15f };
|
||||
bool _isSharpenEnabled{ true };
|
||||
};
|
||||
|
|
|
@ -35,12 +35,13 @@ void BloomThreshold::run(const render::RenderContextPointer& renderContext, cons
|
|||
const auto frameTransform = inputs.get0();
|
||||
const auto inputFrameBuffer = inputs.get1();
|
||||
const auto bloomFrame = inputs.get2();
|
||||
const auto lightingModel = inputs.get3();
|
||||
const auto& bloomStage = renderContext->_scene->getStage<BloomStage>();
|
||||
graphics::BloomPointer bloom;
|
||||
if (bloomStage && bloomFrame->_blooms.size()) {
|
||||
bloom = bloomStage->getBloom(bloomFrame->_blooms.front());
|
||||
}
|
||||
if (!bloom) {
|
||||
if (!bloom || (lightingModel && !lightingModel->isBloomEnabled())) {
|
||||
renderContext->taskFlow.abortTask();
|
||||
return;
|
||||
}
|
||||
|
@ -187,12 +188,17 @@ void BloomDraw::run(const render::RenderContextPointer& renderContext, const Inp
|
|||
}
|
||||
}
|
||||
|
||||
void DebugBloomConfig::setMode(int mode) {
|
||||
_mode = std::min((int)DebugBloomConfig::MODE_COUNT, std::max(0, mode));
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
DebugBloom::DebugBloom() {
|
||||
_params = std::make_shared<gpu::Buffer>(sizeof(glm::vec4), nullptr);
|
||||
}
|
||||
|
||||
void DebugBloom::configure(const Config& config) {
|
||||
_mode = static_cast<DebugBloomConfig::Mode>(config.mode);
|
||||
_mode = (DebugBloomConfig::Mode) config.getMode();
|
||||
assert(_mode < DebugBloomConfig::MODE_COUNT);
|
||||
}
|
||||
|
||||
|
@ -201,6 +207,10 @@ void DebugBloom::run(const render::RenderContextPointer& renderContext, const In
|
|||
assert(renderContext->args->hasViewFrustum());
|
||||
RenderArgs* args = renderContext->args;
|
||||
|
||||
if (_mode == DebugBloomConfig::OFF) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto frameBuffer = inputs.get0();
|
||||
const auto combinedBlurBuffer = inputs.get4();
|
||||
const auto framebufferSize = frameBuffer->getSize();
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "BloomStage.h"
|
||||
|
||||
#include "DeferredFrameTransform.h"
|
||||
#include "LightingModel.h"
|
||||
|
||||
class BloomConfig : public render::Task::Config {
|
||||
Q_OBJECT
|
||||
|
@ -28,7 +29,7 @@ class BloomThresholdConfig : public render::Job::Config {
|
|||
|
||||
class BloomThreshold {
|
||||
public:
|
||||
using Inputs = render::VaryingSet3<DeferredFrameTransformPointer, gpu::FramebufferPointer, BloomStage::FramePointer>;
|
||||
using Inputs = render::VaryingSet4<DeferredFrameTransformPointer, gpu::FramebufferPointer, BloomStage::FramePointer, LightingModelPointer>;
|
||||
using Outputs = render::VaryingSet3<gpu::FramebufferPointer, float, graphics::BloomPointer>;
|
||||
using Config = BloomThresholdConfig;
|
||||
using JobModel = render::Job::ModelIO<BloomThreshold, Inputs, Outputs, Config>;
|
||||
|
@ -87,12 +88,13 @@ private:
|
|||
|
||||
class DebugBloomConfig : public render::Job::Config {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int mode MEMBER mode NOTIFY dirty)
|
||||
Q_PROPERTY(int mode READ getMode WRITE setMode NOTIFY dirty)
|
||||
|
||||
public:
|
||||
|
||||
enum Mode {
|
||||
MODE_LEVEL0 = 0,
|
||||
OFF = 0,
|
||||
MODE_LEVEL0,
|
||||
MODE_LEVEL1,
|
||||
MODE_LEVEL2,
|
||||
MODE_ALL_LEVELS,
|
||||
|
@ -102,7 +104,10 @@ public:
|
|||
|
||||
DebugBloomConfig() : render::Job::Config(false) {}
|
||||
|
||||
int mode{ MODE_ALL_LEVELS };
|
||||
void setMode(int mode);
|
||||
int getMode() const { return _mode; }
|
||||
|
||||
int _mode{ MODE_ALL_LEVELS };
|
||||
|
||||
signals:
|
||||
void dirty();
|
||||
|
@ -127,14 +132,14 @@ private:
|
|||
|
||||
class BloomEffect {
|
||||
public:
|
||||
using Inputs = render::VaryingSet3<DeferredFrameTransformPointer, gpu::FramebufferPointer, BloomStage::FramePointer>;
|
||||
using Inputs = render::VaryingSet4<DeferredFrameTransformPointer, gpu::FramebufferPointer, BloomStage::FramePointer, LightingModelPointer>;
|
||||
using Config = BloomConfig;
|
||||
using JobModel = render::Task::ModelI<BloomEffect, Inputs, Config>;
|
||||
using JobModel = render::Task::ModelI<BloomEffect, Inputs, Config>;
|
||||
|
||||
BloomEffect();
|
||||
BloomEffect();
|
||||
|
||||
void configure(const Config& config);
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs);
|
||||
void configure(const Config& config);
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -150,8 +150,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
|||
// Prepare deferred, generate the shared Deferred Frame Transform. Only valid with the scaled frame buffer
|
||||
const auto deferredFrameTransform = task.addJob<GenerateDeferredFrameTransform>("DeferredFrameTransform", jitter);
|
||||
|
||||
const auto opaqueRangeTimer = task.addJob<BeginGPURangeTimer>("BeginOpaqueRangeTimer", "DrawOpaques");
|
||||
|
||||
const auto prepareDeferredInputs = PrepareDeferred::Inputs(scaledPrimaryFramebuffer, lightingModel).asVarying();
|
||||
const auto prepareDeferredOutputs = task.addJob<PrepareDeferred>("PrepareDeferred", prepareDeferredInputs);
|
||||
const auto deferredFramebuffer = prepareDeferredOutputs.getN<PrepareDeferred::Outputs>(0);
|
||||
|
@ -164,8 +162,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
|||
const auto opaqueInputs = DrawStateSortDeferred::Inputs(opaques, lightingModel, jitter).asVarying();
|
||||
task.addJob<DrawStateSortDeferred>("DrawOpaqueDeferred", opaqueInputs, shapePlumber);
|
||||
|
||||
task.addJob<EndGPURangeTimer>("OpaqueRangeTimer", opaqueRangeTimer);
|
||||
|
||||
// Opaque all rendered
|
||||
|
||||
// Linear Depth Pass
|
||||
|
@ -216,13 +212,10 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
|||
const auto transparentsInputs = RenderTransparentDeferred::Inputs(transparents, hazeFrame, lightFrame, lightingModel, lightClusters, shadowFrame, jitter).asVarying();
|
||||
task.addJob<RenderTransparentDeferred>("DrawTransparentDeferred", transparentsInputs, shapePlumber);
|
||||
|
||||
const auto outlineRangeTimer = task.addJob<BeginGPURangeTimer>("BeginHighlightRangeTimer", "Highlight");
|
||||
|
||||
// Highlight
|
||||
const auto outlineInputs = DrawHighlightTask::Inputs(items, deferredFramebuffer, lightingFramebuffer, deferredFrameTransform, jitter).asVarying();
|
||||
task.addJob<DrawHighlightTask>("DrawHighlight", outlineInputs);
|
||||
|
||||
task.addJob<EndGPURangeTimer>("HighlightRangeTimer", outlineRangeTimer);
|
||||
|
||||
// Layered Over (in front)
|
||||
const auto inFrontOpaquesInputs = DrawLayered3D::Inputs(inFrontOpaque, lightingModel, hazeFrame, jitter).asVarying();
|
||||
const auto inFrontTransparentsInputs = DrawLayered3D::Inputs(inFrontTransparent, lightingModel, hazeFrame, jitter).asVarying();
|
||||
|
@ -234,7 +227,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
|||
task.addJob<Antialiasing>("Antialiasing", antialiasingInputs);
|
||||
|
||||
// Add bloom
|
||||
const auto bloomInputs = BloomEffect::Inputs(deferredFrameTransform, lightingFramebuffer, bloomFrame).asVarying();
|
||||
const auto bloomInputs = BloomEffect::Inputs(deferredFrameTransform, lightingFramebuffer, bloomFrame, lightingModel).asVarying();
|
||||
task.addJob<BloomEffect>("Bloom", bloomInputs);
|
||||
|
||||
const auto destFramebuffer = static_cast<gpu::FramebufferPointer>(nullptr);
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
//
|
||||
// bloom.qml
|
||||
// developer/utilities/render
|
||||
//
|
||||
// Olivier Prat, created on 09/25/2017.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import "configSlider"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property var configDebug: Render.getConfig("RenderMainView.DebugBloom")
|
||||
|
||||
Column {
|
||||
spacing: 8
|
||||
|
||||
GroupBox {
|
||||
title: "Debug"
|
||||
Row {
|
||||
ExclusiveGroup { id: debugGroup }
|
||||
RadioButton {
|
||||
text : "Off"
|
||||
checked : !root.configDebug["enabled"]
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
root.configDebug["enabled"] = false
|
||||
}
|
||||
}
|
||||
exclusiveGroup : debugGroup
|
||||
}
|
||||
RadioButton {
|
||||
text : "Lvl 0"
|
||||
checked :root.configDebug["enabled"] && root.configDebug["mode"]==0
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
root.configDebug["enabled"] = true
|
||||
root.configDebug["mode"] = 0
|
||||
}
|
||||
}
|
||||
exclusiveGroup : debugGroup
|
||||
}
|
||||
RadioButton {
|
||||
text : "Lvl 1"
|
||||
checked : root.configDebug["enabled"] && root.configDebug["mode"]==1
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
root.configDebug["enabled"] = true
|
||||
root.configDebug["mode"] = 1
|
||||
}
|
||||
}
|
||||
exclusiveGroup : debugGroup
|
||||
}
|
||||
RadioButton {
|
||||
text : "Lvl 2"
|
||||
checked : root.configDebug["enabled"] && root.configDebug["mode"]==2
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
root.configDebug["enabled"] = true
|
||||
root.configDebug["mode"] = 2
|
||||
}
|
||||
}
|
||||
exclusiveGroup : debugGroup
|
||||
}
|
||||
RadioButton {
|
||||
text : "All"
|
||||
checked : root.configDebug["enabled"] && root.configDebug["mode"]==3
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
root.configDebug["enabled"] = true
|
||||
root.configDebug["mode"] = 3
|
||||
}
|
||||
}
|
||||
exclusiveGroup : debugGroup
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,11 +10,8 @@
|
|||
//
|
||||
|
||||
// Set up the qml ui
|
||||
var qml = Script.resolvePath('bloom.qml');
|
||||
var window = new OverlayWindow({
|
||||
title: 'Bloom',
|
||||
source: qml,
|
||||
width: 285,
|
||||
height: 40,
|
||||
});
|
||||
window.closed.connect(function() { Script.stop(); });
|
||||
var window = Desktop.createWindow(Script.resolvePath('./luci/Bloom.qml'), {
|
||||
title: "Bloom",
|
||||
presentationMode: Desktop.PresentationMode.NATIVE,
|
||||
size: {x: 285, y: 40}
|
||||
});
|
|
@ -1,103 +0,0 @@
|
|||
//
|
||||
// deferredLighting.qml
|
||||
//
|
||||
// Created by Sam Gateau on 6/6/2016
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import stylesUit 1.0
|
||||
import controlsUit 1.0 as HifiControls
|
||||
import "configSlider"
|
||||
import "luci"
|
||||
|
||||
Rectangle {
|
||||
HifiConstants { id: hifi;}
|
||||
id: render;
|
||||
anchors.margins: hifi.dimensions.contentMargin.x
|
||||
|
||||
color: hifi.colors.baseGray;
|
||||
property var mainViewTask: Render.getConfig("RenderMainView")
|
||||
|
||||
Column {
|
||||
spacing: 5
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.margins: hifi.dimensions.contentMargin.x
|
||||
|
||||
|
||||
HifiControls.Label {
|
||||
text: "Shading"
|
||||
}
|
||||
ShadingModel {}
|
||||
|
||||
Separator {}
|
||||
ToneMapping {}
|
||||
|
||||
Separator {}
|
||||
Column {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: 5
|
||||
Repeater {
|
||||
model: [ "MSAA:PreparePrimaryBufferForward:numSamples:4:1"
|
||||
]
|
||||
ConfigSlider {
|
||||
label: qsTr(modelData.split(":")[0])
|
||||
integral: true
|
||||
config: render.mainViewTask.getConfig(modelData.split(":")[1])
|
||||
property: modelData.split(":")[2]
|
||||
max: modelData.split(":")[3]
|
||||
min: modelData.split(":")[4]
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
}
|
||||
}
|
||||
}
|
||||
Separator {}
|
||||
Framebuffer {}
|
||||
|
||||
Separator {}
|
||||
BoundingBoxes {
|
||||
|
||||
}
|
||||
Separator {}
|
||||
Row {
|
||||
HifiControls.Button {
|
||||
text: "Engine"
|
||||
// activeFocusOnPress: false
|
||||
onClicked: {
|
||||
sendToScript({method: "openEngineView"});
|
||||
}
|
||||
}
|
||||
HifiControls.Button {
|
||||
text: "LOD"
|
||||
// activeFocusOnPress: false
|
||||
onClicked: {
|
||||
sendToScript({method: "openEngineLODView"});
|
||||
}
|
||||
}
|
||||
HifiControls.Button {
|
||||
text: "Cull"
|
||||
// activeFocusOnPress: false
|
||||
onClicked: {
|
||||
sendToScript({method: "openCullInspectorView"});
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
HifiControls.Button {
|
||||
text: "Material"
|
||||
onClicked: {
|
||||
sendToScript({method: "openMaterialInspectorView"});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,80 +1,84 @@
|
|||
"use strict";
|
||||
|
||||
//
|
||||
// Luci.js
|
||||
// tablet-engine app
|
||||
//
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
|
||||
var MaterialInspector = Script.require('./materialInspector.js');
|
||||
var Page = Script.require('./luci/Page.js');
|
||||
|
||||
(function() {
|
||||
var AppUi = Script.require('appUi');
|
||||
|
||||
var MaterialInspector = Script.require('./materialInspector.js');
|
||||
var Page = Script.require('./luci/Page.js');
|
||||
|
||||
var moveDebugCursor = false;
|
||||
var onMousePressEvent = function (e) {
|
||||
if (e.isMiddleButton) {
|
||||
moveDebugCursor = true;
|
||||
setDebugCursor(e.x, e.y);
|
||||
}
|
||||
};
|
||||
Controller.mousePressEvent.connect(onMousePressEvent);
|
||||
|
||||
var onMouseReleaseEvent = function () {
|
||||
moveDebugCursor = false;
|
||||
};
|
||||
Controller.mouseReleaseEvent.connect(onMouseReleaseEvent);
|
||||
|
||||
var onMouseMoveEvent = function (e) {
|
||||
if (moveDebugCursor) {
|
||||
setDebugCursor(e.x, e.y);
|
||||
}
|
||||
};
|
||||
Controller.mouseMoveEvent.connect(onMouseMoveEvent);
|
||||
|
||||
function setDebugCursor(x, y) {
|
||||
var nx = 2.0 * (x / Window.innerWidth) - 1.0;
|
||||
var ny = 1.0 - 2.0 * ((y) / (Window.innerHeight));
|
||||
|
||||
Render.getConfig("RenderMainView").getConfig("DebugDeferredBuffer").size = { x: nx, y: ny, z: 1.0, w: 1.0 };
|
||||
}
|
||||
function openView() {
|
||||
//window.closed.connect(function() { Script.stop(); });
|
||||
|
||||
|
||||
var pages = new Pages();
|
||||
|
||||
pages.addPage('openEngineLODView', 'Render LOD', '../lod.qml', 300, 400);
|
||||
pages.addPage('openCullInspectorView', 'Cull Inspector', '../luci/Culling.qml', 300, 400);
|
||||
pages.addPage('openMaterialInspectorView', 'Material Inspector', '../materialInspector.qml', 300, 400, MaterialInspector.setWindow);
|
||||
|
||||
function fromQml(message) {
|
||||
if (pages.open(message.method)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var ui;
|
||||
function startup() {
|
||||
ui = new AppUi({
|
||||
buttonName: "LUCI",
|
||||
home: Script.resolvePath("deferredLighting.qml"),
|
||||
additionalAppScreens : Script.resolvePath("engineInspector.qml"),
|
||||
onMessage: fromQml,
|
||||
normalButton: Script.resolvePath("../../../system/assets/images/luci-i.svg"),
|
||||
activeButton: Script.resolvePath("../../../system/assets/images/luci-a.svg")
|
||||
});
|
||||
var luciWindow
|
||||
function openLuciWindow(window) {
|
||||
if (luciWindow !== undefined) {
|
||||
activeWindow.fromQml.disconnect(fromQml);
|
||||
}
|
||||
if (window !== undefined) {
|
||||
window.fromQml.connect(fromQml);
|
||||
}
|
||||
luciWindow = window;
|
||||
|
||||
|
||||
var moveDebugCursor = false;
|
||||
var onMousePressEvent = function (e) {
|
||||
if (e.isMiddleButton) {
|
||||
moveDebugCursor = true;
|
||||
setDebugCursor(e.x, e.y);
|
||||
}
|
||||
};
|
||||
Controller.mousePressEvent.connect(onMousePressEvent);
|
||||
|
||||
var onMouseReleaseEvent = function () {
|
||||
moveDebugCursor = false;
|
||||
};
|
||||
Controller.mouseReleaseEvent.connect(onMouseReleaseEvent);
|
||||
|
||||
var onMouseMoveEvent = function (e) {
|
||||
if (moveDebugCursor) {
|
||||
setDebugCursor(e.x, e.y);
|
||||
}
|
||||
};
|
||||
Controller.mouseMoveEvent.connect(onMouseMoveEvent);
|
||||
|
||||
function setDebugCursor(x, y) {
|
||||
var nx = 2.0 * (x / Window.innerWidth) - 1.0;
|
||||
var ny = 1.0 - 2.0 * ((y) / (Window.innerHeight));
|
||||
|
||||
Render.getConfig("RenderMainView").getConfig("DebugDeferredBuffer").size = { x: nx, y: ny, z: 1.0, w: 1.0 };
|
||||
}
|
||||
|
||||
}
|
||||
startup();
|
||||
Script.scriptEnding.connect(function () {
|
||||
|
||||
function closeLuciWindow() {
|
||||
if (luciWindow !== undefined) {
|
||||
activeWindow.fromQml.disconnect(fromQml);
|
||||
}
|
||||
luciWindow = {};
|
||||
|
||||
Controller.mousePressEvent.disconnect(onMousePressEvent);
|
||||
Controller.mouseReleaseEvent.disconnect(onMouseReleaseEvent);
|
||||
Controller.mouseMoveEvent.disconnect(onMouseMoveEvent);
|
||||
pages.clear();
|
||||
});
|
||||
}());
|
||||
}
|
||||
|
||||
pages.addPage('Luci', 'Luci', '../luci.qml', 300, 420, openLuciWindow, closeLuciWindow);
|
||||
pages.addPage('openEngineInspectorView', 'Render Engine Inspector', '../engineInspector.qml', 300, 400);
|
||||
pages.addPage('openEngineLODView', 'Render LOD', '../lod.qml', 300, 400);
|
||||
pages.addPage('openMaterialInspectorView', 'Material Inspector', '../materialInspector.qml', 300, 400, MaterialInspector.setWindow, MaterialInspector.setWindow);
|
||||
|
||||
pages.open('Luci');
|
||||
|
||||
|
||||
return pages;
|
||||
}
|
||||
|
||||
|
||||
openView();
|
||||
|
||||
|
|
|
@ -72,6 +72,12 @@ Rectangle {
|
|||
Antialiasing {}
|
||||
}
|
||||
}
|
||||
Prop.PropFolderPanel {
|
||||
label: "Bloom"
|
||||
panelFrameData: Component {
|
||||
Bloom {}
|
||||
}
|
||||
}
|
||||
Prop.PropFolderPanel {
|
||||
label: "Culling"
|
||||
panelFrameData: Component {
|
||||
|
|
|
@ -22,15 +22,12 @@ import "../../lib/prop" as Prop
|
|||
|
||||
|
||||
Column{
|
||||
HifiConstants { id: hifi; }
|
||||
id: antialiasing
|
||||
|
||||
id: antialiasing
|
||||
padding: 10
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
spacing: 10
|
||||
Prop.PropScalar {
|
||||
Prop.PropScalar {
|
||||
label: "MSAA"
|
||||
object: Render.getConfig("RenderMainView.PreparePrimaryBufferForward")
|
||||
property: "numSamples"
|
||||
|
@ -38,49 +35,44 @@ Column{
|
|||
max: 32
|
||||
integral: true
|
||||
}
|
||||
Row {
|
||||
spacing: 10
|
||||
id: fxaaOnOff
|
||||
property bool debugFXAA: false
|
||||
HifiControls.Button {
|
||||
function getTheText() {
|
||||
if (Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff) {
|
||||
return "FXAA"
|
||||
} else {
|
||||
return "TAA"
|
||||
}
|
||||
}
|
||||
text: getTheText()
|
||||
onClicked: {
|
||||
var onOff = !Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff;
|
||||
if (onOff) {
|
||||
Render.getConfig("RenderMainView.JitterCam").none();
|
||||
Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = true;
|
||||
} else {
|
||||
Render.getConfig("RenderMainView.JitterCam").play();
|
||||
Render.getConfig("RenderMainView.Antialiasing").fxaaOnOff = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Prop.PropEnum {
|
||||
label: "Deferred AA Method"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "mode"
|
||||
enums: [
|
||||
"Off",
|
||||
"TAA",
|
||||
"FXAA",
|
||||
]
|
||||
}
|
||||
Prop.PropEnum {
|
||||
id: jitter
|
||||
label: "Jitter"
|
||||
object: Render.getConfig("RenderMainView.JitterCam")
|
||||
property: "state"
|
||||
enums: [
|
||||
"Off",
|
||||
"On",
|
||||
"Paused",
|
||||
]
|
||||
}
|
||||
Separator {}
|
||||
|
||||
Prop.PropScalar {
|
||||
visible: (Render.getConfig("RenderMainView.JitterCam").state == 2)
|
||||
label: "Sample Index"
|
||||
object: Render.getConfig("RenderMainView.JitterCam")
|
||||
property: "index"
|
||||
// min: -1
|
||||
// max: 32
|
||||
readOnly: true
|
||||
integral: true
|
||||
}
|
||||
Row {
|
||||
visible: (Render.getConfig("RenderMainView.JitterCam").state == 2)
|
||||
spacing: 10
|
||||
|
||||
HifiControls.Button {
|
||||
text: {
|
||||
var state = 2 - (Render.getConfig("RenderMainView.JitterCam").freeze * 1 - Render.getConfig("RenderMainView.JitterCam").stop * 2);
|
||||
if (state === 2) {
|
||||
return "Jitter"
|
||||
} else if (state === 1) {
|
||||
return "Paused at " + Render.getConfig("RenderMainView.JitterCam").index + ""
|
||||
} else {
|
||||
return "No Jitter"
|
||||
}
|
||||
}
|
||||
onClicked: { Render.getConfig("RenderMainView.JitterCam").cycleStopPauseRun(); }
|
||||
}
|
||||
|
||||
HifiControls.Button {
|
||||
text: "<"
|
||||
onClicked: { Render.getConfig("RenderMainView.JitterCam").prev(); }
|
||||
|
@ -90,96 +82,75 @@ Column{
|
|||
onClicked: { Render.getConfig("RenderMainView.JitterCam").next(); }
|
||||
}
|
||||
}
|
||||
Separator {}
|
||||
HifiControls.CheckBox {
|
||||
boxSize: 20
|
||||
text: "Constrain color"
|
||||
checked: Render.getConfig("RenderMainView.Antialiasing")["constrainColor"]
|
||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["constrainColor"] = checked }
|
||||
}
|
||||
ConfigSlider {
|
||||
label: qsTr("Covariance gamma")
|
||||
integral: false
|
||||
config: Render.getConfig("RenderMainView.Antialiasing")
|
||||
Separator {}
|
||||
Prop.PropBool {
|
||||
label: "Constrain color"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "constrainColor"
|
||||
}
|
||||
Prop.PropScalar {
|
||||
label: "Covariance gamma"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "covarianceGamma"
|
||||
max: 1.5
|
||||
min: 0.5
|
||||
height: 38
|
||||
}
|
||||
Separator {}
|
||||
HifiControls.CheckBox {
|
||||
boxSize: 20
|
||||
text: "Feedback history color"
|
||||
checked: Render.getConfig("RenderMainView.Antialiasing")["feedbackColor"]
|
||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["feedbackColor"] = checked }
|
||||
}
|
||||
|
||||
ConfigSlider {
|
||||
label: qsTr("Source blend")
|
||||
integral: false
|
||||
config: Render.getConfig("RenderMainView.Antialiasing")
|
||||
}
|
||||
Separator {}
|
||||
Prop.PropBool {
|
||||
label: "Feedback history color"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "feedbackColor"
|
||||
}
|
||||
Prop.PropScalar {
|
||||
label: "Source blend"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "blend"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
height: 38
|
||||
}
|
||||
|
||||
ConfigSlider {
|
||||
label: qsTr("Post sharpen")
|
||||
integral: false
|
||||
config: Render.getConfig("RenderMainView.Antialiasing")
|
||||
Prop.PropScalar {
|
||||
label: "Post sharpen"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "sharpen"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
}
|
||||
Separator {}
|
||||
Row {
|
||||
|
||||
spacing: 10
|
||||
HifiControls.CheckBox {
|
||||
boxSize: 20
|
||||
text: "Debug"
|
||||
checked: Render.getConfig("RenderMainView.Antialiasing")["debug"]
|
||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["debug"] = checked }
|
||||
}
|
||||
HifiControls.CheckBox {
|
||||
boxSize: 20
|
||||
text: "Show Debug Cursor"
|
||||
checked: Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"]
|
||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showCursorPixel"] = checked }
|
||||
}
|
||||
}
|
||||
ConfigSlider {
|
||||
label: qsTr("Debug Region <")
|
||||
integral: false
|
||||
config: Render.getConfig("RenderMainView.Antialiasing")
|
||||
Separator {}
|
||||
Prop.PropBool {
|
||||
label: "Debug"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "debug"
|
||||
}
|
||||
Prop.PropBool {
|
||||
label: "Show Debug Cursor"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "showCursorPixel"
|
||||
}
|
||||
Prop.PropScalar {
|
||||
label: "Debug Region <"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "debugX"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
}
|
||||
HifiControls.CheckBox {
|
||||
boxSize: 20
|
||||
text: "Closest Fragment"
|
||||
checked: Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"]
|
||||
onCheckedChanged: { Render.getConfig("RenderMainView.Antialiasing")["showClosestFragment"] = checked }
|
||||
}
|
||||
ConfigSlider {
|
||||
label: qsTr("Debug Velocity Threshold [pix]")
|
||||
integral: false
|
||||
config: Render.getConfig("RenderMainView.Antialiasing")
|
||||
Prop.PropBool {
|
||||
label: "Closest Fragment"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "showClosestFragment"
|
||||
}
|
||||
Prop.PropScalar {
|
||||
label: "Debug Velocity Threshold [pix]"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "debugShowVelocityThreshold"
|
||||
max: 50
|
||||
min: 0.0
|
||||
height: 38
|
||||
}
|
||||
ConfigSlider {
|
||||
label: qsTr("Debug Orb Zoom")
|
||||
integral: false
|
||||
config: Render.getConfig("RenderMainView.Antialiasing")
|
||||
Prop.PropScalar {
|
||||
label: "Debug Orb Zoom"
|
||||
object: Render.getConfig("RenderMainView.Antialiasing")
|
||||
property: "debugOrbZoom"
|
||||
max: 32.0
|
||||
min: 1.0
|
||||
height: 38
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
48
scripts/developer/utilities/render/luci/Bloom.qml
Normal file
48
scripts/developer/utilities/render/luci/Bloom.qml
Normal file
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// bloom.qml
|
||||
//
|
||||
// Olivier Prat, created on 09/25/2017.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
import QtQuick 2.7
|
||||
import "../../lib/prop" as Prop
|
||||
|
||||
Column {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
id: bloom
|
||||
|
||||
property var config: Render.getConfig("RenderMainView.DebugBloom")
|
||||
|
||||
Prop.PropBool {
|
||||
label: "Apply Bloom"
|
||||
object: Render.getConfig("RenderMainView.LightingModel")
|
||||
property: "enableBloom"
|
||||
}
|
||||
|
||||
function setDebugMode(mode) {
|
||||
console.log("Bloom mode is " + mode)
|
||||
bloom.config.enabled = (mode != 0);
|
||||
bloom.config.mode = mode;
|
||||
}
|
||||
|
||||
Prop.PropEnum {
|
||||
label: "Debug Bloom Buffer"
|
||||
// object: config
|
||||
// property: "mode"
|
||||
enums: [
|
||||
"Off",
|
||||
"Lvl 0",
|
||||
"Lvl 1",
|
||||
"Lvl 2",
|
||||
"All",
|
||||
]
|
||||
|
||||
valueVarSetter: function (mode) { bloom.setDebugMode(mode) }
|
||||
}
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ Column {
|
|||
Prop.PropCheckBox {
|
||||
text: "Zones"
|
||||
checked: root.mainViewTask.getConfig("DrawZones")["enabled"]
|
||||
onCheckedChanged: { root.mainViewTask.getConfig("ZoneRenderer")["enabled"] = checked; root.mainViewTask.getConfig("DrawZones")["enabled"] = checked; }
|
||||
onCheckedChanged: { root.mainViewTask.getConfig("DrawZones")["enabled"] = checked; }
|
||||
}
|
||||
}
|
||||
Column {
|
||||
|
|
|
@ -35,7 +35,8 @@ Column {
|
|||
"Emissive:LightingModel:enableEmissive",
|
||||
"Lightmap:LightingModel:enableLightmap",
|
||||
"Background:LightingModel:enableBackground",
|
||||
"Haze:LightingModel:enableHaze",
|
||||
"Haze:LightingModel:enableHaze",
|
||||
"Bloom:LightingModel:enableBloom",
|
||||
"AO:LightingModel:enableAmbientOcclusion",
|
||||
"Textures:LightingModel:enableMaterialTexturing"
|
||||
]
|
||||
|
|
|
@ -5,6 +5,7 @@ BoundingBoxes 1.0 BoundingBoxes.qml
|
|||
Framebuffer 1.0 Framebuffer.qml
|
||||
Antialiasing 1.0 Antialiasing.qml
|
||||
Culling 1.0 Culling.qml
|
||||
Bloom 1.0 Bloom.qml
|
||||
|
||||
Platform 1.0 Platform.qml
|
||||
RenderSettings 1.0 RenderSettings.qml
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
|
||||
|
||||
var MaterialInspector = Script.require('./materialInspector.js');
|
||||
var Page = Script.require('./luci/Page.js');
|
||||
|
||||
|
||||
function openView() {
|
||||
//window.closed.connect(function() { Script.stop(); });
|
||||
|
||||
|
||||
var pages = new Pages();
|
||||
function fromQml(message) {
|
||||
if (pages.open(message.method)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var luciWindow
|
||||
function openLuciWindow(window) {
|
||||
if (luciWindow !== undefined) {
|
||||
activeWindow.fromQml.disconnect(fromQml);
|
||||
}
|
||||
if (window !== undefined) {
|
||||
window.fromQml.connect(fromQml);
|
||||
}
|
||||
luciWindow = window;
|
||||
|
||||
|
||||
var moveDebugCursor = false;
|
||||
var onMousePressEvent = function (e) {
|
||||
if (e.isMiddleButton) {
|
||||
moveDebugCursor = true;
|
||||
setDebugCursor(e.x, e.y);
|
||||
}
|
||||
};
|
||||
Controller.mousePressEvent.connect(onMousePressEvent);
|
||||
|
||||
var onMouseReleaseEvent = function () {
|
||||
moveDebugCursor = false;
|
||||
};
|
||||
Controller.mouseReleaseEvent.connect(onMouseReleaseEvent);
|
||||
|
||||
var onMouseMoveEvent = function (e) {
|
||||
if (moveDebugCursor) {
|
||||
setDebugCursor(e.x, e.y);
|
||||
}
|
||||
};
|
||||
Controller.mouseMoveEvent.connect(onMouseMoveEvent);
|
||||
|
||||
function setDebugCursor(x, y) {
|
||||
var nx = 2.0 * (x / Window.innerWidth) - 1.0;
|
||||
var ny = 1.0 - 2.0 * ((y) / (Window.innerHeight));
|
||||
|
||||
Render.getConfig("RenderMainView").getConfig("DebugDeferredBuffer").size = { x: nx, y: ny, z: 1.0, w: 1.0 };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function closeLuciWindow() {
|
||||
if (luciWindow !== undefined) {
|
||||
activeWindow.fromQml.disconnect(fromQml);
|
||||
}
|
||||
luciWindow = {};
|
||||
|
||||
Controller.mousePressEvent.disconnect(onMousePressEvent);
|
||||
Controller.mouseReleaseEvent.disconnect(onMouseReleaseEvent);
|
||||
Controller.mouseMoveEvent.disconnect(onMouseMoveEvent);
|
||||
pages.clear();
|
||||
}
|
||||
|
||||
pages.addPage('Luci', 'Luci', '../luci.qml', 300, 420, openLuciWindow, closeLuciWindow);
|
||||
pages.addPage('openEngineInspectorView', 'Render Engine Inspector', '../engineInspector.qml', 300, 400);
|
||||
pages.addPage('openEngineLODView', 'Render LOD', '../lod.qml', 300, 400);
|
||||
pages.addPage('openMaterialInspectorView', 'Material Inspector', '../materialInspector.qml', 300, 400, MaterialInspector.setWindow, MaterialInspector.setWindow);
|
||||
|
||||
pages.open('Luci');
|
||||
|
||||
|
||||
return pages;
|
||||
}
|
||||
|
||||
|
||||
openView();
|
||||
|
Loading…
Reference in a new issue