Browse Source

Fix DXT1 textures which use 1 bit alpha-cutout.

Note that premultiplied alpha blending must be used with DXT1 alpha cutout textures if linear filtering is used, otherwise transparent black pixels will be blended with opaque non-black pixels resulting in dark fringes.
Alex Szpakowski 4 years ago
parent
commit
16ebaea390
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/graphics/opengl/OpenGL.cpp

+ 1 - 1
src/modules/graphics/opengl/OpenGL.cpp

@@ -1575,7 +1575,7 @@ OpenGL::TextureFormat OpenGL::convertPixelFormat(PixelFormat pixelformat, bool r
 		break;
 		break;
 
 
 	case PIXELFORMAT_DXT1:
 	case PIXELFORMAT_DXT1:
-		f.internalformat = isSRGB ? GL_COMPRESSED_SRGB_S3TC_DXT1_EXT : GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+		f.internalformat = isSRGB ? GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT : GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
 		break;
 		break;
 	case PIXELFORMAT_DXT3:
 	case PIXELFORMAT_DXT3:
 		f.internalformat = isSRGB ? GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT : GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
 		f.internalformat = isSRGB ? GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT : GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;