From 52397bf87af1ca5d2431f108cf55dfadb207a5fe Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 8 May 2015 15:59:39 +0200 Subject: [PATCH 1/2] Fix wireframe render for meshes with special properties --- libraries/render-utils/src/Model.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index eb010f874d..db95005a09 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -2068,6 +2068,12 @@ void Model::segregateMeshGroups() { bool hasSpecular = mesh.hasSpecularTexture(); bool hasLightmap = mesh.hasEmissiveTexture(); bool isSkinned = state.clusterMatrices.size() > 1; + bool isWireframe = this->isWireframe(); + + if (isWireframe) { + translucentMesh = hasTangents = hasSpecular = hasLightmap = isSkinned = false; + } + QString materialID; // create a material name from all the parts. If there's one part, this will be a single material and its @@ -2085,7 +2091,7 @@ void Model::segregateMeshGroups() { qCDebug(renderutils) << "materialID:" << materialID << "parts:" << mesh.parts.size(); } - RenderKey key(translucentMesh, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe()); + RenderKey key(translucentMesh, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe); // reuse or create the bucket corresponding to that key and insert the mesh as unsorted _renderBuckets[key.getRaw()]._unsortedMeshes.insertMulti(materialID, i); From e51040db5302a2d752d71ed70581a733b250613c Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Mon, 11 May 2015 14:31:22 +0200 Subject: [PATCH 2/2] CR --- libraries/render-utils/src/Model.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index db95005a09..080b63370a 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -2068,9 +2068,9 @@ void Model::segregateMeshGroups() { bool hasSpecular = mesh.hasSpecularTexture(); bool hasLightmap = mesh.hasEmissiveTexture(); bool isSkinned = state.clusterMatrices.size() > 1; - bool isWireframe = this->isWireframe(); + bool wireframe = isWireframe(); - if (isWireframe) { + if (wireframe) { translucentMesh = hasTangents = hasSpecular = hasLightmap = isSkinned = false; } @@ -2091,7 +2091,7 @@ void Model::segregateMeshGroups() { qCDebug(renderutils) << "materialID:" << materialID << "parts:" << mesh.parts.size(); } - RenderKey key(translucentMesh, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe); + RenderKey key(translucentMesh, hasLightmap, hasTangents, hasSpecular, isSkinned, wireframe); // reuse or create the bucket corresponding to that key and insert the mesh as unsorted _renderBuckets[key.getRaw()]._unsortedMeshes.insertMulti(materialID, i);