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

Support for mist contents to be single-sided - possible ? #18

Closed motorsep closed 2 years ago

motorsep commented 2 years ago

With all the improvements that were added to these tools (and Q2RTX engine fork) we finally have first run of AD Sepulcher:

https://www.youtube.com/watch?v=uQ53oRGxJJ4

As you can see, the brushes with vines texture don't really look proper because in Q2 (from what I understand) brushes with mist content are always double sided.

Would it be possible to add a contents (or surface?) flag, so that when 4bsp compiler finds mist content with such additional flag, it will make such brush face to be single-sided (or whole brush rather).

Thanks

qbism commented 2 years ago

Instead of one of the unused flags, combo contents flags like AUX + MIST may be more supported by map editors. AUX is available in Trenchbroom and probably other editors but is not used AFAIK. I've started looking into it. As we found with SKIP, the compiler will override contents flags based on certain face flags.

motorsep commented 2 years ago

This is what's available in TB: image image

and this is NetRadiant Custom: image

@Paril What do you think?

qbism commented 2 years ago

Please verify this is resolved in latest commit. Add AUX content flag to turn off backface rendering of MIST. This turned out to be the simplest in terms of code and is compatible with current TrenchBroom.

motorsep commented 2 years ago

Unfortunately in RTX it comes out double sided because of the shader. The one on the right was suppose to be AUX + MIST. When testing in GL renderer (still Q2RTX engine) - both are single sided :/

image

quake055

quake054

qbism commented 2 years ago

Here's regular q2pro left to right-

  1. no content flags (set to CONTENTS_WINDOW by bsp)
  2. AUX+MIST
  3. MIST pic020
motorsep commented 2 years ago

This is in GL mode:

https://www.youtube.com/watch?v=l6-RVrZRYYg

This is the map/bsp (below). Please see if you get different results (or maybe I am doing something wrong): q2_q1start.zip

Q2RTX can run in GL mode, no need for RTX hardware.

qbism commented 2 years ago

Would not suggest mixing clip texture + anything else. Rather, use a trans texture on the other sides (solid color 255).
http://maps.rcmd.org/tutorials/q2_palette_textures/trans.wal See explanation here: http://maps.rcmd.org/tutorials/q2_palette_textures/

motorsep commented 2 years ago

Alright, I tried it again and it still fails. 4vis is butchering it. I had to use q2pro instead of q2rtx to be able to load unvis'ed BSP:

4bsp, no 4vis: https://www.youtube.com/watch?v=_sAFu2SnUd4

4bsp + 4vis: https://www.youtube.com/watch?v=PWZFTgdUoXg

So it kinda works, but not 100%, so to speak :)

qbism commented 2 years ago

OK, I'll look at it again and post a start.map + .bsp

qbism commented 2 years ago

In the video, guessing there's still a clip texture on the bottom. Stock q2pro needs a small modification to get non-translucent fence textures. This will kick in if both TRANS33 and TRANS66 are flagged. Or else use SURF_TRANS66 only and it will be 66% transparent.

static uint32_t color_for_surface(mface_t *surf) { if ((surf->drawflags & SURF_TRANS33) && (surf->drawflags & SURF_TRANS66)) //qb: so alphamask is not transparent return U32_WHITE;

if (surf->drawflags & SURF_TRANS33)
    return gl_static.inverse_intensity_33;

if (surf->drawflags & SURF_TRANS66)
    return gl_static.inverse_intensity_66;

if (surf->drawflags & SURF_WARP)
    return gl_static.inverse_intensity_100;

return U32_WHITE;

}

In the attached map, left block is MIST, center is unflagged (solid), and right is AUX+MIST

start-test.zip

quake000

motorsep commented 2 years ago

In the video, guessing there's still a clip texture on the bottom

No, it's the one you provided (trans.wal)

qbism commented 2 years ago

If any issues remain, please submit an example .map and .bsp

motorsep commented 2 years ago

You didn't vis your test map though.. The issue isn't with 4bsp not supporting this case, it's 4vis messing it up. And since bsp needs to be vis'ed, you get this issue I've been illustrating.