PDA

View Full Version : Polygon edges sharing requirement question...



Izhido
03-26-2001, 04:02 PM
From the OpenGL 1.2 spec, Appendix B (Corollaries):

"17. (No pixel dropouts or duplicates). Let two polygons share an identical edge (that
is, there exist vertices A and B of an edge of one polygon, and vertices C and D of an
edge of the other polygon, and the coordinates of vertex A (resp. B) are
identical to those of vertex C (resp. D) and the state of the coordinate transformations
is identical when A, B, C, and D are specified). Then, when the fragments
produced by rasterization of both polygons are taken together, each fragment
intersecting the interior of the shared edge is produced exactly once."

To put it simple, no two polygon edges can be drawn twice.

However, I was wondering about the actual extent of this requirement. One possible
implementation would check all the polygons sent to the GL, flagging for each one which
edges should be drawn and which ones not. My question is: To what extent this check should be made?

A. Until glFlush() ?

B. Until glFinish() ?

C. Until glClear(GL_COLOR_BUFFER_BIT ...) ?

D. None of the above? (Which one, then?)

E. Invalid algorithm, should be replaced with another way to ensure that requirement?


- Heriberto Delgado
(heribertod@ruteo.com)

RandyU
03-26-2001, 07:01 PM
I think (not sure) that it's rasterizer's feature that makes different pixels position depending on location of edge(left polygon's edge is shifted to right). I think OpenGL dont keep information about previous polies.

Serge K
03-26-2001, 08:34 PM
The similar thing for D3D:
Triangle Rasterization Rules (http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/directx/dx8_c/hh/directx8_c/_dx_triangle_rasterization_rules_graphics.htm)

Relic
03-28-2001, 07:29 AM
izhido, I think you drew wrong conclusions.

This rule is about FILLED rasterization and guarantees that for two adjacent triangles which have two vertices in common (exact same coordinates, that is share an edge), the rasterizer will not touch any of the pixels at this edge twice (this is a requirement for logic ops, blending, stencil operations etc.) and exactly fills the area without dropping pixels.

All the programs which show cracks don't send the same coordinates for the vertices or have T-vertices. (Often seen in CAD programs due to non-uniform tesselation over different parts.)

And to answer the questions, the rasterizer can decide per triangle which pixels to set.

[This message has been edited by Relic (edited 03-28-2001).]