• <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 逛奔的蝸牛 閱讀(2494) 評論(2)  編輯 收藏 引用 所屬分類: OpenGL

            評論

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

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

            久久99国产精品久久久 | 久久天天躁狠狠躁夜夜躁2014| 国产香蕉97碰碰久久人人| 国产韩国精品一区二区三区久久| 国产亚洲婷婷香蕉久久精品| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区 | 人妻精品久久无码区| 成人久久精品一区二区三区| 一级做a爰片久久毛片毛片| 亚洲精品乱码久久久久久蜜桃不卡| 欧美精品久久久久久久自慰| 亚洲国产成人精品久久久国产成人一区二区三区综 | 99久久精品国产一区二区| 狠狠狠色丁香婷婷综合久久俺| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 亚洲国产日韩综合久久精品| 国内精品久久久久影院优| 2021国内精品久久久久久影院| 97久久精品午夜一区二区| 久久人妻少妇嫩草AV无码专区| 久久99精品久久久久久9蜜桃| 久久天天躁狠狠躁夜夜96流白浆 | 欧美精品一区二区精品久久 | 2021国内久久精品| 91麻豆国产精品91久久久| 老男人久久青草av高清| 午夜视频久久久久一区 | 久久久久国产精品麻豆AR影院 | 一本色道久久综合| 亚洲国产精品嫩草影院久久| 国色天香久久久久久久小说| 性高湖久久久久久久久| 成人a毛片久久免费播放| 波多野结衣久久| 久久涩综合| 影音先锋女人AV鲁色资源网久久| 97热久久免费频精品99| 亚洲а∨天堂久久精品| 久久激情五月丁香伊人| 精品久久久久久综合日本| 伊人久久大香线蕉综合热线|