diff --git a/src/meshgenerator.cpp b/src/meshgenerator.cpp index 46b3329d..82cf55bf 100644 --- a/src/meshgenerator.cpp +++ b/src/meshgenerator.cpp @@ -784,7 +784,9 @@ MeshCombiner::Mesh *MeshGenerator::combinePartMesh(const QString &partIdString, m_partPreviewMeshes[partId] = new Model(partPreviewVertices, partCache.previewTriangles, partPreviewTriangleVertexNormals, - partPreviewColor); + partPreviewColor, + metalness, + roughness); } delete strokeModifier; diff --git a/src/model.cpp b/src/model.cpp index 3a4cc226..67802c7d 100644 --- a/src/model.cpp +++ b/src/model.cpp @@ -89,7 +89,9 @@ Model::Model(ShaderVertex *triangleVertices, int vertexNum, ShaderVertex *edgeVe Model::Model(const std::vector &vertices, const std::vector> &triangles, const std::vector> &triangleVertexNormals, - const QColor &color) + const QColor &color, + float metalness, + float roughness) { m_triangleVertexCount = triangles.size() * 3; m_triangleVertices = new ShaderVertex[m_triangleVertexCount]; @@ -112,8 +114,8 @@ Model::Model(const std::vector &vertices, const std::vectornormX = srcNormal->x(); dest->normY = srcNormal->y(); dest->normZ = srcNormal->z(); - dest->metalness = m_defaultMetalness; - dest->roughness = m_defaultRoughness; + dest->metalness = metalness; + dest->roughness = roughness; dest->tangentX = 0; dest->tangentY = 0; dest->tangentZ = 0; diff --git a/src/model.h b/src/model.h index 53207292..58371ea1 100644 --- a/src/model.h +++ b/src/model.h @@ -20,7 +20,9 @@ class Model public: Model(const std::vector &vertices, const std::vector> &triangles, const std::vector> &triangleVertexNormals, - const QColor &color=Qt::white); + const QColor &color=Qt::white, + float metalness=0.0, + float roughness=0.0); Model(Outcome &outcome); Model(ShaderVertex *triangleVertices, int vertexNum, ShaderVertex *edgeVertices=nullptr, int edgeVertexCount=0); Model(const Model &mesh);