]> git.rm.cloudns.org Git - xonotic/xonotic-maps.pk3dir.git/commitdiff
DarkPlaces does not support alphaFunc GT0 and uses GE128 instead 140/head
authorThomas Debesse <dev@illwieckz.net>
Thu, 9 Jan 2020 09:27:03 +0000 (10:27 +0100)
committerThomas Debesse <dev@illwieckz.net>
Thu, 9 Jan 2020 09:42:20 +0000 (10:42 +0100)
By making this change, we ensure the materials look the same on DarkPlaces and
other engines, even in the case it's wrong on DarkPlaces because Xonotic mappers
now expect the wrong behavior.

Darkplaces only supports one alphaFunc operation, it only reads the alphaFunc
keyword and does not read the function name:

https://gitlab.com/xonotic/darkplaces/blob/324a5329d33ef90df59e6488abce6433d90ac04c/model_shared.c#L1875-1876

It then uses the GE128 operator unconditionally:

https://gitlab.com/xonotic/darkplaces/blob/0ea8f691e05ea968bb8940942197fa627966ff99/render.h#L95

People may silently introduce regressions in their textures designed for GT0
by compressing them using a lossy picture format like Jpg.

Xonotic texture known to trigger this bug (in xonotic-maps):

    models/desertfactory/textures/shaders/grass01.jpg

Using GE128 hides Jpeg artifacts while it's possible a TGA version worked with GT0.

Xonotic texture that may benefit from GT0 if supported (in xonotic-maps):

    models/desertfactory/textures/shaders/sign_ladder_dirty.jpg

By storing this texture in lossless format and making sure the frame is pure
black and the ladder is a bit less black than pure black, only the frame would
be transparent.

Unfortunately, after years of GE128 usagen displaying the texture with GT0
operation would be a regression.

Note: I also renamed some `alphafunc` to `alphaFunc` even if it was already GE128.

scripts/ex2x.shader
scripts/exx.shader
scripts/logos.shader
scripts/map_catharsis.shader
scripts/map_warfare.shader
scripts/model_desertfactory.shader
scripts/model_tree.shader
scripts/phillipk2x.shader

index 5ca03aaccc318aba0c600e5fa9ee75a4981f69ef..0e4d218702aff0c9c52226d6151bca606b027e2a 100644 (file)
@@ -57,7 +57,7 @@ textures/ex2x/base-chainlink
 
        {
                map textures/ex2x/base/base_chainlink.tga
-               alphafunc GE128
+               alphaFunc GE128
        }
        {
                map $lightmap
index 2c42daa80131c83697f6efd9e999c93ede509133..8e6903e6b2ab58d180fc1414f7d9323c8d7fb8a9 100644 (file)
@@ -420,7 +420,7 @@ textures/exx/floor-grate01
 
        {
                map textures/exx/floor/floor_grate01.tga
-            alphaFunc GT0
+            alphaFunc GE128
        }
        {
                map $lightmap
@@ -444,7 +444,7 @@ textures/exx/floor-grate01-cull
 
        {
                map textures/exx/floor/floor_grate01.tga
-            alphaFunc GT0
+            alphaFunc GE128
        }
        {
                map $lightmap
@@ -469,7 +469,7 @@ textures/exx/floor-grate02
 
        {
                map textures/exx/floor/floor_grate02.tga
-            alphaFunc GT0
+            alphaFunc GE128
        }
        {
                map $lightmap
@@ -493,7 +493,7 @@ textures/exx/floor-grate02-cull
 
        {
                map textures/exx/floor/floor_grate02.tga
-            alphaFunc GT0
+            alphaFunc GE128
        }
        {
                map $lightmap
@@ -518,7 +518,7 @@ textures/exx/floor-grate03
 
        {
                map textures/exx/floor/floor_grate03.tga
-            alphaFunc GT0
+            alphaFunc GE128
        }
        {
                map $lightmap
@@ -542,7 +542,7 @@ textures/exx/floor-grate03-cull
 
        {
                map textures/exx/floor/floor_grate03.tga
-            alphaFunc GT0
+            alphaFunc GE128
        }
        {
                map $lightmap
@@ -567,7 +567,7 @@ textures/exx/floor-grate04
 
        {
                map textures/exx/floor/floor_grate04.tga
-            alphaFunc GT0
+            alphaFunc GE128
        }
        {
                map $lightmap
@@ -592,7 +592,7 @@ textures/exx/floor-grate04-cull
 
        {
                map textures/exx/floor/floor_grate04.tga
-            alphaFunc GT0
+            alphaFunc GE128
        }
        {
                map $lightmap
@@ -1035,7 +1035,7 @@ textures/exx/panel-grate01
        nomipmaps
        {
                map textures/exx/panel/panel_grate01.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen vertex
        }
        {
@@ -1063,7 +1063,7 @@ textures/exx/panel-grate01-cull
        nomipmaps
        {
                map textures/exx/panel/panel_grate01.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen vertex
        }
        {
index b0e72c2254a20eaaaec552c45832030ac47b1640..07cd7b36d70eee9d93a7796d47873b64fef89086 100644 (file)
@@ -13,7 +13,7 @@ textures/logos/logo01_black
 
        {
                map textures/logos/logo01/logo01_black.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -34,7 +34,7 @@ textures/logos/logo01_blue
        {
                map textures/logos/logo01/logo01_blue.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -55,7 +55,7 @@ textures/logos/logo01_blue_glowy
        {
                map textures/logos/logo01/logo01_blueg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -76,7 +76,7 @@ textures/logos/logo01_cyan
        {
                map textures/logos/logo01/logo01_cyan.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -97,7 +97,7 @@ textures/logos/logo01_cyan_glowy
        {
                map textures/logos/logo01/logo01_cyang.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -118,7 +118,7 @@ textures/logos/logo01_red
        {
                map textures/logos/logo01/logo01_red.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -139,7 +139,7 @@ textures/logos/logo01_red_glowy
        {
                map textures/logos/logo01/logo01_redg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -160,7 +160,7 @@ textures/logos/logo01_green
        {
                map textures/logos/logo01/logo01_green.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -181,7 +181,7 @@ textures/logos/logo01_green_glowy
        {
                map textures/logos/logo01/logo01_greeng.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -202,7 +202,7 @@ textures/logos/logo01_purple
        {
                map textures/logos/logo01/logo01_purple.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -223,7 +223,7 @@ textures/logos/logo01_purple_glowy
        {
                map textures/logos/logo01/logo01_purpleg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -243,7 +243,7 @@ textures/logos/logo01_white
 
        {
                map textures/logos/logo01/logo01_white.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -264,7 +264,7 @@ textures/logos/logo01_yellow
        {
                map textures/logos/logo01/logo01_yellow.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -285,7 +285,7 @@ textures/logos/logo01_yellow_glowy
        {
                map textures/logos/logo01/logo01_yellowg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -306,7 +306,7 @@ textures/logos/logo02_red
        {
                map textures/logos/logo02/logo02_red.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -327,7 +327,7 @@ textures/logos/logo02_red_glowy
        {
                map textures/logos/logo02/logo02_redg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -347,7 +347,7 @@ textures/logos/logo02_black
 
        {
                map textures/logos/logo02/logo02_black.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -368,7 +368,7 @@ textures/logos/logo02_blue
        {
                map textures/logos/logo02/logo02_blue.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -389,7 +389,7 @@ textures/logos/logo02_blue_glowy
        {
                map textures/logos/logo02/logo02_blueg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -410,7 +410,7 @@ textures/logos/logo02_cyan
        {
                map textures/logos/logo02/logo02_cyan.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -431,7 +431,7 @@ textures/logos/logo02_cyan_glowy
        {
                map textures/logos/logo02/logo02_cyang.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -452,7 +452,7 @@ textures/logos/logo02_green
        {
                map textures/logos/logo02/logo02_green.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -473,7 +473,7 @@ textures/logos/logo02_green_glowy
        {
                map textures/logos/logo02/logo02_greeng.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -494,7 +494,7 @@ textures/logos/logo02_purple
        {
                map textures/logos/logo02/logo02_purple.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -515,7 +515,7 @@ textures/logos/logo02_purple_glowy
        {
                map textures/logos/logo02/logo02_purpleg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -535,7 +535,7 @@ textures/logos/logo02_white
 
        {
                map textures/logos/logo02/logo02_white.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -556,7 +556,7 @@ textures/logos/logo02_yellow
        {
                map textures/logos/logo02/logo02_yellow.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -577,7 +577,7 @@ textures/logos/logo02_yellow_glowy
        {
                map textures/logos/logo02/logo02_yellowg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -597,7 +597,7 @@ textures/logos/logo03_black
 
        {
                map textures/logos/logo03/logo03_black.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -618,7 +618,7 @@ textures/logos/logo03_blue
        {
                map textures/logos/logo03/logo03_blue.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -639,7 +639,7 @@ textures/logos/logo03_blue_glowy
        {
                map textures/logos/logo03/logo03_blueg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -660,7 +660,7 @@ textures/logos/logo03_cyan
        {
                map textures/logos/logo03/logo03_cyan.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -681,7 +681,7 @@ textures/logos/logo03_cyan_glowy
        {
                map textures/logos/logo03/logo03_cyang.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -702,7 +702,7 @@ textures/logos/logo03_green
        {
                map textures/logos/logo03/logo03_green.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -723,7 +723,7 @@ textures/logos/logo03_green_glowy
        {
                map textures/logos/logo03/logo03_greeng.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -744,7 +744,7 @@ textures/logos/logo03_purple
        {
                map textures/logos/logo03/logo03_purple.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -765,7 +765,7 @@ textures/logos/logo03_purple_glowy
        {
                map textures/logos/logo03/logo03_purpleg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -786,7 +786,7 @@ textures/logos/logo03_red
        {
                map textures/logos/logo03/logo03_red.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -807,7 +807,7 @@ textures/logos/logo03_red_glowy
        {
                map textures/logos/logo03/logo03_redg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -827,7 +827,7 @@ textures/logos/logo03_white
 
        {
                map textures/logos/logo03/logo03_white.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -848,7 +848,7 @@ textures/logos/logo03_yellow
        {
                map textures/logos/logo03/logo03_yellow.tga
                blendFunc filter
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
@@ -869,7 +869,7 @@ textures/logos/logo03_yellow_glowy
        {
                map textures/logos/logo03/logo03_yellowg.tga
                blendFunc GL_SRC_ALPHA GL_ONE
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen identity
        }
 }
index f05f609bcab225287a8353f550fc4cf979cf2784..6d5be89423126d525eda5c19ab5c0f2b109e208a 100644 (file)
@@ -90,7 +90,7 @@ textures/map_catharsis/chain
        {
                map textures/map_catharsis/chain.tga
                tcMod scale 2 2
-               alphafunc GE128
+               alphaFunc GE128
        }
        {
                map $lightmap
index bf16eba4f08deeeb5b4bb68b941f7f31875d13c8..e84971e05978ef2373313be83cf2e91daad37134 100644 (file)
@@ -57,7 +57,7 @@ textures/map_warfare/floor_panel
     polygonoffset
     {
         map textures/map_warfare/floor_panel
-        alphafunc GT0
+        alphaFunc GE128
     }
     {
         map $lightmap
@@ -100,7 +100,7 @@ textures/map_warfare/cactus
     cull none
     {
         map textures/map_warfare/cactus
-        alphafunc GT0
+        alphaFunc GE128
     }
     {
         map $lightmap
index 14989e53a5498375cd3f096f6f52fa0885561eab..13682f9a3f4991b398a9f8b3310ac9122f6d1c3d 100644 (file)
@@ -51,7 +51,7 @@ models/desertfactory/textures/shaders/grates01
        surfaceparm nomarks
        {
                map models/desertfactory/textures/metal/grates01.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -65,7 +65,7 @@ models/desertfactory/textures/shaders/grass01
        cull none
        {
                map models/desertfactory/textures/misc/grass01.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -79,7 +79,7 @@ models/desertfactory/textures/shaders/grass02
        cull none
        {
                map models/desertfactory/textures/misc/grass02.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -93,7 +93,7 @@ models/desertfactory/textures/shaders/vines01
        cull none
        {
                map models/desertfactory/textures/misc/vines01.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -107,7 +107,7 @@ models/desertfactory/textures/shaders/sign_ladder_dirty
        qer_editorimage models/desertfactory/textures/shaders/sign_ladder_dirty.tga
        {
                map models/desertfactory/textures/signs/ladder_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
index 5aff9ff39654849e1cf9f5bee807aebc8c529672..1aa00cac3fe7559bd50a6e14d45dae464a8711f7 100644 (file)
@@ -11,7 +11,7 @@ models/grass02
        deformVertexes wave 128 sin 0 1 0 0.1 
        {
                map models/grass02.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
index c86f4bac76fef9217826fe20c1851a9709e18454..f8e3ab7f478666edf7c39756c579498f7de8233d 100644 (file)
@@ -683,7 +683,7 @@ textures/phillipk2x/floor-pk02_floor07-trans
     cull none
     {
         map textures/phillipk2x/floor/pk02_floor07
-        alphafunc GT0
+        alphaFunc GE128
     }
     {
         map $lightmap
@@ -805,7 +805,7 @@ textures/phillipk2x/floor-pk02_floor10-trans
     cull none
     {
         map textures/phillipk2x/floor/pk02_floor10
-        alphafunc GT0
+        alphaFunc GE128
     }
     {
         map $lightmap
@@ -911,7 +911,7 @@ textures/phillipk2x/floor-pk02_floor13a-trans
     cull none
     {
         map textures/phillipk2x/floor/pk02_floor13a
-        alphafunc GT0
+        alphaFunc GE128
     }
     {
         map $lightmap
@@ -957,7 +957,7 @@ textures/phillipk2x/floor-pk02_floor13b-trans
     cull none
     {
         map textures/phillipk2x/floor/pk02_floor13b
-        alphafunc GT0
+        alphaFunc GE128
     }
     {
         map $lightmap