]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix most Q3 & QL glow maps
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 25 May 2020 13:51:59 +0000 (13:51 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 25 May 2020 13:51:59 +0000 (13:51 +0000)
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

gl_rmain.c

index b18db24457b34831bfb6a9aa5013282041ac5a5f..2c6b96b2a1043181c45b49ce2464b633269ae360 100644 (file)
@@ -2399,9 +2399,10 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch
        }
 
        // _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