Correctly swizzle the textures for ScreenSpaceImage types to allow for 8 bit grayscale images (closes #2330)

This commit is contained in:
Alexander Bock
2023-01-27 21:29:12 +01:00
parent eba9d000e6
commit 2fcf4617c9
2 changed files with 8 additions and 0 deletions

View File

@@ -124,6 +124,10 @@ void ScreenSpaceImageLocal::update() {
// image is only RGB
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if (texture->format() == ghoul::opengl::Texture::Format::Red) {
texture->setSwizzleMask({ GL_RED, GL_RED, GL_RED, GL_ONE });
}
texture->uploadTexture();
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
texture->purgeFromRAM();