mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 15:13:41 +02:00
Merge pull request #3400 from ey6es/master
Allow skeletons to use blendshapes; provide default mappings for Mixamo models. Also, generate mipmaps for all textures loaded from network.
This commit is contained in:
commit
8602dbef78
3 changed files with 46 additions and 8 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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<Texture> 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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue