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

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>
            国产精品女主播一区二区三区| 欧美人与性动交cc0o| 国产精品中文在线| 亚洲欧美制服另类日韩| 亚洲综合日韩| 极品少妇一区二区三区| 久久综合伊人77777尤物| 免费看的黄色欧美网站| 亚洲毛片在线| 亚洲一区二区少妇| 尤妮丝一区二区裸体视频| 亚洲国产精品久久久久秋霞影院| 欧美国产在线观看| 亚洲欧美亚洲| 久久亚洲综合网| 一本久久青青| 欧美伊人久久久久久久久影院| 亚洲国产黄色| 亚洲一区不卡| 亚洲黄色免费| 亚洲综合第一| 亚洲国产日韩在线一区模特| 中文一区二区| 亚洲国产一区二区三区在线播 | 国产视频亚洲精品| 欧美福利电影在线观看| 国产精品国产精品| 免费黄网站欧美| 国产精品区一区二区三| 欧美激情在线播放| 国产午夜精品麻豆| 亚洲毛片av| 亚洲国产欧美日韩精品| 性欧美大战久久久久久久久| 亚洲精品九九| 久久综合亚洲社区| 欧美亚洲视频在线观看| 欧美另类一区| 亚洲电影免费| 激情综合色综合久久综合| 亚洲一区二区三区精品在线 | 欧美天堂亚洲电影院在线播放| 久久亚洲国产精品日日av夜夜| 欧美日韩在线一区二区| 欧美激情亚洲激情| 伊人久久久大香线蕉综合直播| 亚洲男人的天堂在线| 中文网丁香综合网| 欧美福利专区| 欧美激情亚洲综合一区| 在线看片成人| 久久久美女艺术照精彩视频福利播放 | 欧美日韩国产黄| 亚洲高清不卡在线观看| 1000部精品久久久久久久久| 香蕉乱码成人久久天堂爱免费| 亚洲欧美日韩国产中文| 国产精品福利网| 一区二区国产精品| 中文日韩欧美| 国产精品va在线播放| 一本色道久久加勒比精品| 在线综合+亚洲+欧美中文字幕| 免费日本视频一区| 亚洲欧洲日韩综合二区| 日韩视频在线观看免费| 欧美激情在线观看| 亚洲人成人一区二区在线观看 | 国产一区二区三区久久精品| 亚洲一区二区三区中文字幕| 小辣椒精品导航| 国产欧亚日韩视频| 久久成人人人人精品欧| 欧美成人午夜激情视频| 亚洲欧洲日本mm| 欧美日韩三级电影在线| 亚洲香蕉网站| 久久嫩草精品久久久精品一| 亚洲第一精品久久忘忧草社区| 免费在线观看成人av| 亚洲人体大胆视频| 亚洲欧美激情视频| 国产午夜精品一区二区三区视频| 久久精精品视频| 亚洲大片av| 亚洲欧美国产精品va在线观看| 国产嫩草一区二区三区在线观看| 久久大逼视频| 最新国产精品拍自在线播放| 亚洲免费在线视频| 在线电影国产精品| 欧美裸体一区二区三区| 午夜视黄欧洲亚洲| 亚洲国产精品www| 午夜国产不卡在线观看视频| 精品福利av| 欧美三级视频| 久久久夜夜夜| 亚洲午夜电影在线观看| 免费国产一区二区| 午夜国产精品视频免费体验区| 亚洲第一区色| 国产麻豆精品在线观看| 欧美成人精品一区二区三区| 亚洲中午字幕| 亚洲三级色网| 美女视频黄 久久| 亚洲欧美日本日韩| 亚洲精品美女久久7777777| 国产美女扒开尿口久久久| 美女国产精品| 久久国产欧美精品| 亚洲视频在线观看| 亚洲国产成人porn| 久久色在线播放| 亚洲欧美一区二区在线观看| 亚洲精品视频一区二区三区| 狠狠综合久久av一区二区老牛| 欧美系列亚洲系列| 欧美大片va欧美在线播放| 久久激情一区| 亚洲一区在线播放| 99re这里只有精品6| 亚洲观看高清完整版在线观看| 久久久久久久久岛国免费| 亚洲欧美在线一区| 亚洲在线成人精品| 一区二区高清视频| 亚洲精品国产欧美| 亚洲国产成人av| 在线观看亚洲一区| 黑人巨大精品欧美黑白配亚洲| 国产伦精品一区二区三区四区免费 | 欧美大片一区二区| 久久免费精品视频| 久久成人这里只有精品| 亚洲影院色在线观看免费| 99热精品在线观看| 99精品福利视频| 夜夜嗨av一区二区三区四季av| 亚洲精品久久| 9人人澡人人爽人人精品| 99视频超级精品| 夜夜嗨网站十八久久| 一区二区三区日韩欧美| 亚洲视频专区在线| 亚洲欧美国产制服动漫| 午夜亚洲一区| 久久久国产精品一区二区三区| 久久久久久久999| 欧美+亚洲+精品+三区| 欧美激情成人在线| 亚洲人成在线观看一区二区| 亚洲精品日韩激情在线电影| 一区二区三区日韩在线观看| 亚洲欧美日韩精品久久久久| 欧美一区二区三区的| 久久久久国内| 欧美激情精品久久久久久变态| 欧美日韩国产小视频在线观看| 欧美亚洲不卡| 国产一区二区三区高清在线观看 | 亚洲观看高清完整版在线观看| 亚洲精品在线观看免费| 亚洲一级在线观看| 久久精品日韩欧美| 亚洲大片在线| 亚洲小少妇裸体bbw| 久久黄色影院| 欧美片在线播放| 国产亚洲观看| 99国产精品久久| 久久国产夜色精品鲁鲁99| 久久这里只有精品视频首页| 亚洲激情在线播放| 亚洲欧美日韩精品久久奇米色影视| 久久久青草青青国产亚洲免观| 欧美久久久久久| 国户精品久久久久久久久久久不卡| 亚洲日本无吗高清不卡| 久久成人免费视频| 亚洲日本va午夜在线影院| 午夜电影亚洲| 欧美日韩成人一区| 国内精品免费在线观看| 亚洲性线免费观看视频成熟| 久久阴道视频| 亚洲一区二区三区精品在线观看| 欧美va天堂在线| 国产农村妇女精品一二区| 日韩视频欧美视频| 久久久久久久尹人综合网亚洲| 亚洲美女精品久久| 久久欧美肥婆一二区| 国产精品爽爽ⅴa在线观看| 日韩一区二区电影网| 美女999久久久精品视频| 亚洲免费影视| 欧美视频一区二区三区四区| 亚洲国产精品999|