Update part preview image to show the metallic and roughness setting
parent
51b7d85c3b
commit
8e952c955a
|
@ -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;
|
||||
|
|
|
@ -89,7 +89,9 @@ Model::Model(ShaderVertex *triangleVertices, int vertexNum, ShaderVertex *edgeVe
|
|||
|
||||
Model::Model(const std::vector<QVector3D> &vertices, const std::vector<std::vector<size_t>> &triangles,
|
||||
const std::vector<std::vector<QVector3D>> &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<QVector3D> &vertices, const std::vector<std::vect
|
|||
dest->normX = 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;
|
||||
|
|
|
@ -20,7 +20,9 @@ class Model
|
|||
public:
|
||||
Model(const std::vector<QVector3D> &vertices, const std::vector<std::vector<size_t>> &triangles,
|
||||
const std::vector<std::vector<QVector3D>> &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);
|
||||
|
|
Loading…
Reference in New Issue