scrsub(3G)scrsub(3G)NAMEscrsub - subdivide lines and polygons to a screen-space limit
FORTRAN SPECIFICATION
subroutine scrsub(mode, params)
integer*4 mode
real params()PARAMETERS
mode Specify whether and how lines and polygons are to be subdivided.
Options are:
SSOFF: do not subdivide. (default)
SSDEPT: subdivide based on z values in screen-coordinates.
params Expects an array that contains parameter specifications for the
subdivision mode that has been selected.
SSOFF The values provided in the params array are ignored when
the mode is SS_OFF.
SSDEPT expects three values in the params array: maxz, minsize,
and maxsize. maxz specifies the distance, in screen-
coordinates, between z=constant subdivision planes. (Z-buffer
screen coordinates are defined by lsetde.) minsize and maxsize
specify bounds, in units of pixels, of the screen size of the
resulting subdivided polygons. Setting maxz to 0.0 eliminates
screen-coordinate z from consideration during the subdivision.
Likewise, setting minsize or maxsize to 0.0 eliminates lower or
upper bounds on screen size from consideration.
DESCRIPTION
When scrsub mode is not SSOFF, lines and polygons are subdivided until
the specified criteria are met. Parameters are assigned to created
vertices as though they have been interpolated in eye-coordinates, rather
than in screen-coordinates. Thus effects that result from (incorrect)
linear interpolation in screen-coordinates can be compensated for with
scrsub.
Mode SSDEPT slices polygons into strips whose edges have constant screen
z value. It divides lines into segments whose endpoint z values differ
by maxz. This subdivision is done after lighting, so the newly created
vertices are not lighted, but rather simply take color values as linear
interpolants of the original vertices (in eye-coordinates). Both fog and
texture mapping are done after the depth subdivision, so both benefit
from its operation.
Polygon slices created by SSDEPT subdivision have edges whose z values
differ by maxz. However, if the width of the resulting slices is less
than minsize, the slices are increased to have width equal to minsize.
For example, if maxsize is set to 0.0 (i.e. defeated), a polygon that
Page 1
scrsub(3G)scrsub(3G)
directly faces the viewer is not subdivided, because all vertices have
the same z value. As this polygon is rotated away from the viewer, it is
sliced into strips whose edges are parallel to the axis of rotation. The
number of strips increases as the rotation increases, until the strips
reach a width (measured perpendicular to the axis of rotation) of
minsize. At this angle the number of slices is at its maximum. As the
rotation is continued, the slice width remains constant, and the number
of slices decreases, reaching zero as the polygon becomes perpendicular
to the viewer.
When maxsize is non-zero, the description above changes only in that
large polygons that are nearly perpendicular to the viewer are subdivided
into strips of width maxsize. Likewise, lines segments created by SSDEPT
subdivision are limited to a minimum length of minsize, and a maximum
length of maxsize.
SSDEPT subdivision improves the accuracy of texture mapping when non-
orthographic projections are used, and improves the accuracy of fog
calculations. It is not useful for lighting improvement.
SEE ALSO
fogver, texbin, tevbin
NOTESscrsub cannot be used while mmode is MSINGL.
Only the VGX supports scrsub.
BUGS
When the screen size of subdivided polygons is limited, either by minsize
or by maxsize, adjacent polygons can subdivide differently such that
newly created vertices on their shared boundary do not coincide. In this
case, some pixels at their shared boundary may not be scan converted by
either polygon.
Incorrect specification of either maxz or minsize can result in near-
infinite polygon subdivision. To avoid the resulting poor graphics
system response, IRIS-4D VGX models do not subdivide polygons whose
SSDEPT subdivision would result in more than 2000 slices.
Page 2