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

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>
            性欧美1819性猛交| 亚洲欧美国产精品专区久久| 久久久久久久性| 欧美一区二区三区免费看 | 日韩视频永久免费观看| 国产亚洲综合精品| 黄色成人在线| 影音先锋在线一区| 狠狠狠色丁香婷婷综合激情| 国产亚洲激情视频在线| 国产一区二区三区日韩| 国产日韩1区| 亚洲第一在线综合网站| 亚洲欧洲视频在线| 亚洲一区二区三区欧美| 午夜精品久久久久99热蜜桃导演| 亚洲欧美国产va在线影院| 久久久精彩视频| 亚洲黑丝一区二区| 亚洲一品av免费观看| 久久夜色精品国产亚洲aⅴ| 欧美激情视频免费观看| 国产日韩欧美成人| 一本色道久久| 欧美成年网站| 欧美一区二区网站| 欧美性色综合| 一本色道久久88综合日韩精品 | 亚洲与欧洲av电影| 久久成人综合视频| 一区二区免费在线播放| 蜜桃av一区二区| 国内精品美女av在线播放| 麻豆精品一区二区av白丝在线| 欧美日韩精品伦理作品在线免费观看| 国产欧美一区二区精品婷婷| 日韩午夜一区| 亚洲精品日韩综合观看成人91| 免费亚洲电影| 亚洲最新视频在线| 在线视频亚洲一区| 国产精品v一区二区三区| 一本色道久久综合亚洲精品婷婷 | 欧美日韩中文字幕日韩欧美| 99伊人成综合| 亚洲欧美bt| 精品动漫3d一区二区三区免费 | 在线国产亚洲欧美| 免费在线日韩av| 欧美国产日韩精品| 午夜精品福利在线| 欧美一区二区三区免费视| 国产精品一区二区在线观看| 蜜臀a∨国产成人精品| 欧美日韩久久久久久| 欧美高清影院| 欧美色大人视频| 欧美不卡激情三级在线观看| 欧美成人在线影院| 久久九九有精品国产23| 欧美激情一区二区三区不卡| 蜜桃精品久久久久久久免费影院| 欧美三级网址| 狼人社综合社区| 久久综合亚洲社区| 久久美女性网| 在线观看欧美日韩国产| 亚洲欧美久久久| 性色av一区二区三区| 欧美日韩亚洲网| 亚洲二区在线观看| 一区三区视频| 麻豆国产精品va在线观看不卡| 久久综合色影院| 在线观看欧美成人| 欧美成人嫩草网站| 亚洲精品偷拍| 欧美一级一区| 在线观看日韩欧美| 欧美精品九九99久久| 亚洲欧洲一区二区在线观看| 91久久精品国产91性色tv| 久久综合九色| 99v久久综合狠狠综合久久| 亚洲色无码播放| 国产精品综合色区在线观看| 亚洲特级毛片| 欧美激情在线有限公司| 亚洲在线国产日韩欧美| 国内一区二区三区在线视频| 久久亚洲一区二区三区四区| 亚洲第一黄色网| 亚洲欧美经典视频| 亚洲国产欧美精品| 国产精品国产自产拍高清av王其| 欧美亚洲一区二区在线| 亚洲国产午夜| 久久久夜夜夜| 欧美亚洲自偷自偷| 一区二区三区高清在线观看| 在线免费观看欧美| 国产一区 二区 三区一级| 午夜亚洲一区| 亚洲视频每日更新| 99精品欧美一区| 亚洲精品久久久久| 欧美激情1区| 久久久综合免费视频| 欧美一级片久久久久久久| 一本色道久久综合狠狠躁篇的优点 | 免费成人av在线看| 一本色道久久综合精品竹菊| 亚洲国产精品电影| 亚洲欧洲日本专区| 国内精品久久久久影院优| 国产欧美一区二区精品仙草咪| 国产欧美1区2区3区| 国产伦精品一区二区三区免费迷| 国产精品久久久久久久9999| 国产精品成人播放| 国产午夜精品美女视频明星a级| 国产亚洲欧美激情| 精品成人一区二区三区四区| 亚洲国产mv| 亚洲欧美日韩精品久久久| 久久久久久一区二区| 欧美国产精品| 国产精品99久久久久久久女警| 欧美一区二区三区播放老司机| 久久久人成影片一区二区三区 | 国产一区二区欧美日韩| 国产精品美女在线观看| 亚洲综合成人在线| 欧美一区二区在线视频| 欧美99久久| 正在播放欧美视频| 久久一区二区三区国产精品 | 免费久久精品视频| 亚洲国产精品久久久久秋霞不卡| 亚洲国产美女| 亚洲欧美国产日韩中文字幕| 欧美aⅴ99久久黑人专区| 国产精品日韩二区| 夜夜爽99久久国产综合精品女不卡| 亚洲欧美伊人| 日韩视频在线一区二区| 久久精品国产综合精品| 国产精品午夜春色av| 日韩视频在线一区二区三区| 久久蜜桃资源一区二区老牛| 亚洲视频一区二区在线观看| 欧美日韩岛国| 99热这里只有精品8| 欧美高清在线视频| 老司机一区二区| 亚洲激情国产| 91久久亚洲| 欧美视频二区36p| 亚洲一区二区三区四区在线观看| 亚洲激情一区| 欧美日韩在线精品一区二区三区| 亚洲黄色av| 夜夜嗨av一区二区三区四区| 欧美日韩国产精品成人| 中文在线不卡| 欧美一区二区三区四区视频| 国产日韩精品在线播放| 久久综合精品一区| 免费成人av在线| 亚洲欧美另类在线| 久久一二三四| 午夜在线a亚洲v天堂网2018| 欧美中文字幕久久| 亚洲精品孕妇| 久久国产精品99久久久久久老狼| 校园春色综合网| 日韩视频一区二区在线观看 | 一区二区三区视频在线观看| 99精品视频免费观看视频| 国产午夜精品理论片a级大结局| 欧美第一黄网免费网站| 国产综合精品一区| 亚洲一级片在线观看| 久久精品国产久精国产思思| 在线综合视频| 欧美久久久久中文字幕| 久久全国免费视频| 国产精品海角社区在线观看| 亚洲大片免费看| 日韩视频免费观看| 亚洲日本成人在线观看| 久久久亚洲一区| 欧美**字幕| 99国产精品视频免费观看一公开| 免费欧美电影| 91久久久久| 亚洲综合好骚| 国产一区日韩二区欧美三区| 久久免费少妇高潮久久精品99| 久久尤物视频|