jdolan / quetoo

Quetoo ("Q2") is a free first person shooter based on id Tech2. GPL v2 license.
http://quetoo.org
204 stars 28 forks source link

See-through sides of some bmodels #618

Closed Paril closed 3 years ago

Paril commented 3 years ago

This decal also disappears if you're under the water way below. Both issues do not occur with r_depth_pass 0.

jdolan-chwy commented 3 years ago

Blended draw elements are drawn after all opaque ones (across all inline models, including world). SURF_DECAL might be disabling depth test, and that would explain what you're seeing here.

Paril commented 3 years ago

I'm not sure if this decal in particular is SURF_ALPHA_TEST or not, that's the only one that actually enables depthmask during draw elements. Again too this only occurs with depth pass enabled.

jdolan commented 3 years ago

It's not SURF_ALPHA_TEST. It's SURF_BLEND_100 | SURF_DECAL. Decals are excluded from R_BlendDepthForPoint but are still back-to-front sorted so that e.g. even decals on glass will work correctly. So the state leak here might have nothing to do with this decal, but it might just be manifesting on it.

jdolan commented 3 years ago

Okay, so.. been looking into this. There are a few things going on. I've found and fixed a state leak with materials stages on blended elements (the water on Tokays is blend and also has stages). I've also noticed that this particular inline model has SURF_ALPHA_TEST elements: the "holes" where the cable goes through are actually 1u thick "decal" type faces with alpha test. They weren't even showing up in-game. I've fixed that, but they're killing the faces behind them:

quetoo026

jdolan commented 3 years ago

This is all fixed up now. The "cable holes" were killing the faces behind them because the .map had CONTENTS_SOLID explicitly set on some of the faces, rather than letting them auto-set to CONTENTS_WINDOW by quemap. I'll make sure to re-fix that when I absorb @Panjoo's updated .map files.

quetoo028