diff --git a/src/librender/trimesh.cpp b/src/librender/trimesh.cpp index 97d2eb4f..018399e6 100644 --- a/src/librender/trimesh.cpp +++ b/src/librender/trimesh.cpp @@ -252,6 +252,7 @@ void TriMesh::configure() { for (size_t i=0; igetType() & BSDF::EAnisotropicMaterial || m_bsdf->usesRayDifferentials()) && !m_tangents) computeTangentSpaceBasis(); @@ -337,7 +338,7 @@ void TriMesh::computeNormals() { void TriMesh::computeTangentSpaceBasis() { int zeroArea = 0, zeroNormals = 0; - if (!m_texcoords) + if (!m_texcoords && m_bsdf->getType() & BSDF::EAnisotropicMaterial) Log(EError, "\"%s\": computeTangentSpace(): texture coordinates are required " "to generate tangent vectors. If you want to render with an anisotropic " "material, make sure that all assigned objects have texture coordinates."); @@ -359,6 +360,11 @@ void TriMesh::computeTangentSpaceBasis() { } sharers[i] = 0; } + + if (!m_texcoords) { + delete [] sharers; + return; + } for (size_t i=0; i