]> git.rm.cloudns.org Git - xonotic/xonotic-nexcompat.pk3dir.git/commit
DarkPlaces does not support alphaFunc GT0 and uses GE128 instead 2/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:37:59 +0000 (10:37 +0100)
commitc76355f15d01283cf0fee97e7f0e5c1bb74990ca
treeecec61cf79d21b449159397283f0fb592a13c5d7
parente0e9f99475626962eb2297e19597d1b2cd9e265f
DarkPlaces does not support alphaFunc GT0 and uses GE128 instead

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 GT128 hides Jpg 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 GT128 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