From 00baaffb97ebd66fb5179cca8da8c8a7d50c7a09 Mon Sep 17 00:00:00 2001 From: dante ruiz Date: Fri, 7 Jun 2019 10:56:44 -0700 Subject: [PATCH 1/9] allow launcher to work from mounted dmg --- launchers/darwin/src/DownloadInterface.m | 2 ++ launchers/darwin/src/Launcher.h | 1 + launchers/darwin/src/Launcher.m | 11 +++++++---- launchers/darwin/src/main.mm | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/launchers/darwin/src/DownloadInterface.m b/launchers/darwin/src/DownloadInterface.m index b957197567..ed7aaf51c4 100644 --- a/launchers/darwin/src/DownloadInterface.m +++ b/launchers/darwin/src/DownloadInterface.m @@ -46,6 +46,8 @@ NSString* downloadFileName = [sharedLauncher getDownloadFilename]; NSLog(@"extract interface zip"); + NSLog(@"%@", appPath); + NSLog(@"%@", [appPath stringByAppendingString:downloadFileName]); [sharedLauncher extractZipFileAtDestination:appPath :[appPath stringByAppendingString:downloadFileName]]; NSLog(@"finished extracting interface zip"); diff --git a/launchers/darwin/src/Launcher.h b/launchers/darwin/src/Launcher.h index 5838e25a82..69484a378d 100644 --- a/launchers/darwin/src/Launcher.h +++ b/launchers/darwin/src/Launcher.h @@ -57,6 +57,7 @@ typedef enum LoginErrorTypes - (BOOL) loginShouldSetErrorState; - (void) displayErrorPage; - (void) showLoginScreen; +- (NSString*) getLauncherPath; - (ProcessState) currentProccessState; - (void) setCurrentProcessState:(ProcessState) aProcessState; - (void) setLoginErrorState:(LoginError) aLoginError; diff --git a/launchers/darwin/src/Launcher.m b/launchers/darwin/src/Launcher.m index 07fc8878da..3ab4379e7a 100644 --- a/launchers/darwin/src/Launcher.m +++ b/launchers/darwin/src/Launcher.m @@ -73,6 +73,11 @@ static BOOL const DELETE_ZIP_FILES = TRUE; return filePath; } +- (NSString*) getLauncherPath +{ + return [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/Contents/MacOS/"]; +} + - (void) extractZipFileAtDestination:(NSString *)destination :(NSString*)file { NSTask* task = [[NSTask alloc] init]; @@ -174,7 +179,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; - (NSString*) getAppPath { - return [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/Contents/MacOS/"]; + return [self getDownloadPathForContentAndScripts]; } - (BOOL) loginShouldSetErrorState @@ -317,7 +322,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; - (void) launchInterface { - NSString* launcherPath = [[self getAppPath] stringByAppendingString:@"HQ Launcher"]; + NSString* launcherPath = [[self getLauncherPath] stringByAppendingString:@"HQ Launcher"]; [[Settings sharedSettings] setLauncherPath:launcherPath]; [[Settings sharedSettings] save]; @@ -351,8 +356,6 @@ static BOOL const DELETE_ZIP_FILES = TRUE; } [workspace launchApplicationAtURL:url options:NSWorkspaceLaunchNewInstance configuration:[NSDictionary dictionaryWithObject:arguments forKey:NSWorkspaceLaunchConfigurationArguments] error:&error]; - //NSLog(@"arguments %@", [NSDictionary dictionaryWithObject:arguments forKey:NSWorkspaceLaunchConfigurationArguments]); - [NSApp terminate:self]; } diff --git a/launchers/darwin/src/main.mm b/launchers/darwin/src/main.mm index cdcd66f963..41e2986af7 100644 --- a/launchers/darwin/src/main.mm +++ b/launchers/darwin/src/main.mm @@ -17,7 +17,7 @@ void redirectLogToDocuments() int main(int argc, const char* argv[]) { //NSApp.appearance = [NSAppearance appearanceNamed: NSAppearanceNameAqua]; - redirectLogToDocuments(); + //redirectLogToDocuments(); NSArray* apps = [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.highfidelity.launcher"]; if ([apps count] > 1) { NSLog(@"launcher is already running"); From 5499da0b7b5bad88b8075ef348916eb0d2d7d685 Mon Sep 17 00:00:00 2001 From: dante ruiz Date: Fri, 7 Jun 2019 10:59:17 -0700 Subject: [PATCH 2/9] removing debug statments --- launchers/darwin/src/DownloadInterface.m | 2 -- launchers/darwin/src/main.mm | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/launchers/darwin/src/DownloadInterface.m b/launchers/darwin/src/DownloadInterface.m index ed7aaf51c4..b957197567 100644 --- a/launchers/darwin/src/DownloadInterface.m +++ b/launchers/darwin/src/DownloadInterface.m @@ -46,8 +46,6 @@ NSString* downloadFileName = [sharedLauncher getDownloadFilename]; NSLog(@"extract interface zip"); - NSLog(@"%@", appPath); - NSLog(@"%@", [appPath stringByAppendingString:downloadFileName]); [sharedLauncher extractZipFileAtDestination:appPath :[appPath stringByAppendingString:downloadFileName]]; NSLog(@"finished extracting interface zip"); diff --git a/launchers/darwin/src/main.mm b/launchers/darwin/src/main.mm index 41e2986af7..cdcd66f963 100644 --- a/launchers/darwin/src/main.mm +++ b/launchers/darwin/src/main.mm @@ -17,7 +17,7 @@ void redirectLogToDocuments() int main(int argc, const char* argv[]) { //NSApp.appearance = [NSAppearance appearanceNamed: NSAppearanceNameAqua]; - //redirectLogToDocuments(); + redirectLogToDocuments(); NSArray* apps = [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.highfidelity.launcher"]; if ([apps count] > 1) { NSLog(@"launcher is already running"); From 129d96a997d0557e89de76c8aa0322e53382dede Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Fri, 7 Jun 2019 14:51:24 -0700 Subject: [PATCH 3/9] get rid of lightmapMap --- .../src/RenderableMaterialEntityItem.cpp | 4 +-- .../src/RenderableShapeEntityItem.cpp | 4 +-- libraries/entities/src/MaterialEntityItem.h | 2 +- .../src/graphics-scripting/Forward.h | 4 +-- .../GraphicsScriptingInterface.cpp | 8 ++--- .../graphics-scripting/ScriptableModel.cpp | 6 ++-- libraries/graphics/src/graphics/Material.cpp | 2 +- libraries/graphics/src/graphics/Material.h | 14 ++++---- .../src/graphics/MaterialTextures.slh | 4 +-- .../src/material-networking/MaterialCache.cpp | 20 +++++------ .../src/material-networking/MaterialCache.h | 2 +- .../render-utils/src/MeshPartPayload.cpp | 8 ++--- .../render-utils/src/RenderPipelines.cpp | 36 +++++++++---------- libraries/render/src/render/ShapePipeline.h | 10 +++--- 14 files changed, 62 insertions(+), 62 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableMaterialEntityItem.cpp b/libraries/entities-renderer/src/RenderableMaterialEntityItem.cpp index 9a634a85ad..01eac7b203 100644 --- a/libraries/entities-renderer/src/RenderableMaterialEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableMaterialEntityItem.cpp @@ -257,7 +257,7 @@ ShapeKey MaterialEntityRenderer::getShapeKey() { bool isTranslucent = drawMaterialKey.isTranslucent(); bool hasTangents = drawMaterialKey.isNormalMap(); - bool hasLightmap = drawMaterialKey.isLightmapMap(); + bool hasLightmap = drawMaterialKey.isLightMap(); bool isUnlit = drawMaterialKey.isUnlit(); ShapeKey::Builder builder; @@ -270,7 +270,7 @@ ShapeKey MaterialEntityRenderer::getShapeKey() { builder.withTangents(); } if (hasLightmap) { - builder.withLightmap(); + builder.withLightMap(); } if (isUnlit) { builder.withUnlit(); diff --git a/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp b/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp index fbc24cb4a5..7faebfdf56 100644 --- a/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp @@ -197,7 +197,7 @@ ShapeKey ShapeEntityRenderer::getShapeKey() { bool isTranslucent = drawMaterialKey.isTranslucent(); bool hasTangents = drawMaterialKey.isNormalMap(); - bool hasLightmap = drawMaterialKey.isLightmapMap(); + bool hasLightmap = drawMaterialKey.isLightMap(); bool isUnlit = drawMaterialKey.isUnlit(); ShapeKey::Builder builder; @@ -210,7 +210,7 @@ ShapeKey ShapeEntityRenderer::getShapeKey() { builder.withTangents(); } if (hasLightmap) { - builder.withLightmap(); + builder.withLightMap(); } if (isUnlit) { builder.withUnlit(); diff --git a/libraries/entities/src/MaterialEntityItem.h b/libraries/entities/src/MaterialEntityItem.h index b9e83a7fe5..717ceb4ee0 100644 --- a/libraries/entities/src/MaterialEntityItem.h +++ b/libraries/entities/src/MaterialEntityItem.h @@ -88,7 +88,7 @@ private: // emissive, albedo // urls to textures: // emissiveMap, albedoMap (set opacityMap = albedoMap for transparency), metallicMap or specularMap, roughnessMap or glossMap, - // normalMap or bumpMap, occlusionMap, lightmapMap (broken, FIXME), scatteringMap (only works if normal mapped) + // normalMap or bumpMap, occlusionMap, lightMap (broken, FIXME), scatteringMap (only works if normal mapped) QString _materialURL; // Type of material. "uv" or "projected". MaterialMappingMode _materialMappingMode { UV }; diff --git a/libraries/graphics-scripting/src/graphics-scripting/Forward.h b/libraries/graphics-scripting/src/graphics-scripting/Forward.h index 6d1b9d83d2..428c08e9f6 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/Forward.h +++ b/libraries/graphics-scripting/src/graphics-scripting/Forward.h @@ -57,7 +57,7 @@ namespace scriptable { * @property {string} normalMap * @property {string} bumpMap * @property {string} occlusionMap - * @property {string} lightmapMap + * @property {string} lightMap * @property {string} scatteringMap * @property {Mat4|string} texCoordTransform0 * @property {Mat4|string} texCoordTransform1 @@ -91,7 +91,7 @@ namespace scriptable { QString normalMap; QString bumpMap; QString occlusionMap; - QString lightmapMap; + QString lightMap; QString scatteringMap; std::array texCoordTransforms; diff --git a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp index eb4bfa197c..404e2d3ac6 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp +++ b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp @@ -430,10 +430,10 @@ namespace scriptable { obj.setProperty("occlusionMap", material.occlusionMap); } - if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::LIGHTMAP_MAP_BIT)) { - obj.setProperty("lightmapMap", FALLTHROUGH); - } else if (!material.lightmapMap.isEmpty()) { - obj.setProperty("lightmapMap", material.lightmapMap); + if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::LIGHT_MAP_BIT)) { + obj.setProperty("lightMap", FALLTHROUGH); + } else if (!material.lightMap.isEmpty()) { + obj.setProperty("lightMap", material.lightMap); } if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::SCATTERING_MAP_BIT)) { diff --git a/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.cpp b/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.cpp index 8825a26bfe..e9cc7930ae 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.cpp +++ b/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.cpp @@ -39,7 +39,7 @@ scriptable::ScriptableMaterial& scriptable::ScriptableMaterial::operator=(const normalMap = material.normalMap; bumpMap = material.bumpMap; occlusionMap = material.occlusionMap; - lightmapMap = material.lightmapMap; + lightMap = material.lightMap; scatteringMap = material.scatteringMap; defaultFallthrough = material.defaultFallthrough; @@ -110,9 +110,9 @@ scriptable::ScriptableMaterial::ScriptableMaterial(const graphics::MaterialPoint occlusionMap = map->getTextureSource()->getUrl().toString(); } - map = material->getTextureMap(graphics::Material::MapChannel::LIGHTMAP_MAP); + map = material->getTextureMap(graphics::Material::MapChannel::LIGHT_MAP); if (map && map->getTextureSource()) { - lightmapMap = map->getTextureSource()->getUrl().toString(); + lightMap = map->getTextureSource()->getUrl().toString(); } map = material->getTextureMap(graphics::Material::MapChannel::SCATTERING_MAP); diff --git a/libraries/graphics/src/graphics/Material.cpp b/libraries/graphics/src/graphics/Material.cpp index 3ef407b7d9..6be8ec5f68 100755 --- a/libraries/graphics/src/graphics/Material.cpp +++ b/libraries/graphics/src/graphics/Material.cpp @@ -129,7 +129,7 @@ void Material::setTextureMap(MapChannel channel, const TextureMapPointer& textur _texcoordTransforms[1] = (textureMap ? textureMap->getTextureTransform().getMatrix() : glm::mat4()); } - if (channel == MaterialKey::LIGHTMAP_MAP) { + if (channel == MaterialKey::LIGHT_MAP) { // update the texcoord1 with lightmap _texcoordTransforms[1] = (textureMap ? textureMap->getTextureTransform().getMatrix() : glm::mat4()); _lightmapParams = (textureMap ? glm::vec2(textureMap->getLightmapOffsetScale()) : glm::vec2(0.0, 1.0)); diff --git a/libraries/graphics/src/graphics/Material.h b/libraries/graphics/src/graphics/Material.h index 330feaa61c..25601c5743 100755 --- a/libraries/graphics/src/graphics/Material.h +++ b/libraries/graphics/src/graphics/Material.h @@ -53,7 +53,7 @@ public: ROUGHNESS_MAP_BIT, NORMAL_MAP_BIT, OCCLUSION_MAP_BIT, - LIGHTMAP_MAP_BIT, + LIGHT_MAP_BIT, SCATTERING_MAP_BIT, NUM_FLAGS, @@ -67,7 +67,7 @@ public: ROUGHNESS_MAP, NORMAL_MAP, OCCLUSION_MAP, - LIGHTMAP_MAP, + LIGHT_MAP, SCATTERING_MAP, NUM_MAP_CHANNELS, @@ -107,7 +107,7 @@ public: Builder& withNormalMap() { _flags.set(NORMAL_MAP_BIT); return (*this); } Builder& withOcclusionMap() { _flags.set(OCCLUSION_MAP_BIT); return (*this); } - Builder& withLightmapMap() { _flags.set(LIGHTMAP_MAP_BIT); return (*this); } + Builder& withLightMap() { _flags.set(LIGHT_MAP_BIT); return (*this); } Builder& withScatteringMap() { _flags.set(SCATTERING_MAP_BIT); return (*this); } // Convenient standard keys that we will keep on using all over the place @@ -157,8 +157,8 @@ public: void setOcclusionMap(bool value) { _flags.set(OCCLUSION_MAP_BIT, value); } bool isOcclusionMap() const { return _flags[OCCLUSION_MAP_BIT]; } - void setLightmapMap(bool value) { _flags.set(LIGHTMAP_MAP_BIT, value); } - bool isLightmapMap() const { return _flags[LIGHTMAP_MAP_BIT]; } + void setLightMap(bool value) { _flags.set(LIGHT_MAP_BIT, value); } + bool isLightMap() const { return _flags[LIGHT_MAP_BIT]; } void setScattering(bool value) { _flags.set(SCATTERING_VAL_BIT, value); } bool isScattering() const { return _flags[SCATTERING_VAL_BIT]; } @@ -235,8 +235,8 @@ public: Builder& withoutOcclusionMap() { _value.reset(MaterialKey::OCCLUSION_MAP_BIT); _mask.set(MaterialKey::OCCLUSION_MAP_BIT); return (*this); } Builder& withOcclusionMap() { _value.set(MaterialKey::OCCLUSION_MAP_BIT); _mask.set(MaterialKey::OCCLUSION_MAP_BIT); return (*this); } - Builder& withoutLightmapMap() { _value.reset(MaterialKey::LIGHTMAP_MAP_BIT); _mask.set(MaterialKey::LIGHTMAP_MAP_BIT); return (*this); } - Builder& withLightmapMap() { _value.set(MaterialKey::LIGHTMAP_MAP_BIT); _mask.set(MaterialKey::LIGHTMAP_MAP_BIT); return (*this); } + Builder& withoutLightMap() { _value.reset(MaterialKey::LIGHT_MAP_BIT); _mask.set(MaterialKey::LIGHT_MAP_BIT); return (*this); } + Builder& withLightMap() { _value.set(MaterialKey::LIGHT_MAP_BIT); _mask.set(MaterialKey::LIGHT_MAP_BIT); return (*this); } Builder& withoutScattering() { _value.reset(MaterialKey::SCATTERING_VAL_BIT); _mask.set(MaterialKey::SCATTERING_VAL_BIT); return (*this); } Builder& withScattering() { _value.set(MaterialKey::SCATTERING_VAL_BIT); _mask.set(MaterialKey::SCATTERING_VAL_BIT); return (*this); } diff --git a/libraries/graphics/src/graphics/MaterialTextures.slh b/libraries/graphics/src/graphics/MaterialTextures.slh index 92e76e5736..bf0416c7bf 100644 --- a/libraries/graphics/src/graphics/MaterialTextures.slh +++ b/libraries/graphics/src/graphics/MaterialTextures.slh @@ -178,7 +178,7 @@ float fetchScatteringMap(vec2 uv) { float <$occlusion$> = mix(1.0, fetchOcclusionMap(<$texcoord1$>), float((<$matKey$> & OCCLUSION_MAP_BIT) != 0)); <@endif@> <@if lightmap@> - vec3 <$lightmap$> = fetchLightmapMap(<$texcoord1$>); + vec3 <$lightmap$> = fetchLightMap(<$texcoord1$>); <@endif@> <@endfunc@> @@ -189,7 +189,7 @@ float fetchScatteringMap(vec2 uv) { <$declareMaterialTexMapArrayBuffer()$> LAYOUT(binding=GRAPHICS_TEXTURE_MATERIAL_EMISSIVE_LIGHTMAP) uniform sampler2D emissiveMap; -vec3 fetchLightmapMap(vec2 uv) { +vec3 fetchLightMap(vec2 uv) { vec2 lightmapParams = getTexMapArray()._lightmapParams; return (vec3(lightmapParams.x) + lightmapParams.y * texture(emissiveMap, uv).rgb); } diff --git a/libraries/material-networking/src/material-networking/MaterialCache.cpp b/libraries/material-networking/src/material-networking/MaterialCache.cpp index 745504fb3d..5e86ea506a 100644 --- a/libraries/material-networking/src/material-networking/MaterialCache.cpp +++ b/libraries/material-networking/src/material-networking/MaterialCache.cpp @@ -362,9 +362,9 @@ std::pair> NetworkMaterialResource if (value.isString()) { auto valueString = value.toString(); if (valueString == FALLTHROUGH) { - material->setPropertyDoesFallthrough(graphics::MaterialKey::FlagBit::LIGHTMAP_MAP_BIT); + material->setPropertyDoesFallthrough(graphics::MaterialKey::FlagBit::LIGHT_MAP_BIT); } else { - material->setLightmapMap(baseUrl.resolved(valueString)); + material->setLightMap(baseUrl.resolved(valueString)); } } } else if (key == "texCoordTransform0") { @@ -567,12 +567,12 @@ void NetworkMaterial::setScatteringMap(const QUrl& url) { } } -void NetworkMaterial::setLightmapMap(const QUrl& url) { - auto map = fetchTextureMap(url, image::TextureUsage::LIGHTMAP_TEXTURE, MapChannel::LIGHTMAP_MAP); +void NetworkMaterial::setLightMap(const QUrl& url) { + auto map = fetchTextureMap(url, image::TextureUsage::LIGHTMAP_TEXTURE, MapChannel::LIGHT_MAP); if (map) { //map->setTextureTransform(_lightmapTransform); //map->setLightmapOffsetScale(_lightmapParams.x, _lightmapParams.y); - setTextureMap(MapChannel::LIGHTMAP_MAP, map); + setTextureMap(MapChannel::LIGHT_MAP, map); } } @@ -640,14 +640,14 @@ NetworkMaterial::NetworkMaterial(const HFMMaterial& material, const QUrl& textur } if (!material.lightmapTexture.filename.isEmpty()) { - auto map = fetchTextureMap(textureBaseUrl, material.lightmapTexture, image::TextureUsage::LIGHTMAP_TEXTURE, MapChannel::LIGHTMAP_MAP); + auto map = fetchTextureMap(textureBaseUrl, material.lightmapTexture, image::TextureUsage::LIGHTMAP_TEXTURE, MapChannel::LIGHT_MAP); if (map) { _lightmapTransform = material.lightmapTexture.transform; _lightmapParams = material.lightmapParams; map->setTextureTransform(_lightmapTransform); map->setLightmapOffsetScale(_lightmapParams.x, _lightmapParams.y); } - setTextureMap(MapChannel::LIGHTMAP_MAP, map); + setTextureMap(MapChannel::LIGHT_MAP, map); } } @@ -660,7 +660,7 @@ void NetworkMaterial::setTextures(const QVariantMap& textureMap) { const auto& metallicName = getTextureName(MapChannel::METALLIC_MAP); const auto& occlusionName = getTextureName(MapChannel::OCCLUSION_MAP); const auto& emissiveName = getTextureName(MapChannel::EMISSIVE_MAP); - const auto& lightmapName = getTextureName(MapChannel::LIGHTMAP_MAP); + const auto& lightmapName = getTextureName(MapChannel::LIGHT_MAP); const auto& scatteringName = getTextureName(MapChannel::SCATTERING_MAP); if (!albedoName.isEmpty()) { @@ -715,12 +715,12 @@ void NetworkMaterial::setTextures(const QVariantMap& textureMap) { if (!lightmapName.isEmpty()) { auto url = textureMap.contains(lightmapName) ? textureMap[lightmapName].toUrl() : QUrl(); - auto map = fetchTextureMap(url, image::TextureUsage::LIGHTMAP_TEXTURE, MapChannel::LIGHTMAP_MAP); + auto map = fetchTextureMap(url, image::TextureUsage::LIGHTMAP_TEXTURE, MapChannel::LIGHT_MAP); if (map) { map->setTextureTransform(_lightmapTransform); map->setLightmapOffsetScale(_lightmapParams.x, _lightmapParams.y); } - setTextureMap(MapChannel::LIGHTMAP_MAP, map); + setTextureMap(MapChannel::LIGHT_MAP, map); } } diff --git a/libraries/material-networking/src/material-networking/MaterialCache.h b/libraries/material-networking/src/material-networking/MaterialCache.h index 7ed0453187..66e6b8250b 100644 --- a/libraries/material-networking/src/material-networking/MaterialCache.h +++ b/libraries/material-networking/src/material-networking/MaterialCache.h @@ -31,7 +31,7 @@ public: void setOcclusionMap(const QUrl& url); void setEmissiveMap(const QUrl& url); void setScatteringMap(const QUrl& url); - void setLightmapMap(const QUrl& url); + void setLightMap(const QUrl& url); bool isMissingTexture(); void checkResetOpacityMap(); diff --git a/libraries/render-utils/src/MeshPartPayload.cpp b/libraries/render-utils/src/MeshPartPayload.cpp index cb3aa76468..1a6e5dbadc 100644 --- a/libraries/render-utils/src/MeshPartPayload.cpp +++ b/libraries/render-utils/src/MeshPartPayload.cpp @@ -115,8 +115,8 @@ ShapeKey MeshPartPayload::getShapeKey() const { if (drawMaterialKey.isNormalMap()) { builder.withTangents(); } - if (drawMaterialKey.isLightmapMap()) { - builder.withLightmap(); + if (drawMaterialKey.isLightMap()) { + builder.withLightMap(); } return builder.build(); } @@ -354,7 +354,7 @@ void ModelMeshPartPayload::setShapeKey(bool invalidateShapeKey, PrimitiveMode pr bool isTranslucent = drawMaterialKey.isTranslucent(); bool hasTangents = drawMaterialKey.isNormalMap() && _hasTangents; - bool hasLightmap = drawMaterialKey.isLightmapMap(); + bool hasLightmap = drawMaterialKey.isLightMap(); bool isUnlit = drawMaterialKey.isUnlit(); bool isDeformed = _isBlendShaped || _isSkinned; @@ -374,7 +374,7 @@ void ModelMeshPartPayload::setShapeKey(bool invalidateShapeKey, PrimitiveMode pr builder.withTangents(); } if (hasLightmap) { - builder.withLightmap(); + builder.withLightMap(); } if (isUnlit) { builder.withUnlit(); diff --git a/libraries/render-utils/src/RenderPipelines.cpp b/libraries/render-utils/src/RenderPipelines.cpp index 2817abb4a1..69a76cce00 100644 --- a/libraries/render-utils/src/RenderPipelines.cpp +++ b/libraries/render-utils/src/RenderPipelines.cpp @@ -107,7 +107,7 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip model_translucent_normal_map, nullptr, nullptr); addPipeline( // FIXME: Ignore lightmap for translucents meshpart - Key::Builder().withMaterial().withTranslucent().withLightmap(), + Key::Builder().withMaterial().withTranslucent().withLightMap(), model_translucent, nullptr, nullptr); // Same thing but with Fade on addPipeline( @@ -127,21 +127,21 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip model_translucent_normal_map_fade, batchSetter, itemSetter); addPipeline( // FIXME: Ignore lightmap for translucents meshpart - Key::Builder().withMaterial().withTranslucent().withLightmap().withFade(), + Key::Builder().withMaterial().withTranslucent().withLightMap().withFade(), model_translucent_fade, batchSetter, itemSetter); // Lightmapped addPipeline( - Key::Builder().withMaterial().withLightmap(), + Key::Builder().withMaterial().withLightMap(), model_lightmap, nullptr, nullptr); addPipeline( - Key::Builder().withMaterial().withLightmap().withTangents(), + Key::Builder().withMaterial().withLightMap().withTangents(), model_lightmap_normal_map, nullptr, nullptr); // Same thing but with Fade on addPipeline( - Key::Builder().withMaterial().withLightmap().withFade(), + Key::Builder().withMaterial().withLightMap().withFade(), model_lightmap_fade, batchSetter, itemSetter); addPipeline( - Key::Builder().withMaterial().withLightmap().withTangents().withFade(), + Key::Builder().withMaterial().withLightMap().withTangents().withFade(), model_lightmap_normal_map_fade, batchSetter, itemSetter); // matrix palette skinned @@ -228,10 +228,10 @@ void initForwardPipelines(ShapePlumber& plumber) { // Opaques addPipeline(Key::Builder().withMaterial(), program::forward_model); - addPipeline(Key::Builder().withMaterial().withLightmap(), program::forward_model_lightmap); + addPipeline(Key::Builder().withMaterial().withLightMap(), program::forward_model_lightmap); addPipeline(Key::Builder().withMaterial().withUnlit(), program::forward_model_unlit); addPipeline(Key::Builder().withMaterial().withTangents(), program::forward_model_normal_map); - addPipeline(Key::Builder().withMaterial().withTangents().withLightmap(), program::forward_model_normal_map_lightmap); + addPipeline(Key::Builder().withMaterial().withTangents().withLightMap(), program::forward_model_normal_map_lightmap); // Deformed Opaques addPipeline(Key::Builder().withMaterial().withDeformed(), program::forward_deformed_model); @@ -581,7 +581,7 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial break; case graphics::MaterialKey::EMISSIVE_MAP_BIT: // Lightmap takes precendence over emissive map for legacy reasons - if (materialKey.isEmissiveMap() && !materialKey.isLightmapMap()) { + if (materialKey.isEmissiveMap() && !materialKey.isLightMap()) { auto itr = textureMaps.find(graphics::MaterialKey::EMISSIVE_MAP); if (itr != textureMaps.end()) { if (itr->second->isDefined()) { @@ -595,14 +595,14 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial forceDefault = true; } schemaKey.setEmissiveMap(true); - } else if (materialKey.isLightmapMap()) { + } else if (materialKey.isLightMap()) { // We'll set this later when we check the lightmap wasSet = true; } break; - case graphics::MaterialKey::LIGHTMAP_MAP_BIT: - if (materialKey.isLightmapMap()) { - auto itr = textureMaps.find(graphics::MaterialKey::LIGHTMAP_MAP); + case graphics::MaterialKey::LIGHT_MAP_BIT: + if (materialKey.isLightMap()) { + auto itr = textureMaps.find(graphics::MaterialKey::LIGHT_MAP); if (itr != textureMaps.end()) { if (itr->second->isDefined()) { drawMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, itr->second->getTextureView()); @@ -614,7 +614,7 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial } else { forceDefault = true; } - schemaKey.setLightmapMap(true); + schemaKey.setLightMap(true); } break; case graphics::Material::TEXCOORDTRANSFORM0: @@ -712,12 +712,12 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial } break; case graphics::MaterialKey::EMISSIVE_MAP_BIT: - if (schemaKey.isEmissiveMap() && !schemaKey.isLightmapMap()) { + if (schemaKey.isEmissiveMap() && !schemaKey.isLightMap()) { drawMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getGrayTexture()); } break; - case graphics::MaterialKey::LIGHTMAP_MAP_BIT: - if (schemaKey.isLightmapMap()) { + case graphics::MaterialKey::LIGHT_MAP_BIT: + if (schemaKey.isLightMap()) { drawMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getBlackTexture()); } break; @@ -765,7 +765,7 @@ bool RenderPipelines::bindMaterials(graphics::MultiMaterial& multiMaterial, gpu: batch.setResourceTextureTable(multiMaterial.getTextureTable()); } else { if (renderMode != render::Args::RenderMode::SHADOW_RENDER_MODE) { - if (key.isLightmapMap()) { + if (key.isLightMap()) { defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getBlackTexture()); } else if (key.isEmissiveMap()) { defaultMaterialTextures->setTexture(gr::Texture::MaterialEmissiveLightmap, textureCache->getGrayTexture()); diff --git a/libraries/render/src/render/ShapePipeline.h b/libraries/render/src/render/ShapePipeline.h index 159d2ba6f3..ad91ea61ef 100644 --- a/libraries/render/src/render/ShapePipeline.h +++ b/libraries/render/src/render/ShapePipeline.h @@ -74,7 +74,7 @@ public: Builder& withMaterial() { _flags.set(MATERIAL); return (*this); } Builder& withTranslucent() { _flags.set(TRANSLUCENT); return (*this); } - Builder& withLightmap() { _flags.set(LIGHTMAP); return (*this); } + Builder& withLightMap() { _flags.set(LIGHTMAP); return (*this); } Builder& withTangents() { _flags.set(TANGENTS); return (*this); } Builder& withUnlit() { _flags.set(UNLIT); return (*this); } Builder& withDeformed() { _flags.set(DEFORMED); return (*this); } @@ -116,8 +116,8 @@ public: Builder& withTranslucent() { _flags.set(TRANSLUCENT); _mask.set(TRANSLUCENT); return (*this); } Builder& withOpaque() { _flags.reset(TRANSLUCENT); _mask.set(TRANSLUCENT); return (*this); } - Builder& withLightmap() { _flags.set(LIGHTMAP); _mask.set(LIGHTMAP); return (*this); } - Builder& withoutLightmap() { _flags.reset(LIGHTMAP); _mask.set(LIGHTMAP); return (*this); } + Builder& withLightMap() { _flags.set(LIGHTMAP); _mask.set(LIGHTMAP); return (*this); } + Builder& withoutLightMap() { _flags.reset(LIGHTMAP); _mask.set(LIGHTMAP); return (*this); } Builder& withTangents() { _flags.set(TANGENTS); _mask.set(TANGENTS); return (*this); } Builder& withoutTangents() { _flags.reset(TANGENTS); _mask.set(TANGENTS); return (*this); } @@ -160,7 +160,7 @@ public: }; bool useMaterial() const { return _flags[MATERIAL]; } - bool hasLightmap() const { return _flags[LIGHTMAP]; } + bool hasLightMap() const { return _flags[LIGHTMAP]; } bool hasTangents() const { return _flags[TANGENTS]; } bool isUnlit() const { return _flags[UNLIT]; } bool isTranslucent() const { return _flags[TRANSLUCENT]; } @@ -199,7 +199,7 @@ inline QDebug operator<<(QDebug debug, const ShapeKey& key) { } else { debug << "[ShapeKey:" << "useMaterial:" << key.useMaterial() - << "hasLightmap:" << key.hasLightmap() + << "hasLightmap:" << key.hasLightMap() << "hasTangents:" << key.hasTangents() << "isUnlit:" << key.isUnlit() << "isTranslucent:" << key.isTranslucent() From da071abd8b56333983755d1f0d32b705a6df9316 Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Fri, 7 Jun 2019 16:25:04 -0700 Subject: [PATCH 4/9] wrapping the dependencyManager::get<> call with ifdef to prevent the log from constantly spitting out that instance does not exist --- interface/src/Application.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0e873cbb70..7807014dd6 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -274,6 +274,8 @@ static QTimer pingTimer; #if defined(Q_OS_ANDROID) static bool DISABLE_WATCHDOG = true; #else + + static const QString DISABLE_WATCHDOG_FLAG{ "HIFI_DISABLE_WATCHDOG" }; static bool DISABLE_WATCHDOG = nsightActive() || QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG); #endif @@ -5180,11 +5182,13 @@ ivec2 Application::getMouse() const { } FaceTracker* Application::getActiveFaceTracker() { +#ifdef HAVE_DDE auto dde = DependencyManager::get(); if (dde && dde->isActive()) { return static_cast(dde.data()); } +#endif return nullptr; } @@ -7228,6 +7232,9 @@ void Application::nodeKilled(SharedNodePointer node) { _entityEditSender.nodeKilled(node); + qDebug() << "NODE KIlled: " << node->getType() << "********************************************************"; + + if (node->getType() == NodeType::AudioMixer) { QMetaObject::invokeMethod(DependencyManager::get().data(), "audioMixerKilled"); } else if (node->getType() == NodeType::EntityServer) { From b57e4869c8b29f19c42e16db6e25b9daa1a1df44 Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Fri, 7 Jun 2019 16:26:21 -0700 Subject: [PATCH 5/9] removed debug info --- interface/src/Application.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7807014dd6..8286f73ff0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -274,8 +274,6 @@ static QTimer pingTimer; #if defined(Q_OS_ANDROID) static bool DISABLE_WATCHDOG = true; #else - - static const QString DISABLE_WATCHDOG_FLAG{ "HIFI_DISABLE_WATCHDOG" }; static bool DISABLE_WATCHDOG = nsightActive() || QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG); #endif @@ -7231,10 +7229,7 @@ void Application::nodeKilled(SharedNodePointer node) { _octreeProcessor.nodeKilled(node); _entityEditSender.nodeKilled(node); - - qDebug() << "NODE KIlled: " << node->getType() << "********************************************************"; - - + if (node->getType() == NodeType::AudioMixer) { QMetaObject::invokeMethod(DependencyManager::get().data(), "audioMixerKilled"); } else if (node->getType() == NodeType::EntityServer) { From 00bba828ee12471249307bfdf7e5642358510918 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Fri, 7 Jun 2019 16:41:56 -0700 Subject: [PATCH 6/9] Fix crash using Settings in the Tablet in VR This was introduced in Qt5.12.3. There are several issues in their bug tracker about this issue. https://bugreports.qt.io/browse/QTBUG-75516 https://bugreports.qt.io/browse/QTBUG-75335 To workaround this, we call Qt.createComponent() manually, instead of letting StackView do it for us. --- interface/resources/qml/hifi/tablet/TabletMenuStack.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/tablet/TabletMenuStack.qml b/interface/resources/qml/hifi/tablet/TabletMenuStack.qml index fe636dafa5..76d170cba8 100644 --- a/interface/resources/qml/hifi/tablet/TabletMenuStack.qml +++ b/interface/resources/qml/hifi/tablet/TabletMenuStack.qml @@ -49,7 +49,10 @@ Item { } function pushSource(path) { - d.push(Qt.resolvedUrl("../../" + path)); + // Workaround issue https://bugreports.qt.io/browse/QTBUG-75516 in Qt 5.12.3 + // by creating the manually, instead of letting StackView do it for us. + var item = Qt.createComponent(Qt.resolvedUrl("../../" + path)); + d.push(item); if (d.currentItem.sendToScript !== undefined) { d.currentItem.sendToScript.connect(tabletMenu.sendToScript); } From 0b282b201cb80b32077d123aee156623783ae65f Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 7 Jun 2019 18:01:47 -0700 Subject: [PATCH 7/9] typo fix --- interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml b/interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml index e824036587..0ca9d6d80c 100644 --- a/interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml @@ -22,7 +22,7 @@ StackView { signal sendToScript(var message); function pushSource(path) { - profileRoot.push(Qt.reslovedUrl(path)); + profileRoot.push(Qt.resolvedUrl(path)); } function popSource() { From 9d57f5ac6295a6b7b8d69a7322d4713f4fdd8747 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Fri, 7 Jun 2019 18:35:39 -0700 Subject: [PATCH 8/9] Defer DependencyManager::destroy() until all ScriptAudioInjectors have been destroyed --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4a0bce5103..106ecfc606 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2759,7 +2759,6 @@ void Application::cleanupBeforeQuit() { // this must happen after QML, as there are unexplained audio crashes originating in qtwebengine QMetaObject::invokeMethod(DependencyManager::get().data(), "stop"); DependencyManager::destroy(); - DependencyManager::destroy(); DependencyManager::destroy(); // The PointerManager must be destroyed before the PickManager because when a Pointer is deleted, @@ -2819,6 +2818,7 @@ Application::~Application() { DependencyManager::destroy(); + DependencyManager::destroy(); DependencyManager::destroy(); DependencyManager::destroy(); DependencyManager::destroy(); From fd872009fe73a97d5f36890ddbedece5032d9145 Mon Sep 17 00:00:00 2001 From: Anna Date: Mon, 10 Jun 2019 09:25:12 -0700 Subject: [PATCH 9/9] added workaround for bug in Qt StackView push method --- interface/resources/qml/hifi/tablet/Edit.qml | 3 ++- interface/resources/qml/hifi/tablet/EditTools.qml | 3 ++- interface/resources/qml/hifi/tablet/TabletAudioBuffers.qml | 3 ++- .../resources/qml/hifi/tablet/TabletAvatarPreferences.qml | 3 ++- .../resources/qml/hifi/tablet/TabletGeneralPreferences.qml | 3 ++- .../resources/qml/hifi/tablet/TabletGraphicsPreferences.qml | 3 ++- interface/resources/qml/hifi/tablet/TabletLodPreferences.qml | 3 ++- .../resources/qml/hifi/tablet/TabletNetworkingPreferences.qml | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index 099c53cda2..ca18388def 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -34,7 +34,8 @@ StackView { } function pushSource(path) { - editRoot.push(Qt.resolvedUrl("../../" + path), itemProperties, + var item = Qt.createComponent(Qt.resolvedUrl("../../" + path)); + editRoot.push(item, itemProperties, StackView.Immediate); editRoot.currentItem.sendToScript.connect(editRoot.sendToScript); } diff --git a/interface/resources/qml/hifi/tablet/EditTools.qml b/interface/resources/qml/hifi/tablet/EditTools.qml index f989038c16..976e98cd50 100644 --- a/interface/resources/qml/hifi/tablet/EditTools.qml +++ b/interface/resources/qml/hifi/tablet/EditTools.qml @@ -37,7 +37,8 @@ StackView { } function pushSource(path) { - editRoot.push(Qt.resolvedUrl("../../" + path), itemProperties, + var item = Qt.createComponent(Qt.resolvedUrl("../../" + path)); + editRoot.push(item, itemProperties, StackView.Immediate); editRoot.currentItem.sendToScript.connect(editRoot.sendToScript); } diff --git a/interface/resources/qml/hifi/tablet/TabletAudioBuffers.qml b/interface/resources/qml/hifi/tablet/TabletAudioBuffers.qml index 239c2452d4..2836c2bac6 100644 --- a/interface/resources/qml/hifi/tablet/TabletAudioBuffers.qml +++ b/interface/resources/qml/hifi/tablet/TabletAudioBuffers.qml @@ -24,7 +24,8 @@ StackView { signal sendToScript(var message); function pushSource(path) { - profileRoot.push(Qt.resolvedUrl(path)); + var item = Qt.createComponent(Qt.resolvedUrl(path)); + profileRoot.push(item); } function popSource() { diff --git a/interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml b/interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml index 0ca9d6d80c..dbe4ab12db 100644 --- a/interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletAvatarPreferences.qml @@ -22,7 +22,8 @@ StackView { signal sendToScript(var message); function pushSource(path) { - profileRoot.push(Qt.resolvedUrl(path)); + var item = Qt.createComponent(Qt.resolvedUrl(path)); + profileRoot.push(item); } function popSource() { diff --git a/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml b/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml index 4f1100f20b..254e4203ce 100644 --- a/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml @@ -22,7 +22,8 @@ StackView { signal sendToScript(var message); function pushSource(path) { - profileRoot.push(Qt.resolvedUrl(path)); + var item = Qt.createComponent(Qt.resolvedUrl(path)); + profileRoot.push(item); } function popSource() { diff --git a/interface/resources/qml/hifi/tablet/TabletGraphicsPreferences.qml b/interface/resources/qml/hifi/tablet/TabletGraphicsPreferences.qml index 8d600975ed..9b9f01d031 100644 --- a/interface/resources/qml/hifi/tablet/TabletGraphicsPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletGraphicsPreferences.qml @@ -22,7 +22,8 @@ StackView { signal sendToScript(var message); function pushSource(path) { - profileRoot.push(Qt.resolvedUrl(path)); + var item = Qt.createComponent(Qt.resolvedUrl(path)); + profileRoot.push(item); } function popSource() { diff --git a/interface/resources/qml/hifi/tablet/TabletLodPreferences.qml b/interface/resources/qml/hifi/tablet/TabletLodPreferences.qml index ddc116371d..0938d0a82e 100644 --- a/interface/resources/qml/hifi/tablet/TabletLodPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletLodPreferences.qml @@ -22,7 +22,8 @@ StackView { signal sendToScript(var message); function pushSource(path) { - profileRoot.push(Qt.resolvedUrl(path)); + var item = Qt.createComponent(Qt.resolvedUrl(path)); + profileRoot.push(item); } function popSource() { diff --git a/interface/resources/qml/hifi/tablet/TabletNetworkingPreferences.qml b/interface/resources/qml/hifi/tablet/TabletNetworkingPreferences.qml index bad546a39c..67d6e6c52e 100644 --- a/interface/resources/qml/hifi/tablet/TabletNetworkingPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletNetworkingPreferences.qml @@ -22,7 +22,8 @@ StackView { signal sendToScript(var message); function pushSource(path) { - profileRoot.push(Qt.resolvedUrl(path)); + var item = Qt.createComponent(Qt.resolvedUrl(path)); + profileRoot.push(item); } function popSource() {