Merge pull request #11577 from samcake/orange

Fix the HDR generation of cube maps from equirect images (1x2)
This commit is contained in:
Sam Gateau 2017-10-11 17:12:27 -07:00 committed by GitHub
commit 7edb41b0ea

View file

@ -1202,10 +1202,6 @@ gpu::TexturePointer TextureUsage::processCubeTextureColorFromImage(const QImage&
formatGPU = HDR_FORMAT;
}
if (image.format() != QIMAGE_HDR_FORMAT) {
image = convertToHDRFormat(image, HDR_FORMAT);
}
// Find the layout of the cubemap in the 2D image
// Use the original image size since processSourceImage may have altered the size / aspect ratio
int foundLayout = CubeLayout::findLayout(srcImage.width(), srcImage.height());
@ -1233,6 +1229,13 @@ gpu::TexturePointer TextureUsage::processCubeTextureColorFromImage(const QImage&
faces.push_back(faceImage);
}
}
if (image.format() != QIMAGE_HDR_FORMAT) {
for (auto& face : faces) {
face = convertToHDRFormat(face, HDR_FORMAT);
}
}
} else {
qCDebug(imagelogging) << "Failed to find a known cube map layout from this image:" << QString(srcImageName.c_str());
return nullptr;