Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ polysmooth(3G) — IRIX 6.5.3f

Media Vault

Software Library

Restoration Projects

Artifacts Sought



polysmooth(3G)                                                  polysmooth(3G)



NAME
     polysmooth - specify antialiasing of polygons

C SPECIFICATION
     void polysmooth(long mode)

PARAMETERS
     mode   Expects one of the symbolic constants:

            PYSMOFF:  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.

            PYSMSHRINK:  Compute coverage values for all perimeter polygon
            pixels in such a way as to shrink the polygon slightly.

DESCRIPTION
     polysmooth specifies one-pass antialiasing of polygons.  Unlike pntsmooth
     and linesmooth, it is available only in RGB mode.  Also, unlike pntsmooth
     and linesmooth, its use in complex scenes requires attention to primitive
     drawing order if acceptable results are to be achieved.  Thus polysmooth
     use is somewhat more complex than that of pntsmooth and linesmooth.

     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,
     blendfunction 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 blendfunction as is typically used for point and line antialiasing
     can be used:

          blendfunction(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 blendfunction
     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:





                                                                        Page 1





polysmooth(3G)                                                  polysmooth(3G)



     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
          backface(TRUE).)

     3.   The special blendfunction(BF_MIN_SA_MDA, BF_ONE) must be used to
          blend polygons into the framebuffer.

     4.   Polysmooth mode PYSMON must be used.

     The special polysmooth mode PYSMSHRINK specifies a coverage algorithm
     that includes only pixels that would have been scan-converted had the
     mode been PYSMOFF.  (PYSMON includes pixels that are outside that range
     of those point-sampled by the PYSMOFF algorithm.)  PYSMSHRINK
     necessarily leaks background color between adjacent polygons, but does
     this in a way that resembles antialiased lines.  Thus, PYSMSHRINK can be
     used in conjunction with blendfunction(BF_SA, BF_ZERO), and with no
     sorting of polygons (use the z-buffer), to generate solid images
     tesselated with black, antialiased lines.

SEE ALSO
     linesmooth, pntsmooth, blendfunction, subpixel

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
     polysmooth.  Use getgdesc to determine whether polysmooth is supported.

     subpixel mode should always be enabled while polysmooth 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 PYSMSHRINK is selected.  This behavior is not intended,
     and may not be duplicated by future VGX software releases, or by future
     models.
















                                                                        Page 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026