Fix the fragment shader to work with any background color

There now some dither to avoid banding in the gradients.
This commit is contained in:
luisangelsm
2026-01-19 19:23:57 +01:00
parent 41b02725d7
commit 720d58533c
6 changed files with 47 additions and 27 deletions

View File

@ -37,7 +37,7 @@ void YACReaderComicFlow3D::updateImageData()
// Create QRhiTexture from the loaded image
if (m_rhi) {
QRhiTexture *texture = m_rhi->newTexture(QRhiTexture::BGRA8, img.size(), 1, QRhiTexture::MipMapped | QRhiTexture::UsedWithGenerateMips);
QRhiTexture *texture = m_rhi->newTexture(QRhiTexture::RGBA8, img.size(), 1, QRhiTexture::MipMapped | QRhiTexture::UsedWithGenerateMips);
if (texture->create()) {
PendingTextureUpload upload;
@ -168,7 +168,7 @@ QImage ImageLoader3D::loadImage(const QString &fileName)
break;
}
return image;
return image.convertToFormat(QImage::Format_RGBA8888);
}
ImageLoader3D::ImageLoader3D(YACReaderFlow3D *flow)