• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            逛奔的蝸牛

            我不聰明,但我會很努力

               ::  :: 新隨筆 ::  ::  :: 管理 ::
            Antialiasing 
            Another use for OpenGL’s blending capabilities is antialiasing. 
            Turning on antialiasing is simple. 
            First: you must enable blending and set the blending function.
            glEnable(GL_BLEND);
            glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

            Second: choose to antialias points, lines, and/or polygons(any solid primitive) by  calling glEnable:
            glEnable(GL_POINT_SMOOTH);  // Smooth out points.(smooth out: 使平滑)
            glEnable(GL_LINE_SMOOTH); // Smooth out lines.
            glEnable(GL_POLYGON_SMOOTH); // Smooth out polygon edges.

            Third: give hint to do the best job possible:
            glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);


            Solid objects antialiasing called "multisampling", more tedious rules.

            Point and line smoothing is widely supported, but unfortunately polygon smoothing is not available on all platforms. Even when GL_POLYGON_SMOOTH is available, it is not as convenient a means of having your whole scene antialiased as you might think. Because it is based on the blending operation, you would need to sort all your primitives from front to back! Yuck.


            Multisample(抽樣):
            A more recent addition to OpenGL to address this shortcoming is multisampling. When this feature is supported (it is an OpenGL 1.3 feature), an additional buffer is added to the framebuffer that includes the color, depth, and stencil values. All primitives are sampled multiple times per pixel, and the results are stored in this buffer.

            First: you must obtain a rendering context that has support for a multisampled framebuffer.
            setFormat(QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer | QGL::SampleBuffers));
            Second: turn multisampling on or off:
            glEnable(GL_MULTISAMPLE); // glDisable(GL_MULTISAMPLE);

            Another important note about multisampling is that when it is enabled, the point, line, and polygon smoothing features are ignored if enabled. On a given OpenGL implementation, points and lines may look better with smoothing turned on instead of multisampling.
            實體圖形效果非常的好啊, 比使用前面的antialiasing好非常多. 而且就上面兩步搞定. 但對于點和線來說, 使用smoothing的效果卻比multisampling的效果好, 所以要看情況來定.
            posted on 2009-05-23 15:14 逛奔的蝸牛 閱讀(2490) 評論(2)  編輯 收藏 引用 所屬分類: OpenGL

            評論

            # re: OpenGL: 反鋸齒 2012-07-30 14:47 外星人
            setFormat是哪里有?是哪個庫的?  回復  更多評論
              

            # re: OpenGL: 反鋸齒 2012-07-30 14:48 外星人
            setFormat在哪個庫文件?  回復  更多評論
              

            欧美国产成人久久精品| 久久久久国产一级毛片高清版| 国产精品久久久久影院嫩草| 无码AV中文字幕久久专区| 久久久无码精品亚洲日韩蜜臀浪潮| 91精品国产色综合久久| 久久久久久无码国产精品中文字幕| 一本一道久久a久久精品综合 | 久久国产精品视频| 亚洲国产视频久久| 欧美亚洲国产精品久久蜜芽| 国产亚洲精品久久久久秋霞| 成人精品一区二区久久| 国产亚洲精久久久久久无码77777 国产亚洲精品久久久久秋霞 | 少妇熟女久久综合网色欲| 精品久久无码中文字幕| 无夜精品久久久久久| 国产精品禁18久久久夂久| 久久精品国产精品亚洲艾草网美妙 | 人妻无码αv中文字幕久久琪琪布 人妻无码精品久久亚瑟影视 | 国产精品久久国产精麻豆99网站| 日韩欧美亚洲综合久久影院Ds| 国内精品九九久久久精品| 色妞色综合久久夜夜| 久久涩综合| 久久久久久狠狠丁香| 精品久久久噜噜噜久久久| 人妻无码精品久久亚瑟影视| 精品一区二区久久久久久久网站| 久久天天躁狠狠躁夜夜网站| 久久伊人五月天论坛| 丰满少妇人妻久久久久久 | 久久久精品久久久久久| 香港aa三级久久三级| 久久99精品国产| 亚洲国产精品久久久久网站 | 伊人久久成人成综合网222| 久久综合伊人77777麻豆| 国内精品久久久久影院网站| 精品久久久久久99人妻| 久久国产精品波多野结衣AV|