diff --git a/src/texturegenerator.cpp b/src/texturegenerator.cpp index e057a0e7..aa2e6a03 100644 --- a/src/texturegenerator.cpp +++ b/src/texturegenerator.cpp @@ -218,7 +218,7 @@ void TextureGenerator::generate() m_resultTextureBorderImage->fill(Qt::transparent); m_resultTextureNormalImage = new QImage(TextureGenerator::m_textureSize, TextureGenerator::m_textureSize, QImage::Format_ARGB32); - m_resultTextureNormalImage->fill(Qt::transparent); + m_resultTextureNormalImage->fill(QColor(127, 127, 127)); m_resultTextureMetalnessRoughnessAmbientOcclusionImage = new QImage(TextureGenerator::m_textureSize, TextureGenerator::m_textureSize, QImage::Format_ARGB32); m_resultTextureMetalnessRoughnessAmbientOcclusionImage->fill(QColor(255, 255, 0)); diff --git a/src/triangletangentresolve.cpp b/src/triangletangentresolve.cpp index 037c7f69..157b4073 100644 --- a/src/triangletangentresolve.cpp +++ b/src/triangletangentresolve.cpp @@ -1,3 +1,4 @@ +#include #include "triangletangentresolve.h" void triangleTangentResolve(const Outcome &outcome, std::vector &tangents) @@ -24,8 +25,9 @@ void triangleTangentResolve(const Outcome &outcome, std::vector &tang QVector2D deltaUv1 = uv2 - uv1; QVector2D deltaUv2 = uv3 - uv1; auto bottom = deltaUv1.x() * deltaUv2.y() - deltaUv2.x() * deltaUv1.y(); - if (qFuzzyIsNull(bottom)) - continue; + if (qFuzzyIsNull(bottom)) { + bottom = 0.000001; + } float f = 1.0 / bottom; QVector3D tangent = { f * (deltaUv2.y() * edge1.x() - deltaUv1.y() * edge2.x()),