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

@ -40,7 +40,7 @@ void YACReaderPageFlow3D::updateImageData()
// Create QRhiTexture from the loaded image and queue the pixel upload
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()) {
// Queue the image upload so it happens together with other resource updates
@ -136,7 +136,7 @@ QImage ImageLoaderByteArray3D::loadImage(const QByteArray &raw)
break;
}
return image;
return image.convertToFormat(QImage::Format_RGBA8888);
}
ImageLoaderByteArray3D::ImageLoaderByteArray3D(YACReaderFlow3D *flow)