Chen Rabiner wrote: > >>> my questions are >>> 1. Do both modes (e.g. double and fixed) test if a sampled pixel center >>> is >>> inside the triangle, from the calculation i'm not sure. > >> Yes. > > If both sample exact pixel center, why do they get different results,
I'm not sure. Like I said, I haven't looked at the double-mode code in a long time. OpenGL doesn't specify a single way to do triangle rasterization so it's possible to get different results from one GL to another. It's also possible to get different results with a single GL depending on the GL state. See the "OpenGL Invariance" section of the OpenGL Programming Guide for more info about that. > i > would expect the exact same triangle to be rasterized? > Just to check if we speak in the same terms, a pixel center is some int plus > half > for example if x = 11.5 y = 4.5 is inside a triangle it will be rasterized. Right. But the way in which vertices are converted from float to fixed point can vary causing differences in the edge walking results. > I can't see from the code how Mesa checks exact pixel centers. Think of the code as sampling at pixel corners. We apply a half-pixel bias early in the process to hit pixel centers (as you note below). >>> I know that Mesa doesnt exactly samples, it does some complicated setup >>> and >>> than scanline using that setup but if someone can describe in words how >>> this >>> correspands to sampling i would be most grateful. > >> By "samples" do you mean point sampling or multisampling or something else? > > by sampling i mean traversing pixel centers and checking using edge > functions for example to know if that exact point is inside a triangle or > not. > Another question i have is about the code: what is the purpose of the "minus > half reduction" in thenext line from s_tritemp.h, does it have anything to > do with pixel centers? Yes, the half pixel bias effectively give us pixel-center sampling. > const GLfixed fy0 = FloatToFixed(v0->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & > snapMask; > -Brian ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
