Here's why my tdfx v3 doesn't show fog any more[1]: it's the
glPolygonOffset() in the 3D-panel code. And I remembered that
Andy had commented on this problem a while back in the already
mentioned thread ...
  
| Re: 3d Panel problem
| Date: Fri, 28 Jun 2002 12:47:36 -0700
| From: Andy Ross <[EMAIL PROTECTED]>  (NextBus Information Systems)
| [...]
| Curt's intuition was right.  These are almost certainly due to
| differences in the implementation of glPolygonOffset() between our
| drivers.  I'm using a Geforce 3, which doesn't show this behavior.
| What PolygonOffset does is add a tiny bit to the depth value of
| generated polygons; to lift them off the surface that they're being
| drawn on top of.  But the Voodoo cards have thinner depth buffers, and
| I'm using a pretty large offset value to begin with.  Let me tune a
| little and see how much smaller I can make it.
| [...]
| One thing you could do is play with
| the value of the POFF_UNITS define in panel.cxx.  See if you can find
| the smallest value that prevents z-fighting between instrument layers,
| but doesn't bleed through other geometry.  Hopefully there's a number
| that will work for all cards, or at least most cards with an override
| for funny ones.


panel.cxx says:

| // The number of polygon-offset "units" to place between layers.  In
| // principle, one is supposed to be enough.  In practice, I find that
| // my hardware/driver requires many more.
| #define POFF_UNITS 40

1 would fix my problem. BUT: 40 only breaks the fog in the scenery, while
it works well for the instruments. So I suggest to let POFF_UNITS be 40 but
to reset the PolygonOffset to -1 or zero after having drawn the instruments.
This should also work for all other cards. (Please verify and apply!)

m.   :-)






Index: panel.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.7/FlightGear/src/Cockpit/panel.cxx,v
retrieving revision 1.75
diff -u -3 -p -r1.75 panel.cxx
--- panel.cxx   22 Jul 2002 19:09:42 -0000      1.75
+++ panel.cxx   23 Jul 2002 18:59:07 -0000
@@ -423,6 +423,7 @@ FGPanel::draw()

   // restore some original state
   glPopAttrib();
+  glPolygonOffset(0, 0);
   glDisable(GL_POLYGON_OFFSET_FILL);
 }






[1] that's a lie. It =does= still show fog, but the fog is =very= distant
    and doesn't match the visibility value. Bringing it nearer by hitting 
    'Z' a few times "breakes" the tile loader.



Note to users of a recent vim: Have you ever tried something like this?  :-)

  set listchars=tab:�`,trail:�,extends:>,precedes:<
  set list


-- 
Who can afford to do professional work for nothing?
What hobbyist can put three man-years into programming,
finding all bugs, documenting his product, and distribute it
for free?  -- Bill Gates (in the mid-1970s)


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to