• <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在哪個庫文件?  回復  更多評論
              

            香蕉久久夜色精品国产小说| 久久久噜噜噜久久中文字幕色伊伊| 精品久久久久久无码专区不卡| 热re99久久精品国产99热| 国产精品狼人久久久久影院| 麻豆久久| 久久免费精品视频| 国内精品久久久久影院亚洲| 99国产欧美精品久久久蜜芽| 久久久这里有精品中文字幕| 久久久婷婷五月亚洲97号色| 久久久久久噜噜精品免费直播| 狠狠色狠狠色综合久久| 久久久久亚洲AV成人网| 欧美精品一区二区精品久久| 色综合久久无码五十路人妻| 欧美精品福利视频一区二区三区久久久精品 | 久久精品国产精品亚洲精品| 伊人久久免费视频| 久久精品国产亚洲AV大全| 久久亚洲欧洲国产综合| 久久精品视频免费| 996久久国产精品线观看| 无码国内精品久久人妻| 久久久久亚洲精品日久生情| 婷婷久久综合九色综合98| 97久久国产综合精品女不卡| 色天使久久综合网天天| 久久久噜噜噜久久| 久久99精品久久久久久| 精品久久久久久国产91| AV色综合久久天堂AV色综合在| 色偷偷88888欧美精品久久久| 狠狠色丁香久久婷婷综合_中| 中文字幕久久精品| 亚洲精品久久久www| 久久久久久久91精品免费观看| 综合久久久久久中文字幕亚洲国产国产综合一区首 | 久久久久99精品成人片牛牛影视| 久久精品亚洲精品国产色婷| 久久精品国产亚洲av麻豆色欲 |