by Spike » Wed Oct 08, 2014 11:54 pm
regarding z-fighting, you're probably best going with some sort of csg solution. try this:
shrink the submodel's bounding box by an epsilon.
find all non-solid world leafs within shrunken bbox.
if all were solid, then early out: the bbox is in a wall and nothing should be drawn (might be coplaner like the lift on e1m1).
create a bounding box of the open leafs you found, expand it by your original epsilon.
if this new bounding box is bigger than the original bbox, early out: its a closed door or something that's fully visible.
anything remaining is half-embedded within some geometry, but its side may be coplaner (e1m2 exit doors)
chop off any part of the geometry that extends outside this new bounding box. use clip planes or an equivelent (if you've got only one clip plane, you can just pick the most significant axis).
assuming everything is axial, the worst case is that any z-fighting is restricted to an epsilon along the coplaner side of the door. if you have confidence in your numerical precision, you can keep the epsilon small (using .3 fixed point for bsp geometry should give precise clipping without any zfighting at all, assuming you implement your clip plane in software). if you want non-axial then things become much more complex, and it will hopefully not be needed.
regarding fences, yes. compat was with halflife. tools not understanding { was somewhat of a surprise, but then tools not supporting spaces either is also an issue. a gl engine 'should' generally be able to support fences on world surfaces (again, more recent halflife maps use it) if only because its somewhat trivial to do so, but this requires qbsp support and isn't recommended for that reason alone (presumably similarity with water+watervis could be used here too). I don't think software rendering was a consideration at all. iirc, doesn't the software renderer merge submodels with world surfaces resulting in fences being a problem regardless of which bsp tree its in? all I really remember now is that software writes bsp colour and depth in separate passes which is a significant issue with alpha testing, so pulling it out into a separate pass from the opaque span rendering stuff is mandatory.
* warps with optional alpha blend
{ does not warp, and requires an alpha test to ensure that depth buffering happens properly. blending should only be needed if the entity its on has .alpha set. tools should be careful to enclose such texture names in quotes when saving maps with these textures, if possible (like they should if it has a //, /*, whitespace, or non-ascii char in the name, or arguably an open bracket).
.