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

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>
            国产一区二区精品丝袜| 欧美承认网站| 国产日韩欧美综合一区| 午夜在线精品偷拍| 亚洲免费中文字幕| 国产午夜精品理论片a级大结局| 欧美一区1区三区3区公司| 久久国产精品网站| 亚洲国产日韩欧美| 一本色道久久加勒比精品| 国产精品专区第二| 蜜臀av性久久久久蜜臀aⅴ四虎| 久久久人成影片一区二区三区观看 | 欧美在线三区| 久久久久一区二区| 夜夜嗨av一区二区三区网站四季av | 亚洲免费在线看| 久久99伊人| 一本大道久久a久久精二百| 亚洲视频一区| 136国产福利精品导航| 一本大道久久精品懂色aⅴ| 国产一区二区精品| 99国产精品国产精品久久| 国产午夜精品理论片a级大结局| 欧美激情国产精品| 国产精品亚洲产品| 亚洲第一综合天堂另类专| 欧美日本国产在线| 免费观看成人网| 国产精品久久久久9999吃药| 欧美va天堂| 国产麻豆一精品一av一免费| 亚洲国产一区在线观看| 国产伦理一区| 日韩视频在线你懂得| 影音先锋日韩资源| 亚洲伊人久久综合| 夜夜嗨网站十八久久| 久久免费视频一区| 欧美一区二区日韩一区二区| 欧美激情精品久久久久| 美女成人午夜| 国产一区二区三区在线观看网站 | 免费成人高清| 国产一区成人| 亚洲一区二区高清| 中文国产成人精品久久一| 美女亚洲精品| 免费成人毛片| **网站欧美大片在线观看| 欧美一区二区三区成人| 欧美一区综合| 国产精品自拍在线| 午夜在线观看欧美| 久久成人免费电影| 国产精品丝袜xxxxxxx| 亚洲香蕉网站| 亚洲在线视频网站| 国产精品国色综合久久| 一区二区三区 在线观看视频| 亚洲美女黄色| 欧美国产国产综合| 亚洲激情在线| 夜久久久久久| 国产精品久久久久久久久婷婷| 在线视频欧美一区| 亚洲一区三区电影在线观看| 欧美日韩黄视频| 一区二区三区欧美视频| 亚洲综合成人在线| 国产精品男gay被猛男狂揉视频| 中国成人在线视频| 欧美一区日本一区韩国一区| 国产伦理一区| 久久综合成人精品亚洲另类欧美| 蜜月aⅴ免费一区二区三区| 亚洲国产精品va在线观看黑人| 美女精品视频一区| 日韩视频精品| 久久国产直播| 亚洲精品123区| 欧美成人首页| 亚洲视频一起| 欧美成人dvd在线视频| 亚洲免费观看在线观看| 国产精品久久久久久久7电影 | 亚洲欧洲日本mm| 亚洲小说区图片区| 国内精品99| 欧美日韩国产在线看| 亚洲综合不卡| 欧美激情a∨在线视频播放| 一本一本久久a久久精品综合麻豆| 欧美性大战xxxxx久久久| 亚洲欧美日韩国产精品| 欧美成年人网| 亚洲欧美国产精品va在线观看| 国产午夜亚洲精品理论片色戒| 久久蜜臀精品av| 国产精品99久久久久久人| 久久中文字幕一区| 国产精品99久久99久久久二8 | 免费观看国产成人| 先锋a资源在线看亚洲| 亚洲欧洲一区二区在线播放| 欧美一区二区视频在线观看| 亚洲三级影片| 国产一区二区三区电影在线观看| 免费成人高清在线视频| 亚洲免费中文字幕| 亚洲精品日产精品乱码不卡| 久久久免费观看视频| 亚洲性人人天天夜夜摸| 亚洲国产毛片完整版 | 国产精品久久久久婷婷| 久久综合九色99| 午夜日本精品| 亚洲一区二区在线视频| 亚洲激情av| 久久亚洲视频| 久久精品视频导航| 午夜精品福利一区二区三区av | 国产精品捆绑调教| 欧美裸体一区二区三区| 美女网站在线免费欧美精品| 欧美一区二区日韩一区二区| 亚洲一区二区三区在线观看视频| 亚洲国产成人精品女人久久久| 久久久噜噜噜久久人人看| 午夜精品视频网站| 亚洲欧美资源在线| 亚洲视频一起| 亚洲网站视频| 这里只有精品视频| 一区二区三区av| 日韩天堂av| 日韩视频永久免费| 99伊人成综合| 一区二区三区久久网| 亚洲午夜精品国产| 亚洲欧美韩国| 欧美中文字幕久久| 久久免费99精品久久久久久| 久久精品国产综合| 久久午夜影视| 免费在线播放第一区高清av| 麻豆久久久9性大片| 美女尤物久久精品| 亚洲高清不卡在线| 亚洲精品在线观看免费| 99亚洲伊人久久精品影院红桃| 日韩一级精品| 午夜精品久久久久久久男人的天堂| 亚洲女人天堂av| 久久精品首页| 欧美高清成人| 欧美日韩国产不卡在线看| 欧美日韩在线视频一区二区| 欧美色大人视频| 国产日产欧产精品推荐色| 国产专区精品视频| 亚洲人成网在线播放| 亚洲视频www| 久久国产精品毛片| 欧美国产一区二区在线观看| 日韩图片一区| 欧美专区在线| 欧美人与禽性xxxxx杂性| 国产精品视频导航| 亚洲第一主播视频| 亚洲欧美日韩在线高清直播| 久久久午夜视频| 亚洲日本中文字幕区| 亚洲欧洲av一区二区三区久久| 久久这里只有| 欧美午夜一区二区三区免费大片| 国产日韩欧美黄色| 亚洲理论电影网| 久久av资源网| 日韩一区二区精品| 久久婷婷丁香| 国产精品久久久久久久久果冻传媒| 国产在线麻豆精品观看| 一本久道久久久| 久久免费精品日本久久中文字幕| 亚洲国产欧美精品| 先锋影音久久久| 欧美精品三级| 亚洲激情欧美激情| 欧美在线免费一级片| 亚洲另类春色国产| 看片网站欧美日韩| 国产偷自视频区视频一区二区| 亚洲色图自拍| 亚洲日本中文字幕| 欧美成人精品一区二区| 狠狠入ady亚洲精品| 午夜精品久久久久久久99樱桃 | 欧美在线观看一二区|