From: "Lourens Veen" <[EMAIL PROTECTED]> Sent: Tuesday, March 08, 2005 02:29 > On Tuesday 08 March 2005 00:23, Martijn Sipkema wrote: > > On Mon, 2005-03-07 at 00:45 -0500, Daniel Phillips wrote: > > > On Saturday 05 March 2005 17:43, Lourens Veen wrote: > > > > Just a short question though, knowing next to nothing about this. How > > > > does the blending at the edges work theoretically? Alpha blending > > > > gives problems with continuity I'd think. Let's say we render two > > > > adjacent white polygons on a black background, and we render them one > > > > at a time. If we blend the edge pixels with the background then a > > > > pixel that is cut right through the middle will be 75% white instead > > > > of 100%. And if you render the same polygon twice then it will be 75% > > > > white instead of 50%. How do you prevent that? > > > > > > That is a pretty good illustration of algorithms based on blending into > > > a partially constructed image don't work very well. None of the three > > > algorithms I described do this. > > > > For 2d antialiasing you can use front-to-back drawing using smooth > > polygons, i.e. alpha values that represent coverage, and use > > GL_SRC_ALPHA_SATURATE/GL_ONE for the src/dst blending functions. > > Erm, wouldn't that give the problem I outlined above? Or does "2d > antialiasing" have a special meaning that I'm unaware of?
The technique using smooth polygons isn't perfect since it only stores the coverage in the framebuffer---some information is lost. It works well for 2d drawing from front to back. Note that it doesn't give the problem described above, because different blending functions are used. > > > > The simple 2x2 supersampling approach does not have this problem, but > > > > how does this work for multisampling? > > > > > > The color value for each subsample is stored separately and only mixed > > > with other subsamples in final scanout. > > > > Multisampling is the standard OpenGL way---apart from using a multipass > > algorithm using the accumulation buffer---of handling antialiasing for > > the general 3d case. > > > > > > The reason I'm asking is that I'm wondering whether we can't cheat, > > > > and do something that gives somewhat better results than 2x2 > > > > antialiasing. > > > > > > If you find a way, be sure to shout! > > > > For 2d drawing the OpenGL smooth polygons will give much better results. > > Huh? What is an "OpenGL smooth polygon"? A polygon with alpha representing coverage; see the OpenGL spec. for details. --ms _______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
