TrenchBroom / TrenchBroom

Cross-Platform Level Editor
kristianduske.com/trenchbroom
GNU General Public License v3.0
2.05k stars 237 forks source link

GameConfig.cfg tags - add "alphatest" attrib #4551

Open SirYodaJedi opened 6 months ago

SirYodaJedi commented 6 months ago

In Quake II's gameconfig.cfg, the "attribs" field is used in the brushface tags definitions to make SURF_TRANS33 and SURF_TRANS66 appear as translucent when set, like so:

            {
                "name": "Transparent",
+               "attribs": [ "transparent" ],
                "match": "surfaceflag",
                "flags": [ "trans33", "trans66" ]
            },

I propose an additional "alphatest" option here; for 8-bit textures, it can work like { textures in a wad, and for true-color textures, use the actual alpha channel of the texture. This would be useful for Quake II mappers using modern engines, as the remaster has an additional surface flag for alpha-tested textures (which currently appear as opaque in TrenchBroom).

SirYodaJedi commented 6 months ago

As a related aside, it would also be nice if it could somehow extend to Half-Life's { textures as well; unlike Quake I, index 255 of { should only be transparent if rendermode != 0 (if it is 0, index 255 is still remapped to black, but the surface is opaque), but trenchbroom currently always shows { textures as transparent, regardless of gameconfig. Not sure if it's possible to match both a classname and a texture, though, much less make it conditional depending upon the value of a KV like model() does.