• No se han encontrado resultados

and the set of texture coordinates can be anywhere within the pixel including the fragment center or any of the sample locations. The color value and the set of tex- ture coordinates need not be evaluated at the same location. Each pixel fragment thus consists of integer x and y grid coordinates,SAMPLEScolor and depth values,

SAMPLESsets of texture coordinates, and a coverage value with a maximum of

SAMPLESbits.

Multisample rasterization is enabled or disabled by callingEnableorDisable with the symbolic constantMULTISAMPLE.

If MULTISAMPLE is disabled, multisample rasterization of all primitives is equivalent to single-sample (fragment-center) rasterization, except that the frag- ment coverage value is set to full coverage. The color and depth values and the sets of texture coordinates may all be set to the values that would have been as- signed by single-sample rasterization, or they may be assigned as described below for multisample rasterization.

IfMULTISAMPLEis enabled, multisample rasterization of all primitives differs substantially from single-sample rasterization. It is understood that each pixel in the framebuffer has SAMPLES locations associated with it. These locations are exact positions, rather than regions or areas, and each is referred to as a sample point. The sample points associated with a pixel may be located inside or outside of the unit square that is considered to bound the pixel. Furthermore, the relative locations of sample points may be identical for each pixel in the framebuffer, or they may differ.

If the sample locations differ per pixel, they should be aligned to window, not screen, boundaries. Otherwise rendering results will be window-position specific. The invariance requirement described in section3.2is relaxed for all multisample rasterization, because the sample locations may be a function of pixel location.

It is not possible to query the actual sample locations of a pixel.

3.4

Points

If vertex program point size mode is enabled, then the derived point size is taken from the (potentially clipped) shader built-ingl PointSizeand clamped to the implementation-dependent point size range. If the value written togl PointSize

is less than or equal to zero, results are undefined. If vertex program point size mode is disabled, then the derived point size is specified with the command

void PointSize(floatsize);

sizespecifies the requested size of a point. The default value is 1.0. A value less than or equal to zero results in the errorINVALID VALUE. Vertex program point

3.4. POINTS 90

size mode is enabled and disabled by callingEnableorDisablewith the symbolic valueVERTEX PROGRAM POINT SIZE.

If multisampling is enabled, an implementation may optionally fade the point alpha (see section3.11) instead of allowing the point width to go below a given threshold. In this case, the width of the rasterized point is

width=

derived size derived size≥threshold

threshold otherwise (3.1)

and the fade factor is computed as follows:

f ade=

(

1 derived size≥threshold

derived size threshold

2

otherwise (3.2)

The point fadethresholdis specified with

void PointParameter{if}(enumpname, Tparam);

void PointParameter{if}v(enumpname, const Tparams);

IfpnameisPOINT FADE THRESHOLD SIZE, thenparamspecifies, orparams

points to the point fadethreshold. Values of POINT FADE THRESHOLD SIZEless than zero result in the errorINVALID VALUE.

The point sprite texture coordinate origin is set with the PointParame- ter* commands where pname is POINT SPRITE COORD ORIGIN and param is

LOWER LEFTorUPPER LEFT. The default value isUPPER LEFT.

3.4.1 Basic Point Rasterization

Point rasterization produces a fragment for each framebuffer pixel whose center lies inside a square centered at the point’s(xw, yw), with side length equal to the

current point size.

All fragments produced in rasterizing a point sprite are assigned the same as- sociated data, which are those of the vertex corresponding to the point. However, the fragment shader builtingl PointCoordcontains point sprite texture coordi- nates. Thespoint sprite texture coordinate varies from 0 to 1 across the point horizontally left-to-right. IfPOINT SPRITE COORD ORIGIN isLOWER LEFT, the

t coordinate varies from 0 to 1 vertically bottom-to-top. Otherwise if the point sprite texture coordinate origin isUPPER LEFT, thetcoordinate varies from 0 to 1 vertically top-to-bottom. Therandqcoordinates are replaced with the constants 0 and 1, respectively.

3.4. POINTS 91

The following formula is used to evaluate thesandtpoint sprite texture coor- dinates: s= 1 2+ xf +12 −xw size (3.3) t=    1 2+ (yf+12−yw)

size ,POINT SPRITE COORD ORIGIN=LOWER LEFT

1 2−

(yf+12−yw)

size ,POINT SPRITE COORD ORIGIN=UPPER LEFT

(3.4) wheresizeis the point’s size,xf andyf are the (integral) window coordinates of

the fragment, andxw andyw are the exact, unrounded window coordinates of the

vertex for the point.

Not all point widths need be supported, but the width1.0must be provided. The range of supported widths and the width of evenly-spaced gradations within that range are implementation-dependent. The range and gradations may be ob- tained using the query mechanism described in chapter 6. If, for instance, the width range is from 0.1 to 2.0 and the gradation width is 0.1, then the widths

0.1,0.2, . . . ,1.9,2.0 are supported. Additional point widths may also be sup- ported. There is no requirement that these widths must be equally spaced. If an unsupported width is requested, the nearest supported width is used instead.

3.4.2 Point Rasterization State

The state required to control point rasterization consists of the floating-point point width, a bit indicating whether or not vertex program point size mode is enabled, a bit for the point sprite texture coordinate origin, and a floating-point value speci- fying the point fade threshold size.

3.4.3 Point Multisample Rasterization

IfMULTISAMPLEis enabled, and the value ofSAMPLE BUFFERSis one, then points are rasterized using the following algorithm Point rasterization produces a frag- ment for each framebuffer pixel with one or more sample points that intersect a region centered at the point’s(xw, yw). This region is a square with side equal

to the current point width. Coverage bits that correspond to sample points that intersect the region are 1, other coverage bits are 0. All data associated with each sample for the fragment are the data associated with the point being rasterized, .

The set of point sizes supported is equivalent to those for point sprites without multisample .

Documento similar