From 767f413a2c1c16ccf02bf411900227154d256703 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 29 Jul 2019 00:07:16 -0700 Subject: [PATCH 01/12] merging the various job/task/switch congif into one --- .../scripting/RenderScriptingInterface.cpp | 2 +- libraries/render/src/render/Engine.h | 2 +- libraries/task/src/task/Config.cpp | 12 ++-- libraries/task/src/task/Config.h | 71 ++++++++++++++++--- libraries/task/src/task/Task.h | 56 +++++++++------ scripts/developer/utilities/lib/jet/jet.js | 8 ++- .../utilities/lib/jet/qml/TaskList.qml | 2 +- .../utilities/lib/jet/qml/TaskPropView.qml | 2 +- .../developer/utilities/lib/prop/PropItem.qml | 4 +- .../utilities/lib/prop/PropScalar.qml | 18 +++-- .../utilities/lib/prop/style/Global.qml | 8 ++- .../utilities/render/engineInspector.js | 62 ++-------------- .../utilities/render/engineInspector.qml | 2 +- .../developer/utilities/render/engineList.js | 18 ++--- .../developer/utilities/render/engineList.qml | 2 +- 15 files changed, 144 insertions(+), 125 deletions(-) diff --git a/interface/src/scripting/RenderScriptingInterface.cpp b/interface/src/scripting/RenderScriptingInterface.cpp index 338a5ab883..f23dc598a9 100644 --- a/interface/src/scripting/RenderScriptingInterface.cpp +++ b/interface/src/scripting/RenderScriptingInterface.cpp @@ -54,7 +54,7 @@ void RenderScriptingInterface::forceRenderMethod(RenderMethod renderMethod) { _renderMethod = (int)renderMethod; _renderMethodSetting.set((int)renderMethod); - auto config = dynamic_cast(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch")); + auto config = dynamic_cast(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch")); if (config) { config->setBranch((int)renderMethod); } diff --git a/libraries/render/src/render/Engine.h b/libraries/render/src/render/Engine.h index 130ed6533f..f1d59727d3 100644 --- a/libraries/render/src/render/Engine.h +++ b/libraries/render/src/render/Engine.h @@ -70,7 +70,7 @@ namespace render { GPUTaskConfig() = default; - GPUTaskConfig(bool enabled) : TaskConfig(enabled) {} + GPUTaskConfig(bool enabled) : render::TaskConfig(enabled) {} // Running Time measurement on GPU and for Batch execution void setGPUBatchRunTime(double msGpuTime, double msBatchTime) { _msGPURunTime = msGpuTime; _msBatchRunTime = msBatchTime; } diff --git a/libraries/task/src/task/Config.cpp b/libraries/task/src/task/Config.cpp index 79e0b9f7fb..bcf5eb7d1f 100644 --- a/libraries/task/src/task/Config.cpp +++ b/libraries/task/src/task/Config.cpp @@ -79,8 +79,8 @@ void JobConfig::refresh() { _jobConcept->applyConfiguration(); } -TaskConfig* TaskConfig::getRootConfig(const std::string& jobPath, std::string& jobName) const { - TaskConfig* root = const_cast (this); +JobConfig* JobConfig::getRootConfig(const std::string& jobPath, std::string& jobName) const { + JobConfig* root = const_cast (this); std::list tokens; std::size_t pos = 0, sepPos; @@ -105,7 +105,7 @@ TaskConfig* TaskConfig::getRootConfig(const std::string& jobPath, std::string& j while (tokens.size() > 1) { auto taskName = tokens.front(); tokens.pop_front(); - root = root->findChild((taskName.empty() ? QString() : QString(taskName.c_str()))); + root = root->findChild((taskName.empty() ? QString() : QString(taskName.c_str()))); if (!root) { return nullptr; } @@ -115,7 +115,7 @@ TaskConfig* TaskConfig::getRootConfig(const std::string& jobPath, std::string& j return root; } -JobConfig* TaskConfig::getJobConfig(const std::string& jobPath) const { +JobConfig* JobConfig::getJobConfig(const std::string& jobPath) const { std::string jobName; auto root = getRootConfig(jobPath, jobName); @@ -134,10 +134,10 @@ JobConfig* TaskConfig::getJobConfig(const std::string& jobPath) const { } } -void SwitchConfig::setBranch(uint8_t branch) { +void JobConfig::setBranch(uint8_t branch) { if (_branch != branch) { _branch = branch; // We can re-use this signal here emit dirtyEnabled(); } -} \ No newline at end of file +} diff --git a/libraries/task/src/task/Config.h b/libraries/task/src/task/Config.h index ab76bc5fba..8c674da31c 100644 --- a/libraries/task/src/task/Config.h +++ b/libraries/task/src/task/Config.h @@ -83,11 +83,19 @@ protected: Setting::Handle _preset; }; +class JobConfig; + +class TConfigProxy { +public: + using Config = JobConfig; +}; + // A default Config is always on; to create an enableable Config, use the ctor JobConfig(bool enabled) class JobConfig : public QObject { Q_OBJECT Q_PROPERTY(double cpuRunTime READ getCPURunTime NOTIFY newStats()) //ms Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY dirtyEnabled()) + Q_PROPERTY(int branch READ getBranch WRITE setBranch NOTIFY dirtyEnabled) double _msCPURunTime{ 0.0 }; @@ -96,7 +104,11 @@ protected: bool _isEnabled{ true }; + uint8_t _branch { 0 }; public: + bool _isTask{ false }; + bool _isSwitch{ false }; + using Persistent = PersistentConfig; JobConfig() = default; @@ -121,44 +133,86 @@ public: */ Q_INVOKABLE void load(const QVariantMap& map) { qObjectFromJsonValue(QJsonObject::fromVariantMap(map), *this); emit loaded(); } - Q_INVOKABLE QObject* getConfig(const QString& name) { return nullptr; } + //Q_INVOKABLE QObject* getConfig(const QString& name) { return nullptr; } // Running Time measurement // The new stats signal is emitted once per run time of a job when stats (cpu runtime) are updated void setCPURunTime(const std::chrono::nanoseconds& runtime) { _msCPURunTime = std::chrono::duration(runtime).count(); emit newStats(); } double getCPURunTime() const { return _msCPURunTime; } + /**jsdoc + * @function Render.getConfig + * @param {string} name + * @returns {object} + */ + // Get a sub job config through task.getConfig(path) + // where path can be: + // - search for the first job named job_name traversing the the sub graph of task and jobs (from this task as root) + // - .[.] + // Allowing to first look for the parent_name job (from this task as root) and then search from there for the + // optional sub_parent_names and finally from there looking for the job_name (assuming every job in the path were found) + // + // getter for qml integration, prefer the templated getter + Q_INVOKABLE QObject* getConfig(const QString& name) { return getConfig(name.toStdString()); } + + // getter for cpp (strictly typed), prefer this getter + JobConfig* getRootConfig(const std::string& jobPath, std::string& jobName) const; + JobConfig* getJobConfig(const std::string& jobPath) const; + template typename T::Config* getConfig(std::string jobPath = "") const { + return dynamic_cast(getJobConfig(jobPath)); + } + + Q_INVOKABLE bool isTask() const { return _isTask; } + Q_INVOKABLE bool isSwitch() const { return _isSwitch; } + + Q_INVOKABLE QObjectList getSubConfigs() const { + auto list = findChildren(QRegExp(".*"), Qt::FindDirectChildrenOnly); + QObjectList returned; + for (int i = 0; i < list.size(); i++) { + returned.push_back(list[i]); + } + return returned; + } + Q_INVOKABLE int getNumSubs() const { return getSubConfigs().size(); } + Q_INVOKABLE QObject* getSubConfig(int i) const { + auto subs = getSubConfigs(); + return ((i < 0 || i >= subs.size()) ? nullptr : subs[i]); + } + // Describe the node graph data connections of the associated Job/Task /**jsdoc * @function Render.isTask * @returns {boolean} */ - Q_INVOKABLE virtual bool isTask() const { return false; } + //Q_INVOKABLE virtual bool isTask() const { return false; } /**jsdoc * @function Render.getSubConfigs * @returns {object[]} */ - Q_INVOKABLE virtual QObjectList getSubConfigs() const { return QObjectList(); } + // Q_INVOKABLE virtual QObjectList getSubConfigs() const { return QObjectList(); } /**jsdoc * @function Render.getNumSubs * @returns {number} */ - Q_INVOKABLE virtual int getNumSubs() const { return 0; } + // Q_INVOKABLE virtual int getNumSubs() const { return 0; } /**jsdoc * @function Render.getSubConfig * @param {number} index * @returns {object} */ - Q_INVOKABLE virtual QObject* getSubConfig(int i) const { return nullptr; } + //Q_INVOKABLE virtual QObject* getSubConfig(int i) const { return nullptr; } void connectChildConfig(std::shared_ptr childConfig, const std::string& name); void transferChildrenConfigs(std::shared_ptr source); JobConcept* _jobConcept; + uint8_t getBranch() const { return _branch; } + void setBranch(uint8_t index); + public slots: /**jsdoc @@ -195,12 +249,9 @@ signals: using QConfigPointer = std::shared_ptr; -class TConfigProxy { -public: - using Config = JobConfig; -}; +#ifdef SPECIALIZE_CONFIG /**jsdoc * @namespace Render * @@ -270,7 +321,7 @@ public: protected: uint8_t _branch { 0 }; }; - +#endif } #endif // hifi_task_Config_h diff --git a/libraries/task/src/task/Task.h b/libraries/task/src/task/Task.h index cdc279ff36..0871cb5982 100644 --- a/libraries/task/src/task/Task.h +++ b/libraries/task/src/task/Task.h @@ -69,7 +69,7 @@ class JobConcept { public: using Config = JobConfig; - JobConcept(const std::string& name, QConfigPointer config) : _config(config), _name(name) {} + JobConcept(const std::string& name, QConfigPointer config) : _config(config), _name(name) { config->_jobConcept = this; } virtual ~JobConcept() = default; const std::string& getName() const { return _name; } @@ -80,7 +80,8 @@ public: virtual QConfigPointer& getConfiguration() { return _config; } virtual void applyConfiguration() = 0; - void setCPURunTime(const std::chrono::nanoseconds& runtime) { std::static_pointer_cast(_config)->setCPURunTime(runtime); } + void setCPURunTime(const std::chrono::nanoseconds& runtime) { + /*std::static_pointer_cast*/(_config)->setCPURunTime(runtime); } QConfigPointer _config; protected: @@ -94,9 +95,9 @@ template void jobConfigure(T& data, const C& configuration) { template void jobConfigure(T&, const JobConfig&) { // nop, as the default JobConfig was used, so the data does not need a configure method } -template void jobConfigure(T&, const TaskConfig&) { +/*template void jobConfigure(T&, const TaskConfig&) { // nop, as the default TaskConfig was used, so the data does not need a configure method -} +}*/ template void jobRun(T& data, const JC& jobContext, const JobNoIO& input, JobNoIO& output) { data.run(jobContext); @@ -158,7 +159,17 @@ public: return std::make_shared(name, input, std::make_shared(), std::forward(args)...); } - + void createConfiguration() { + // A brand new config + auto config = std::make_shared(); + // Make sure we transfer the former children configs to the new config + config->transferChildrenConfigs(Concept::_config); + // swap + Concept::_config = config; + // Capture this + Concept::_config->_jobConcept = this; + } + void applyConfiguration() override { TimeProfiler probe(("configure::" + JobConcept::getName())); @@ -228,7 +239,7 @@ public: using Context = JC; using TimeProfiler = TP; using ContextPointer = std::shared_ptr; - using Config = TaskConfig; + using Config = JobConfig; //TaskConfig; using JobType = Job; using None = typename JobType::None; using Concept = typename JobType::Concept; @@ -247,14 +258,15 @@ public: const Varying getOutput() const override { return _output; } Varying& editInput() override { return _input; } - TaskConcept(const std::string& name, const Varying& input, QConfigPointer config) : Concept(name, config), _input(input) {} + TaskConcept(const std::string& name, const Varying& input, QConfigPointer config) : Concept(name, config), _input(input) {config->_isTask = true;} // Create a new job in the container's queue; returns the job's output template const Varying addJob(std::string name, const Varying& input, NA&&... args) { _jobs.emplace_back((NT::JobModel::create(name, input, std::forward(args)...))); // Conect the child config to this task's config - std::static_pointer_cast(Concept::getConfiguration())->connectChildConfig(_jobs.back().getConfiguration(), name); + // std::static_pointer_cast(Concept::getConfiguration())->connectChildConfig(_jobs.back().getConfiguration(), name); + std::static_pointer_cast(Concept::getConfiguration())->connectChildConfig(_jobs.back().getConfiguration(), name); return _jobs.back().getOutput(); } @@ -285,8 +297,8 @@ public: model->_data.build(*(model), model->_input, model->_output, std::forward(args)...); } // Recreate the Config to use the templated type - model->createConfiguration(); - model->applyConfiguration(); + // model->createConfiguration(); + // model->applyConfiguration(); return model; } @@ -369,7 +381,7 @@ public: using Context = JC; using TimeProfiler = TP; using ContextPointer = std::shared_ptr; - using Config = SwitchConfig; + using Config = JobConfig; //SwitchConfig; using JobType = Job; using None = typename JobType::None; using Concept = typename JobType::Concept; @@ -388,14 +400,15 @@ public: const Varying getOutput() const override { return _output; } Varying& editInput() override { return _input; } - SwitchConcept(const std::string& name, const Varying& input, QConfigPointer config) : Concept(name, config), _input(input) {} + SwitchConcept(const std::string& name, const Varying& input, QConfigPointer config) : Concept(name, config), _input(input) + {config->_isTask = true; config->_isSwitch = true; } template const Varying addBranch(std::string name, uint8_t index, const Varying& input, NA&&... args) { auto& branch = _branches[index]; branch = JobType(NT::JobModel::create(name, input, std::forward(args)...)); // Conect the child config to this task's config - std::static_pointer_cast(Concept::getConfiguration())->connectChildConfig(branch.getConfiguration(), name); + std::static_pointer_cast(Concept::getConfiguration())->connectChildConfig(branch.getConfiguration(), name); return branch.getOutput(); } @@ -405,7 +418,7 @@ public: } }; - template class SwitchModel : public SwitchConcept { + template class SwitchModel : public SwitchConcept { public: using Data = T; using Input = I; @@ -427,8 +440,8 @@ public: model->_data.build(*(model), model->_input, model->_output, std::forward(args)...); } // Recreate the Config to use the templated type - model->createConfiguration(); - model->applyConfiguration(); + // model->createConfiguration(); + // model->applyConfiguration(); return model; } @@ -475,8 +488,8 @@ public: } } }; - template using Model = SwitchModel; - template using ModelI = SwitchModel; + template using Model = SwitchModel; + template using ModelI = SwitchModel; // TODO: Switches don't support Outputs yet //template using ModelO = SwitchModel; //template using ModelIO = SwitchModel; @@ -500,7 +513,7 @@ class Engine : public Task { public: using Context = JC; using ContextPointer = std::shared_ptr; - using Config = TaskConfig; + using Config = JobConfig; //TaskConfig; using TaskType = Task; using ConceptPointer = typename TaskType::ConceptPointer; @@ -526,10 +539,11 @@ protected: } + #define Task_DeclareTypeAliases(ContextType, TimeProfiler) \ using JobConfig = task::JobConfig; \ - using TaskConfig = task::TaskConfig; \ - using SwitchConfig = task::SwitchConfig; \ + using TaskConfig = task::JobConfig; \ + using SwitchConfig = task::JobConfig; \ template using PersistentConfig = task::PersistentConfig; \ using Job = task::Job; \ using Switch = task::Switch; \ diff --git a/scripts/developer/utilities/lib/jet/jet.js b/scripts/developer/utilities/lib/jet/jet.js index 52c13c5279..4c3188a5cf 100644 --- a/scripts/developer/utilities/lib/jet/jet.js +++ b/scripts/developer/utilities/lib/jet/jet.js @@ -18,7 +18,7 @@ // @param depth: the depth of the recurse loop since the initial call. function task_traverse(root, functor, depth) { if (root.isTask()) { - depth++; + depth++; for (var i = 0; i Date: Wed, 31 Jul 2019 11:44:42 -0700 Subject: [PATCH 02/12] better ui --- .../utilities/lib/jet/qml/TaskPropView.qml | 5 ++-- .../utilities/render/engineInspector.qml | 27 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml index ea5af4896f..04a18f8e2a 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml @@ -12,9 +12,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 as Original import QtQuick.Controls.Styles 1.4 -import stylesUit 1.0 -import controlsUit 1.0 as HifiControls - import "../../prop" as Prop import "../jet.js" as Jet @@ -23,6 +20,8 @@ Prop.PropGroup { id: root; + Prop.Global { id: global;} + property var rootConfig : Render property var jobPath: "" property alias label: root.label diff --git a/scripts/developer/utilities/render/engineInspector.qml b/scripts/developer/utilities/render/engineInspector.qml index fabbbe449b..a4b23ad33e 100644 --- a/scripts/developer/utilities/render/engineInspector.qml +++ b/scripts/developer/utilities/render/engineInspector.qml @@ -8,23 +8,32 @@ // 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.Controls 2.5 import QtQuick.Layouts 1.3 -import stylesUit 1.0 -import controlsUit 1.0 as HifiControls import "../lib/jet/qml" as Jet Item { - HifiConstants { id: hifi;} + anchors.fill: parent id: root; - anchors.fill: parent - + property var rootConfig: Render.getConfig("") - Jet.TaskPropView { - rootConfig: root.rootConfig - anchors.fill: root + ScrollView { + id: scrollView + anchors.fill: parent + contentWidth: parent.width + clip: true + + Column { + anchors.left: parent.left + anchors.right: parent.right + + Jet.TaskPropView { + rootConfig: root.rootConfig + anchors.fill: root + } + } } } \ No newline at end of file From 67a13ee7cd06df9b4d8b32c4097a33611cd68cdc Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 8 Aug 2019 17:10:46 -0700 Subject: [PATCH 03/12] Exploring differences in the polyline rendering --- .../entities-renderer/src/RenderablePolyLineEntityItem.cpp | 6 ++++-- scripts/developer/utilities/render/luci.qml | 4 ++-- scripts/developer/utilities/render/luci2.js | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp index 6cdc25d7b3..4f9a408191 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp @@ -63,11 +63,13 @@ void PolyLineEntityRenderer::buildPipelines() { } ItemKey PolyLineEntityRenderer::getKey() { - return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); + // return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); + return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); } ShapeKey PolyLineEntityRenderer::getShapeKey() { - auto builder = ShapeKey::Builder().withOwnPipeline().withTranslucent().withoutCullFace(); + // auto builder = ShapeKey::Builder().withOwnPipeline().withTranslucent().withoutCullFace(); + auto builder = ShapeKey::Builder().withOwnPipeline().withoutCullFace(); if (_primitiveMode == PrimitiveMode::LINES) { builder.withWireframe(); } diff --git a/scripts/developer/utilities/render/luci.qml b/scripts/developer/utilities/render/luci.qml index 98fd3039d1..803c8f0cb2 100644 --- a/scripts/developer/utilities/render/luci.qml +++ b/scripts/developer/utilities/render/luci.qml @@ -69,7 +69,7 @@ Rectangle { Culling {} } } - Prop.PropFolderPanel { + /* Prop.PropFolderPanel { label: "Tools" panelFrameData: Component { Row { @@ -87,7 +87,7 @@ Rectangle { } } } - } + }*/ /* Jet.TaskPropView { id: "le" jobPath: "" diff --git a/scripts/developer/utilities/render/luci2.js b/scripts/developer/utilities/render/luci2.js index a34cf88415..ba0215569a 100644 --- a/scripts/developer/utilities/render/luci2.js +++ b/scripts/developer/utilities/render/luci2.js @@ -69,8 +69,8 @@ function openView() { } pages.addPage('Luci', 'Luci', '../luci.qml', 300, 420, openLuciWindow, closeLuciWindow); - pages.addPage('openEngineLODView', 'Render LOD', '../lod.qml', 300, 400); - pages.addPage('openMaterialInspectorView', 'Material Inspector', '../materialInspector.qml', 300, 400, MaterialInspector.setWindow, MaterialInspector.setWindow); + // 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'); From a96ef7b5f00e4e2f773abdd1c6cd174f0ac5b2d5 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Fri, 9 Aug 2019 18:34:36 -0700 Subject: [PATCH 04/12] Exloring the why.... --- .../src/RenderablePolyLineEntityItem.cpp | 17 +++++++++-------- scripts/developer/utilities/render/luci.qml | 12 ++++++++++-- .../utilities/render/luci/Antialiasing.qml | 11 ++++++++++- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp index 4f9a408191..0c4e59ec18 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp @@ -52,24 +52,25 @@ void PolyLineEntityRenderer::buildPipelines() { gpu::ShaderPointer program = gpu::Shader::createProgram(key.first == render::Args::DEFERRED ? shader::entities_renderer::program::paintStroke : shader::entities_renderer::program::paintStroke_forward); gpu::StatePointer state = gpu::StatePointer(new gpu::State()); + state->setCullMode(gpu::State::CullMode::CULL_NONE); state->setDepthTest(true, !key.second, gpu::LESS_EQUAL); - PrepareStencil::testMask(*state); - state->setBlendFunction(true, - gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA, - gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE); + PrepareStencil::testMaskDrawShape(*state); + + state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA); + _pipelines[key] = gpu::Pipeline::create(program, state); } } ItemKey PolyLineEntityRenderer::getKey() { - // return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); - return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); + return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); + // return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); } ShapeKey PolyLineEntityRenderer::getShapeKey() { - // auto builder = ShapeKey::Builder().withOwnPipeline().withTranslucent().withoutCullFace(); - auto builder = ShapeKey::Builder().withOwnPipeline().withoutCullFace(); + auto builder = ShapeKey::Builder().withOwnPipeline().withTranslucent().withoutCullFace(); + //auto builder = ShapeKey::Builder().withOwnPipeline().withoutCullFace(); if (_primitiveMode == PrimitiveMode::LINES) { builder.withWireframe(); } diff --git a/scripts/developer/utilities/render/luci.qml b/scripts/developer/utilities/render/luci.qml index 803c8f0cb2..3a61a0394d 100644 --- a/scripts/developer/utilities/render/luci.qml +++ b/scripts/developer/utilities/render/luci.qml @@ -33,6 +33,14 @@ Rectangle { Column { width: parent.width + Prop.PropFolderPanel { + label: "Render Settings" + isUnfold: false + panelFrameData: Component { + RenderSettings { + } + } + } Prop.PropFolderPanel { label: "Shading Model" panelFrameData: Component { @@ -69,7 +77,7 @@ Rectangle { Culling {} } } - /* Prop.PropFolderPanel { + Prop.PropFolderPanel { label: "Tools" panelFrameData: Component { Row { @@ -87,7 +95,7 @@ Rectangle { } } } - }*/ + } /* Jet.TaskPropView { id: "le" jobPath: "" diff --git a/scripts/developer/utilities/render/luci/Antialiasing.qml b/scripts/developer/utilities/render/luci/Antialiasing.qml index e29bca43eb..0cea509761 100644 --- a/scripts/developer/utilities/render/luci/Antialiasing.qml +++ b/scripts/developer/utilities/render/luci/Antialiasing.qml @@ -18,6 +18,8 @@ import controlsUit 1.0 as HifiControls import "../configSlider" import "../../lib/plotperf" +import "../../lib/prop" as Prop + Column{ HifiConstants { id: hifi; } @@ -28,7 +30,14 @@ Column{ anchors.right: parent.right spacing: 10 - + Prop.PropScalar { + label: "MSAA" + object: Render.getConfig("RenderMainView.PreparePrimaryBufferForward") + property: "numSamples" + min: 1 + max: 4 + integral: true + } Row { spacing: 10 id: fxaaOnOff From 9139edc8b116726759b2ccf5b78cd24460461c28 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Mon, 12 Aug 2019 00:44:14 -0700 Subject: [PATCH 05/12] Maybe fixed the problem, cannot render the gl41 version properly --- .../src/RenderablePolyLineEntityItem.cpp | 6 ++++-- libraries/entities-renderer/src/paintStroke.slf | 2 +- libraries/render-utils/src/RenderForwardTask.cpp | 12 ++++++++++++ libraries/render-utils/src/RenderForwardTask.h | 12 ++---------- .../developer/utilities/render/luci/Antialiasing.qml | 2 +- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp index 0c4e59ec18..ca0a924d91 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp @@ -55,9 +55,11 @@ void PolyLineEntityRenderer::buildPipelines() { state->setCullMode(gpu::State::CullMode::CULL_NONE); state->setDepthTest(true, !key.second, gpu::LESS_EQUAL); - PrepareStencil::testMaskDrawShape(*state); + // PrepareStencil::testMaskDrawShape(*state); + PrepareStencil::testMask(*state); - state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA); + state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA, + gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE); _pipelines[key] = gpu::Pipeline::create(program, state); } diff --git a/libraries/entities-renderer/src/paintStroke.slf b/libraries/entities-renderer/src/paintStroke.slf index 837291efe6..4ae242655c 100644 --- a/libraries/entities-renderer/src/paintStroke.slf +++ b/libraries/entities-renderer/src/paintStroke.slf @@ -31,7 +31,7 @@ layout(location=3) in float _distanceFromCenter; void main(void) { vec4 texel = texture(_texture, _texCoord); texel *= _color; - texel.a *= mix(1.0, pow(1.0 - abs(_distanceFromCenter), 10.0), _polylineData.faceCameraGlow.y); + texel.a *= mix(1.0, pow(1.0 - min(1.0, abs(_distanceFromCenter)), 10.0), _polylineData.faceCameraGlow.y); <@if not HIFI_USE_FORWARD@> packDeferredFragmentTranslucent((2.0 * float(gl_FrontFacing) - 1.0) * _normalWS, texel.a, texel.rgb, DEFAULT_ROUGHNESS); diff --git a/libraries/render-utils/src/RenderForwardTask.cpp b/libraries/render-utils/src/RenderForwardTask.cpp index 14f2e51697..9b547b82bb 100755 --- a/libraries/render-utils/src/RenderForwardTask.cpp +++ b/libraries/render-utils/src/RenderForwardTask.cpp @@ -48,6 +48,18 @@ using namespace render; extern void initForwardPipelines(ShapePlumber& plumber); +void PreparePrimaryFramebufferMSAAConfig::setResolutionScale(float scale) { + const float SCALE_RANGE_MIN = 0.1f; + const float SCALE_RANGE_MAX = 2.0f; + resolutionScale = std::max(SCALE_RANGE_MIN, std::min(SCALE_RANGE_MAX, scale)); + // emit dirty(); +} + +void PreparePrimaryFramebufferMSAAConfig::setNumSamples(int num) { + numSamples = std::max(1, std::min(32, num)); + emit dirty(); +} + void RenderForwardTask::configure(const Config& config) { // Propagate resolution scale to sub jobs who need it auto preparePrimaryBufferConfig = config.getConfig("PreparePrimaryBufferForward"); diff --git a/libraries/render-utils/src/RenderForwardTask.h b/libraries/render-utils/src/RenderForwardTask.h index dd0abbc9ab..d225ffb648 100755 --- a/libraries/render-utils/src/RenderForwardTask.h +++ b/libraries/render-utils/src/RenderForwardTask.h @@ -46,18 +46,10 @@ class PreparePrimaryFramebufferMSAAConfig : public render::Job::Config { Q_PROPERTY(int numSamples WRITE setNumSamples READ getNumSamples) public: float getResolutionScale() const { return resolutionScale; } - void setResolutionScale(float scale) { - const float SCALE_RANGE_MIN = 0.1f; - const float SCALE_RANGE_MAX = 2.0f; - resolutionScale = std::max(SCALE_RANGE_MIN, std::min(SCALE_RANGE_MAX, scale)); - //emit dirty(); - } + void setResolutionScale(float scale); int getNumSamples() const { return numSamples; } - void setNumSamples(int num) { - numSamples = std::max(1, std::min(32, num)); - emit dirty(); - } + void setNumSamples(int num); signals: void dirty(); diff --git a/scripts/developer/utilities/render/luci/Antialiasing.qml b/scripts/developer/utilities/render/luci/Antialiasing.qml index 0cea509761..6d1209157f 100644 --- a/scripts/developer/utilities/render/luci/Antialiasing.qml +++ b/scripts/developer/utilities/render/luci/Antialiasing.qml @@ -35,7 +35,7 @@ Column{ object: Render.getConfig("RenderMainView.PreparePrimaryBufferForward") property: "numSamples" min: 1 - max: 4 + max: 32 integral: true } Row { From 0b470b9ab8912eac9a14145950e01d58f207702c Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Tue, 13 Aug 2019 00:22:17 -0700 Subject: [PATCH 06/12] Fixing the bad location assignment on gl41 on windows with Austin's help --- .../gpu-gl-common/src/gpu/gl/GLBackend.h | 1 + .../src/gpu/gl/GLBackendShader.cpp | 2 +- .../gpu-gl-common/src/gpu/gl/GLPipeline.cpp | 3 ++- .../gpu-gl/src/gpu/gl41/GL41BackendShader.cpp | 21 ++++++++------- libraries/gpu/src/gpu/Shader.cpp | 26 ++++++++++++------- libraries/gpu/src/gpu/Shader.h | 2 +- .../procedural/src/procedural/Procedural.cpp | 2 +- libraries/render/src/render/ShapePipeline.cpp | 2 +- libraries/shaders/src/shaders/Shaders.cpp | 2 -- libraries/shaders/src/shaders/Shaders.h | 3 --- 10 files changed, 35 insertions(+), 29 deletions(-) diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h index ffd0466b79..2532de31b0 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h @@ -584,6 +584,7 @@ protected: friend class GLState; friend class GLTexture; friend class GLShader; + friend class GLPipeline; }; }} // namespace gpu::gl diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackendShader.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLBackendShader.cpp index f737842ec0..10b573276e 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackendShader.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackendShader.cpp @@ -202,7 +202,7 @@ GLint GLBackend::getRealUniformLocation(GLint location) const { void GLBackend::postLinkProgram(ShaderObject& shaderObject, const Shader& program) const { const auto& glprogram = shaderObject.glprogram; - const auto& expectedUniforms = program.getReflection().uniforms; + auto expectedUniforms = program.getReflection(getShaderDialect(), getShaderVariant()).uniforms; auto& uniformRemap = shaderObject.uniformRemap; // initialize all the uniforms with an invalid location diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLPipeline.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLPipeline.cpp index e00dc9fc25..52e10eb417 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLPipeline.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLPipeline.cpp @@ -52,7 +52,8 @@ GLPipeline* GLPipeline::sync(GLBackend& backend, const Pipeline& pipeline) { // Special case for view correction matrices, any pipeline that declares the correction buffer // uniform will automatically have it provided without any client code necessary. // Required for stable lighting in the HMD. - object->_cameraCorrection = shader->getReflection().validUniformBuffer(gpu::slot::buffer::CameraCorrection); + auto reflection = shader->getReflection(backend.getShaderDialect(), backend.getShaderVariant()); + object->_cameraCorrection = reflection.validUniformBuffer(gpu::slot::buffer::CameraCorrection); object->_program = programObject; object->_state = stateObject; diff --git a/libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp b/libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp index f33dd91d03..1b21be2e73 100644 --- a/libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp +++ b/libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp @@ -15,7 +15,7 @@ using namespace gpu::gl41; void GL41Backend::postLinkProgram(ShaderObject& programObject, const Shader& program) const { Parent::postLinkProgram(programObject, program); const auto& glprogram = programObject.glprogram; - const auto& reflection = program.getReflection(); + auto reflection = program.getReflection(getShaderDialect(), getShaderVariant()); // For the UBOs, use glUniformBlockBinding to fixup the locations based on the reflection { const auto& expectedUbos = reflection.uniformBuffers; @@ -43,25 +43,26 @@ void GL41Backend::postLinkProgram(ShaderObject& programObject, const Shader& pro } // For the resource buffers, do the same as for the textures, since in GL 4.1 that's how they're implemented + static const std::string TRANSFORM_OBJECT_BUFFER = "transformObjectBuffer"; { const auto& expectedResourceBuffers = reflection.resourceBuffers; const auto names = Shader::Reflection::getNames(expectedResourceBuffers); const auto resourceBufferUniforms = ::gl::Uniform::loadByName(glprogram, names); for (const auto& resourceBuffer : resourceBufferUniforms) { + + // Special case for the transformObjectBuffer, which is filtered out of the reflection data at shader load time + if (resourceBuffer.name == TRANSFORM_OBJECT_BUFFER) { + glProgramUniform1i(glprogram, resourceBuffer.binding, ::gpu::slot::texture::ObjectTransforms); + continue; + } const auto& targetBinding = expectedResourceBuffers.at(resourceBuffer.name); + if (resourceBuffer.name == std::string("polylineVerticesBuffer")) { + qDebug() << "Setting texture unit for " << resourceBuffer.name.c_str() << " to " << targetBinding; + } glProgramUniform1i(glprogram, resourceBuffer.binding, targetBinding); } } - // Special case for the transformObjectBuffer, which is filtered out of the reflection data at shader load time - // - { - static const std::string TRANSFORM_OBJECT_BUFFER = "transformObjectBuffer"; - const auto uniform = ::gl::Uniform::loadByName(glprogram, TRANSFORM_OBJECT_BUFFER); - if (-1 != uniform.binding) { - glProgramUniform1i(glprogram, uniform.binding, ::gpu::slot::texture::ObjectTransforms); - } - } } diff --git a/libraries/gpu/src/gpu/Shader.cpp b/libraries/gpu/src/gpu/Shader.cpp index d4236ac66c..6fef768a08 100755 --- a/libraries/gpu/src/gpu/Shader.cpp +++ b/libraries/gpu/src/gpu/Shader.cpp @@ -43,17 +43,25 @@ Shader::Shader(Type type, const Pointer& vertex, const Pointer& geometry, const shaders[VERTEX] = vertex; shaders[PIXEL] = pixel; } +} - auto& reflection = const_cast(getReflection()); - for (const auto& subShader : _shaders) { - reflection.merge(subShader->getReflection()); - } - if (_shaders[VERTEX]) { - reflection.inputs = _shaders[VERTEX]->getReflection().inputs; - } - if (_shaders[PIXEL]) { - reflection.outputs = _shaders[PIXEL]->getReflection().outputs; +Shader::Reflection Shader::getReflection(shader::Dialect dialect, shader::Variant variant) const { + if (_type == Shader::Type::PROGRAM) { + Reflection reflection; + for (const auto& subShader : _shaders) { + reflection.merge(subShader->getReflection(dialect, variant)); + } + if (_shaders[VERTEX]) { + reflection.inputs = _shaders[VERTEX]->getReflection(dialect, variant).inputs; + } + if (_shaders[PIXEL]) { + reflection.outputs = _shaders[PIXEL]->getReflection(dialect, variant).outputs; + } + + return reflection; } + + return _source.getReflection(dialect, variant); } Shader::~Shader() diff --git a/libraries/gpu/src/gpu/Shader.h b/libraries/gpu/src/gpu/Shader.h index 987e632025..6461437971 100755 --- a/libraries/gpu/src/gpu/Shader.h +++ b/libraries/gpu/src/gpu/Shader.h @@ -91,7 +91,7 @@ public: const Shaders& getShaders() const { return _shaders; } - const Reflection& getReflection() const { return _source.reflection; } + Reflection getReflection(shader::Dialect dialect, shader::Variant variant) const; // Compilation Handler can be passed while compiling a shader (in the makeProgram call) to be able to give the hand to // the caller thread if the compilation fails and to provide a different version of the source for it diff --git a/libraries/procedural/src/procedural/Procedural.cpp b/libraries/procedural/src/procedural/Procedural.cpp index dbdf9cc7d1..7d0b7c05ea 100644 --- a/libraries/procedural/src/procedural/Procedural.cpp +++ b/libraries/procedural/src/procedural/Procedural.cpp @@ -268,7 +268,7 @@ void Procedural::prepare(gpu::Batch& batch, int customSlot = procedural::slot::uniform::Custom; for (const auto& key : _data.uniforms.keys()) { std::string uniformName = key.toLocal8Bit().data(); - fragmentSource.reflection.uniforms[uniformName] = customSlot; + // fragmentSource.reflection.uniforms[uniformName] = customSlot; ++customSlot; } diff --git a/libraries/render/src/render/ShapePipeline.cpp b/libraries/render/src/render/ShapePipeline.cpp index 12947f5291..9942f1a46c 100644 --- a/libraries/render/src/render/ShapePipeline.cpp +++ b/libraries/render/src/render/ShapePipeline.cpp @@ -86,7 +86,7 @@ void ShapePlumber::addPipeline(const Key& key, const gpu::ShaderPointer& program void ShapePlumber::addPipeline(const Filter& filter, const gpu::ShaderPointer& program, const gpu::StatePointer& state, BatchSetter batchSetter, ItemSetter itemSetter) { ShapeKey key{ filter._flags }; - const auto& reflection = program->getReflection(); + auto reflection = program->getReflection(shader::Dialect::glsl450, shader::Variant::Mono); auto locations = std::make_shared(); locations->albedoTextureUnit = reflection.validTexture(graphics::slot::texture::MaterialAlbedo); locations->roughnessTextureUnit = reflection.validTexture(graphics::slot::texture::MaterialRoughness); diff --git a/libraries/shaders/src/shaders/Shaders.cpp b/libraries/shaders/src/shaders/Shaders.cpp index a074c2f0c9..02a3c9587e 100644 --- a/libraries/shaders/src/shaders/Shaders.cpp +++ b/libraries/shaders/src/shaders/Shaders.cpp @@ -131,7 +131,6 @@ Source::Pointer Source::loadSource(uint32_t shaderId) { for (const auto& dialect : dialects) { result->dialectSources[dialect] = loadDialectSource(dialect, shaderId); } - result->reflection = result->dialectSources[DEFAULT_DIALECT].variantSources[Variant::Mono].reflection; return result; } @@ -140,7 +139,6 @@ Source& Source::operator=(const Source& other) { name = other.name; dialectSources = other.dialectSources; replacements = other.replacements; - reflection = other.reflection; return *this; } diff --git a/libraries/shaders/src/shaders/Shaders.h b/libraries/shaders/src/shaders/Shaders.h index 134b2bdcf8..7eb4241de4 100644 --- a/libraries/shaders/src/shaders/Shaders.h +++ b/libraries/shaders/src/shaders/Shaders.h @@ -140,9 +140,6 @@ struct Source { // The name of the shader file, with extension, i.e. DrawColor.frag std::string name; - // Generic reflection, copied from the 450 dialect / mono variant - Reflection reflection; - // Map of platforms to their specific shaders std::unordered_map dialectSources; From 224e9590ecb7ccf22be236ba013ef3d017606560 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Tue, 13 Aug 2019 15:45:24 -0700 Subject: [PATCH 07/12] avoid using explicit dialects when we want just a default one --- libraries/gpu/src/gpu/Shader.cpp | 19 +++++++++++++++++++ libraries/gpu/src/gpu/Shader.h | 1 + libraries/render/src/render/ShapePipeline.cpp | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/libraries/gpu/src/gpu/Shader.cpp b/libraries/gpu/src/gpu/Shader.cpp index 6fef768a08..dcdbff56d2 100755 --- a/libraries/gpu/src/gpu/Shader.cpp +++ b/libraries/gpu/src/gpu/Shader.cpp @@ -64,6 +64,25 @@ Shader::Reflection Shader::getReflection(shader::Dialect dialect, shader::Varian return _source.getReflection(dialect, variant); } + +Shader::Reflection Shader::getReflection() const { + + // FOr sake of convenience i would like to be able to use a "default" dialect that represents the reflection + // of the source of the shader + // What i really want, is a reflection that is designed for the gpu lib interface but we don;t have that yet (glsl45 is the closest to that) + // Until we have an implementation for this, we will return such default reflection from the one available and platform specific + +#if defined(USE_GLES) + auto defaultDialect = shader::Dialect::glsl310es; +#elif defined(Q_OS_MAC) + // Mac only supports 4.1 + auto defaultDialect = shader::Dialect::glsl410; +#else + auto defaultDialect = shader::Dialect::glsl450; +#endif + return getReflection(defaultDialect, shader::Variant::Mono); +} + Shader::~Shader() { } diff --git a/libraries/gpu/src/gpu/Shader.h b/libraries/gpu/src/gpu/Shader.h index 6461437971..f4f37b1815 100755 --- a/libraries/gpu/src/gpu/Shader.h +++ b/libraries/gpu/src/gpu/Shader.h @@ -92,6 +92,7 @@ public: const Shaders& getShaders() const { return _shaders; } Reflection getReflection(shader::Dialect dialect, shader::Variant variant) const; + Reflection getReflection() const; // get the default version of the reflection // Compilation Handler can be passed while compiling a shader (in the makeProgram call) to be able to give the hand to // the caller thread if the compilation fails and to provide a different version of the source for it diff --git a/libraries/render/src/render/ShapePipeline.cpp b/libraries/render/src/render/ShapePipeline.cpp index 9942f1a46c..048e08e959 100644 --- a/libraries/render/src/render/ShapePipeline.cpp +++ b/libraries/render/src/render/ShapePipeline.cpp @@ -86,7 +86,7 @@ void ShapePlumber::addPipeline(const Key& key, const gpu::ShaderPointer& program void ShapePlumber::addPipeline(const Filter& filter, const gpu::ShaderPointer& program, const gpu::StatePointer& state, BatchSetter batchSetter, ItemSetter itemSetter) { ShapeKey key{ filter._flags }; - auto reflection = program->getReflection(shader::Dialect::glsl450, shader::Variant::Mono); + auto reflection = program->getReflection(); auto locations = std::make_shared(); locations->albedoTextureUnit = reflection.validTexture(graphics::slot::texture::MaterialAlbedo); locations->roughnessTextureUnit = reflection.validTexture(graphics::slot::texture::MaterialRoughness); From 4a93b23d83d1dd80bb518067d8920489f72ecbfa Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Tue, 13 Aug 2019 18:47:57 -0700 Subject: [PATCH 08/12] Address the procedural to populate all reflection versions with user uniforms bindings and make EnigneInspector works correctly --- .../src/RenderablePolyLineEntityItem.cpp | 3 --- libraries/gpu/src/gpu/Shader.cpp | 16 +++---------- .../procedural/src/procedural/Procedural.cpp | 24 ++++++++++++++----- .../render-utils/src/RenderForwardTask.h | 4 ++-- libraries/shaders/src/shaders/Shaders.cpp | 6 ++--- libraries/shaders/src/shaders/Shaders.h | 2 ++ .../utilities/lib/jet/qml/TaskPropView.qml | 2 +- .../utilities/lib/prop/PropGroup.qml | 2 +- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp index ca0a924d91..1c3e755c7b 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp @@ -55,7 +55,6 @@ void PolyLineEntityRenderer::buildPipelines() { state->setCullMode(gpu::State::CullMode::CULL_NONE); state->setDepthTest(true, !key.second, gpu::LESS_EQUAL); - // PrepareStencil::testMaskDrawShape(*state); PrepareStencil::testMask(*state); state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA, @@ -67,12 +66,10 @@ void PolyLineEntityRenderer::buildPipelines() { ItemKey PolyLineEntityRenderer::getKey() { return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); - // return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); } ShapeKey PolyLineEntityRenderer::getShapeKey() { auto builder = ShapeKey::Builder().withOwnPipeline().withTranslucent().withoutCullFace(); - //auto builder = ShapeKey::Builder().withOwnPipeline().withoutCullFace(); if (_primitiveMode == PrimitiveMode::LINES) { builder.withWireframe(); } diff --git a/libraries/gpu/src/gpu/Shader.cpp b/libraries/gpu/src/gpu/Shader.cpp index dcdbff56d2..6a1ea53cda 100755 --- a/libraries/gpu/src/gpu/Shader.cpp +++ b/libraries/gpu/src/gpu/Shader.cpp @@ -66,21 +66,11 @@ Shader::Reflection Shader::getReflection(shader::Dialect dialect, shader::Varian Shader::Reflection Shader::getReflection() const { - - // FOr sake of convenience i would like to be able to use a "default" dialect that represents the reflection + // For sake of convenience i would like to be able to use a "default" dialect that represents the reflection // of the source of the shader - // What i really want, is a reflection that is designed for the gpu lib interface but we don;t have that yet (glsl45 is the closest to that) + // What i really want, is a reflection that is designed for the gpu lib interface but we don't have that yet (glsl45 is the closest to that) // Until we have an implementation for this, we will return such default reflection from the one available and platform specific - -#if defined(USE_GLES) - auto defaultDialect = shader::Dialect::glsl310es; -#elif defined(Q_OS_MAC) - // Mac only supports 4.1 - auto defaultDialect = shader::Dialect::glsl410; -#else - auto defaultDialect = shader::Dialect::glsl450; -#endif - return getReflection(defaultDialect, shader::Variant::Mono); + return getReflection(shader::DEFAULT_DIALECT, shader::Variant::Mono); } Shader::~Shader() diff --git a/libraries/procedural/src/procedural/Procedural.cpp b/libraries/procedural/src/procedural/Procedural.cpp index 7d0b7c05ea..ce4fbb2a38 100644 --- a/libraries/procedural/src/procedural/Procedural.cpp +++ b/libraries/procedural/src/procedural/Procedural.cpp @@ -264,12 +264,24 @@ void Procedural::prepare(gpu::Batch& batch, fragmentSource.replacements[PROCEDURAL_VERSION] = "#define PROCEDURAL_V" + std::to_string(_data.version); fragmentSource.replacements[PROCEDURAL_BLOCK] = _shaderSource.toStdString(); - // Set any userdata specified uniforms - int customSlot = procedural::slot::uniform::Custom; - for (const auto& key : _data.uniforms.keys()) { - std::string uniformName = key.toLocal8Bit().data(); - // fragmentSource.reflection.uniforms[uniformName] = customSlot; - ++customSlot; + // Set any userdata specified uniforms (if any) + if (!_data.uniforms.empty()) { + // First grab all the possible dialect/variant/Reflections + std::vector allReflections; + for (auto dialectIt = fragmentSource.dialectSources.begin(); dialectIt != fragmentSource.dialectSources.end(); ++dialectIt) { + for (auto variantIt = (*dialectIt).second.variantSources.begin(); variantIt != (*dialectIt).second.variantSources.end(); ++variantIt) { + allReflections.push_back(&(*variantIt).second.reflection); + } + } + // Then fill in every reflections the new custom bindings + int customSlot = procedural::slot::uniform::Custom; + for (const auto& key : _data.uniforms.keys()) { + std::string uniformName = key.toLocal8Bit().data(); + for (auto reflection : allReflections) { + reflection->uniforms[uniformName] = customSlot; + } + ++customSlot; + } } // Leave this here for debugging diff --git a/libraries/render-utils/src/RenderForwardTask.h b/libraries/render-utils/src/RenderForwardTask.h index d225ffb648..647994d3c0 100755 --- a/libraries/render-utils/src/RenderForwardTask.h +++ b/libraries/render-utils/src/RenderForwardTask.h @@ -42,8 +42,8 @@ public: class PreparePrimaryFramebufferMSAAConfig : public render::Job::Config { Q_OBJECT - Q_PROPERTY(float resolutionScale WRITE setResolutionScale READ getResolutionScale) - Q_PROPERTY(int numSamples WRITE setNumSamples READ getNumSamples) + Q_PROPERTY(float resolutionScale WRITE setResolutionScale READ getResolutionScale NOTIFY dirty()) + Q_PROPERTY(int numSamples WRITE setNumSamples READ getNumSamples NOTIFY dirty()) public: float getResolutionScale() const { return resolutionScale; } void setResolutionScale(float scale); diff --git a/libraries/shaders/src/shaders/Shaders.cpp b/libraries/shaders/src/shaders/Shaders.cpp index 02a3c9587e..ef67842f84 100644 --- a/libraries/shaders/src/shaders/Shaders.cpp +++ b/libraries/shaders/src/shaders/Shaders.cpp @@ -32,7 +32,7 @@ namespace shader { #if defined(USE_GLES) -static const Dialect DEFAULT_DIALECT = Dialect::glsl310es; +const Dialect DEFAULT_DIALECT = Dialect::glsl310es; const std::vector& allDialects() { static const std::vector ALL_DIALECTS{ { Dialect::glsl310es } }; @@ -41,7 +41,7 @@ const std::vector& allDialects() { #elif defined(Q_OS_MAC) -static const Dialect DEFAULT_DIALECT = Dialect::glsl410; +const Dialect DEFAULT_DIALECT = Dialect::glsl410; const std::vector& allDialects() { static const std::vector ALL_DIALECTS{ Dialect::glsl410 }; @@ -50,7 +50,7 @@ const std::vector& allDialects() { #else -static const Dialect DEFAULT_DIALECT = Dialect::glsl450; +const Dialect DEFAULT_DIALECT = Dialect::glsl450; const std::vector & allDialects() { static const std::vector ALL_DIALECTS{ { Dialect::glsl450, Dialect::glsl410 } }; diff --git a/libraries/shaders/src/shaders/Shaders.h b/libraries/shaders/src/shaders/Shaders.h index 7eb4241de4..701695c3a8 100644 --- a/libraries/shaders/src/shaders/Shaders.h +++ b/libraries/shaders/src/shaders/Shaders.h @@ -42,6 +42,8 @@ enum class Dialect #endif }; +extern const Dialect DEFAULT_DIALECT; + const std::vector& allDialects(); const std::string& dialectPath(Dialect dialect); diff --git a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml index 04a18f8e2a..69902392a5 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml @@ -91,7 +91,7 @@ Prop.PropGroup { // console.log(JSON.stringify(props)); if (showProps) { for (var p in props) { - propsModel.push({"object": rootConfig.getConfig(jobPath), "property":props[p] }) + propsModel.push({"object": rootConfig.getConfig(jobPath), "property":props[p]}) } root.updatePropItems(root.propItemsPanel, propsModel); } diff --git a/scripts/developer/utilities/lib/prop/PropGroup.qml b/scripts/developer/utilities/lib/prop/PropGroup.qml index c6b2c694f6..bfae2798eb 100644 --- a/scripts/developer/utilities/lib/prop/PropGroup.qml +++ b/scripts/developer/utilities/lib/prop/PropGroup.qml @@ -68,7 +68,7 @@ PropFolderPanel { "min": (proItem["min"] !== undefined ? proItem.min : 0.0), "max": (proItem["max"] !== undefined ? proItem.max : 1.0), "integer": (proItem["integral"] !== undefined ? proItem.integral : false), - "readOnly": (proItem["readOnly"] !== undefined ? proItem["readOnly"] : false), + "readOnly": (proItem["readOnly"] !== undefined ? proItem["readOnly"] : true), }) } break; case 'PropEnum': { From 5c085bd08d5139c566908f470cf06b7e5517e7ac Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Tue, 13 Aug 2019 18:58:35 -0700 Subject: [PATCH 09/12] CLean the code of the task::COnfig changes --- libraries/task/src/task/Config.h | 126 ++++-------------- libraries/task/src/task/Task.h | 12 +- .../utilities/lib/jet/qml/TaskList.qml | 2 +- 3 files changed, 28 insertions(+), 112 deletions(-) diff --git a/libraries/task/src/task/Config.h b/libraries/task/src/task/Config.h index ba17c7418c..193674d152 100644 --- a/libraries/task/src/task/Config.h +++ b/libraries/task/src/task/Config.h @@ -161,10 +161,24 @@ public: template typename T::Config* getConfig(std::string jobPath = "") const { return dynamic_cast(getJobConfig(jobPath)); } - + + // Describe the node graph data connections of the associated Job/Task + /**jsdoc + * @function JobConfig.isTask + * @returns {boolean} + */ Q_INVOKABLE bool isTask() const { return _isTask; } + + /**jsdoc + * @function JobConfig.isSwitch + * @returns {boolean} + */ Q_INVOKABLE bool isSwitch() const { return _isSwitch; } + /**jsdoc + * @function JobConfig.getSubConfigs + * @returns {object[]} + */ Q_INVOKABLE QObjectList getSubConfigs() const { auto list = findChildren(QRegExp(".*"), Qt::FindDirectChildrenOnly); QObjectList returned; @@ -173,38 +187,23 @@ public: } return returned; } + + /**jsdoc + * @function JobConfig.getNumSubs + * @returns {number} + */ Q_INVOKABLE int getNumSubs() const { return getSubConfigs().size(); } + + /**jsdoc + * @function JobConfig.getSubConfig + * @param {number} index + * @returns {object} + */ Q_INVOKABLE QObject* getSubConfig(int i) const { auto subs = getSubConfigs(); return ((i < 0 || i >= subs.size()) ? nullptr : subs[i]); } - // Describe the node graph data connections of the associated Job/Task - /**jsdoc - * @function Workload.isTask - * @returns {boolean} - */ - //Q_INVOKABLE virtual bool isTask() const { return false; } - - /**jsdoc - * @function Workload.getSubConfigs - * @returns {object[]} - */ - // Q_INVOKABLE virtual QObjectList getSubConfigs() const { return QObjectList(); } - - /**jsdoc - * @function Workload.getNumSubs - * @returns {number} - */ - // Q_INVOKABLE virtual int getNumSubs() const { return 0; } - - /**jsdoc - * @function Workload.getSubConfig - * @param {number} index - * @returns {object} - */ - //Q_INVOKABLE virtual QObject* getSubConfig(int i) const { return nullptr; } - void connectChildConfig(std::shared_ptr childConfig, const std::string& name); void transferChildrenConfigs(std::shared_ptr source); @@ -249,79 +248,6 @@ signals: using QConfigPointer = std::shared_ptr; - - -#ifdef SPECIALIZE_CONFIG -/**jsdoc - * @namespace Workload - * - * @hifi-interface - * @hifi-client-entity - * @hifi-avatar - * - * @property {number} cpuRunTime - Read-only. - * @property {boolean} enabled - */ -class TaskConfig : public JobConfig { - Q_OBJECT - -public: - using Persistent = PersistentConfig; - - TaskConfig() = default; - TaskConfig(bool enabled) : JobConfig(enabled) {} - - /**jsdoc - * @function Workload.getConfig - * @param {string} name - * @returns {object} - */ - // Get a sub job config through task.getConfig(path) - // where path can be: - // - search for the first job named job_name traversing the the sub graph of task and jobs (from this task as root) - // - .[.] - // Allowing to first look for the parent_name job (from this task as root) and then search from there for the - // optional sub_parent_names and finally from there looking for the job_name (assuming every job in the path were found) - // - // getter for qml integration, prefer the templated getter - Q_INVOKABLE QObject* getConfig(const QString& name) { return getConfig(name.toStdString()); } - - // getter for cpp (strictly typed), prefer this getter - TaskConfig* getRootConfig(const std::string& jobPath, std::string& jobName) const; - JobConfig* getJobConfig(const std::string& jobPath) const; - - template typename T::Config* getConfig(std::string jobPath = "") const { - return dynamic_cast(getJobConfig(jobPath)); - } - - Q_INVOKABLE bool isTask() const override { return true; } - Q_INVOKABLE QObjectList getSubConfigs() const override { - auto list = findChildren(QRegExp(".*"), Qt::FindDirectChildrenOnly); - QObjectList returned; - for (int i = 0; i < list.size(); i++) { - returned.push_back(list[i]); - } - return returned; - } - Q_INVOKABLE int getNumSubs() const override { return getSubConfigs().size(); } - Q_INVOKABLE QObject* getSubConfig(int i) const override { - auto subs = getSubConfigs(); - return ((i < 0 || i >= subs.size()) ? nullptr : subs[i]); - } -}; - -class SwitchConfig : public JobConfig { - Q_OBJECT - Q_PROPERTY(int branch READ getBranch WRITE setBranch NOTIFY dirtyEnabled) - -public: - uint8_t getBranch() const { return _branch; } - void setBranch(uint8_t index); - -protected: - uint8_t _branch { 0 }; -}; -#endif } #endif // hifi_task_Config_h diff --git a/libraries/task/src/task/Task.h b/libraries/task/src/task/Task.h index 0871cb5982..4d346480b6 100644 --- a/libraries/task/src/task/Task.h +++ b/libraries/task/src/task/Task.h @@ -80,8 +80,7 @@ public: virtual QConfigPointer& getConfiguration() { return _config; } virtual void applyConfiguration() = 0; - void setCPURunTime(const std::chrono::nanoseconds& runtime) { - /*std::static_pointer_cast*/(_config)->setCPURunTime(runtime); } + void setCPURunTime(const std::chrono::nanoseconds& runtime) { (_config)->setCPURunTime(runtime); } QConfigPointer _config; protected: @@ -95,9 +94,6 @@ template void jobConfigure(T& data, const C& configuration) { template void jobConfigure(T&, const JobConfig&) { // nop, as the default JobConfig was used, so the data does not need a configure method } -/*template void jobConfigure(T&, const TaskConfig&) { - // nop, as the default TaskConfig was used, so the data does not need a configure method -}*/ template void jobRun(T& data, const JC& jobContext, const JobNoIO& input, JobNoIO& output) { data.run(jobContext); @@ -296,9 +292,6 @@ public: TimeProfiler probe("build::" + model->getName()); model->_data.build(*(model), model->_input, model->_output, std::forward(args)...); } - // Recreate the Config to use the templated type - // model->createConfiguration(); - // model->applyConfiguration(); return model; } @@ -439,9 +432,6 @@ public: TimeProfiler probe("build::" + model->getName()); model->_data.build(*(model), model->_input, model->_output, std::forward(args)...); } - // Recreate the Config to use the templated type - // model->createConfiguration(); - // model->applyConfiguration(); return model; } diff --git a/scripts/developer/utilities/lib/jet/qml/TaskList.qml b/scripts/developer/utilities/lib/jet/qml/TaskList.qml index 0cfd9c049a..e4b0267d3f 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskList.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskList.qml @@ -31,7 +31,7 @@ Rectangle { } Component.onCompleted: { - var message = "sam" + var message = "" var functor = Jet.job_print_functor(function (line) { message += line + "\n"; }, false, true); Jet.task_traverseTree(rootConfig, functor); textArea.append(message); From 859016bf37fadd49e94d5a10f46f6d15fc143f96 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Wed, 14 Aug 2019 10:28:42 -0700 Subject: [PATCH 10/12] Addressing review comments --- libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp | 3 --- libraries/render-utils/src/RenderForwardTask.cpp | 1 - libraries/render-utils/src/RenderForwardTask.h | 4 ++-- libraries/task/src/task/Config.h | 2 -- libraries/task/src/task/Task.h | 1 - scripts/developer/utilities/render/luci2.js | 4 ++-- 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp b/libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp index 1b21be2e73..227bad787b 100644 --- a/libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp +++ b/libraries/gpu-gl/src/gpu/gl41/GL41BackendShader.cpp @@ -56,9 +56,6 @@ void GL41Backend::postLinkProgram(ShaderObject& programObject, const Shader& pro continue; } const auto& targetBinding = expectedResourceBuffers.at(resourceBuffer.name); - if (resourceBuffer.name == std::string("polylineVerticesBuffer")) { - qDebug() << "Setting texture unit for " << resourceBuffer.name.c_str() << " to " << targetBinding; - } glProgramUniform1i(glprogram, resourceBuffer.binding, targetBinding); } } diff --git a/libraries/render-utils/src/RenderForwardTask.cpp b/libraries/render-utils/src/RenderForwardTask.cpp index 9b547b82bb..e34db755b7 100755 --- a/libraries/render-utils/src/RenderForwardTask.cpp +++ b/libraries/render-utils/src/RenderForwardTask.cpp @@ -52,7 +52,6 @@ void PreparePrimaryFramebufferMSAAConfig::setResolutionScale(float scale) { const float SCALE_RANGE_MIN = 0.1f; const float SCALE_RANGE_MAX = 2.0f; resolutionScale = std::max(SCALE_RANGE_MIN, std::min(SCALE_RANGE_MAX, scale)); - // emit dirty(); } void PreparePrimaryFramebufferMSAAConfig::setNumSamples(int num) { diff --git a/libraries/render-utils/src/RenderForwardTask.h b/libraries/render-utils/src/RenderForwardTask.h index 647994d3c0..6833e42449 100755 --- a/libraries/render-utils/src/RenderForwardTask.h +++ b/libraries/render-utils/src/RenderForwardTask.h @@ -42,8 +42,8 @@ public: class PreparePrimaryFramebufferMSAAConfig : public render::Job::Config { Q_OBJECT - Q_PROPERTY(float resolutionScale WRITE setResolutionScale READ getResolutionScale NOTIFY dirty()) - Q_PROPERTY(int numSamples WRITE setNumSamples READ getNumSamples NOTIFY dirty()) + Q_PROPERTY(float resolutionScale WRITE setResolutionScale READ getResolutionScale NOTIFY dirty) + Q_PROPERTY(int numSamples WRITE setNumSamples READ getNumSamples NOTIFY dirty) public: float getResolutionScale() const { return resolutionScale; } void setResolutionScale(float scale); diff --git a/libraries/task/src/task/Config.h b/libraries/task/src/task/Config.h index 193674d152..8accba9e1f 100644 --- a/libraries/task/src/task/Config.h +++ b/libraries/task/src/task/Config.h @@ -133,8 +133,6 @@ public: */ Q_INVOKABLE void load(const QVariantMap& map) { qObjectFromJsonValue(QJsonObject::fromVariantMap(map), *this); emit loaded(); } - //Q_INVOKABLE QObject* getConfig(const QString& name) { return nullptr; } - // Running Time measurement // The new stats signal is emitted once per run time of a job when stats (cpu runtime) are updated void setCPURunTime(const std::chrono::nanoseconds& runtime) { _msCPURunTime = std::chrono::duration(runtime).count(); emit newStats(); } diff --git a/libraries/task/src/task/Task.h b/libraries/task/src/task/Task.h index 4d346480b6..0ee458f3ea 100644 --- a/libraries/task/src/task/Task.h +++ b/libraries/task/src/task/Task.h @@ -261,7 +261,6 @@ public: _jobs.emplace_back((NT::JobModel::create(name, input, std::forward(args)...))); // Conect the child config to this task's config - // std::static_pointer_cast(Concept::getConfiguration())->connectChildConfig(_jobs.back().getConfiguration(), name); std::static_pointer_cast(Concept::getConfiguration())->connectChildConfig(_jobs.back().getConfiguration(), name); return _jobs.back().getOutput(); diff --git a/scripts/developer/utilities/render/luci2.js b/scripts/developer/utilities/render/luci2.js index ba0215569a..a34cf88415 100644 --- a/scripts/developer/utilities/render/luci2.js +++ b/scripts/developer/utilities/render/luci2.js @@ -69,8 +69,8 @@ function openView() { } pages.addPage('Luci', 'Luci', '../luci.qml', 300, 420, openLuciWindow, closeLuciWindow); - // pages.addPage('openEngineLODView', 'Render LOD', '../lod.qml', 300, 400); - // pages.addPage('openMaterialInspectorView', 'Material Inspector', '../materialInspector.qml', 300, 400, MaterialInspector.setWindow, MaterialInspector.setWindow); + 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'); From 5e57e53db2674e4a2287a45bf5ee017da846b61e Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Wed, 14 Aug 2019 11:15:52 -0700 Subject: [PATCH 11/12] Address errors sent from running the ENgine Inspector.js --- .../utilities/lib/jet/qml/TaskPropView.qml | 4 +- .../utilities/lib/prop/PropGroup.qml | 48 ++++++++++--------- .../utilities/lib/prop/style/Global.qml | 6 +-- scripts/developer/utilities/render/luci.qml | 10 ++++ scripts/developer/utilities/render/luci2.js | 1 + 5 files changed, 41 insertions(+), 28 deletions(-) diff --git a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml index 69902392a5..699390c8bf 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml @@ -29,7 +29,7 @@ Prop.PropGroup { property var showProps: true property var showSubs: true - property var jobEnabled: rootConfig.getConfig(jobPath).enabled + property bool jobEnabled: rootConfig.getConfig(jobPath).enabled property var jobCpuTime: pullCpuTime() function pullCpuTime() { @@ -72,7 +72,7 @@ Prop.PropGroup { anchors.right:parent.right anchors.verticalCenter: parent.verticalCenter filled: root.jobEnabled - fillColor: (root.jobEnabled ? root.global.colorGreenHighlight : global.colorOrangeAccent) + fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorOrangeAccent) icon: 5 MouseArea{ diff --git a/scripts/developer/utilities/lib/prop/PropGroup.qml b/scripts/developer/utilities/lib/prop/PropGroup.qml index bfae2798eb..a4133ab96c 100644 --- a/scripts/developer/utilities/lib/prop/PropGroup.qml +++ b/scripts/developer/utilities/lib/prop/PropGroup.qml @@ -136,30 +136,32 @@ PropFolderPanel { function populateFromObjectProps(object) { var propsModel = [] - var props = Object.keys(object); - for (var p in props) { - var o = {}; - o["object"] = object - o["property"] = props[p]; - // o["readOnly"] = true; - - var thePropThing = object[props[p]]; - if ((thePropThing !== undefined) && (thePropThing !== null)) { - var theType = typeof(thePropThing) - switch(theType) { - case 'object': { - o["type"] = "object"; - propsModel.push(o) - } break; - default: { - o["type"] = "string"; - propsModel.push(o) - } break; - } + if (object !== undefined) { + var props = Object.keys(object); + for (var p in props) { + var o = {}; + o["object"] = object + o["property"] = props[p]; + // o["readOnly"] = true; - } else { - o["type"] = "string"; - propsModel.push(o) + var thePropThing = object[props[p]]; + if ((thePropThing !== undefined) && (thePropThing !== null)) { + var theType = typeof(thePropThing) + switch(theType) { + case 'object': { + o["type"] = "object"; + propsModel.push(o) + } break; + default: { + o["type"] = "string"; + propsModel.push(o) + } break; + } + + } else { + o["type"] = "string"; + propsModel.push(o) + } } } diff --git a/scripts/developer/utilities/lib/prop/style/Global.qml b/scripts/developer/utilities/lib/prop/style/Global.qml index b8ea41371e..cec56e6126 100644 --- a/scripts/developer/utilities/lib/prop/style/Global.qml +++ b/scripts/developer/utilities/lib/prop/style/Global.qml @@ -31,9 +31,9 @@ Item { readonly property color colorBorderHighight: hifi.colors.blueHighlight readonly property color colorBorderLighter: hifi.colors.faintGray - readonly property color colorOrangeAccent: "#FF6309" - readonly property color colorRedAccent: "#C62147" - readonly property color colorGreenHighlight: "#1ac567" + readonly property color colorOrangeAccent: hifi.colors.orangeAccent + readonly property color colorRedAccent: hifi.colors.redAccent + readonly property color colorGreenHighlight: hifi.colors.greenHighlight readonly property real fontSize: 12 readonly property var fontFamily: "Raleway" diff --git a/scripts/developer/utilities/render/luci.qml b/scripts/developer/utilities/render/luci.qml index 3a61a0394d..d768acb160 100644 --- a/scripts/developer/utilities/render/luci.qml +++ b/scripts/developer/utilities/render/luci.qml @@ -32,6 +32,7 @@ Rectangle { clip: true Column { + id: column width: parent.width Prop.PropFolderPanel { label: "Render Settings" @@ -81,17 +82,26 @@ Rectangle { label: "Tools" panelFrameData: Component { Row { + HifiControls.Button { + text: "Engine" + onClicked: { + sendToScript({method: "openEngineInspectorView"}); + } + width:column.width / 3 + } HifiControls.Button { text: "LOD" onClicked: { sendToScript({method: "openEngineLODView"}); } + width:column.width / 3 } HifiControls.Button { text: "Material" onClicked: { sendToScript({method: "openMaterialInspectorView"}); } + width:column.width / 3 } } } diff --git a/scripts/developer/utilities/render/luci2.js b/scripts/developer/utilities/render/luci2.js index a34cf88415..e2e5523ccd 100644 --- a/scripts/developer/utilities/render/luci2.js +++ b/scripts/developer/utilities/render/luci2.js @@ -69,6 +69,7 @@ function openView() { } 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); From f4c33d8392f2a1a56b6294b3808266a429aaf052 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Wed, 14 Aug 2019 11:33:30 -0700 Subject: [PATCH 12/12] Refining the look of the enable button of the TaskPropView --- scripts/developer/utilities/lib/jet/qml/TaskPropView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml index 699390c8bf..6a658a33e3 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml @@ -71,8 +71,8 @@ Prop.PropGroup { id: enabledIcon anchors.right:parent.right anchors.verticalCenter: parent.verticalCenter - filled: root.jobEnabled - fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorOrangeAccent) + filled: true + fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorRedAccent) icon: 5 MouseArea{