Howdy,

Okay, heres the bug in two parts.
part 1) I forget to turn of GL_BLEND while I do selection.
My bad - DOH!

part2) The blending function glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) - gets applied and ends up producing the wrong results.

The destination fragment is:
0,0,0,0 (background)
The source fragment is:
X,Y,Z,1 (my triangle)
The resulting color is:
(X*1+0*(1-1),(Y*1+0*(1-1),(Z*1+0*(1-1),(1*1+0*(1-1))
which should end up being
X,Y,Z,1
but ends up being
X-1,Y-1,Z-1,1
Not my bad - phew, maybe this wasn't a total waste of your time. :)

cheers and thanks again!
Dave DeMarle


On 10/12/06, Carlos Pereira <carlos@pehoe.civil.ist.utl.pt> wrote:


> As for the colors, I still think that either I missed some openGL setting in
> my program, or there is a bug in Mesa. I would expect that regardless of the
> GL implementation I should be able to turn off all shading, antialiasing
> etc, render something in color XYZ, read back pixels and find color XYZ, not
> color (X-1)(Y-1)(Z-1). This makes selection by color value a little harder
> to do across platforms, but I can work around it.

I do selection by color with Mesa, with thousands
of objects, I never had any problem,

Probably you need this:

glPixelStorei(GL_PACK_ALIGNMENT, 1);

Carlos

>
> Thanks!
> Dave DeMarle
>
>
> On 10/12/06, Dave Demarle <dave.demarle@kitware.com> wrote:
> >
> >
> >
> > On 10/12/06, Brian Paul < brian.paul@tungstengraphics.com> wrote:
> > >
> > > Dave Demarle wrote:
> > > > Hello,
> > > >
> > > > I think I have found a bug in Mesa.
> > > >
> > > > When I run this code
> > > > <http://www.cs.utah.edu/%7Edemarle/mesabug/main.cxx > linked to
> > > > my
> > > > system's GL library (nvidia on debian linux) I get image A
> > > > (below)
> > > which
> > > > is correct. When I run the same code linked to the Mesa libary
> > > > (either
> > > > current CVS or release mesa-6-1) I get image B (further below)
> > > > which
> > > is
> > > > incorrect. Specifically the colors in the Mesa image are off by
> > > > one
> > > and
> > > > a few extra triangles around the silhouette are drawn.
> > >
> > > The OpenGL spec is not pixel-accurate so two different versions of
> > > OpenGL will often produce slightly different images.
> > >
> > > As for the "extra" pixels in Mesa, those are probably coming from
> > > back-facing polygons passing the depth test because of insufficient
> > > depth buffer precision.  You can try two things:
> > >
> > > 1. Set the MESA_GLX_DEPTH_BITS env var to 32 to get a 32-bit depth
> > > buffer (If you're using the Xlib driver, that is).  The Xlib driver
> > > uses a 16-bit depth buffer by default.
> > >
> > > 2. Adjust your near/far clip planes so they're closer together.
> > >
> > > -Brian
> > >
> >
> >
>
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mesa3d-users mailing list
Mesa3d-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-users