From 4f0677347f35e2ac19459f3304b4aaed17e7368d Mon Sep 17 00:00:00 2001 From: turanszkij Date: Wed, 4 Apr 2018 12:56:29 +0100 Subject: [PATCH] fixed obj loader not hashing material index correctly --- WickedEngine/wiLoader.cpp | 3 ++- WickedEngine/wiVersion.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WickedEngine/wiLoader.cpp b/WickedEngine/wiLoader.cpp index 3a1a72694..94c79f693 100644 --- a/WickedEngine/wiLoader.cpp +++ b/WickedEngine/wiLoader.cpp @@ -2901,8 +2901,9 @@ void Model::LoadFromDisk(const std::string& fileName, const std::string& identif hash{}(index.vertex_index), hash{}(index.normal_index), hash{}(index.texcoord_index), + hash{}(materialIndex), }; - size_t vertexHash = (hashes[0] ^ (hashes[1] << 1) >> 1) ^ (hashes[2] << 1); + size_t vertexHash = (((hashes[0] ^ (hashes[1] << 1) >> 1) ^ (hashes[2] << 1)) >> 1) ^ (hashes[3] << 1); if (uniqueVertices.count(vertexHash) == 0) { diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index 88a0ab0f1..71d443737 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wiVersion // minor features, major updates const int minor = 16; // minor bug fixes, alterations, refactors, updates - const int revision = 36; + const int revision = 37; long GetVersion()