diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml index 812971dc3a..778c626048 100644 --- a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml @@ -288,6 +288,7 @@ Rectangle { Item { id: outputDeviceButtonContainer + visible: false // An experiment. Will you notice? anchors.verticalCenter: parent.verticalCenter anchors.left: inputDeviceButton.right anchors.leftMargin: 7 @@ -343,6 +344,7 @@ Rectangle { Item { id: statusButtonContainer + visible: false // An experiment. Will you notice? anchors.verticalCenter: parent.verticalCenter anchors.left: outputDeviceButtonContainer.right anchors.leftMargin: 8 diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 9700ff6336..508c44fbd1 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -471,9 +471,9 @@ Menu::Menu() { addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::ComputeBlendshapes, 0, true, DependencyManager::get().data(), SLOT(setComputeBlendshapes(bool))); - action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::MeshShaders, 0, false); + action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::MaterialProceduralShaders, 0, false); connect(action, &QAction::triggered, [action] { - MeshPartPayload::enableMeshShaders = action->isChecked(); + MeshPartPayload::enableMaterialProceduralShaders = action->isChecked(); }); { diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 4c6a6c48dc..ea118ec5dd 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -228,7 +228,7 @@ namespace MenuOption { const QString ForceCoarsePicking = "Force Coarse Picking"; const QString ComputeBlendshapes = "Compute Blendshapes"; const QString HighlightTransitions = "Highlight Transitions"; - const QString MeshShaders = "Enable Procedural Materials on Meshes"; + const QString MaterialProceduralShaders = "Enable Procedural Materials"; } #endif // hifi_Menu_h diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 4e4fd965a8..7e11406808 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -103,15 +103,15 @@ void setupPreferences() { preference->setItems(refreshRateProfiles); preferences->addPreference(preference); - auto getterMeshShaders = []() -> bool { + auto getterMaterialProceduralShaders = []() -> bool { auto menu = Menu::getInstance(); - return menu->isOptionChecked(MenuOption::MeshShaders); + return menu->isOptionChecked(MenuOption::MaterialProceduralShaders); }; - auto setterMeshShaders = [](bool value) { + auto setterMaterialProceduralShaders = [](bool value) { auto menu = Menu::getInstance(); - menu->setIsOptionChecked(MenuOption::MeshShaders, value); + menu->setIsOptionChecked(MenuOption::MaterialProceduralShaders, value); }; - preferences->addPreference(new CheckPreference(GRAPHICS_QUALITY, "Enable Procedural Materials on Meshes", getterMeshShaders, setterMeshShaders)); + preferences->addPreference(new CheckPreference(GRAPHICS_QUALITY, "Enable Procedural Materials", getterMaterialProceduralShaders, setterMaterialProceduralShaders)); } { // Expose the Viewport Resolution Scale diff --git a/launchers/qt/src/LauncherInstaller_windows.cpp b/launchers/qt/src/LauncherInstaller_windows.cpp index 78c7dadd2b..b5558f972c 100644 --- a/launchers/qt/src/LauncherInstaller_windows.cpp +++ b/launchers/qt/src/LauncherInstaller_windows.cpp @@ -14,7 +14,16 @@ #include #include #include +#include + +void timeDelay() { + static const int ONE_SECOND = 1; + QTime delayTime = QTime::currentTime().addSecs(ONE_SECOND); + while (QTime::currentTime() < delayTime) { + qDebug() << "Delaying time"; + } +} LauncherInstaller::LauncherInstaller() { _launcherInstallDir = PathUtils::getLauncherDirectory(); _launcherApplicationsDir = PathUtils::getApplicationsDirectory(); @@ -56,8 +65,8 @@ void LauncherInstaller::install() { } deleteShortcuts(); - createShortcuts(); deleteApplicationRegistryKeys(); + createShortcuts(); createApplicationRegistryKeys(); } else { qDebug() << "Failed to install HQ Launcher"; @@ -67,26 +76,26 @@ void LauncherInstaller::install() { void LauncherInstaller::createShortcuts() { QString launcherPath = PathUtils::getLauncherFilePath(); - QString uninstallLinkPath = _launcherInstallDir.absoluteFilePath("Uninstall HQ.lnk"); + QString uninstallLinkPath = _launcherInstallDir.absoluteFilePath("Uninstall HQ Launcher.lnk"); QDir desktopDir = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); QString appStartLinkPath = _launcherApplicationsDir.absoluteFilePath("HQ Launcher.lnk"); - QString uninstallAppStartLinkPath = _launcherApplicationsDir.absoluteFilePath("Uninstall HQ.lnk"); + QString uninstallAppStartLinkPath = _launcherApplicationsDir.absoluteFilePath("Uninstall HQ Launcher.lnk"); QString desktopAppLinkPath = desktopDir.absoluteFilePath("HQ Launcher.lnk"); createSymbolicLink((LPCSTR)launcherPath.toStdString().c_str(), (LPCSTR)uninstallLinkPath.toStdString().c_str(), - (LPCSTR)("Click to Uninstall HQ"), (LPCSTR)("--uninstall")); + (LPCSTR)("Click to Uninstall HQ Launcher"), (LPCSTR)("--uninstall")); createSymbolicLink((LPCSTR)launcherPath.toStdString().c_str(), (LPCSTR)uninstallAppStartLinkPath.toStdString().c_str(), - (LPCSTR)("Click to Uninstall HQ"), (LPCSTR)("--uninstall")); + (LPCSTR)("Click to Uninstall HQ Launcher"), (LPCSTR)("--uninstall")); createSymbolicLink((LPCSTR)launcherPath.toStdString().c_str(), (LPCSTR)desktopAppLinkPath.toStdString().c_str(), - (LPCSTR)("Click to Setup and Launch HQ")); + (LPCSTR)("Click to Setup and Launch HQ Launcher")); createSymbolicLink((LPCSTR)launcherPath.toStdString().c_str(), (LPCSTR)appStartLinkPath.toStdString().c_str(), - (LPCSTR)("Click to Setup and Launch HQ")); + (LPCSTR)("Click to Setup and Launch HQ Launcher")); } QString randomQtString() { @@ -141,20 +150,42 @@ void LauncherInstaller::uninstall() { qDebug() << "Failed to complete uninstall launcher"; } return; + } else { + + bool deletedHQLauncherExe = deleteHQLauncherExecutable(); + if (deletedHQLauncherExe) { + qDebug() << "Deleteing registry keys"; + deleteApplicationRegistryKeys(); + } } +} + +bool LauncherInstaller::deleteHQLauncherExecutable() { + static const int MAX_DELETE_ATTEMPTS = 3; + + int deleteAttempts = 0; + bool fileRemoved = false; QString launcherPath = _launcherInstallDir.absoluteFilePath("HQ Launcher.exe"); - if (QFile::exists(launcherPath)) { - bool removed = QFile::remove(launcherPath); - qDebug() << "Successfully removed " << launcherPath << ": " << removed; + while (deleteAttempts < MAX_DELETE_ATTEMPTS) { + fileRemoved = QFile::remove(launcherPath); + if (fileRemoved) { + break; + } + + timeDelay(); + deleteAttempts++; } - deleteApplicationRegistryKeys(); + + qDebug() << "Successfully removed " << launcherPath << ": " << fileRemoved; + + return fileRemoved; } void LauncherInstaller::deleteShortcuts() { QDir desktopDir = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); QString applicationPath = _launcherApplicationsDir.absolutePath(); - QString uninstallLinkPath = _launcherInstallDir.absoluteFilePath("Uninstall HQ.lnk"); + QString uninstallLinkPath = _launcherInstallDir.absoluteFilePath("Uninstall HQ Launcher.lnk"); if (QFile::exists(uninstallLinkPath)) { QFile::remove(uninstallLinkPath); } @@ -164,7 +195,7 @@ void LauncherInstaller::deleteShortcuts() { QFile::remove(appStartLinkPath); } - QString uninstallAppStartLinkPath = _launcherApplicationsDir.absoluteFilePath("Uninstall HQ.lnk"); + QString uninstallAppStartLinkPath = _launcherApplicationsDir.absoluteFilePath("Uninstall HQ Launcher.lnk"); if (QFile::exists(uninstallAppStartLinkPath)) { QFile::remove(uninstallAppStartLinkPath); } @@ -212,7 +243,7 @@ void LauncherInstaller::uninstallOldLauncher() { void LauncherInstaller::createApplicationRegistryKeys() { const std::string REGISTRY_PATH = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\HQ"; - bool success = insertRegistryKey(REGISTRY_PATH, "DisplayName", "HQ"); + bool success = insertRegistryKey(REGISTRY_PATH, "DisplayName", "HQ Launcher"); std::string installPath = _launcherInstallDir.absolutePath().replace("/", "\\").toStdString(); success = insertRegistryKey(REGISTRY_PATH, "InstallLocation", installPath); std::string applicationExe = installPath + "\\HQ Launcher.exe"; diff --git a/launchers/qt/src/LauncherInstaller_windows.h b/launchers/qt/src/LauncherInstaller_windows.h index ffb402cce5..e06cbc4b40 100644 --- a/launchers/qt/src/LauncherInstaller_windows.h +++ b/launchers/qt/src/LauncherInstaller_windows.h @@ -15,6 +15,7 @@ private: void createApplicationRegistryKeys(); void deleteShortcuts(); void deleteApplicationRegistryKeys(); + bool deleteHQLauncherExecutable(); QDir _launcherInstallDir; QDir _launcherApplicationsDir; diff --git a/launchers/qt/src/PathUtils.cpp b/launchers/qt/src/PathUtils.cpp index 538303b564..d7e7b0af8b 100644 --- a/launchers/qt/src/PathUtils.cpp +++ b/launchers/qt/src/PathUtils.cpp @@ -28,7 +28,7 @@ QDir PathUtils::getLauncherDirectory() { } QDir PathUtils::getApplicationsDirectory() { - return QDir(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).absoluteFilePath("Launcher"); + return QDir(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).absoluteFilePath("HQ"); } // The client directory is where interface is installed to. diff --git a/launchers/qt/src/main.cpp b/launchers/qt/src/main.cpp index 9aef6990fa..75c35cd708 100644 --- a/launchers/qt/src/main.cpp +++ b/launchers/qt/src/main.cpp @@ -32,7 +32,7 @@ bool hasSuffix(const std::string& path, const std::string& suffix) { int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setOrganizationName("High Fidelity"); - QCoreApplication::setApplicationName("Launcher"); + QCoreApplication::setApplicationName("HQ Launcher"); Q_INIT_RESOURCE(resources); cleanLogFile(); diff --git a/libraries/material-networking/src/material-networking/MaterialCacheScriptingInterface.cpp b/libraries/procedural/src/procedural/MaterialCacheScriptingInterface.cpp similarity index 90% rename from libraries/material-networking/src/material-networking/MaterialCacheScriptingInterface.cpp rename to libraries/procedural/src/procedural/MaterialCacheScriptingInterface.cpp index 193d9b96ee..77eceaa10b 100644 --- a/libraries/material-networking/src/material-networking/MaterialCacheScriptingInterface.cpp +++ b/libraries/procedural/src/procedural/MaterialCacheScriptingInterface.cpp @@ -1,6 +1,5 @@ // // MaterialCacheScriptingInterface.cpp -// libraries/mmodel-networking/src/model-networking // // Created by Sam Gateau on 17 September 2019. // Copyright 2019 High Fidelity, Inc. diff --git a/libraries/material-networking/src/material-networking/MaterialCacheScriptingInterface.h b/libraries/procedural/src/procedural/MaterialCacheScriptingInterface.h similarity index 81% rename from libraries/material-networking/src/material-networking/MaterialCacheScriptingInterface.h rename to libraries/procedural/src/procedural/MaterialCacheScriptingInterface.h index c619966a2a..3a13652aec 100644 --- a/libraries/material-networking/src/material-networking/MaterialCacheScriptingInterface.h +++ b/libraries/procedural/src/procedural/MaterialCacheScriptingInterface.h @@ -1,6 +1,5 @@ // -// MaterialCacheScriptingInterface.h -// libraries/material-networking/src/material-networking +// ProceduralMaterialCacheScriptingInterface.h // // Created by Sam Gateau on 17 September 2019. // Copyright 2019 High Fidelity, Inc. @@ -10,14 +9,14 @@ // #pragma once -#ifndef hifi_MaterialCacheScriptingInterface_h -#define hifi_MaterialCacheScriptingInterface_h +#ifndef hifi_ProceduralMaterialCacheScriptingInterface_h +#define hifi_ProceduralMaterialCacheScriptingInterface_h #include #include -#include "MaterialCache.h" +#include "ProceduralMaterialCache.h" class MaterialCacheScriptingInterface : public ScriptableResourceCache, public Dependency { Q_OBJECT @@ -27,7 +26,7 @@ class MaterialCacheScriptingInterface : public ScriptableResourceCache, public D /**jsdoc * The TextureCache API manages texture cache resources. * - * @namespace TextureCache + * @namespace MaterialCache * * @hifi-interface * @hifi-client-entity @@ -48,4 +47,4 @@ public: MaterialCacheScriptingInterface(); }; -#endif // hifi_MaterialCacheScriptingInterface_h +#endif // hifi_ProceduralMaterialCacheScriptingInterface_h diff --git a/libraries/material-networking/src/material-networking/MaterialCache.cpp b/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp similarity index 90% rename from libraries/material-networking/src/material-networking/MaterialCache.cpp rename to libraries/procedural/src/procedural/ProceduralMaterialCache.cpp index db4783d249..b9611358e7 100644 --- a/libraries/material-networking/src/material-networking/MaterialCache.cpp +++ b/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp @@ -5,7 +5,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include "MaterialCache.h" +#include "ProceduralMaterialCache.h" #include "QJsonObject" #include "QJsonDocument" @@ -13,6 +13,8 @@ #include "RegisteredMetaTypes.h" +#include "Procedural.h" + NetworkMaterialResource::NetworkMaterialResource(const QUrl& url) : Resource(url) {} @@ -112,20 +114,22 @@ NetworkMaterialResource::ParsedMaterials NetworkMaterialResource::parseJSONMater * A material used in a {@link Entities.MaterialResource|MaterialResource}. * @typedef {object} Entities.Material * @property {string} model="hifi_pbr" - Different material models support different properties and rendering modes. - * Supported models are: "hifi_pbr". + * Supported models are: "hifi_pbr", "hifi_shader_simple". * @property {string} name="" - A name for the material. Supported by all material models. * @property {ColorFloat|RGBS|string} emissive - The emissive color, i.e., the color that the material emits. A * {@link ColorFloat} value is treated as sRGB and must have component values in the range 0.0 – * 1.0. A {@link RGBS} value can be either RGB or sRGB. * Set to "fallthrough" to fall through to the material below. "hifi_pbr" model only. - * @property {number|string} opacity=1.0 - The opacity, range 0.01.0. - * Set to "fallthrough" to fall through to the material below. "hifi_pbr" model only. + * @property {number|string} opacity=1.0 - The opacity, range 0.01.0. + * Set to "fallthrough" to fall through to the material below. "hifi_pbr" and + * "hifi_shader_simple" models only. * @property {boolean|string} unlit=false - true if the material is unaffected by lighting, false if * it is lit by the key light and local lights. * Set to "fallthrough" to fall through to the material below. "hifi_pbr" model only. - * @property {ColorFloat|RGBS|string} albedo - The albedo color. A {@link ColorFloat} value is treated as sRGB and must have - * component values in the range 0.01.0. A {@link RGBS} value can be either RGB or sRGB. - * Set to "fallthrough" to fall through to the material below. "hifi_pbr" model only. + * @property {ColorFloat|RGBS|string} albedo - The albedo color. A {@link ColorFloat} value is treated as sRGB and must have + * component values in the range 0.01.0. A {@link RGBS} value can be either RGB or sRGB. + * Set to "fallthrough" to fall through to the material below. "hifi_pbr" and + * "hifi_shader_simple" models only. * @property {number|string} roughness - The roughness, range 0.01.0. * Set to "fallthrough" to fall through to the material below. "hifi_pbr" model only. * @property {number|string} metallic - The metallicness, range 0.01.0. @@ -183,25 +187,25 @@ NetworkMaterialResource::ParsedMaterials NetworkMaterialResource::parseJSONMater *

Currently not used.

* @property {boolean} defaultFallthrough=false - true if all properties fall through to the material below * unless they are set, false if properties respect their individual fall-through settings. - * "hifi_pbr" model only. + * "hifi_pbr" and "hifi_shader_simple" models only. + * @property {ProceduralData} procedural - The definition of a procedural shader material. "hifi_shader_simple" model only. */ // Note: See MaterialEntityItem.h for default values used in practice. std::pair> NetworkMaterialResource::parseJSONMaterial(const QJsonObject& materialJSON, const QUrl& baseUrl) { std::string name = ""; - std::shared_ptr material = std::make_shared(); + std::shared_ptr networkMaterial; - const std::string HIFI_PBR = "hifi_pbr"; - std::string modelString = HIFI_PBR; + std::string modelString = graphics::Material::HIFI_PBR; auto modelJSONIter = materialJSON.find("model"); if (modelJSONIter != materialJSON.end() && modelJSONIter.value().isString()) { modelString = modelJSONIter.value().toString().toStdString(); - material->setModel(modelString); } std::array texcoordTransforms; - if (modelString == HIFI_PBR) { - const QString FALLTHROUGH("fallthrough"); + const QString FALLTHROUGH("fallthrough"); + if (modelString == graphics::Material::HIFI_PBR) { + auto material = std::make_shared(); for (auto& key : materialJSON.keys()) { if (key == "name") { auto nameJSON = materialJSON.value(key); @@ -209,11 +213,6 @@ std::pair> NetworkMaterialResource name = nameJSON.toString().toStdString(); material->setName(name); } - } else if (key == "model") { - auto modelJSON = materialJSON.value(key); - if (modelJSON.isString()) { - material->setModel(modelJSON.toString().toStdString()); - } } else if (key == "emissive") { auto value = materialJSON.value(key); if (value.isString() && value.toString() == FALLTHROUGH) { @@ -268,13 +267,15 @@ std::pair> NetworkMaterialResource } } else if (key == "opacityMapMode") { auto value = materialJSON.value(key); - auto valueString = (value.isString() ? value.toString() : ""); - if (valueString == FALLTHROUGH) { - material->setPropertyDoesFallthrough(graphics::MaterialKey::FlagBit::OPACITY_MAP_MODE_BIT); - } else { - graphics::MaterialKey::OpacityMapMode mode; - if (graphics::MaterialKey::getOpacityMapModeFromName(valueString.toStdString(), mode)) { - material->setOpacityMapMode(mode); + if (value.isString()) { + auto valueString = value.toString(); + if (valueString == FALLTHROUGH) { + material->setPropertyDoesFallthrough(graphics::MaterialKey::FlagBit::OPACITY_MAP_MODE_BIT); + } else { + graphics::MaterialKey::OpacityMapMode mode; + if (graphics::MaterialKey::getOpacityMapModeFromName(valueString.toStdString(), mode)) { + material->setOpacityMapMode(mode); + } } } } else if (key == "opacityCutoff") { @@ -455,17 +456,61 @@ std::pair> NetworkMaterialResource } } } - } - // Do this after the texture maps are defined, so it overrides the default transforms - for (int i = 0; i < graphics::Material::NUM_TEXCOORD_TRANSFORMS; i++) { - mat4 newTransform = texcoordTransforms[i]; - if (newTransform != mat4() || newTransform != material->getTexCoordTransform(i)) { - material->setTexCoordTransform(i, newTransform); + // Do this after the texture maps are defined, so it overrides the default transforms + for (int i = 0; i < graphics::Material::NUM_TEXCOORD_TRANSFORMS; i++) { + mat4 newTransform = texcoordTransforms[i]; + if (newTransform != mat4() || newTransform != material->getTexCoordTransform(i)) { + material->setTexCoordTransform(i, newTransform); + } } + networkMaterial = material; + } else if (modelString == graphics::Material::HIFI_SHADER_SIMPLE) { + auto material = std::make_shared(); + for (auto& key : materialJSON.keys()) { + if (key == "name") { + auto nameJSON = materialJSON.value(key); + if (nameJSON.isString()) { + name = nameJSON.toString().toStdString(); + material->setName(name); + } + } else if (key == "opacity") { + auto value = materialJSON.value(key); + if (value.isString() && value.toString() == FALLTHROUGH) { + material->setPropertyDoesFallthrough(graphics::MaterialKey::FlagBit::OPACITY_VAL_BIT); + } else if (value.isDouble()) { + material->setOpacity(value.toDouble()); + } + } else if (key == "albedo") { + auto value = materialJSON.value(key); + if (value.isString() && value.toString() == FALLTHROUGH) { + material->setPropertyDoesFallthrough(graphics::MaterialKey::FlagBit::ALBEDO_VAL_BIT); + } else { + glm::vec3 color; + bool isSRGB; + bool valid = parseJSONColor(value, color, isSRGB); + if (valid) { + material->setAlbedo(color, isSRGB); + } + } + } else if (key == "defaultFallthrough") { + auto value = materialJSON.value(key); + if (value.isBool()) { + material->setDefaultFallthrough(value.toBool()); + } + } else if (key == "procedural") { + auto value = materialJSON.value(key); + material->setProceduralData(QJsonDocument::fromVariant(value.toVariant()).toJson()); + } + } + networkMaterial = material; } - return std::pair>(name, material); + if (networkMaterial) { + networkMaterial->setModel(modelString); + } + + return std::pair>(name, networkMaterial); } NetworkMaterialResourcePointer MaterialCache::getMaterial(const QUrl& url) { diff --git a/libraries/material-networking/src/material-networking/MaterialCache.h b/libraries/procedural/src/procedural/ProceduralMaterialCache.h similarity index 98% rename from libraries/material-networking/src/material-networking/MaterialCache.h rename to libraries/procedural/src/procedural/ProceduralMaterialCache.h index aa103adb1e..0a44ccf0ef 100644 --- a/libraries/material-networking/src/material-networking/MaterialCache.h +++ b/libraries/procedural/src/procedural/ProceduralMaterialCache.h @@ -14,7 +14,7 @@ #include #include -#include "TextureCache.h" +#include class NetworkMaterial : public graphics::Material { public: diff --git a/libraries/render-utils/src/MeshPartPayload.cpp b/libraries/render-utils/src/MeshPartPayload.cpp index 9525d9c105..9b42139892 100644 --- a/libraries/render-utils/src/MeshPartPayload.cpp +++ b/libraries/render-utils/src/MeshPartPayload.cpp @@ -23,10 +23,10 @@ #include "RenderPipelines.h" -static const QString ENABLE_MESH_SHADERS_STRING { "HIFI_ENABLE_MESH_SHADERS" }; -static bool ENABLE_MESH_SHADERS = QProcessEnvironment::systemEnvironment().contains(ENABLE_MESH_SHADERS_STRING); +static const QString ENABLE_MATERIAL_PROCEDURAL_SHADERS_STRING { "HIFI_ENABLE_MATERIAL_PROCEDURAL_SHADERS" }; +static bool ENABLE_MATERIAL_PROCEDURAL_SHADERS = QProcessEnvironment::systemEnvironment().contains(ENABLE_MATERIAL_PROCEDURAL_SHADERS_STRING); -bool MeshPartPayload::enableMeshShaders = false; +bool MeshPartPayload::enableMaterialProceduralShaders = false; using namespace render; @@ -471,7 +471,7 @@ void ModelMeshPartPayload::render(RenderArgs* args) { if (!_drawMaterials.empty() && _drawMaterials.top().material && _drawMaterials.top().material->isProcedural() && _drawMaterials.top().material->isReady()) { - if (!(enableMeshShaders && ENABLE_MESH_SHADERS)) { + if (!(enableMaterialProceduralShaders && ENABLE_MATERIAL_PROCEDURAL_SHADERS)) { return; } auto procedural = std::static_pointer_cast(_drawMaterials.top().material); diff --git a/libraries/render-utils/src/MeshPartPayload.h b/libraries/render-utils/src/MeshPartPayload.h index 18ef513a87..4d9510e4a2 100644 --- a/libraries/render-utils/src/MeshPartPayload.h +++ b/libraries/render-utils/src/MeshPartPayload.h @@ -73,7 +73,7 @@ public: void addMaterial(graphics::MaterialLayer material); void removeMaterial(graphics::MaterialPointer material); - static bool enableMeshShaders; + static bool enableMaterialProceduralShaders; protected: render::ItemKey _itemKey{ render::ItemKey::Builder::opaqueShape().build() };