From 64028a37ef716a24c1110f3ab82fd177098f862d Mon Sep 17 00:00:00 2001 From: curt Date: Sun, 1 Dec 2002 22:38:38 +0000 Subject: [PATCH] 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. --- src/Cockpit/panel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index bfdb5600c..130b1315c 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -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 -- 2.39.5