scrsubdivide(3G) scrsubdivide(3G)
scrsubdivide - subdivide lines and polygons to a screen-space limit
void scrsubdivide(mode, params)
long mode;
float params[];
mode Specify whether and how lines and polygons are to be subdivided.
Options are:
SS_OFF: do not subdivide. (default)
SS_DEPTH: subdivide based on z values in screen-coordinates.
params Expects an array that contains parameter specifications for the
subdivision mode that has been selected.
The values provided in the params array are ignored when the
mode is SS_OFF.
SS_DEPTH expects three values in the params array: maxz,
minsize, and maxsize. maxz specifies the distance, in screencoordinates,
between z=constant subdivision planes. (Z-buffer
screen coordinates are defined by lsetdepth.) 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.
When scrsubdivide mode is not SS_OFF, 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
scrsubdivide.
Mode SS_DEPTH 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 SS_DEPTH 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.
Page 1
scrsubdivide(3G) scrsubdivide(3G)
For example, if maxsize is set to 0.0 (i.e. defeated), a polygon that
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
SS_DEPTH subdivision are limited to a minimum length of minsize, and a
maximum length of maxsize.
SS_DEPTH subdivision improves the accuracy of texture mapping when nonorthographic
projections are used, and improves the accuracy of fog
calculations. It is not useful for lighting improvement.
fogvertex, texbind, tevbind
scrsubdivide cannot be used while mmode is MSINGLE.
Only the VGX supports scrsubdivide. It has no effect on the VGXT and
SkyWriter models because of their support for per-pixel perspective
division.
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 nearinfinite
polygon subdivision. To avoid the resulting poor graphics
system response, IRIS-4D VGX models do not subdivide polygons whose
SS_DEPTH subdivision would result in more than 2000 slices.
PPPPaaaaggggeeee 2222 [ Back ]
|