mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 23:27:34 +02:00
Ambient map has different hash than sky map to prevent using one instead of the other, even if they are using the same source texture.
This commit is contained in:
parent
e3355cd6a4
commit
50fecf5e01
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue