From 5e5a0dc6a799dea2883254396414e6c3817f862f Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Mon, 25 May 2020 13:51:59 +0000 Subject: [PATCH] Fix most Q3 & QL glow maps From bones_was_here: "Very few glow maps work in unmodified Q3 maps as they do not use the _glow darkplaces convention, instead Q3 shaders specify the file name to use which is not currently supported. Fortunately there is a naming convention started in id software's pak0 and continued in QL and most 3rd party maps. It uses these forms: foo_texture.blend.ext and bar_texture_blend.ext It's not possible to fix 100% of glow maps without parsing Q3 shaders and using the specified file name, but this is a big improvement. This also fixes a few glow maps in nexcompat, which are originally Q3 textures that were not renamed to _glow." git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12573 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=9155ce9124c0d6f63a262291a95304e20e911243 --- gl_rmain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gl_rmain.c b/gl_rmain.c index 522cea20..7b2c7ac6 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3424,9 +3424,10 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole } // _luma is supported only for tenebrae compatibility + // _blend and .blend are supported only for Q3 & QL compatibility, this hack can be removed if better Q3 shader support is implemented // _glow is the preferred name mymiplevel = savemiplevel; - if (skinframe->glow == NULL && ((pixels = loadimagepixelsbgra(va(vabuf, sizeof(vabuf), "%s_glow", skinframe->basename), false, false, false, &mymiplevel)) || (pixels = loadimagepixelsbgra(va(vabuf, sizeof(vabuf), "%s_luma", skinframe->basename), false, false, false, &mymiplevel)))) + if (skinframe->glow == NULL && ((pixels = loadimagepixelsbgra(va(vabuf, sizeof(vabuf), "%s_glow", skinframe->basename), false, false, false, &mymiplevel)) || (pixels = loadimagepixelsbgra(va(vabuf, sizeof(vabuf), "%s.blend", skinframe->basename), false, false, false, &mymiplevel)) || (pixels = loadimagepixelsbgra(va(vabuf, sizeof(vabuf), "%s_blend", skinframe->basename), false, false, false, &mymiplevel)) || (pixels = loadimagepixelsbgra(va(vabuf, sizeof(vabuf), "%s_luma", skinframe->basename), false, false, false, &mymiplevel)))) { skinframe->glow = R_LoadTexture2D (r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_glow", skinframe->basename), image_width, image_height, pixels, vid.sRGB3D ? TEXTYPE_SRGB_BGRA : TEXTYPE_BGRA, textureflags & (gl_texturecompression_glow.integer && gl_texturecompression.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL); #ifndef USE_GLES2 -- 2.39.2