polysm(3G)
polysm - specify antialiasing of polygons
As shipped in IRIX 6.5.30. Unchanged since IRIX 6.5.
NAME polysm - specify antialiasing of polygons FORTRAN SPECIFICATION subroutine polysm(mode) integer*4 mode PARAMETERS mode Expects one of the symbolic constants: PYSMOF: do not antialias polygons. (default) PYSMON: compute coverage values for all perimeter polygon pixels in such a way as to not change the size of the polygon. PYSMSH: Compute coverage values for all perimeter polygon pixels in such a way as to shrink the polygon slightly. DESCRIPTION polysm specifies one-pass antialiasing of polygons. Unlike pntsmo and linesm, it is available only in RGB mode. Also, unlike pntsmo and linesm, its use in complex scenes requires attention to primitive drawing order if acceptable results are to be achieved. Thus polysm use is somewhat more complex than that of pntsmo and linesm. Like points and lines, polygons are antialiased by computing a coverage value for each scan-converted pixel, and using this coverage value to scale pixel alpha. Thus, for RGB antialiased polygons to draw correctly, blendf must be set to merge new pixel color components with the previous components using the incoming alpha. In the simplistic case of adding a single, antialiased polygon to a previously rendered scene, the same blendf as is typically used for point and line antialiasing can be used: blendf(BFSA, BFMSA). Pixels in the interior of the polygon will have coverage assigned to 1.0, and will therefore replace their framebuffer counterparts. Pixels on the perimeter of the polygon are blended into the framebuffer in proportion to their computed coverage. A more typical case, however, is that of antialiasing the polygons that comprise the surface of a solid object. Here the standard blendf will result in 'leakage' of color between adjacent polygons. For example, if the first polygon drawn covers a sample pixel 40%, and the second (adjacent) polygon covers the pixel 60%, the net coverage of %100 still leaves %24 background color in the pixel. If the solid object is to be correctly antialiased, with no leakage through interior edges, and with proper silhouettes, the following rules must be followed: 1. Polygons must be drawn in view order from nearest to farthest. (Not farthest to nearest as is done with transparency.) 2. Polygons that face away from the viewer must not be drawn. (Use backfa(.TRUE.).) 3. The special blendf(BFMINS, BFONE) must be used to blend polygons into the framebuffer. 4. Polysmooth mode PYSMON must be used. The special polysmooth mode PYSMSH specifies a coverage algorithm that includes only pixels that would have been scan-converted had the mode been PYSMOF. (PYSMON includes pixels that are outside that range of those point-sampled by the PYSMOF algorithm.) PYSMSH necessarily leaks background color between adjacent polygons, but does this in a way that resembles antialiased lines. Thus, PYSMSH can be used in conjunction with blendf(BFSA, BFZERO), and with no sorting of polygons (use the z- buffer), to generate solid images tesselated with black, antialiased lines. SEE ALSO linesm, pntsmo, blendf, subpix NOTES IRIS-4D G, GT, and GTX models, as well as the Personal Iris, Iris Entry, Indy, XL, XS, XS24, XZ, Elan, and Extreme systems do not support polysm. Use getgde to determine whether polysm is supported. subpix mode should always be enabled while polysm is used. On the IRIS-4D RealityEngine pixels that are outside of the perimeter of the polygon may be drawn. However, their coverage values will be 0.0. BUGS IRIS-4D VGX models reveal their decomposition of 4+ sided polygons into triangles when PYSMSH is selected. This behavior is not intended, and may not be duplicated by future VGX software releases, or by future models.