diff --git a/libraries/baking/src/TextureBaker.cpp b/libraries/baking/src/TextureBaker.cpp index 60cca77bda..bed0e9a40b 100644 --- a/libraries/baking/src/TextureBaker.cpp +++ b/libraries/baking/src/TextureBaker.cpp @@ -131,7 +131,14 @@ void TextureBaker::handleTextureNetworkReply() { void TextureBaker::processTexture() { // the baked textures need to have the source hash added for cache checks in Interface // so we add that to the processed texture before handling it off to be serialized - auto hashData = QCryptographicHash::hash(_originalTexture, QCryptographicHash::Md5); + QCryptographicHash hasher(QCryptographicHash::Md5); + hasher.addData(_originalTexture); + // An ambient texture is built with the same pixel data as sky texture but its Mip Maps are different + // so we mustn't use one instead of the other. + if (_textureType == image::TextureUsage::AMBIENT_TEXTURE) { + hasher.addData((const char*)&_textureType, sizeof(_textureType)); + } + auto hashData = hasher.result(); std::string hash = hashData.toHex().toStdString(); TextureMeta meta;