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

            亚洲色婷婷综合久久| 国产综合免费精品久久久| 久久久久se色偷偷亚洲精品av| 人人妻久久人人澡人人爽人人精品 | 欧美久久一级内射wwwwww.| 日韩欧美亚洲综合久久影院Ds | 亚洲国产成人久久精品影视| 精品久久人人妻人人做精品| 久久久久亚洲av综合波多野结衣| 久久99精品久久久久婷婷| 久久久久亚洲精品天堂久久久久久| 精产国品久久一二三产区区别| 国产精品久久午夜夜伦鲁鲁| 久久青青草原精品国产软件| 久久亚洲AV成人出白浆无码国产| 久久久青草青青国产亚洲免观| 国产精品久久久亚洲| av色综合久久天堂av色综合在| 国产真实乱对白精彩久久| 国产精品一久久香蕉国产线看 | 潮喷大喷水系列无码久久精品| 久久午夜综合久久| 夜夜亚洲天天久久| 国产精品欧美久久久天天影视| 伊人久久精品无码二区麻豆| 亚洲婷婷国产精品电影人久久| 大美女久久久久久j久久| a高清免费毛片久久| 国产精品18久久久久久vr| 97久久综合精品久久久综合| 精品熟女少妇AV免费久久| 亚洲精品国精品久久99热| 久久精品中文字幕有码| 久久亚洲视频| 久久这里只有精品首页| 国色天香久久久久久久小说| 久久这里只有精品首页| 久久香蕉国产线看观看精品yw| 精品免费久久久久久久| 99久久精品毛片免费播放| 国产亚洲欧美精品久久久|