qbism/q2tools-220

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

Closed this issue · 13 comments

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

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.

This is what's available in TB:
image
image

and this is NetRadiant Custom:
image

@Paril What do you think?

qbism commented

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.

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

Here's regular q2pro left to right-

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

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

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/

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

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

qbism commented

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

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

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

qbism commented

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

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.