-
Notifications
You must be signed in to change notification settings - Fork 70
Need to have gl_polyoffset for movable walls #8
Comments
Have you tried setting What I want to do some time is implement better emulation of winquake by detecting fragments on the same plane without using the depth buffer, i.e. this idea but done in glsl: |
You right, z_fix is not a good decision, because I will see a 1-pixel dot border around secret doors. I hope, than reference_plane will be a better way to fix z-fighting. |
Is there something wrong with using polygon offset to fix z-fighting? I tried adding polygon offset to |
Hi, I don't know if there was a good reason Quakespasm wasn't using glPolygonOffset. The current gl_zfix code, which is just sliding the model slightly, fails in cases like these:
How does it look if you delete these bits:
and also use glPolygonOffset? |
I tried the following:
Polygon offset with factor 1 is only slightly better than |
I did more extensive testing and unfortunately it seems that there is no polygon offset factor value which reliably fixes z-fighting and does not reveal secrets. So I guess that's the reason why it was not used in the first place. |
For the general case, the following probably works better than anything else: Then use zfix_origin instead of e->origin when positioning the entity. That kills 99% of z-fighting problems stone dead with a gl_zfix of 1, without revealing secrets via cracks in the geometry, and also allows for some user-configurable tuning. The 1% it doesn't kill includes stubborn cases like the platform in e1m1, but I've never seen a z-fighting fix that kills that without introducing other, more serious problems elsewhere. For Quake I think at this stage it's probably OK to just state that ID1 maps are legacy content so it's OK to hard-code fixes for problem areas like this into the engine - in that case, detect model name "*15" in e1m1 (CRC the entities lump for a more robust match) and drop it's origin[2] by some epsilon. Polygon offset is problematical in that the spec for it includes an implementation-dependent constant term, so values that work on one GPU/driver won't necessarily work on another. It's not a magic fix for z-fighting. |
Please note that I have released the "Vanilla Quake Fixes" which contain a full set of z-fighting fixes for all ID1, SoA and DoE maps. The Quakespasm authors are welcome to take whatever they want from this pack to address these issues. |
Sometimes I see z-fighting, for example, here (e2m1): https://s8.hostingkartinok.com/uploads/images/2018/04/4861fdc3e227ebef4299cde3f36a6751.jpg
In original software-rendering WinQuake there is no problem, because original uses custom polygon culling without z-checking.
But with OpenGL we can't use same technique. I think, using negative polyoffset will fix this problem.
The text was updated successfully, but these errors were encountered: