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

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


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(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>
            欧美人与性动交cc0o| 久久综合色综合88| 国产精品日本一区二区| 欧美婷婷在线| 欧美性生交xxxxx久久久| 国产精品v日韩精品v欧美精品网站| 欧美激情欧美激情在线五月| 欧美人与禽性xxxxx杂性| 国产精品国产三级国产aⅴ无密码| 国产精品一区二区久久| 在线免费观看视频一区| 亚洲精品久久久久中文字幕欢迎你| 亚洲精品乱码视频 | 欧美成人tv| 免费亚洲网站| 一区二区三区日韩精品视频| 欧美日韩国产首页| 欧美日韩成人综合在线一区二区| 久久久999精品视频| 欧美精品久久久久a| 国产精品视频一二三| 在线成人激情| 亚洲网站在线观看| 麻豆freexxxx性91精品| 99精品视频免费观看视频| 欧美中文字幕在线观看| 欧美黄色小视频| 国产伦精品一区二区三区照片91 | 国产精品午夜av在线| 亚洲国产经典视频| 欧美一级片在线播放| 亚洲二区视频在线| 夜夜夜久久久| 欧美96在线丨欧| 一区在线观看| 久久精品一区蜜桃臀影院| 日韩系列欧美系列| 久久三级福利| 黄色小说综合网站| 欧美伊人久久久久久午夜久久久久 | 欧美国产精品va在线观看| 亚洲影院色在线观看免费| 欧美成人免费在线视频| 娇妻被交换粗又大又硬视频欧美| 中文亚洲视频在线| 欧美大香线蕉线伊人久久国产精品| 亚洲婷婷综合色高清在线| 欧美极品欧美精品欧美视频| 在线看片日韩| 噜噜爱69成人精品| 久久精品一区二区三区不卡牛牛| 国产欧美一区二区精品忘忧草| 中文一区二区在线观看| 日韩五码在线| 欧美xxx在线观看| 亚洲黄色影院| 欧美高清视频在线| 免费日韩av| 亚洲第一页自拍| 欧美成人资源网| 久久婷婷国产综合精品青草| 红桃视频一区| 欧美丰满少妇xxxbbb| 麻豆精品精华液| 亚洲欧洲日本mm| 一区二区三区四区五区精品| 欧美一区网站| 黑人巨大精品欧美一区二区| 日韩视频精品在线| 欧美日韩精品欧美日韩精品| 国产精品亚洲综合天堂夜夜| 欧美在现视频| 久久香蕉国产线看观看av| 亚洲黄网站在线观看| 欧美二区视频| 欧美高清视频www夜色资源网| 日韩视频―中文字幕| 99re热精品| 国产精品久久国产精品99gif | 亚洲日本成人网| 欧美日韩在线免费视频| 香蕉久久国产| 久久本道综合色狠狠五月| 国产欧美视频一区二区三区| 欧美插天视频在线播放| 欧美日本高清一区| 久久aⅴ国产紧身牛仔裤| 久久久精彩视频| 亚洲一级一区| 久久人人97超碰国产公开结果| 最新国产成人av网站网址麻豆| 亚洲精品乱码久久久久久蜜桃麻豆| 欧美日韩国产精品专区| 亚洲自拍高清| 久久久91精品国产| 亚洲一区二区三区在线| 久久蜜桃香蕉精品一区二区三区| 一本色道**综合亚洲精品蜜桃冫| 亚洲欧美日韩综合一区| 亚洲国产欧美日韩另类综合| 亚洲免费av网站| 国产在线国偷精品产拍免费yy| 亚洲国产日韩欧美在线99| 国产精品影片在线观看| 亚洲国产成人tv| 国产在线观看91精品一区| 中文高清一区| 亚洲狼人综合| 久久午夜电影网| 久久爱www久久做| 欧美日本三级| 欧美激情1区| 狠狠入ady亚洲精品| 亚洲一级电影| 亚洲一区二区三区色| 免费欧美在线视频| 欧美+亚洲+精品+三区| 国产日韩欧美a| 亚洲砖区区免费| 亚洲综合色婷婷| 欧美性大战久久久久久久蜜臀| 欧美激情第1页| 亚洲电影在线免费观看| 久久久久综合网| 欧美日韩在线视频观看| 亚洲国产精品久久91精品| 亚洲欧美一区二区激情| 麻豆freexxxx性91精品| 正在播放欧美一区| 欧美大片第1页| 尤物网精品视频| 久久久国产亚洲精品| 久久视频精品在线| 黄色成人91| 美国十次了思思久久精品导航| 美女视频网站黄色亚洲| 一区二区在线免费观看| 久久久噜噜噜| 欧美国产另类| 亚洲精品久久久久中文字幕欢迎你 | 亚洲精品日韩一| 欧美v日韩v国产v| 亚洲激情视频在线观看| 日韩视频在线观看| 欧美国产视频一区二区| 亚洲精品日韩综合观看成人91| 夜夜嗨av一区二区三区| 国产精品成人午夜| 亚洲男人的天堂在线aⅴ视频| 久久激情一区| 在线免费观看日本一区| 欧美激情一区二区| 亚洲午夜一级| 另类av一区二区| 亚洲最新在线视频| 国产精品伊人日日| 快播亚洲色图| 99在线视频精品| 久久人人97超碰人人澡爱香蕉| 亚洲国产小视频在线观看| 欧美日韩免费观看中文| 欧美呦呦网站| 日韩视频精品在线| 麻豆91精品| 亚洲一区图片| 在线视频观看日韩| 欧美日韩三级| 久久久国产午夜精品| 一区二区三区国产精华| 欧美aa在线视频| 亚洲欧美欧美一区二区三区| 精品成人国产| 国产精品久久久久秋霞鲁丝 | 久久精品天堂| 亚洲作爱视频| 国产一区二区毛片| 欧美日韩午夜剧场| 久久久久欧美| 宅男66日本亚洲欧美视频| 噜噜噜躁狠狠躁狠狠精品视频| 日韩视频在线永久播放| 狠久久av成人天堂| 国产精品丝袜91| 欧美精品一区二区精品网| 性做久久久久久| 日韩天堂在线观看| 日韩一二三在线视频播| 亚洲在线国产日韩欧美| 欧美另类在线播放| 久久久久一区| 亚洲欧美国产一区二区三区| 亚洲国产成人午夜在线一区| 久久国内精品自在自线400部| 99综合在线| 亚洲日本中文字幕| 一区在线影院| 韩国免费一区| 国产欧美婷婷中文| 国产精品爽爽爽| 国产精品视频一区二区高潮|