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

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 閱讀(1155) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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>
            亚洲国产精品一区在线观看不卡| 狠狠入ady亚洲精品经典电影| 日韩午夜av电影| 欧美激情bt| 欧美区国产区| 亚洲免费在线电影| 午夜精品视频在线观看一区二区 | 蜜臀av性久久久久蜜臀aⅴ四虎| 性欧美办公室18xxxxhd| 韩国av一区二区三区四区| 美女精品国产| 欧美屁股在线| 欧美在线短视频| 久久亚洲私人国产精品va媚药| 亚洲黄色免费电影| 亚洲精品国产精品乱码不99按摩| 欧美日韩国产成人在线91| 亚洲欧美经典视频| 久久不射电影网| 日韩亚洲欧美中文三级| 亚洲自拍偷拍麻豆| 最新日韩在线视频| 亚洲自啪免费| 亚洲精品日韩精品| 性欧美大战久久久久久久免费观看| 伊人久久综合97精品| 亚洲人成在线观看网站高清| 国产伦精品一区二区三区| 美女视频网站黄色亚洲| 欧美日韩在线第一页| 另类综合日韩欧美亚洲| 欧美日韩日韩| 欧美88av| 国产午夜亚洲精品不卡| 亚洲精品国产精品国自产在线| 国产精一区二区三区| 最新亚洲一区| 一区二区在线观看视频在线观看| 99国内精品| 亚洲国产婷婷香蕉久久久久久| 亚洲小视频在线| 99riav久久精品riav| 久久久亚洲一区| 久久久精品一区| 欧美日韩亚洲一区三区| 亚洲成色777777女色窝| 亚洲精品国产视频| 韩日午夜在线资源一区二区| 亚洲一区二区久久| 一区二区精品国产| 免费观看在线综合色| 久久久久9999亚洲精品| 国产精品揄拍500视频| 99精品国产在热久久| 亚洲人成人77777线观看| 久久久久久欧美| 久久香蕉国产线看观看网| 国产精品乱码一区二区三区| 亚洲精品美女在线观看播放| 亚洲经典一区| 久久阴道视频| 欧美电影资源| 91久久久在线| 欧美国产日韩一区二区在线观看| 欧美国产一区二区三区激情无套| 激情综合久久| 久久久久国产精品一区二区| 久久亚洲二区| 亚洲电影免费观看高清完整版| 久久婷婷色综合| 欧美波霸影院| 亚洲精品日韩久久| 欧美日韩一区在线观看| 夜夜爽av福利精品导航| 亚洲男女毛片无遮挡| 国产久一道中文一区| 久久国产色av| 麻豆精品一区二区av白丝在线| 在线观看国产成人av片| 久久人人爽人人爽爽久久| 欧美国产日本| 亚洲午夜视频| 国产伪娘ts一区| 久久久人成影片一区二区三区观看 | 在线免费观看日本欧美| 美女91精品| 99re亚洲国产精品| 欧美在线观看视频| 久久久久免费视频| 亚洲欧洲视频在线| 国产精品国色综合久久| 欧美一区综合| 亚洲激情网址| 午夜性色一区二区三区免费视频| 国产视频一区在线观看一区免费| 久久国产色av| 亚洲美女av网站| 欧美中文在线观看| 亚洲精品免费一区二区三区| 国产精品成人免费| 欧美专区一区二区三区| 亚洲国产视频一区| 久久国内精品视频| 亚洲国产日韩综合一区| 国产精品美女主播| 久久综合国产精品| 亚洲视频图片小说| 亚洲第一中文字幕| 欧美中日韩免费视频| 日韩一级黄色大片| 激情小说亚洲一区| 国产精品久久一区主播| 老司机成人在线视频| 亚洲免费视频一区二区| 欧美激情精品久久久久久大尺度 | 欧美承认网站| 午夜精品久久久久久| 亚洲国产成人av好男人在线观看| 国产精品国色综合久久| 米奇777超碰欧美日韩亚洲| 午夜精品成人在线视频| 亚洲美女在线看| 亚洲福利在线视频| 麻豆国产精品777777在线 | 伊人久久婷婷色综合98网| 国产精品美女久久久免费| 欧美v国产在线一区二区三区| 欧美一级精品大片| 在线视频亚洲一区| 亚洲精品在线电影| 亚洲国产高清一区| 美女免费视频一区| 久久久久久久999| 久久av一区二区三区| 亚洲系列中文字幕| 在线亚洲自拍| 亚洲天堂av在线免费| 99精品99| 在线亚洲欧美| 中国女人久久久| 中文日韩电影网站| 亚洲视频日本| 亚洲一区二区欧美日韩| 一区二区欧美在线观看| 一二三区精品福利视频| 日韩午夜视频在线观看| 亚洲精品视频在线看| av成人福利| 亚洲一区二区动漫| 欧美亚洲色图校园春色| 久久精品国产77777蜜臀| 久久av老司机精品网站导航| 久久精品一区二区三区四区| 久久精品综合一区| 嫩草成人www欧美| 亚洲国产日韩一区二区| 亚洲人成艺术| 亚洲午夜久久久| 午夜性色一区二区三区免费视频| 欧美专区18| 久久久中精品2020中文| 裸体女人亚洲精品一区| 欧美刺激午夜性久久久久久久| 欧美精品在线观看91| 欧美日韩视频在线一区二区观看视频| 欧美色中文字幕| 国产欧美日韩| 亚洲精品久久久久久下一站 | 欧美一区二区精品| 久久亚洲风情| 亚洲精品乱码久久久久久日本蜜臀 | 男女激情久久| 欧美日韩在线一区二区| 国产精品午夜春色av| 狠狠色综合网| aa亚洲婷婷| 久久人91精品久久久久久不卡| 欧美**人妖| 在线视频你懂得一区| 欧美资源在线观看| 欧美日韩成人综合天天影院| 国产精品欧美精品| 伊人精品久久久久7777| 亚洲午夜黄色| 免费欧美电影| 亚洲一区二区三区四区中文| 久久手机精品视频| 欧美小视频在线| 亚洲国产日韩美| 欧美一区二区三区的| 亚洲激情婷婷| 久久久中精品2020中文| 国产精品不卡在线| 亚洲剧情一区二区| 久久亚洲美女| 性欧美xxxx视频在线观看| 欧美日韩精品免费观看视频| 1024日韩| 久久黄色影院| 亚洲无吗在线|