qbism / q2tools-220

Quake 2 map compiler tools with v220 map support, automatic phong, enhancements, and fixes.
GNU General Public License v2.0
61 stars 20 forks source link

Incomplete SURF_ALPHATEST support #42

Closed SirYodaJedi closed 10 months ago

SirYodaJedi commented 10 months ago

Issue

The new Quake II remaster (henceforth Q2EX) supports an additional surface flag (bit 25, 0x02000000) for binary transparency, as seen in Q2Pro and KMQuake2. Like SURF_TRANS33 and SURF_TRANS66, this flag needs to be used in conjunction with CONTENTS_TRANSLUCENT in order to actually allow the contained brush to be seen through.

Solution

Q2Tools-220 currently automatically flags brushes with faces containing Trans33 and Trans66 as translucent, and this function could be extended to do the same for alphatest. I have drafted an example of what might need to be done. I don't really do much programming, so I don't completely understand everything involved, which is why this is currently labeled as incomplete and a draft. For example, there are some mentions of the translucency flags in src/patches.c that I have no clue what they do. I hope though, that as a draft, it explains well enough what should be necessary to accomplish what I am suggesting be added.

qbism commented 10 months ago

This is fairly straightforward to add but other support seems needed. Questions:

  1. Do any existing .map files compatible with q2pro support this? What compile tools for Q2EX exist?
  2. Does rad need changes? For example, when transparency mask is enabled (SURF_TRANS33 + SURF_TRANS66) rad basically passes half the light through.
  3. What do these maps look like in non-supporting engines?

I am going to close this request because it is incomplete and untested, but encourage adding as a feature request to issues where it may get more visibility if others have input.