青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Drawing Lines over Polygons and Using Polygon Offset

LINK:http://www.opengl.org/resources/faq/technical/polygonoffset.htm
?What are the basics for using polygon offset?

It's difficult to render coplanar primitives in OpenGL for two reasons:

  • Given two overlapping coplanar primitives with different vertices, floating point round-off errors from the two polygons can generate different depth values for overlapping pixels. With depth test enabled, some of the second polygon's pixels will pass the depth test, while some will fail.
  • For coplanar lines and polygons, vastly different depth values for common pixels can result. This is because depth values from polygon rasterization derive from the polygon's plane equation, while depth values from line rasterization derive from linear interpolation.

Setting the depth function to GL_LEQUAL or GL_EQUAL won't resolve the problem. The visual result is referred to as stitching, bleeding, or Z fighting.

Polygon offset was an extension to OpenGL 1.0, and is now incorporated into OpenGL 1.1. It allows an application to define a depth offset, which can apply to filled primitives, and under OpenGL 1.1, it can be separately enabled or disabled depending on whether the primitives are rendered in fill, line, or point mode. Thus, an application can render coplanar primitives by first rendering one primitive, then by applying an offset and rendering the second primitive.

While polygon offset can alter the depth value of filled primitives in point and line mode, under no circumstances will polygon offset affect the depth values of GL_POINTS, GL_LINES, GL_LINE_STRIP, or GL_LINE_LOOP primitives. If you are trying to render point or line primitives over filled primitives, use polygon offset to push the filled primitives back. (It can't be used to pull the point and line primitives forward.)

Because polygon offset alters the correct Z value calculated during rasterization, the resulting Z value, which is stored in the depth buffer will contain this offset and can adversely affect the resulting image. In many circumstances, undesirable "bleed-through" effects can result. Indeed, polygon offset may cause some primitives to pass the depth test entirely when they normally would not, or vice versa. When models intersect, polygon offset can cause an inaccurate rendering of the intersection point.

13.020 What are the two parameters in a glPolygonOffset() call and what do they mean?

Polygon offset allows the application to specify a depth offset with two parameters, factor and units. factor scales the maximum Z slope, with respect to X or Y of the polygon, and units scales the minimum resolvable depth buffer value. The results are summed to produce the depth offset. This offset is applied in screen space, typically with positive Z pointing into the screen.

The factor parameter is required to ensure correct results for filled primitives that are nearly edge-on to the viewer. In this case, the difference between Z values for the same pixel generated by two coplanar primitives can be as great as the maximum Z slope in X or Y. This Z slope will be large for nearly edge-on primitives, and almost non-existent for face-on primitives. The factor parameter lets you add this type of variable difference into the resulting depth offset.

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.

13.030 What's the difference between the OpenGL 1.0 polygon offset extension and OpenGL 1.1 (and later) polygon offset interfaces?

The 1.0 polygon offset extension didn't let you apply the offset to filled primitives in line or point mode. Only filled primitives in fill mode could be offset.

In the 1.0 extension, a bias parameter was added to the normalized (0.0 - 1.0) depth value, in place of the 1.1 units parameter. Typical applications might obtain a good offset by specifying a bias of 0.001.

See the GLUT example , which renders two cylinders, one using the 1.0 polygon offset extension and the other using the 1.1 polygon offset interface.

13.040 Why doesn't polygon offset work when I draw line primitives over filled primitives?

Polygon offset, as its name implies, only works with polygonal primitives. It affects only the filled primitives: GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, and GL_POLYGON. Polygon offset will work when you render them with glPolygonMode set to GL_FILL, GL_LINE, or GL_POINT.

Polygon offset doesn't affect non-polygonal primitives. The GL_POINTS, GL_LINES, GL_LINE_STRIP, and GL_LINE_LOOP primitives can't be offset with glPolygonOffset().

13.050 What other options do I have for drawing coplanar primitives when I don't want to use polygon offset?

You can simulate the effects of polygon offset by tinkering with glDepthRange(). For example, you might code the following:

glDepthRange (0.1, 1.0); /* Draw underlying geometry */ glDepthRange (0.0, 0.9); /* Draw overlying geometry */

This code provides a fixed offset in Z, but doesn't account for the polygon slope. It's roughly equivalent to using glPolygonOffset with a factor parameter of 0.0.

You can render coplanar primitives with the Stencil buffer in many creative ways. The OpenGL Programming Guide outlines one well-know method. The algorithm for drawing a polygon and its outline is as follows:

  1. Draw the outline into the color, depth, and stencil buffers.
  2. Draw the filled primitive into the color buffer and depth buffer, but only where the stencil buffer is clear.
  3. Mask off the color and depth buffers, and render the outline to clear the stencil buffer.

On some SGI OpenGL platforms, an application can use the SGIX_reference_plane extension. With this extension, the user specifies a plane equation in object coordinates corresponding to a set of coplanar primitives. You can enable or disable the plane. When the plane is enabled, all fragment Z values will derive from the specified plane equation. Thus, for any given fragment XY location, the depth value is guaranteed to be identical regardless of which primitive rendered it.

posted on 2006-10-25 11:19 zmj 閱讀(1153) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            99日韩精品| 久久人人97超碰精品888| 欧美激情一区在线观看| 亚洲精品乱码久久久久久久久| 久久亚洲国产精品一区二区| 精品成人国产| 欧美国产亚洲视频| 欧美激情综合五月色丁香| 一区二区三区免费看| 亚洲一区二区在线观看视频| 国产一区二区久久| 亚洲第一区中文99精品| 欧美金8天国| 欧美一区2区三区4区公司二百| 欧美一区二区三区日韩视频| 在线成人激情黄色| aⅴ色国产欧美| 国产亚洲欧美一区二区三区| 亚洲春色另类小说| 欧美不卡三区| 欧美日韩中国免费专区在线看| 亚洲欧美一区二区原创| 老鸭窝91久久精品色噜噜导演| 中文精品99久久国产香蕉| 久久国产免费看| 在线综合亚洲| 久久久久久久综合狠狠综合| 亚洲一本大道在线| 久久一区二区精品| 性色av一区二区三区| 久久综合狠狠综合久久综合88| 亚洲性线免费观看视频成熟| 久久久久国产免费免费| 亚洲免费中文字幕| 免费精品视频| 久久综合国产精品| 国产精品入口尤物| 亚洲精品久久嫩草网站秘色| 精品成人在线观看| 亚洲一区二区精品在线观看| 日韩视频第一页| 久久嫩草精品久久久久| 欧美一区二区三区在| 欧美日韩在线观看视频| 亚洲国产精品99久久久久久久久| 国产一区 二区 三区一级| 一本久久综合亚洲鲁鲁| 亚洲精品欧美极品| 卡一卡二国产精品| 久久综合一区二区| 国产主播一区二区| 亚洲欧美日韩一区二区在线| 亚洲一区二区动漫| 欧美日韩国产色视频| 亚洲国产精品久久精品怡红院| 国产主播一区| 欧美在线亚洲在线| 久久久高清一区二区三区| 国产精品嫩草久久久久| 中文一区二区在线观看| 亚洲一区日本| 国产精品视频导航| 亚洲一区二区3| 欧美一区二区女人| 国产手机视频精品| 香蕉成人伊视频在线观看| 欧美呦呦网站| 狠狠色综合网站久久久久久久| 欧美自拍偷拍午夜视频| 久久久久久久综合日本| 国内精品久久久久久影视8| 国一区二区在线观看| 久久精品国产亚洲精品| 久久深夜福利| 亚洲国产精品一区二区第四页av| 久久夜色精品国产亚洲aⅴ | 欧美天天影院| 99国产精品自拍| 亚洲欧美日韩在线播放| 国产欧美日韩激情| 久久精品在这里| 免费日韩av电影| 日韩天堂av| 国产精品久久久一区二区| 午夜免费日韩视频| 美女精品国产| 亚洲婷婷综合久久一本伊一区| 国产精品久久久久9999| 午夜视黄欧洲亚洲| 欧美激情一区二区三区蜜桃视频 | 亚洲激情小视频| 中日韩视频在线观看| 国产精品一区二区三区乱码 | 亚洲少妇在线| 久久久久9999亚洲精品| 亚洲人成啪啪网站| 国产精品爽黄69| 久久精品一区中文字幕| 亚洲看片免费| 久久亚洲捆绑美女| 中文国产成人精品| 黄色精品一二区| 欧美日韩播放| 久久成人综合视频| 夜夜嗨av一区二区三区网站四季av| 欧美一区深夜视频| 一本一本久久| 在线观看精品视频| 欧美视频中文字幕在线| 久久婷婷久久| 午夜精品久久久久| 亚洲精品一二| 欧美成人有码| 久久精品成人一区二区三区| 亚洲人久久久| 一区二区在线观看视频在线观看| 欧美日韩视频在线| 欧美不卡视频| 久久九九全国免费精品观看| 日韩视频在线一区二区三区| 欧美成人精品高清在线播放| 欧美一激情一区二区三区| 亚洲精品一二区| 在线欧美影院| 国产亚洲毛片| 国产欧美日韩综合一区在线播放| 欧美片在线播放| 免费精品99久久国产综合精品| 欧美在线一二三四区| 亚洲一区二区在线看| 国产在线视频不卡二| 欧美乱大交xxxxx| 男男成人高潮片免费网站| 久久精品亚洲一区二区| 午夜视频一区在线观看| 亚洲一区中文字幕在线观看| 99国内精品| 夜夜狂射影院欧美极品| 亚洲精一区二区三区| 亚洲人成啪啪网站| 亚洲国产一区二区三区在线播 | 麻豆精品传媒视频| 久久精品一区| 久久久久久久久久久久久久一区 | 在线播放不卡| 狠狠v欧美v日韩v亚洲ⅴ| 国产亚洲综合精品| 国内一区二区三区| 精品96久久久久久中文字幕无| 国产在线国偷精品产拍免费yy| 国内精品久久久久久久影视麻豆 | 国产精品资源| 国产精品尤物| 国产又爽又黄的激情精品视频| 国产视频一区在线观看| 狠狠综合久久av一区二区小说| 伊人久久大香线蕉综合热线| 136国产福利精品导航网址应用| 亚洲高清在线观看| 亚洲美女黄网| 亚洲在线免费视频| 久久九九电影| 欧美激情a∨在线视频播放| 亚洲人成人一区二区在线观看| 亚洲乱码国产乱码精品精天堂 | 欧美成年人网| 亚洲激情校园春色| 亚洲视频一区二区在线观看 | 欧美一区二区在线免费观看| 久久久国产精品亚洲一区| 免费人成网站在线观看欧美高清| 欧美精品一区在线| 国产九九精品| 亚洲欧洲一区二区在线播放| 亚洲视屏在线播放| 久久久青草青青国产亚洲免观| 亚洲大片一区二区三区| 制服丝袜亚洲播放| 久久久久一区二区三区四区| 欧美日韩国产va另类| 国产精品夜夜嗨| 亚洲国产精品福利| 欧美一级午夜免费电影| 欧美大学生性色视频| 亚洲一区二区黄| 美日韩免费视频| 国产欧美一区二区三区视频| 亚洲免费观看在线观看| 久久久999精品视频| 日韩午夜免费视频| 麻豆av一区二区三区| 国产精品午夜av在线| 99精品热视频| 欧美va天堂va视频va在线| 亚洲一区免费| 欧美日韩ab| 亚洲精品女av网站| 欧美jjzz| 久久精品国产亚洲精品| 国产精品永久免费观看|