21.06.2014 Views

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.6. POLYGONS 245<br />

The offset value o for a polygon is<br />

o = m × factor + r × units. (3.13)<br />

m is computed as described above. If the depth buffer uses a fixed-point representation,<br />

m is a function of depth values in the range [0, 1], and o is applied to depth<br />

values in the same range.<br />

Boolean state values POLYGON_OFFSET_POINT, POLYGON_OFFSET_LINE,<br />

and POLYGON_OFFSET_FILL determine whether o is applied during the rasterization<br />

of polygons in POINT, LINE, and FILL modes. These boolean state values are<br />

enabled and disabled as argument values to the commands Enable and Disable.<br />

If POLYGON_OFFSET_POINT is enabled, o is added to the depth value of each<br />

fragment produced by the rasterization of a polygon in POINT mode. Likewise,<br />

if POLYGON_OFFSET_LINE or POLYGON_OFFSET_FILL is enabled, o is added to<br />

the depth value of each fragment produced by the rasterization of a polygon in<br />

LINE or FILL modes, respectively.<br />

For fixed-point depth buffers, fragment depth values are always limited to the<br />

range [0, 1] by clamping after offset addition is performed. Fragment depth values<br />

are clamped even when the depth buffer uses a floating-point representation.<br />

3.6.6 Polygon Multisample Rasterization<br />

If MULTISAMPLE is enabled and the value of SAMPLE_BUFFERS is one, then polygons<br />

are rasterized using the following algorithm, regardless of whether polygon<br />

antialiasing (POLYGON_SMOOTH) is enabled or disabled. Polygon rasterization produces<br />

a fragment for each framebuffer pixel with one or more sample points that<br />

satisfy the point sampling criteria described in section 3.6.1, including the special<br />

treatment for sample points that lie on a polygon boundary edge. If a polygon<br />

is culled, based on its orientation and the CullFace mode, then no fragments are<br />

produced during rasterization. Fragments are culled by the polygon stipple just as<br />

they are for aliased and antialiased polygons.<br />

Coverage bits that correspond to sample points that satisfy the point sampling<br />

criteria are 1, other coverage bits are 0. Each associated datum is produced as<br />

described in section 3.6.1, but using the corresponding sample location instead of<br />

the fragment center. An implementation may choose to assign the same associated<br />

data values to more than one sample by barycentric evaluation using any location<br />

within the pixel including the fragment center or one of the sample locations. The<br />

color value and the set of texture coordinates need not be evaluated at the same<br />

location.<br />

When using a vertex shader, the noperspective and flat qualifiers affect<br />

how shader outputs are interpolated in the same fashion as described for for basic<br />

<strong>OpenGL</strong> <strong>4.2</strong> (<strong>Compatibility</strong> <strong>Profile</strong>) - <strong>April</strong> <strong>27</strong>, <strong>2012</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!