diff --git a/libraries/graphics-scripting/src/graphics-scripting/Forward.h b/libraries/graphics-scripting/src/graphics-scripting/Forward.h index d120e15892..23a7426610 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/Forward.h +++ b/libraries/graphics-scripting/src/graphics-scripting/Forward.h @@ -52,55 +52,55 @@ namespace scriptable { ScriptableMaterial(const ScriptableMaterial& material) { *this = material; } ScriptableMaterial& operator=(const ScriptableMaterial& material); - QString name; - QString model; - float opacity; - float roughness; - float metallic; - float scattering; - bool unlit; - glm::vec3 emissive; - glm::vec3 albedo; - QString emissiveMap; - QString albedoMap; - QString opacityMap; - QString opacityMapMode; - float opacityCutoff; - QString metallicMap; - QString specularMap; - QString roughnessMap; - QString glossMap; - QString normalMap; - QString bumpMap; - QString occlusionMap; - QString lightMap; - QString scatteringMap; + QString name { "" }; + QString model { "" }; + float opacity { 0.0f }; + float roughness { 0.0f }; + float metallic { 0.0f }; + float scattering { 0.0f }; + bool unlit { false }; + glm::vec3 emissive { 0.0f }; + glm::vec3 albedo { 0.0f }; + QString emissiveMap { "" }; + QString albedoMap { "" }; + QString opacityMap { "" }; + QString opacityMapMode { "" }; + float opacityCutoff { 0.0f }; + QString metallicMap { "" }; + QString specularMap { "" }; + QString roughnessMap { "" }; + QString glossMap { "" }; + QString normalMap { "" }; + QString bumpMap { "" }; + QString occlusionMap { "" }; + QString lightMap { "" }; + QString scatteringMap { "" }; std::array texCoordTransforms; - QString cullFaceMode; - bool defaultFallthrough; + QString cullFaceMode { "" }; + bool defaultFallthrough { false }; std::unordered_map propertyFallthroughs; // not actually exposed to script - QString procedural; + QString procedural { "" }; - glm::vec3 shade; - QString shadeMap; - float shadingShift; - QString shadingShiftMap; - float shadingToony; - glm::vec3 matcap; - QString matcapMap; - glm::vec3 parametricRim; - float parametricRimFresnelPower; - float parametricRimLift; - QString rimMap; - float rimLightingMix; - QString outlineWidthMode; - float outlineWidth; - glm::vec3 outline; - QString uvAnimationMaskMap; - float uvAnimationScrollXSpeed; - float uvAnimationScrollYSpeed; - float uvAnimationRotationSpeed; + glm::vec3 shade { 0.0f }; + QString shadeMap { "" }; + float shadingShift { 0.0f }; + QString shadingShiftMap { "" }; + float shadingToony { 0.0f }; + glm::vec3 matcap { 0.0f }; + QString matcapMap { "" }; + glm::vec3 parametricRim { 0.0f }; + float parametricRimFresnelPower { 0.0f }; + float parametricRimLift { 0.0f }; + QString rimMap { "" }; + float rimLightingMix { 0.0f }; + QString outlineWidthMode { "" }; + float outlineWidth { 0.0f }; + glm::vec3 outline { 0.0f }; + QString uvAnimationMaskMap { "" }; + float uvAnimationScrollXSpeed { 0.0f }; + float uvAnimationScrollYSpeed { 0.0f }; + float uvAnimationRotationSpeed { 0.0f }; graphics::MaterialKey key { 0 }; }; diff --git a/libraries/graphics/src/graphics/Material.cpp b/libraries/graphics/src/graphics/Material.cpp index 0e0ec3588c..1061347e27 100644 --- a/libraries/graphics/src/graphics/Material.cpp +++ b/libraries/graphics/src/graphics/Material.cpp @@ -72,8 +72,8 @@ Material::Material() { Material::Material(const Material& material) : _name(material._name), - _model(material._model), _key(material._key), + _model(material._model), _emissive(material._emissive), _opacity(material._opacity), _albedo(material._albedo), diff --git a/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp b/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp index 047c69285f..02ec234266 100644 --- a/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp +++ b/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp @@ -725,7 +725,8 @@ std::pair> NetworkMaterialResource } else { NetworkMToonMaterial::OutlineWidthMode mode; if (NetworkMToonMaterial::getOutlineWidthModeFromName(valueString.toStdString(), mode)) { - toonMaterial->setOutlineWidthMode(mode); + // FIXME: Outlines are currently disabled because they're buggy + //toonMaterial->setOutlineWidthMode(mode); } } } diff --git a/libraries/render/src/render/HighlightStyle.h b/libraries/render/src/render/HighlightStyle.h index 795253cc2f..138674ffbb 100644 --- a/libraries/render/src/render/HighlightStyle.h +++ b/libraries/render/src/render/HighlightStyle.h @@ -69,9 +69,9 @@ namespace render { glm::vec4 p2 = projection * (viewPos - glm::vec4(0.0f, 0.5f * outlineWidth, 0.0f, 0.0f)); p2 /= p2.w; - style._outlineWidth = 0.5 * screenHeight * fabs(p1.y - p2.y); + style._outlineWidth = floor(0.5f * (float)screenHeight * fabs(p1.y - p2.y)); } else { // OUTLINE_SCREEN - style._outlineWidth = outlineWidth * screenHeight; + style._outlineWidth = floor(outlineWidth * (float)screenHeight); } return style;