So let's get rid of it.
Step 1
Find the #define for DIST_EPSILON in world.c and move it to quakedef.h
Step 2
Open gl_rsurf.c, find R_DrawBrushModel, and add these lines before the call to R_RotateForEntity:
Code: Select all
// hack the origin to prevent bmodel z-fighting
e->origin[0] -= DIST_EPSILON;
e->origin[1] -= DIST_EPSILON;
e->origin[2] -= DIST_EPSILON;
Same file, same function, add these lines after the call to R_RotateForEntity:
Code: Select all
// un-hack the origin
e->origin[0] += DIST_EPSILON;
e->origin[1] += DIST_EPSILON;
e->origin[2] += DIST_EPSILON;
No more brush model Z-fighting.
OK, it's the cheapest, nastiest hack in the universe, but it works. You do get a tiny glitch in that there's a very very small see-through crack around some edges of some doors, but if that bothers you, you can make your own define for this purpose (or even cvar-ize it) (I don't recommend messing with the value of DIST_EPSILON).