Next: 1.3 Edge Merging and
Up: 1. Functionality
Previous: 1.1 Parallelism
mental ray supports free-form curves and surfaces in non-uniform rational B-spline (NURBS), Bézier, Taylor (monomial),
cardinal or basis matrix form. Any of these forms may be
rational and may be of
degree up to twenty-one.1.2 Surfaces may be trimmed.
Internally, free-form surfaces are triangulated (approximated)
before rendering. A variety of approximation techniques is
available, including uniform and regular parametric, edge length,
distance, angle, and combined methods.
- The uniform parametric technique (referred to in the input file
as parametric) subdivides the
surface at equal intervals in parameter space. The input file
specifies a factor which is multiplied by the surface degree to
obtain the number of subdivisions in each parametric direction
per patch.
- The regular parametric technique (regular
parametric in the input
file) is a simpler variant of the previous technique. It
subdivides the surface at equal intervals in parameter space.
The number of subdivisions per surface is directly specified in
the input file.
- The edge length technique (using the length keyword)
subdivides the surface at equal intervals in camera space
(in the mi1 format) or in object space (in the mi2
format) -- or, rather, the intervals will never exceed the
given upper bound. Optionally, this bound may be specified in
raster space (in units of pixel diagonals) rather than
camera or object space. If, for example, one wanted to
approximate a surface with sub-pixel size triangles, one could
use the edge length approximation technique with a raster
space accuracy of 0.5 pixel diagonals. Note that the apparent
size of a subdivided portion of a surface is computed as if the
surface was parallel to the screen. Thus, the triangulation
does not become more coarse towards the edge of the object's
silhouette. This has the advantage that the object will be
well approximated even if seen in a mirror from a different
angle, but such a definition can also result in a large number
of triangles.
- The distance-dependent technique (using the distance
keyword) subdivides a surface until an upper bound on the
maximum distance in the space the object is defined in between
the actual surface and its triangle approximation (known as
the distance tolerance). This criterion is scale
dependent: the size of the object determines the number of
triangles, larger objects require more triangles to meet the
same distance criterion because the distance scales with the
object. Note that the distance criterion will not resolve
features whose scale is below the given tolerance.
- The angle-dependent technique (using the angle keyword)
subdivides a surface until an upper bound on the maximum angle
(in degrees) between any two normals on a subdivided portion of
the surface (known as the angle tolerance) is met. In
spite of the apparent advantage of the size-independent angle
criterion over the distance criterion, the angle criterion has
the undesirable property of resolving small discontinuities ad
infinitum, whereas the distance criterion will not resolve
features whose scale is below the given tolerance. Either
criterion can be disabled by setting the corresponding
tolerance to zero. The distance criterion may be optionally
given in raster space, again in units of pixel diagonals.
- Fine approximation3.1 can be combined with the length
and parametric techniques to create a very fine microtriangle
approximation that works especially well for very detailed
displacement maps, resolving every little detail instead of
introducing tessellation artifacts such as broken edges at
contrast boundaries in the displacement map. Due to
mental ray 3.1's cache manager, fine approximation does not
result in excessive memory usage (as non-fine approximation
with the same approximation parameters would). See
page pagereffineapprox for details. Fine approximation
cannot be used together with merging and connections.
The length, distance, and angle criteria can be combined; in this
case refinement continues until all criteria are met. The any
keyword changes this so that refinement stops when any criterion
is met; this is useful to stop the angle criterion from adding more
triangles when the triangle edges become smaller than the limit
specified by the length criterion, for example.
View-dependent subdivision, enabled
by the view keyword, changes the length and distance criteria
to work in raster space, interpreting the parameters in pixels instead
of 3D units. Effectively, closer objects are tessellated more finely.
This means that objects that are instanced more than once must be
triangulated in multiple ways. A tradeoff between the additional memory
required to store multiple objects, and the reduced total number of
instanced triangles must be evaluated to achieve optimal speed.
The length, distance, and angle approximation techniques use a
recursive subdivision process that can also be controlled by two
additional parameters, specifying the minimum and maximum number of
recursion levels. The subdivision can be forced to proceed at least as
far as the given minimum level, and refinement can be halted at the
maximum level.
All subdivisions of a free-form surface apart from the regular
parametric technique and the Delaunay technique begin at the patch
level. (A patch is the smallest unit of a surface.) If, for example, a
plane is modeled with ten by ten patches it will be approximated by at
least two hundred triangles, although two triangles might be adequate.
If mental ray seems to be producing a large number of triangles in
spite of a low approximation accuracy, this is often due to the
selected patch subdivision algorithm.
The combined angle and distance approximation technique is usually
the most useful technique for high quality rendering. For a quick
rendering to examine materials or object positions, the uniform
parametric technique may be used with a factor of zero.
Free-form curves ( trimming curves) may also be approximated by any
of the above described methods using a technique and tolerances which
are distinct from those of the surface which the curve trims. The
definitions are essentially the same if one considers a curve segment
to correspond to a surface patch. An important difference is that the
edge length, distance, and angle approximation techniques will
coalesce curve segments if possible. A straight line consisting of one
hundred co-linear segments may be approximated by a single line segment.
Footnotes
- ... twenty-one.1.2
- Although
the user-settable degree is currently limited to 21, mental ray has no
inherent limit.
Next: 1.3 Edge Merging and
Up: 1. Functionality
Previous: 1.1 Parallelism
Copyright 2002 by mental images