]> git.rm.cloudns.org Git - xonotic/xonotic-nexcompat.pk3dir.git/commitdiff
DarkPlaces does not support alphaFunc GT0 and uses GE128 instead illwieckz/ge128
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.

13 files changed:
scripts/nexcompat-desertfactory.shader
scripts/nexcompat-eX.shader
scripts/nexcompat-evil1_grates.shader
scripts/nexcompat-evil5.shader
scripts/nexcompat-evil6_floors.shader
scripts/nexcompat-evil6_support.shader
scripts/nexcompat-evil6_walls.shader
scripts/nexcompat-kaznexctf2.shader
scripts/nexcompat-mflag.shader
scripts/nexcompat-reaper.shader
scripts/nexcompat-strength.shader
scripts/nexcompat-trak4.shader
scripts/nexcompat-tree.shader

index 3515923ccf7dbc618538b10937854c1d3e771b05..7120d4c783895a258d6ea7d24b37329325157328 100644 (file)
@@ -83,7 +83,7 @@ textures/desertfactory_shaders/grates01
        surfaceparm nomarks
        {
                map textures/desertfactory_metal/grates01.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -97,7 +97,7 @@ textures/desertfactory_shaders/grass01
        cull none
        {
                map textures/desertfactory_misc/grass01.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -111,7 +111,7 @@ textures/desertfactory_shaders/grass02
        cull none
        {
                map textures/desertfactory_misc/grass02.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -125,7 +125,7 @@ textures/desertfactory_shaders/vines01
        cull none
        {
                map textures/desertfactory_misc/vines01.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -138,7 +138,7 @@ textures/desertfactory_shaders/sign_above_clean
        qer_editorimage textures/desertfactory_shaders/sign_above_clean.jpg
        {
                map textures/desertfactory_signs/above_clean.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -148,7 +148,7 @@ textures/desertfactory_shaders/sign_explosion_clean
        qer_editorimage textures/desertfactory_shaders/sign_explosion_clean.jpg
        {
                map textures/desertfactory_signs/explosion_clean.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -158,7 +158,7 @@ textures/desertfactory_shaders/sign_ladder_clean
        qer_editorimage textures/desertfactory_shaders/sign_ladder_clean.tga
        {
                map textures/desertfactory_signs/ladder_clean.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -168,7 +168,7 @@ textures/desertfactory_shaders/sign_radioactive_clean
        qer_editorimage textures/desertfactory_shaders/sign_radioactive_clean.tga
        {
                map textures/desertfactory_signs/radioactive_clean.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -178,7 +178,7 @@ textures/desertfactory_shaders/sign_shock_clean
        qer_editorimage textures/desertfactory_shaders/sign_shock_clean.tga
        {
                map textures/desertfactory_signs/shock_clean.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -188,7 +188,7 @@ textures/desertfactory_shaders/sign_toxic_clean
        qer_editorimage textures/desertfactory_shaders/sign_toxic_clean.tga
        {
                map textures/desertfactory_signs/toxic_clean.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -198,7 +198,7 @@ textures/desertfactory_shaders/sign_warning_clean
        qer_editorimage textures/desertfactory_shaders/sign_warning_clean.tga
        {
                map textures/desertfactory_signs/warning_clean.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -208,7 +208,7 @@ textures/desertfactory_shaders/sign_wires_clean
        qer_editorimage textures/desertfactory_shaders/sign_wires_clean.tga
        {
                map textures/desertfactory_signs/wires_clean.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -218,7 +218,7 @@ textures/desertfactory_shaders/sign_above_dirty
        qer_editorimage textures/desertfactory_shaders/sign_above_dirty.tga
        {
                map textures/desertfactory_signs/above_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -228,7 +228,7 @@ textures/desertfactory_shaders/sign_explosion_dirty
        qer_editorimage textures/desertfactory_shaders/sign_explosion_dirty.tga
        {
                map textures/desertfactory_signs/explosion_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -238,7 +238,7 @@ textures/desertfactory_shaders/sign_ladder_dirty
        qer_editorimage textures/desertfactory_shaders/sign_ladder_dirty.tga
        {
                map textures/desertfactory_signs/ladder_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -248,7 +248,7 @@ textures/desertfactory_shaders/sign_radioactive_dirty
        qer_editorimage textures/desertfactory_shaders/sign_radioactive_dirty.tga
        {
                map textures/desertfactory_signs/radioactive_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -258,7 +258,7 @@ textures/desertfactory_shaders/sign_shock_dirty
        qer_editorimage textures/desertfactory_shaders/sign_shock_dirty.tga
        {
                map textures/desertfactory_signs/shock_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -268,7 +268,7 @@ textures/desertfactory_shaders/sign_toxic_dirty
        qer_editorimage textures/desertfactory_shaders/sign_toxic_dirty.tga
        {
                map textures/desertfactory_signs/toxic_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -278,7 +278,7 @@ textures/desertfactory_shaders/sign_warning_dirty
        qer_editorimage textures/desertfactory_shaders/sign_warning_dirty.tga
        {
                map textures/desertfactory_signs/warning_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -288,7 +288,7 @@ textures/desertfactory_shaders/sign_wires_dirty
        qer_editorimage textures/desertfactory_shaders/sign_wires_dirty.tga
        {
                map textures/desertfactory_signs/wires_dirty.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
index c55041c035c2eacc1f0de18734165d0c671faeb8..79b1e866d52b5d93256fa98547b6d74f133fe938 100644 (file)
@@ -154,7 +154,7 @@ textures/eX/eX_floor_grate03
                map textures/exx/floor/floor_grate01.tga
                rgbGen identity
                depthWrite
-               alphafunc GT0
+               alphaFunc GE128
        }
        {
                map $lightmap
index 6a86f7adc02b47301afc5c2a26eb785df3a024c5..b02caa3d76a98e2d4b1dde908cd83851354118c4 100644 (file)
@@ -10,7 +10,7 @@ textures/evil1_grates/flrgrt_h
        {
                map textures/evil1_grates/flrgrt_h.tga
                //depthWrite
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen vertex
        }
 }
index d48ebd78d9aa209031e5eeba0c04de1976c6a8ff..baa661d005f292aa0bbe5a06257db56df4944fcc 100644 (file)
@@ -37,12 +37,12 @@ textures/evil5_floor/tekconfllr_fx
        {
                map textures/evil5_floor/tekconfllr_fx.tga
                tcmod scroll 0 .9
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
                map textures/evil5_floor/tekconfllr.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
index d21be28ff328bba121f9a5cecfa78bdbf42bceed..06c792840d3573989acce2226ae727b028a601ca 100644 (file)
@@ -7,7 +7,7 @@ textures/evil6_floors/e6bsegrtflr128_s
        cull none
        {
                map textures/evil6_floors/e6bsegrtflr128.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -26,7 +26,7 @@ textures/evil6_floors/e6bsegrtflr256_s
        cull none
        {
                map textures/evil6_floors/e6bsegrtflr256.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -45,7 +45,7 @@ textures/evil6_floors/e6grate_flr_b_s
        cull none
        {
                map textures/evil6_floors/e6grate_flr_b.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -64,7 +64,7 @@ textures/evil6_floors/e6grate_flr_s
        cull none
        {
                map textures/evil6_floors/e6grate_flr.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -83,7 +83,7 @@ textures/evil6_floors/e6grtfloorceil_s
        cull none
        {
                map textures/evil6_floors/e6grtfloorceil.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -102,7 +102,7 @@ textures/evil6_floors/e6grate2_flr_s
        cull none
        {
                map textures/evil6_floors/e6grate2_flr.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -121,7 +121,7 @@ textures/evil6_floors/e6grate2_flr_b_s
        cull none
        {
                map textures/evil6_floors/e6grate2_flr_b.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -301,7 +301,7 @@ textures/evil6_floors/e6xgratebasic_b_s
        cull none
        {
                map textures/evil6_floors/e6xgratebasic_b.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -320,7 +320,7 @@ textures/evil6_floors/e6xgratebasic_s
        cull none
        {
                map textures/evil6_floors/e6xgratebasic.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
index aa15961d2e1118ae1faa8a0080c153512d994dfa..c15c883c914cf5c53dc6db6f0f22d9d93b41f8fa 100644 (file)
@@ -7,7 +7,7 @@ textures/evil6_support/e6h_support_s
        cull none
        {
                map textures/evil6_support/e6h_support.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -26,7 +26,7 @@ textures/evil6_support/e6holestrip_s
        cull none
        {
                map textures/evil6_support/e6holestrip.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -81,7 +81,7 @@ textures/evil6_support/e6x_supprt_s
        cull none
        {
                map textures/evil6_support/e6x_supprt.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -100,7 +100,7 @@ textures/evil6_support/e6xrst_supprt_s
        cull none
        {
                map textures/evil6_support/e6xrst_supprt.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
index 59dd9e21e0dcbb7354a0b6f6e9323df2c8a3f38f..350aea330e3e9627a4d4e6f4fa82ad4f20fffe40 100644 (file)
@@ -11,7 +11,7 @@ textures/evil6_walls/e6girdergrate_s
        cull none
        {
                map textures/evil6_walls/e6girdergrate.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -32,7 +32,7 @@ textures/evil6_walls/e6girdergrate2b_s
        cull none
        {
                map textures/evil6_walls/e6girdergrate2b.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -53,7 +53,7 @@ textures/evil6_walls/e6girdersupport_s
        cull none
        {
                map textures/evil6_walls/e6girdersupport.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
@@ -74,7 +74,7 @@ textures/evil6_walls/e6indsdoor_s
        cull none
        {
                map textures/evil6_walls/e6indsdoor.tga
-               alphafunc GE128
+               alphaFunc GE128
                depthwrite
        }
        {
index 7ff1c03c7cbbc2f23db77a5fd59376df10c4e492..c0af7730076704d08bab14e6714a502cd5bf0af6 100644 (file)
@@ -174,7 +174,7 @@ textures/kaznexctf2/grate3
        {
                map textures/kaznexctf2/grate3.tga
                //depthWrite
-               alphaFunc GT0
+               alphaFunc GE128
                rgbgen vertex
        }
 }
index bfa2f3e84d1fd9e881fd6d356d32c95dd3e4fe47..6c236f7321306f0afe98ae61d77a44a9f64b8f15 100644 (file)
@@ -5,7 +5,7 @@ mflagshader
        tessSize 32
        {
        map models/mflag/flag.tga
-       alphaFunc GT0
+       alphaFunc GE128
        rgbGen vertex
        }
        }
index ffeeac503b9093f889c09befeb8835c3e5e2266d..444f9bbf46550504fa49272ea41fba75749eb0cb 100644 (file)
@@ -98,7 +98,7 @@ textures/shad/shad
        surfaceparm trans
        {
                map *default
-               alphaFunc GT0
+               alphaFunc GE128
                alphagen const 0.0
        }
 }
index 67f6bbd2a4453e3d358f600f039aed355ffde9db..d8fe9605b5f107e2d85a1b23ae58111cb4380a32 100644 (file)
@@ -472,7 +472,7 @@ textures/evil6_walls/e6girdergrate2b-trans
                map textures/evil6_walls/e6girdergrate2b-trans.tga
                rgbGen identity
                depthWrite
-               alphafunc GE128
+               alphaFunc GE128
        }
        {
                map $lightmap
index 9492ed0d999301478edd686398946911f956fa78..724359dd8d2aa56806aa61c7909b74aae9c7a3de 100644 (file)
@@ -8,7 +8,7 @@ textures/trak4/northwing
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -28,7 +28,7 @@ textures/trak4/southwing
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -48,7 +48,7 @@ textures/trak4/help
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -67,7 +67,7 @@ textures/trak4/pills
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -87,7 +87,7 @@ textures/trak4/theater1
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -107,7 +107,7 @@ textures/trak4/theater2
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -127,7 +127,7 @@ textures/trak4/exit
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -147,7 +147,7 @@ textures/trak4/iso1
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -167,7 +167,7 @@ textures/trak4/iso2
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
@@ -187,7 +187,7 @@ textures/trak4/iso3
        surfaceparm nonsolid
        {
                map $lightmap
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen identity
        }
        {
index f047b4440205029fe1c640f2d0356269e131b245..2ae5cc1be210bd6f1f34a08a596356dccb46cb25 100644 (file)
@@ -11,7 +11,7 @@ leaves2
        deformVertexes wave 128 sin 0 1 0 0.4 
        {
                map textures/leaves2.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -29,7 +29,7 @@ cull none
        deformVertexes wave 128 sin 0 1 0 0.4 
        {
                map textures/leaves6.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -46,7 +46,7 @@ cull none
        deformVertexes wave 128 sin 0 1 0 0.2
        {
                map textures/grass.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -64,7 +64,7 @@ grass02
        deformVertexes wave 128 sin 0 1 0 0.1 
        {
                map textures/grass2.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }
@@ -81,7 +81,7 @@ cull none
        deformVertexes wave 128 sin 0 1 0 0.5
        {
                map textures/leaves7.tga
-               alphaFunc GT0
+               alphaFunc GE128
                rgbGen vertex
        }
 }