From 1adf3d28782490f20f98195ef590f4d871901606 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 11 Sep 2014 12:41:12 -0700 Subject: [PATCH 1/3] Go ahead and generate mipmaps for all network-loaded textures. It is the 21st century, after all. --- interface/src/renderer/TextureCache.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/interface/src/renderer/TextureCache.cpp b/interface/src/renderer/TextureCache.cpp index bb07e83980..f22e1bf7a5 100644 --- a/interface/src/renderer/TextureCache.cpp +++ b/interface/src/renderer/TextureCache.cpp @@ -497,13 +497,9 @@ void NetworkTexture::setImage(const QImage& image, bool translucent, const QColo glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.constBits()); } - if (_type == SPLAT_TEXTURE) { - // generate mipmaps for splat textures - glGenerateMipmap(GL_TEXTURE_2D); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - } + // generate mipmaps + glGenerateMipmap(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); } @@ -541,7 +537,8 @@ QSharedPointer DilatableNetworkTexture::getDilatedTexture(float dilatio glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, dilatedImage.width(), dilatedImage.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, dilatedImage.constBits()); } - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glGenerateMipmap(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); } From df192e297cef29180def5c014b119864aa0ec2d6 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 11 Sep 2014 14:01:11 -0700 Subject: [PATCH 2/3] Apply blendshapes to skeleton as well as head. --- interface/src/avatar/SkeletonModel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index e54a8e0f42..ebcf4520cb 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -60,6 +60,7 @@ void SkeletonModel::simulate(float deltaTime, bool fullUpdate) { setRotation(_owningAvatar->getOrientation() * refOrientation); const float MODEL_SCALE = 0.0006f; setScale(glm::vec3(1.0f, 1.0f, 1.0f) * _owningAvatar->getScale() * MODEL_SCALE); + setBlendshapeCoefficients(_owningAvatar->getHead()->getBlendshapeCoefficients()); Model::simulate(deltaTime, fullUpdate); From 870b0c80cf5aeb756b57641b1144511b0e1b4454 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 11 Sep 2014 15:24:23 -0700 Subject: [PATCH 3/3] Default blendshape mappings for Mixamo models. --- interface/src/ModelUploader.cpp | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/interface/src/ModelUploader.cpp b/interface/src/ModelUploader.cpp index 12a4b145cc..a8be2f9f5c 100644 --- a/interface/src/ModelUploader.cpp +++ b/interface/src/ModelUploader.cpp @@ -48,6 +48,7 @@ static const QString TRANSLATION_Y_FIELD = "ty"; static const QString TRANSLATION_Z_FIELD = "tz"; static const QString JOINT_FIELD = "joint"; static const QString FREE_JOINT_FIELD = "freeJoint"; +static const QString BLENDSHAPE_FIELD = "bs"; static const QString S3_URL = "http://public.highfidelity.io"; static const QString MODEL_URL = "/api/v1/models"; @@ -192,6 +193,45 @@ bool ModelUploader::zip() { mapping.insertMulti(FREE_JOINT_FIELD, "RightForeArm"); } + // mixamo blendshapes + if (!mapping.contains(BLENDSHAPE_FIELD) && geometry.applicationName == "mixamo.com") { + QVariantHash blendshapes; + blendshapes.insert("EyeBlink_L", QVariantList() << "Blink_Left" << 1.0); + blendshapes.insert("EyeBlink_R", QVariantList() << "Blink_Right" << 1.0); + blendshapes.insert("EyeSquint_L", QVariantList() << "Squint_Left" << 1.0); + blendshapes.insert("EyeSquint_R", QVariantList() << "Squint_Right" << 1.0); + blendshapes.insert("EyeOpen_L", QVariantList() << "EyesWide_Left" << 1.0); + blendshapes.insert("EyeOpen_R", QVariantList() << "EyesWide_Right" << 1.0); + blendshapes.insert("BrowsD_L", QVariantList() << "BrowsDown_Left" << 1.0); + blendshapes.insert("BrowsD_R", QVariantList() << "BrowsDown_Right" << 1.0); + blendshapes.insert("BrowsU_L", QVariantList() << "BrowsUp_Left" << 1.0); + blendshapes.insert("BrowsU_R", QVariantList() << "BrowsUp_Right" << 1.0); + blendshapes.insert("JawFwd", QVariantList() << "JawForeward" << 1.0); + blendshapes.insert("JawOpen", QVariantList() << "Jaw_Down" << 1.0); + blendshapes.insert("JawLeft", QVariantList() << "Jaw_Left" << 1.0); + blendshapes.insert("JawRight", QVariantList() << "Jaw_Right" << 1.0); + blendshapes.insert("JawChew", QVariantList() << "Jaw_Up" << 1.0); + blendshapes.insert("MouthLeft", QVariantList() << "Midmouth_Left" << 1.0); + blendshapes.insert("MouthRight", QVariantList() << "Midmouth_Right" << 1.0); + blendshapes.insert("MouthFrown_L", QVariantList() << "Frown_Left" << 1.0); + blendshapes.insert("MouthFrown_R", QVariantList() << "Frown_Right" << 1.0); + blendshapes.insert("MouthSmile_L", QVariantList() << "Smile_Left" << 1.0); + blendshapes.insert("MouthSmile_R", QVariantList() << "Smile_Right" << 1.0); + blendshapes.insert("LipsUpperUp", QVariantList() << "UpperLipUp_Left" << 0.5); + blendshapes.insertMulti("LipsUpperUp", QVariantList() << "UpperLipUp_Right" << 0.5); + blendshapes.insert("Puff", QVariantList() << "CheekPuff_Left" << 0.5); + blendshapes.insertMulti("Puff", QVariantList() << "CheekPuff_Right" << 0.5); + blendshapes.insert("Sneer", QVariantList() << "NoseScrunch_Left" << 0.5); + blendshapes.insertMulti("Sneer", QVariantList() << "NoseScrunch_Right" << 0.5); + blendshapes.insert("CheekSquint_L", QVariantList() << "Squint_Left" << 1.0); + blendshapes.insert("CheekSquint_R", QVariantList() << "Squint_Right" << 1.0); + blendshapes.insert("LipsPucker", QVariantList() << "MouthNarrow_Left" << 0.5); + blendshapes.insertMulti("LipsPucker", QVariantList() << "MouthNarrow_Right" << 0.5); + blendshapes.insert("LipsLowerDown", QVariantList() << "LowerLipDown_Left" << 0.5); + blendshapes.insertMulti("LipsLowerDown", QVariantList() << "LowerLipDown_Right" << 0.5); + mapping.insert(BLENDSHAPE_FIELD, blendshapes); + } + // open the dialog to configure the rest ModelPropertiesDialog properties(_modelType, mapping, basePath, geometry); if (properties.exec() == QDialog::Rejected) {