From 8c963ed6a73c4d8bcc844870d54b694f1c3685db Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 23 Sep 2013 10:30:03 -0700 Subject: [PATCH 1/8] Blend the normals, too. --- interface/src/avatar/BlendFace.cpp | 24 ++++++++++++++++++------ interface/src/avatar/BlendFace.h | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index 4bd0c0d7da..63b8a2db6e 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -50,8 +50,11 @@ bool BlendFace::render(float alpha) { // start with the base int vertexCount = _geometry.vertices.size(); + int normalCount = _geometry.normals.size(); _blendedVertices.resize(vertexCount); + _blendedNormals.resize(normalCount); memcpy(_blendedVertices.data(), _geometry.vertices.constData(), vertexCount * sizeof(glm::vec3)); + memcpy(_blendedNormals.data(), _geometry.normals.constData(), normalCount * sizeof(glm::vec3)); // blend in each coefficient const vector& coefficients = _owningHead->getBlendshapeCoefficients(); @@ -60,31 +63,39 @@ bool BlendFace::render(float alpha) { if (coefficient == 0.0f || i >= _geometry.blendshapes.size() || _geometry.blendshapes[i].vertices.isEmpty()) { continue; } - const glm::vec3* source = _geometry.blendshapes[i].vertices.constData(); + const glm::vec3* vertex = _geometry.blendshapes[i].vertices.constData(); + const glm::vec3* normal = _geometry.blendshapes[i].normals.constData(); for (const int* index = _geometry.blendshapes[i].indices.constData(), - *end = index + _geometry.blendshapes[i].indices.size(); index != end; index++, source++) { - _blendedVertices[*index] += *source * coefficient; + *end = index + _geometry.blendshapes[i].indices.size(); index != end; index++, vertex++, normal++) { + _blendedVertices[*index] += *vertex * coefficient; + _blendedNormals[*index] += *normal * coefficient; } } // update the blended vertices glBindBuffer(GL_ARRAY_BUFFER, _vboID); glBufferSubData(GL_ARRAY_BUFFER, 0, vertexCount * sizeof(glm::vec3), _blendedVertices.constData()); + glBufferSubData(GL_ARRAY_BUFFER, vertexCount * sizeof(glm::vec3), + normalCount * sizeof(glm::vec3), _blendedNormals.constData()); // tell OpenGL where to find vertex information glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, 0); + glEnableClientState(GL_NORMAL_ARRAY); + glNormalPointer(GL_FLOAT, 0, (void*)(vertexCount * sizeof(glm::vec3))); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + // enable normalization under the expectation that the GPU can do it faster + glEnable(GL_NORMALIZE); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iboID); glDrawRangeElementsEXT(GL_QUADS, 0, vertexCount - 1, _geometry.quadIndices.size(), GL_UNSIGNED_INT, 0); glDrawRangeElementsEXT(GL_TRIANGLES, 0, vertexCount - 1, _geometry.triangleIndices.size(), GL_UNSIGNED_INT, (void*)(_geometry.quadIndices.size() * sizeof(int))); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glDisable(GL_NORMALIZE); // deactivate vertex arrays after drawing + glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); // bind with 0 to switch back to normal operation @@ -214,7 +225,8 @@ void BlendFace::setGeometry(const FBXGeometry& geometry) { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, _vboID); - glBufferData(GL_ARRAY_BUFFER, geometry.vertices.size() * sizeof(glm::vec3), NULL, GL_DYNAMIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, (geometry.vertices.size() + geometry.normals.size()) * sizeof(glm::vec3), + NULL, GL_DYNAMIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); _geometry = geometry; diff --git a/interface/src/avatar/BlendFace.h b/interface/src/avatar/BlendFace.h index 5e98650e12..24ff1dd3a3 100644 --- a/interface/src/avatar/BlendFace.h +++ b/interface/src/avatar/BlendFace.h @@ -61,6 +61,7 @@ private: FBXGeometry _geometry; QVector _blendedVertices; + QVector _blendedNormals; }; #endif /* defined(__interface__BlendFace__) */ From 0fa2eca02d05a5ed853c51a525a8045ef9493e67 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 23 Sep 2013 10:43:20 -0700 Subject: [PATCH 2/8] Remove option to use Faceshift rig (using the "macaw" model has much the same result, and it lets other people see it). --- interface/src/Menu.cpp | 2 -- interface/src/Menu.h | 1 - interface/src/avatar/BlendFace.cpp | 35 ----------------------------- interface/src/avatar/BlendFace.h | 6 ----- interface/src/avatar/MyAvatar.cpp | 8 ------- interface/src/avatar/MyAvatar.h | 1 - interface/src/devices/Faceshift.cpp | 21 ----------------- interface/src/devices/Faceshift.h | 5 ----- 8 files changed, 79 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index a88954d64b..560f72807b 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -275,8 +275,6 @@ Menu::Menu() : appInstance->getGlowEffect(), SLOT(cycleRenderMode())); - addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::UseFaceshiftRig, 0, false, - appInstance->getFaceshift(), SLOT(setUsingRig(bool))); addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::UsePerlinFace, 0, false); addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::LookAtVectors, 0, true); addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::LookAtIndicator, 0, true); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 081810d374..78ef65221c 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -199,7 +199,6 @@ namespace MenuOption { const QString TestRaveGlove = "Test Rave Glove"; const QString TreeStats = "Calculate Tree Stats"; const QString TransmitterDrive = "Transmitter Drive"; - const QString UseFaceshiftRig = "Use Faceshift Rig"; const QString UsePerlinFace = "Use Perlin's Face"; const QString Quit = "Quit"; const QString Webcam = "Webcam"; diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index 63b8a2db6e..8967991ca3 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -140,41 +140,6 @@ glm::vec3 createVec3(const fsVector3f& vector) { return glm::vec3(vector.x, vector.y, vector.z); } -void BlendFace::setRig(const fsMsgRig& rig) { - // convert to FBX geometry - FBXGeometry geometry; - - for (vector::const_iterator it = rig.mesh().m_quads.begin(), end = rig.mesh().m_quads.end(); it != end; it++) { - geometry.quadIndices.append(it->x); - geometry.quadIndices.append(it->y); - geometry.quadIndices.append(it->z); - geometry.quadIndices.append(it->w); - } - - for (vector::const_iterator it = rig.mesh().m_tris.begin(), end = rig.mesh().m_tris.end(); it != end; it++) { - geometry.triangleIndices.append(it->x); - geometry.triangleIndices.append(it->y); - geometry.triangleIndices.append(it->z); - } - - for (vector::const_iterator it = rig.mesh().m_vertex_data.m_vertices.begin(), - end = rig.mesh().m_vertex_data.m_vertices.end(); it != end; it++) { - geometry.vertices.append(glm::vec3(it->x, it->y, it->z)); - } - - for (vector::const_iterator it = rig.blendshapes().begin(), end = rig.blendshapes().end(); it != end; it++) { - FBXBlendshape blendshape; - for (int i = 0, n = it->m_vertices.size(); i < n; i++) { - // subtract the base vertex position; we want the deltas - blendshape.vertices.append(createVec3(it->m_vertices[i]) - geometry.vertices[i]); - blendshape.indices.append(i); - } - geometry.blendshapes.append(blendshape); - } - - setGeometry(geometry); -} - void BlendFace::handleModelDownloadProgress(qint64 bytesReceived, qint64 bytesTotal) { if (bytesReceived < bytesTotal && !_modelReply->isFinished()) { return; diff --git a/interface/src/avatar/BlendFace.h b/interface/src/avatar/BlendFace.h index 24ff1dd3a3..336d6cc5f0 100644 --- a/interface/src/avatar/BlendFace.h +++ b/interface/src/avatar/BlendFace.h @@ -12,8 +12,6 @@ #include #include -#include - #include "InterfaceConfig.h" #include "renderer/FBXReader.h" @@ -36,10 +34,6 @@ public: Q_INVOKABLE void setModelURL(const QUrl& url); const QUrl& getModelURL() const { return _modelURL; } - -public slots: - - void setRig(const fs::fsMsgRig& rig); private slots: diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 16718948f0..794ad7cf95 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -59,14 +59,6 @@ MyAvatar::MyAvatar(Node* owningNode) : _collisionRadius = _height * COLLISION_RADIUS_SCALE; } -void MyAvatar::init() { - Avatar::init(); - - // when we receive a Faceshift rig, apply it to our own blend face - _head.getBlendFace().connect(Application::getInstance()->getFaceshift(), SIGNAL(rigReceived(fs::fsMsgRig)), - SLOT(setRig(fs::fsMsgRig))); -} - void MyAvatar::reset() { _head.reset(); _hand.reset(); diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index cadc55018c..f6ec055496 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -15,7 +15,6 @@ class MyAvatar : public Avatar { public: MyAvatar(Node* owningNode = NULL); - void init(); void reset(); void simulate(float deltaTime, Transmitter* transmitter, float gyroCameraSensitivity); void updateFromGyrosAndOrWebcam(bool gyroLook, float pitchFromTouch); diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp index 8ca18d74ce..c1b1dfcb52 100644 --- a/interface/src/devices/Faceshift.cpp +++ b/interface/src/devices/Faceshift.cpp @@ -87,17 +87,6 @@ void Faceshift::setTCPEnabled(bool enabled) { } } -void Faceshift::setUsingRig(bool usingRig) { - if (usingRig && _tcpSocket.state() == QAbstractSocket::ConnectedState) { - string message; - fsBinaryStream::encode_message(message, fsMsgSendRig()); - send(message); - - } else { - emit rigReceived(fsMsgRig()); - } -} - void Faceshift::connectSocket() { if (_tcpEnabled) { qDebug("Faceshift: Connecting...\n"); @@ -114,11 +103,6 @@ void Faceshift::noteConnected() { string message; fsBinaryStream::encode_message(message, fsMsgSendBlendshapeNames()); send(message); - - // if using faceshift rig, request it - if (Menu::getInstance()->isOptionChecked(MenuOption::UseFaceshiftRig)) { - setUsingRig(true); - } } void Faceshift::noteError(QAbstractSocket::SocketError error) { @@ -214,11 +198,6 @@ void Faceshift::receive(const QByteArray& buffer) { } break; } - case fsMsg::MSG_OUT_RIG: { - fsMsgRig* rig = static_cast(msg.get()); - emit rigReceived(*rig); - break; - } default: break; } diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index dc42a4e9c6..1b93c717a5 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -60,15 +60,10 @@ public: void update(); void reset(); - -signals: - - void rigReceived(const fs::fsMsgRig& rig); public slots: void setTCPEnabled(bool enabled); - void setUsingRig(bool usingRig); private slots: From 8e2be380f61e85ee36b08e2299ce25a080bb8374 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 23 Sep 2013 11:17:12 -0700 Subject: [PATCH 3/8] Trying a different method of updating the normals. --- interface/src/avatar/BlendFace.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index 8967991ca3..acb7a25526 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -6,6 +6,8 @@ // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. // +#include + #include #include "Application.h" @@ -50,25 +52,35 @@ bool BlendFace::render(float alpha) { // start with the base int vertexCount = _geometry.vertices.size(); - int normalCount = _geometry.normals.size(); _blendedVertices.resize(vertexCount); - _blendedNormals.resize(normalCount); memcpy(_blendedVertices.data(), _geometry.vertices.constData(), vertexCount * sizeof(glm::vec3)); - memcpy(_blendedNormals.data(), _geometry.normals.constData(), normalCount * sizeof(glm::vec3)); + + // find the coefficient total + const vector& coefficients = _owningHead->getBlendshapeCoefficients(); + float coefficientTotal = accumulate(coefficients.begin(), coefficients.end(), 0.0f); + + // for the normals, only use the base if we have nothing else + int normalCount = _geometry.normals.size(); + _blendedNormals.resize(normalCount); + if (coefficientTotal == 0.0f) { + memcpy(_blendedNormals.data(), _geometry.normals.constData(), normalCount * sizeof(glm::vec3)); + } else { + memset(_blendedNormals.data(), 0, normalCount * sizeof(glm::vec3)); + } // blend in each coefficient - const vector& coefficients = _owningHead->getBlendshapeCoefficients(); for (int i = 0; i < coefficients.size(); i++) { float coefficient = coefficients[i]; if (coefficient == 0.0f || i >= _geometry.blendshapes.size() || _geometry.blendshapes[i].vertices.isEmpty()) { continue; } + float normalCoefficient = coefficient / coefficientTotal; const glm::vec3* vertex = _geometry.blendshapes[i].vertices.constData(); const glm::vec3* normal = _geometry.blendshapes[i].normals.constData(); for (const int* index = _geometry.blendshapes[i].indices.constData(), *end = index + _geometry.blendshapes[i].indices.size(); index != end; index++, vertex++, normal++) { _blendedVertices[*index] += *vertex * coefficient; - _blendedNormals[*index] += *normal * coefficient; + _blendedNormals[*index] += *normal * normalCoefficient; } } From 1893fdba29b30b467f42ef877584f00680482bec Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 23 Sep 2013 11:47:59 -0700 Subject: [PATCH 4/8] Revert "Trying a different method of updating the normals." This reverts commit 8e2be380f61e85ee36b08e2299ce25a080bb8374. --- interface/src/avatar/BlendFace.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index acb7a25526..8967991ca3 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -6,8 +6,6 @@ // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. // -#include - #include #include "Application.h" @@ -52,35 +50,25 @@ bool BlendFace::render(float alpha) { // start with the base int vertexCount = _geometry.vertices.size(); - _blendedVertices.resize(vertexCount); - memcpy(_blendedVertices.data(), _geometry.vertices.constData(), vertexCount * sizeof(glm::vec3)); - - // find the coefficient total - const vector& coefficients = _owningHead->getBlendshapeCoefficients(); - float coefficientTotal = accumulate(coefficients.begin(), coefficients.end(), 0.0f); - - // for the normals, only use the base if we have nothing else int normalCount = _geometry.normals.size(); + _blendedVertices.resize(vertexCount); _blendedNormals.resize(normalCount); - if (coefficientTotal == 0.0f) { - memcpy(_blendedNormals.data(), _geometry.normals.constData(), normalCount * sizeof(glm::vec3)); - } else { - memset(_blendedNormals.data(), 0, normalCount * sizeof(glm::vec3)); - } + memcpy(_blendedVertices.data(), _geometry.vertices.constData(), vertexCount * sizeof(glm::vec3)); + memcpy(_blendedNormals.data(), _geometry.normals.constData(), normalCount * sizeof(glm::vec3)); // blend in each coefficient + const vector& coefficients = _owningHead->getBlendshapeCoefficients(); for (int i = 0; i < coefficients.size(); i++) { float coefficient = coefficients[i]; if (coefficient == 0.0f || i >= _geometry.blendshapes.size() || _geometry.blendshapes[i].vertices.isEmpty()) { continue; } - float normalCoefficient = coefficient / coefficientTotal; const glm::vec3* vertex = _geometry.blendshapes[i].vertices.constData(); const glm::vec3* normal = _geometry.blendshapes[i].normals.constData(); for (const int* index = _geometry.blendshapes[i].indices.constData(), *end = index + _geometry.blendshapes[i].indices.size(); index != end; index++, vertex++, normal++) { _blendedVertices[*index] += *vertex * coefficient; - _blendedNormals[*index] += *normal * normalCoefficient; + _blendedNormals[*index] += *normal * coefficient; } } From c7bb523fc527c3a2c13171ea75b25f4beb29ebc1 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 23 Sep 2013 12:15:02 -0700 Subject: [PATCH 5/8] Apply the skin color to the blend face. --- interface/src/avatar/BlendFace.cpp | 2 +- interface/src/avatar/Head.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index 8967991ca3..183d6fcdc7 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -46,7 +46,7 @@ bool BlendFace::render(float alpha) { glScalef(_owningHead->getScale() * MODEL_SCALE, _owningHead->getScale() * MODEL_SCALE, -_owningHead->getScale() * MODEL_SCALE); - glColor4f(1.0f, 1.0f, 1.0f, alpha); + glColor4f(_owningHead->getSkinColor().r, _owningHead->getSkinColor().g, _owningHead->getSkinColor().b, alpha); // start with the base int vertexCount = _geometry.vertices.size(); diff --git a/interface/src/avatar/Head.h b/interface/src/avatar/Head.h index 0af037c337..04fc26c7f9 100644 --- a/interface/src/avatar/Head.h +++ b/interface/src/avatar/Head.h @@ -66,6 +66,7 @@ public: float getScale() const { return _scale; } glm::vec3 getPosition() const { return _position; } + const glm::vec3& getSkinColor() const { return _skinColor; } const glm::vec3& getEyePosition() const { return _eyePosition; } glm::vec3 getRightDirection() const { return getOrientation() * IDENTITY_RIGHT; } glm::vec3 getUpDirection() const { return getOrientation() * IDENTITY_UP; } From 807f6aaf1451afdb302416a27a04d38a7bacdcc6 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 23 Sep 2013 12:20:19 -0700 Subject: [PATCH 6/8] Temporarily render the normals for debugging. --- interface/src/avatar/BlendFace.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index 183d6fcdc7..9da3b9c783 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -46,8 +46,6 @@ bool BlendFace::render(float alpha) { glScalef(_owningHead->getScale() * MODEL_SCALE, _owningHead->getScale() * MODEL_SCALE, -_owningHead->getScale() * MODEL_SCALE); - glColor4f(_owningHead->getSkinColor().r, _owningHead->getSkinColor().g, _owningHead->getSkinColor().b, alpha); - // start with the base int vertexCount = _geometry.vertices.size(); int normalCount = _geometry.normals.size(); @@ -72,6 +70,18 @@ bool BlendFace::render(float alpha) { } } + glColor3f(1.0f, 0.0f, 0.0f); + glBegin(GL_LINES); + for (int i = 0; i < vertexCount; i++) { + glVertex3f(_blendedVertices.at(i).x, _blendedVertices.at(i).y, _blendedVertices.at(i).z); + glm::vec3 end = _blendedVertices.at(i) + glm::normalize(_blendedNormals.at(i)) * 10.0f; + glVertex3f(end.x, end.y, end.z); + } + glEnd(); + + // use the head skin color + glColor4f(_owningHead->getSkinColor().r, _owningHead->getSkinColor().g, _owningHead->getSkinColor().b, alpha); + // update the blended vertices glBindBuffer(GL_ARRAY_BUFFER, _vboID); glBufferSubData(GL_ARRAY_BUFFER, 0, vertexCount * sizeof(glm::vec3), _blendedVertices.constData()); From 1a55c64299a43cf9afee7a1a92cf25e128349d04 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 23 Sep 2013 12:42:58 -0700 Subject: [PATCH 7/8] Scale the normal contributions down. For some reason, their magnitudes are higher than one would expect. --- interface/src/avatar/BlendFace.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index 9da3b9c783..6fceb7939c 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -61,24 +61,17 @@ bool BlendFace::render(float alpha) { if (coefficient == 0.0f || i >= _geometry.blendshapes.size() || _geometry.blendshapes[i].vertices.isEmpty()) { continue; } + const float NORMAL_COEFFICIENT_SCALE = 0.01f; + float normalCoefficient = coefficient * NORMAL_COEFFICIENT_SCALE; const glm::vec3* vertex = _geometry.blendshapes[i].vertices.constData(); const glm::vec3* normal = _geometry.blendshapes[i].normals.constData(); for (const int* index = _geometry.blendshapes[i].indices.constData(), *end = index + _geometry.blendshapes[i].indices.size(); index != end; index++, vertex++, normal++) { _blendedVertices[*index] += *vertex * coefficient; - _blendedNormals[*index] += *normal * coefficient; + _blendedNormals[*index] += *normal * coefficient * NORMAL_COEFFICIENT_SCALE; } } - glColor3f(1.0f, 0.0f, 0.0f); - glBegin(GL_LINES); - for (int i = 0; i < vertexCount; i++) { - glVertex3f(_blendedVertices.at(i).x, _blendedVertices.at(i).y, _blendedVertices.at(i).z); - glm::vec3 end = _blendedVertices.at(i) + glm::normalize(_blendedNormals.at(i)) * 10.0f; - glVertex3f(end.x, end.y, end.z); - } - glEnd(); - // use the head skin color glColor4f(_owningHead->getSkinColor().r, _owningHead->getSkinColor().g, _owningHead->getSkinColor().b, alpha); From 255e5179ae9cea72c06e450a80a1144073197e01 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 23 Sep 2013 13:02:00 -0700 Subject: [PATCH 8/8] Let's actually use the variable we initialized. --- interface/src/avatar/BlendFace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index 6fceb7939c..d1a61b3fa3 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -68,7 +68,7 @@ bool BlendFace::render(float alpha) { for (const int* index = _geometry.blendshapes[i].indices.constData(), *end = index + _geometry.blendshapes[i].indices.size(); index != end; index++, vertex++, normal++) { _blendedVertices[*index] += *vertex * coefficient; - _blendedNormals[*index] += *normal * coefficient * NORMAL_COEFFICIENT_SCALE; + _blendedNormals[*index] += *normal * normalCoefficient; } }