From 81c2ebdbdaf797640702b1b1e663e4e039f549fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20Berk=20T=C3=B6re?= Date: Tue, 16 Aug 2022 20:44:04 +0300 Subject: [PATCH] Introduces Flips UV flag, removes empty space (#420) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces the flip uv flag for unnessary y flip during addition of texture coordinates. Furthermore removes an empty line. Signed-off-by: Onur Berk Tore Co-authored-by: Alejandro Hernández Cordero --- graphics/src/AssimpLoader.cc | 4 ++-- graphics/src/MeshManager.cc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/graphics/src/AssimpLoader.cc b/graphics/src/AssimpLoader.cc index caa2662a..2feabed3 100644 --- a/graphics/src/AssimpLoader.cc +++ b/graphics/src/AssimpLoader.cc @@ -579,8 +579,7 @@ SubMesh AssimpLoader::Implementation::CreateSubMesh( math::Vector3d texcoords; texcoords.X(_assimpMesh->mTextureCoords[uvIdx][vertexIdx].x); texcoords.Y(_assimpMesh->mTextureCoords[uvIdx][vertexIdx].y); - // TODO(luca) why do we need 1.0 - Y? - subMesh.AddTexCoordBySet(texcoords.X(), 1.0 - texcoords.Y(), uvIdx); + subMesh.AddTexCoordBySet(texcoords.X(), texcoords.Y(), uvIdx); ++uvIdx; } } @@ -618,6 +617,7 @@ Mesh *AssimpLoader::Load(const std::string &_filename) aiProcess_JoinIdenticalVertices | aiProcess_RemoveRedundantMaterials | aiProcess_SortByPType | + aiProcess_FlipUVs | #ifndef GZ_ASSIMP_PRE_5_2_0 aiProcess_PopulateArmatureData | #endif diff --git a/graphics/src/MeshManager.cc b/graphics/src/MeshManager.cc index 085dbb62..d92657da 100644 --- a/graphics/src/MeshManager.cc +++ b/graphics/src/MeshManager.cc @@ -111,7 +111,6 @@ MeshManager::MeshManager() this->dataPtr->fileExtensions.insert("gltf"); this->dataPtr->fileExtensions.insert("glb"); this->dataPtr->fileExtensions.insert("fbx"); - } //////////////////////////////////////////////////