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

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

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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国产精品久久久久老师| 一区免费在线| 亚洲人成毛片在线播放女女| 亚洲国产日韩欧美在线99| 91久久精品网| 亚洲视频视频在线| 欧美一区二区三区视频免费播放| 欧美有码视频| 欧美国产精品劲爆| 亚洲精品欧美精品| 亚洲欧美国内爽妇网| 久久99在线观看| 免费在线国产精品| 欧美午夜视频在线观看| 国产日韩欧美另类| 亚洲美女视频在线观看| 欧美淫片网站| 亚洲日本va在线观看| 99国产精品视频免费观看| 亚洲影院污污.| 蜜臀久久99精品久久久画质超高清| 欧美连裤袜在线视频| 国产日产高清欧美一区二区三区| 在线观看日韩专区| 亚洲一区二区在线观看视频| 久久久亚洲人| 一区二区三区四区五区在线| 久久久久久久波多野高潮日日| 欧美日韩精品综合| 亚洲黄网站在线观看| 亚洲男人影院| 欧美国产精品久久| 亚洲欧美国产精品桃花| 欧美人成在线视频| 激情久久久久久久久久久久久久久久 | 国模私拍视频一区| 亚欧美中日韩视频| 久久精品30| 久久久水蜜桃| 久久尤物视频| 亚洲综合三区| 免费久久99精品国产自在现线| 欧美日本一道本| 亚洲第一色在线| 一区二区三区蜜桃网| 美女国产一区| 中日韩视频在线观看| 麻豆精品视频在线| 国产一区二区中文字幕免费看| 亚洲一区二区三区高清不卡| 欧美激情在线观看| 久久噜噜亚洲综合| 国产日韩欧美a| 午夜精品久久久久久99热软件 | 免费在线观看一区二区| 亚洲淫性视频| 欧美性理论片在线观看片免费| 亚洲人体大胆视频| 欧美激情1区2区| 久久综合亚洲社区| 亚洲高清一区二| 欧美成人中文字幕| 狂野欧美一区| 亚洲国产另类久久精品| 欧美黄免费看| 欧美另类69精品久久久久9999| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲国产成人一区| 欧美va亚洲va国产综合| 日韩午夜在线| 这里只有精品丝袜| 国产精品美女午夜av| 久久丁香综合五月国产三级网站| 性做久久久久久久久| 黄色一区二区三区| 欧美a一区二区| 欧美成人伊人久久综合网| 一区二区三区免费看| 亚洲一区二区三区免费视频| 日韩一级在线| 香蕉久久国产| 伊人成人开心激情综合网| 美女精品在线观看| 欧美激情中文不卡| 翔田千里一区二区| 久久久久国色av免费看影院| 亚洲日本va在线观看| 亚洲精品一区在线观看| 亚洲国产精选| 欧美大片免费观看| 亚洲免费观看高清完整版在线观看| 99re成人精品视频| 亚洲国产成人午夜在线一区| 亚洲国产91色在线| 久久一区中文字幕| 国模大胆一区二区三区| 亚洲欧美激情在线视频| 欧美在线综合| 国产一区在线观看视频| 亚洲高清在线精品| 欧美日韩精品欧美日韩精品一| 欧美亚洲综合网| 欧美大片在线观看| 欧美中文字幕| 欧美日韩精品一区二区三区四区| 久久亚洲一区二区三区四区| 欧美日韩亚洲国产精品| 蜜桃av噜噜一区| 国产精品亚发布| 亚洲精品乱码久久久久久日本蜜臀| 国产目拍亚洲精品99久久精品| 欧美激情第10页| 国内视频精品| 亚洲影音先锋| 亚洲午夜一级| 欧美不卡高清| 另类国产ts人妖高潮视频| 国产精品久久久久久久久婷婷| 亚洲国产精品久久久久久女王| 狠狠色噜噜狠狠狠狠色吗综合| 亚洲一区二区av电影| 亚洲视频高清| 欧美日韩伦理在线免费| 亚洲精品日韩一| 日韩一级不卡| 欧美精品二区三区四区免费看视频| 美国十次了思思久久精品导航| 国产精品一区久久| 中日韩高清电影网| 午夜精品久久久久久久99樱桃| 欧美日韩成人精品| 亚洲肉体裸体xxxx137| 亚洲精品小视频在线观看| 嫩草成人www欧美| 欧美激情第1页| 亚洲精品四区| 欧美日本一区二区视频在线观看| 亚洲国产精品视频一区| 欧美va天堂va视频va在线| 国产一区二区| 久久国产免费| 免费欧美高清视频| 亚洲国产高清在线观看视频| 看欧美日韩国产| 亚洲激情视频网| 夜夜嗨av一区二区三区| 欧美日本久久| 一区二区三区四区在线| 久久国产精品久久国产精品| 欧美激情第10页| 欧美日韩国产综合在线| 欧美日韩情趣电影| 午夜视频在线观看一区二区| 小黄鸭视频精品导航| 国产日韩视频| 久久久午夜电影| 久久精品女人天堂| 国产精品白丝jk黑袜喷水| 黄色小说综合网站| 亚洲免费高清视频| 夜夜嗨av一区二区三区网页 | 免费看黄裸体一级大秀欧美| 伊人婷婷欧美激情| 欧美成人一区二区三区| 亚洲图片激情小说| 久久夜色精品国产欧美乱| 亚洲精品视频在线观看免费| 欧美亚男人的天堂| 欧美伊人久久大香线蕉综合69| 欧美大片一区| 亚洲主播在线| 亚洲国产精品久久91精品| 欧美美女福利视频| 欧美伊久线香蕉线新在线| 亚洲国产欧美不卡在线观看| 亚洲视频在线看| 精品盗摄一区二区三区| 欧美啪啪成人vr| 欧美中文在线字幕| 亚洲精品久久久久久久久久久 | 亚洲国产专区校园欧美| 欧美极品在线视频| 欧美影院午夜播放| 亚洲免费观看高清在线观看 | 麻豆精品视频| 亚洲视频综合在线| 在线日韩欧美视频| 国产麻豆精品theporn| 欧美精品在线观看一区二区| 欧美一区二区精品在线| 日韩亚洲一区二区| 欧美黑人国产人伦爽爽爽| 久久久午夜精品| 亚洲欧美精品在线| 久久黄色小说| 亚洲欧美日韩国产成人|