1
0
Fork 0

Andy Ross:

I wrote:
 > I can confirm this.  Layers on the 2D panels (but oddly, only the 2D
 > panels) aren't drawing over the background with the current ATI
 > drivers.

OK, this turns out to be a trivial fix, although I still think it's a
driver bug.  There are two calls to glPolygonOffset in the panel
rendering code (shared by both 2D and 3D panels).  One is called
per-layer, and sets up a layer-specific offset.  The other is called
for drawing the background textures, to lift them off of any
underlying cockpit geometry.

I was using different "factor" values for each, incorrectly.  Patch
attached.  It was affecting only 2D panels because the 3D ones don't
use background images.

Problem is, by my reading of the specification the bug should have had
the effect of pushing the background texture *farther* behind the
instruments, instead of pulling it on top of them.  Either I'm reading
the spec incorrectly or ATI has inverted the sense of the factor
argument.  Dunno, I'll submit a bug report to them and see what
happens.
This commit is contained in:
curt 2002-12-01 22:38:38 +00:00
parent d98b7f05ff
commit 64028a37ef

View file

@ -370,7 +370,7 @@ FGPanel::draw()
// of an existing polygon. Use an offset to prevent z-fighting. In
// 2D mode, this is a no-op.
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(0, -POFF_UNITS);
glPolygonOffset(-1, -POFF_UNITS);
// save some state
glPushAttrib( GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_LIGHTING_BIT