The quad-bug in the libraries

 

how it looks like

qb_hoverk.JPG (32994 bytes) the effect of quad-bug in hover
qb_tele1k.JPG (37538 bytes) the effect of quad-bug in my landscape-prog
it does not look that bad on a static screenshot, but in motion quads appear and disappear like crazy, same as in hover.

it makes you really crazy - doing everything to get best quality - and then there is such a mess on the screen :-(((

qb_tkorrk.JPG (35675 bytes) after correction

it took me a lot of trying and puzzle over this problem, to find a solution (which is in my opinion not really a solution - because it eats some(lot) of performance - look at HS GTE 126/167 -> 33% slower.

distance and angle between viewpoint and quad is calculated in real-time - to decide whether to set up a quad or 2 triangles


whats the problem in the LIBs regarding the handling of small-quads (in my opinion).


1) testing of visibility is not done with the traditional backface-culling method (looking at the angle between poly-normal and eye-to-vertex-vector), but, like Lewis Evans said, depends on the order of vertices on SCREEN.

If you look on top of a (visible) quad, and define the vertices following

2 3 0 1

2     3
* --- *
    /
  /
* --> *
0     1


after local-to-screen transformation and perspective conversion, the quad is handled as visible if the calculated SCREEN-coords (always looking on first 3 vertices) are still:

2:top-left 3:top-right 0:bottom-left

or:

1 0 3 2

2     3
* <-- *
    /
  /
* --- *
0     1

1:bottom-right 0:bottom-left 3:top-right

2) The problems with small quads crop up if SCREEN-coords fall together.
While it seems this is handled correct in triangles, it isn't in quads (it seems to be handled same as in triangles).

What I have seen: If 2 or 3 of the 3 SCREEN-coords (3 in triangles, first 3 in quads) fall together, it is handled as not-visible

for example:

2     3
* --- *
    /
  /
* --- *
0     1


SCREEN-coords 2 & 0 fall together

in Triangle:

two Triangles: 2 3 0 , 3 1 0
230 is not drawn, 310 is drawn -> OK, because 310 covers 230

in Quads:

one PLANAR-Quad: 2 3 0 1
230 is taken for visible-detection, and handled as not-visible, not drawn, although quad is visible


This quads-error appears not only on quads with not-reasonable angles. It appears also if you go into more "polygon-detail", and there are a lot of moiré-effects. Sometimes large areas are not drawn.


If I am wrong please let me know
Andreas Schrattenecker