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

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)  編輯 收藏 引用


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導航: 博客園   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>
            欧美高清视频一区二区| 欧美日韩中文字幕综合视频| 国产亚洲精品福利| 久久国产精品电影| 欧美一区二区视频在线观看2020| 国产老女人精品毛片久久| 午夜精品久久久久久久| 亚洲影院在线| 精品成人一区二区三区| 欧美.com| 欧美日韩一区二区欧美激情| 亚洲欧美精品中文字幕在线| 亚洲欧美日韩精品在线| 尤物九九久久国产精品的分类| 蜜桃av久久久亚洲精品| 欧美日韩不卡合集视频| 亚洲欧美亚洲| 久久亚洲综合网| 夜夜嗨av一区二区三区四季av| 一卡二卡3卡四卡高清精品视频| 国产精品美女www爽爽爽| 欧美在线观看天堂一区二区三区| 久久精品噜噜噜成人av农村| 亚洲精品影视在线观看| 亚洲午夜电影网| 在线观看视频欧美| 国产精品99久久久久久久女警| 国产欧美精品日韩| 亚洲国产精品www| 国产精品久久久久久亚洲毛片| 久久全国免费视频| 欧美视频日韩视频在线观看| 久久米奇亚洲| 国产精品mv在线观看| 美女精品自拍一二三四| 欧美性大战久久久久久久| 麻豆亚洲精品| 国产精品日韩久久久| 亚洲国产视频一区二区| 国产日韩一区| 99热这里只有精品8| 亚洲国产成人精品女人久久久| 这里只有精品视频在线| 亚洲激情校园春色| 欧美一区二区三区在线观看| 亚洲婷婷国产精品电影人久久 | 在线观看日韩精品| 亚洲午夜在线视频| 日韩一级免费| 久久手机免费观看| 久久精品一区蜜桃臀影院| 欧美日韩一视频区二区| 亚洲激情二区| 亚洲激情国产精品| 久久露脸国产精品| 久久久999精品免费| 国产精品久久久久免费a∨大胸| 亚洲国内自拍| 亚洲欧洲一区二区三区久久| 欧美专区中文字幕| 久久aⅴ乱码一区二区三区| 国产精品对白刺激久久久| 亚洲精品网址在线观看| 日韩视频不卡| 欧美日韩国产在线一区| 亚洲片在线观看| aa级大片欧美| 欧美日韩国产亚洲一区| 亚洲精品一区二区三区樱花| 99国产精品国产精品久久| 欧美成人乱码一区二区三区| 欧美激情欧美狂野欧美精品| 在线国产亚洲欧美| 免费欧美高清视频| 亚洲国产精品国自产拍av秋霞| 亚洲黄色成人网| 欧美成人精品福利| 亚洲精品一级| 亚洲欧美怡红院| 国产欧美精品xxxx另类| 久久er99精品| 欧美黑人国产人伦爽爽爽| 亚洲乱码久久| 国产精品久久波多野结衣| 亚洲欧美日韩天堂| 牛夜精品久久久久久久99黑人| 在线欧美日韩国产| 欧美巨乳在线观看| 亚洲一区二区在线免费观看| 久久久久久久久久久一区| 亚洲高清三级视频| 欧美日韩国产一区精品一区| 亚洲校园激情| 美女视频黄 久久| 日韩亚洲视频在线| 国产欧美va欧美va香蕉在| 久久成人国产| 日韩视频第一页| 久久久亚洲国产美女国产盗摄| 亚洲高清不卡在线观看| 欧美视频一区在线观看| 欧美在线免费| 日韩视频在线观看国产| 久久精品亚洲热| 亚洲麻豆av| 国产一区视频观看| 欧美久久久久中文字幕| 欧美一级视频精品观看| 亚洲激情在线观看| 久久精品男女| 亚洲一区二区伦理| 亚洲电影免费| 国产欧美日韩视频一区二区| 欧美国产三级| 久久精品盗摄| 亚洲综合视频网| 亚洲日本在线视频观看| 久热综合在线亚洲精品| 亚洲摸下面视频| 99热免费精品在线观看| 狠狠综合久久av一区二区小说| 欧美日韩亚洲综合| 免费亚洲电影| 久久久91精品国产| 午夜精品美女久久久久av福利| 亚洲人成亚洲人成在线观看图片 | 久久国产视频网| 一区二区三区高清| 亚洲激情国产精品| 尤物九九久久国产精品的特点| 欧美特黄a级高清免费大片a级| 欧美mv日韩mv国产网站| 久久精品国产69国产精品亚洲| 亚洲视频欧洲视频| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 亚洲作爱视频| 亚洲黄色影片| 亚洲国产va精品久久久不卡综合| 久久久成人精品| 亚久久调教视频| 亚洲欧美日韩一区二区| 在线一区免费观看| 一个色综合导航| 一本大道久久精品懂色aⅴ| 91久久中文| 亚洲精品久久久久| 亚洲人成人一区二区在线观看| 亚洲风情在线资源站| 在线视频国产日韩| 亚洲国产精品尤物yw在线观看 | 欧美吻胸吃奶大尺度电影| 午夜精品久久久久久久99樱桃| 亚洲人成绝费网站色www| 亚洲一区三区电影在线观看| 亚洲人午夜精品免费| 亚洲国产一区二区三区青草影视 | 欧美激情一区二区久久久| 欧美88av| 欧美日韩免费看| 国产精品剧情在线亚洲| 国产精品一区二区女厕厕| 国产在线拍偷自揄拍精品| 国语自产精品视频在线看一大j8| 狠狠爱综合网| 91久久精品日日躁夜夜躁国产| 亚洲精品中文字幕女同| 亚洲婷婷国产精品电影人久久| 亚洲欧美日韩精品久久| 久久久久中文| 亚洲国产欧美日韩另类综合| 日韩视频精品| 欧美伊人久久久久久久久影院| 久久亚洲综合色| 欧美日韩亚洲综合在线| 国产视频丨精品|在线观看| 亚洲成色精品| 亚洲一级黄色片| 老司机一区二区| 日韩午夜av电影| 久久激情视频免费观看| 欧美激情五月| 国产亚洲视频在线| 亚洲精品一二区| 久久精品视频在线| 亚洲免费观看高清完整版在线观看熊| 亚洲欧美综合国产精品一区| 久久亚洲风情| 国产精品丝袜久久久久久app| 伊人婷婷久久| 欧美一级视频| 亚洲精品日韩一| 久久久精品动漫| 国产精品剧情在线亚洲| 亚洲人成高清| 卡一卡二国产精品| 亚洲性视频网址| 欧美日韩国产美女| 亚洲福利专区| 老司机免费视频一区二区| 亚洲午夜小视频|