Volume xxx, (1995 ) number yyy pp. 000{000
Implicit Representations of Rough Surfaces John C. Hart School of EECS Washington State University Pullman, WA 99164-2752
[email protected] Abstract
Implicit surface techniques provide useful tools for modeling and rendering smooth surfaces. Deriving implicit formulations for fractal representations extends the scope of implicit surface techniques to rough surfaces. Linear fractals modeled by recurrent iterated function systems may be de ned implicitly using either geometric distance or escape time. Random fractals modeled using Perlin's noise function are already de ned implicitly when described as \hypertexture." Deriving new implicit formulae is only the rst step. Unlike their smooth counterparts, rough implicit surfaces require special rendering techniques that do not rely on continuous dierentiation of the de ning function. Preliminary experiments applying blending operations to rough surfaces have succeeded in an initial attepmt to overcome current challenges in natural modeling. The grafting of a stem onto the base of a linear fractal leaf continuously blends smooth detail into rough detail. The blend of two textured cylinders interpolates geometric bark across branching points in a tree.
1. Introduction Computer-aided geometric design investigates the bene ts and drawbacks of various representations of curves and surfaces. Designers use both implicit and parametric formulations to represent objects, and having both representations available for the same model allows ecient intersection and collision detection determination. In particular, the implicit representations of piecewisesmooth surfaces enjoy the bene ts of topological freedom, simpli ed CSG operations and sophisticated blending operations, but suer drawbacks in surface interogation and texturing, and in realtime rendering. Although computer-aided geometric design is the \representation, approximation and computation of curves, surfaces and volumes," as de ned by the Scope of the journal Computer Aided Geometric Design (edited by R. E. Barnhill and W. Boehm, Elsevier, 1983{), the eld has focused exclusively on smooth models. The complement of smooth is rough and non-dierentiable. Rough ob c The Eurographics Association 1995. Published by Blackwell Publishers, 108 Cowley Road, Oxford OX4 1JF, UK and 238 Main Street, Cambridge, MA 02142, USA.
jects certainly appear more frequently in nature 1 , and are also common in synthetic environments, such as carpeting, fabrics and in the microstructured texture found on otherwise at surfaces.
1.1. De nition
Rough surfaces are typically modeled using the tools of fractal geometry. Geometric fractals typically fall into two families: deterministic and random. While algorithms for generating fractals in either family typically rely on random number sequences, the essential dierence between the two families is that the shape of a random fractal is dependent on the random sequence whereas the shape of a deterministic fractal is independent of the random sequence.
1.2. Overview
This paper pulls together existing de nitions, algorithms and techniques from a wide range of areas in fractal geometry, computer graphics and
2
John C. Hart / Implicit Representations of Rough Surfaces
computer-aided geometric design to formulate implicit representations of fractal surfaces, and to exploit this representation for applications in natural modeling. Section 2 de nes a linear deterministic fractal as the attractor of a recurrent iterated function system (RIFS). One technique for visualizing the dynamics of an RIFS classi es the complement of its attractor by \escape time," a continuous indication of the computation required to determine if a point is not part of the attractor. The original contribution of this section is to show that escape time implicitly de nes the attractor. Section 3 shows how to model a random fractal as the in nite sum of band-limited signals. The \hypertexture" technique modeled a random fractal object by using a fractal deformation to perturb an implicit surface. Whereas previous discussions focused on various fractal deformations, the original contribution of this section is its focus on the implicit representation of the resulting rough surface. Section 4 describes existing ray tracing methods for rendering implicit surfaces, and shows how they were previously adapted to render fractal objects. This section demonstrates how the implicit formulation of rough surfaces has already been used to overcome a problem. Section 5 describes an existing blend, called the \pseudonorm blend," which joins two implicit surfaces in a continuous manner. The original contribution of this section is the use of this common blending operation on both deterministicand random-fractal rough surfaces. This demonstrates an application of the implicit formulation of rough surfaces in natural modeling and reveals an entirely new set of problems to overcome in the development of blends.
2. Deterministic Fractals
One may represent the unit circle at the origin using a variety of dierent methods. The vectorvalued function p() = (cos ; sin ) (1) represents the Cartesian coordinates of the circle parametrically. Alternatively, consider the functions f (x; y) = x2 + y2 ; 1 (2) 2 2 g(x; y) = x + y ; 1: (3) The zerosets of both functions implicitly represent the same circle, and their sign reveals containment
p
within the circle. The magnitude of f (x; y) yields the algebraic distance from the point (x; y) to the circle 2 whereas the magnitude of g(x; y) yields the geometric distance. Consider the vector-valued function q(x; y) = (x2 ; y2 ; 2xy): (4) n n ; 1 Using the notation q (x; y) = q(q (x; y)); the function Q(x; y) = nlim qn (x; y) (5) !1
yields the result of repeated application of q: This result is zero for points (x; y) inside the unit circle, in nity for points outside the circle, and something else for points on the circle. Therefore, the function Q implicitly de nes the unit circle. The number of iterations needed to decide if a point (x; y) is inside or outside the unit circle within a tolerance > 0 forms an iterative distance. If (x; y) is inside the circle, then its iterative distance is the smallest number n such that jjqn (x; y)jj < : Conversely, if (x; y) is outside the circle, then its iterative distance is the smallest number n such that jjqn (x; y)jj > 1=: Figure 1 visually compares iterative distance with geometric and algebraic distance. The function q actually de nes the square of the complex number x + yi; and the circle is called its Julia set. Such quadratic Julia sets are one form of deterministic fractals. A distance underestimate function exists that can be used to implicitly de ne quadratic Julia sets 3 , and this form was used to render 3-D (quaternion) extensions of complex Julia sets 4 . This section instead focuses on the implicit formulation of Julia sets de ned by systems of linear equations, called linear fractals. Of the deterministic fractals, linear fractals permit the greatest degree of control and are hence the most promising deterministic representation for detail in rough surfaces. Linear fractals are represented by the recurrent iterated function system, which can yield implicit de nitions based on geometric distance as well as a continuous version of iterative distance called escape time.
2.1. Recurrent Iterated Function Systems
An iterated function system 5 ; 6; 7 describes an object using smaller copies of itself. Symbolically, an iterated function system is a nite set of N (typically ane) contractive transformations fwi gNi=1 from a complete metric space into itself, typically wi : Rn ! Rn where n = 2 or 3. The Hutchinson
c The Eurographics Association 1995
John C. Hart / Implicit Representations of Rough Surfaces
3
Figure 1: Evenly-spaced contour lines for geometric (left), algebraic (center) and iterative (right) distance functions.
operator applies the transformations of an IFS and is de ned to operate on a set B Rn as
[N w(B ) = w (B ): i=1
i
(6)
The IFS models a shape A; called the attractor of the IFS, as the unique solution to A = w(A); (7) or can be described as the limit set A = klim wk (B ) (8) !1
for any non-empty bounded B Rn: The recurrent iterated function system 8 describes a shape by rst separating it into components, then describing each component using smaller copies of itself and/or other components. The determination of which components are used is controlled by a digraph. A recurrent iterated function system hfwi gNi=1 ; Gi is an IFS and a digraph G consisting of N vertices. The edges of G are denoted hi; j i which indicates an edge from vertex i to vertex j: The operation of a recurrent iterated function system is easier to describe using set-vector notation, where a set-vector B (Rn)N is an N -vector of sets Bi Rn: The Hutchinson operator is de ned on set vectors as w(B) = (w1 (B); w2 (B); : : : ; wN (B)) (9) where wj (B) = wj (Bi ): (10)
[
hi;ji2G
The attractor of an RIFS A Rn by the set-vector A (Rn)N as A =
c The Eurographics Association 1995
is described
[Ni=1 Ai : The
set-vector A is the unique solution of A = w(A) or equivalently A = klim wk (B) !1
(11) (12)
where B (Rn)N is a set-vector whose components Bi are each non-empty and bounded.
2.2. Escape Time
A function need only continuously de ne the exterior of a shape to support many implicit surface algorithms. Such a function f (x) de ning an implicit shape A would then be non-negative over Rn; positive for x 2 Rn n A and zero for x 2 A: Such functions exist for recurrent iterated function systems. The continuous escape time function for the iterated function system 9 and the recurrent iterated function system 10 can be transformed into an appropriate function. Given an RIFS hfwi gNi=1 ; Gi with attractor A and let B A be a bounding volume containing the attractor. The discrete escape time function classi es points x 2 Rn by the number of iterations required to determine that a point is not in the attractor. Hence it is uniformly zero for x 62 B; and in nite for x 2 A: The (discrete) escape time e(x) is the smallest non-negative integer n such that x 62 wn (B ): An escape time of n implies wi;n1 wi;11 (x) 62 B 8i1 ; : : : ; in ; that n is so large that every n-fold allowable composition of inverted RIFS maps takes x outside
4
John C. Hart / Implicit Representations of Rough Surfaces
the disk 11 . It also implies wi;n1;1 wi;11(x) 2 B 9i1 ; : : : ; in;1 ; (13) that n is so small that there exists an (n ; 1)fold composition of inverted maps that keeps x in the disk. Denote the latter point as xn;1 and let the bounding volume B be a disk of radius R about the origin. Then the escape time can be made continuous by adding the fractional residual log R ; log jjxn;1 jj res(x) = max : i log jjwi;1 (xn;1 )jj ; log jjxn;1 jj (14) In the likely event that more than one mapcomposition sequences satisfy (14), choose the xn;1 that maximizes res(x): Inverting the continuous escape time yields a function 1=e whose value is zero on the attractor and continuously rises to in nity at the boundary of the disk. The zeroset of the function 1=e then implicitly de nes the attractor. The values of 1=e yield a continuous iterative distance, which is analogous to the continuous algebraic distance returned by polynomial functions.
where b represents the base surface and the ni represent the roughness. The hypertexture system used this implicit representation of roughness for procedural modeling, but focused on the roughness function, ignoring the implicit formulation. Refocusing on the implicit formulation reveals the suitability of general implicit surface algorithms for application on noise-based rough surfaces.
2.3. Geometric Distance
4.1. Linear Fractals
An alternative implicit formulation is based on the distance to the attractor. Hepting, Prusinkiewicz and Saupe 9 described an ecient, error-bound algorithm for computing the distance from a point to an IFS attractor. The computation of distance straightforwardly extends to the RIFS case as well.
3. Random Fractals
In computer graphics, \noise" is de ned as a function n : Rn ! R that returns a stationary isotropic band-limited random signal 12 . Although random, the noise function is smooth. It forms a basis for constructing fractional Brownian motion (fBm) as 1=f ; noise(x) =
X 2; i n(2i x)
N ;1 i=0
(15)
where N is the number of octaves, 2 is the lacunarity, and controls roughness, ranging from 1 (space- lling) to 3 (smooth). Perlin and Hoer 13 formulated an implicit representation of rough surfaces, in their \hypertexture" system. A rough surface can be implicitly de ned by applying the fBm as a range deformation to a base implicit surface: f (x) = b(x) + 1=f ; noise(x) (16)
4. Ray Tracing
Implicit surfaces are well suited for backward visible-surface techniques like ray tracing. The ray anchored at x0 extending in the direction of xd is de ned parametrically as r(t) = x0 + txd : Finding the rst intersection of the line of sight r(t) with an implicit surface de ned as f (x) = 0 requires nding the smallest t > 0 such that f (r(t)) = 0:
An implicit formulation for RIFS attractors provides an algorithm for eciently nd the rst (smallest positive) ray-attractor intersection 14 . Given an RIFS hfwi gNi=1 ; Gi; let A = w(A) be its attractor and B A be a bounding volume contain the attractor. Applying the allowed RIFS maps to the bounding volume produces a set of new bounding volumes w(B ) that together more closely bound the attractor. The points in (the interior of) B but not in (the interior of) w(B ) have an escape time greater than zero but no more than one, since there exists at least one inverted RIFS map wi;1 that maps the point outside the bounding volume B: Repeated application of the RIFS maps on the bounding volume creates a hierarchy of bounding volumes. Level n of this hierarchy consists of bounding volumes containing points whose escape time is greater than n: Section 2.2 de ned the attractor implicitly as the set of points with in nite escape time. Hence, the limit of this bounding volume hierarchy is the attractor. One may determine if a given point is in the attractor by a depth- rst search through the bounding volume hierarchy, demonstrated in Figure 2. One may determine if and where a ray intersects the attractor through a similar depth rst search 14 .
c The Eurographics Association 1995
John C. Hart / Implicit Representations of Rough Surfaces
5
converges to the rst intersection of the ray with the surface, as shown in Figure 3.
Figure 3: Sequence of sphere-tracing steps for an intersecting ray and a non-intersecting ray.
Figure 2: Bounding volumes checked in determining
the relationship of a point with respect to Sierpinski's gasket.
4.2. Random Fractals
Perlin and Hoert13 used a \ray-marching" rendering algorithm, borrowed more from volume visualization than implicit surfaces, to render the rough surfaces modeled by hypertexture functions. Sphere tracing 15 uses geometric distance to render rough surfaces more eciently and more accurately. Let d(x; A) de ne the distance from a point x 2 R3 to a set A R3 as d(x; A) = min3 jjx ; yjj; (17)
R
y2
as distance between x and the closest point in A: Let f implicitly de ne a surface A = f ;1 (0) such that at every point x 2 R3 jf (x)j d(x; A): (18) The function f underestimates the distance from x to the surface A: Let r(t) represent a ray isometrically parameterized by t. For example, r(t) = x0 + txd where jjxd jj = 1: Sphere tracing nds the rst intersection of r(t) with f ;1 (0) as the limit of the sequence (t0 ; t1 ; : : :) where t0 = 0 and tn+1 = tn + f (r(tn )): (19) Since f is positive outside the set, the sequence does not stagnate. Since f returns at most the distance to the surface, the sequence never causes the ray to step over the surface. Hence, the sequence
c The Eurographics Association 1995
A function f (x) satis es the Lipschitz condition if and only if for any two points x; y 2 R3; there exists a constant > 0 such that
jf (x) ; f (y)j jjx ; yjj: (20) The smallest such that (20) holds is called the Lipschitz constant of f: Given a function f that satis es the Lipschitz condition for some ; then the function f= satis es the distance property in
(18)16 . Hence, any Lipschitz function can be made into a distance underestimate. Any function with bounded partial derivatives is Lipschitz, and its constant is its maximum gradient magnitude. The Lipschitz constant of a sum is no greater than the sum of Lipschitz constants of its terms. Equation 16 de nes a rough surface implicitly, using f (x); as the sum of a base function b(x) and several noise functions ni (x): The sum = b + i i provides a Lipschitz bound on f where b is a Lipschitz bound on b and the i operate similarly on the ni : There are many dierent formulations of noise functions, but all interpolate random scalar lattice-point values. A Lipschitz bound for such noise functions is determined by nding the maximum slope of the interpolation kernel between the two neighboring lattice points with the widest possible disparity in random values.
P
5. Blending The implicit form of a surface greatly facilitates the smooth joining of separate surfaces. This section describes one particular blending function and applies it to the implicit forms of both linear fractals and random fractals.
6
John C. Hart / Implicit Representations of Rough Surfaces
5.1. The Superelliptic Blend
The superelliptic blend 2 is local (has a nite radius of in uence) and possesses desirable metric properties (yields distance underestimate given distance underestimate components). Given two implicit surfaces A = fA;1 (0) and B = fB;1 (0); de ne gA (x) = max f1 ; fA (x) ; 0g (21)
rA
a b c d e f leaf 0.667 0 0 0 0.667 0 0.5 0 0 0 0.5 0.5 0.354 -0.354 -0.235 0.354 0.354 0.235 0.354 0.354 0.235 -0.354 0.354 0.235 stem 0.5 0 0 0 0.5 0 0.5 0 0 0 0.5 -0.25
and gB likewise. The radii rA and rB control the extent of blend. The blend surface is implicitly de ned by p p 1: Iterated function system for leaf and stem, fAB (x) = rA gA (x)p + rB gB (px) (1; gA (x)p ;gB (x)p )1=p : Table of the form w(x; y) = (ax + by + c; dx + ey + f ): gA (x) + gB (x) (22) The resulting blended union is de ned implicitly by 5.3. Blending Random Fractals f (x) = min ffA (x); fB (x); fAB (x)g : (23) Figure 5 (left) demonstrates the superelliptic blend (yellow) on a pair of intersecting quadric The exponent p controls the degree of the resultcylinders (red and orange) meant to simulate the ing blend surface. Increasing p causes the blend branching ramiform studied in implicit form by to adhere more closely to the features of the comBloomenthal 18 . In Figure 5 (right) the geometry ponents. The domain of the blend is the locus of of these cylinders has been modulated by a fractal points such that fA(x) rA and fB (x) rB : Innoise function, stretched along the cylinder axis so creasing rA causes the blend to t to a larger area as to simulate bark. The resulting fractal cylinders along B; and vice versa. were then blended using a degree-four superelliptic blend. 5.2. Blending Linear Fractals The hypertexture addition of the bark noise Figure 4 (left) shows a leaf blended with a line components to the cylinder base surfaces underessegment. The leaf is modeled by an IFS of four timated the geometric distance more severely than transformations in Table 1 and is represented imits smooth counterpart, which required the expanplicitly by an inverted escape time function. The sion of the radii to de ne an equivalent blending line segment (from (0; ;0 :5) to (0; 0)) is likewise region. Furthermore, the roughness of the comrepresented, using a two transformation IFS in Ta- ponent surfaces causes the blending radius, which ble 1. While the line would be simpler to de ne uswas smooth in Figure 5 (left), to wiggle in Figure 5 ing geometric-distance, its escape-time de nition (right). While the silhouettes are continuously inprovides an equivalent eld for blending with the terpolated, the goal of interpolating the bark texleaf. ture is achieved only in a narrow region along the intersection curve. This gure illustrates the result of a fourthdegree superelliptic blend. The radius of in uence The irregular noise functions hinder the detail for the leaf is 0:5 ; which causes the blend to adof the blend in Figure 5. A better visualization of here to the line segment close to the leaf. The rathe blending of bark results from a more regular dius of in uence for the line is 4, which causes the texture. Figure 6 displays a right-angle branch, blend to smooth a wide region along the bottom as would be found in a r tree. In this case, the of the leaf. Figure 4 (right) magni es the blending bark is modeled by a radial sinusoidal deformation region to reveal that the blend approximates the component leaf's detail at progressively ner levels. n(x; y; z ) = asin(f tan ;1 (x; y)) (24) While Figure 4 achieves the goal of blending a where a is the amplitude and f is the frequency smooth edge into a rough edge, the blend creates of the sinusoid. This deformation corrugates the a bulge which is not typically seen on leaves. Apsurface of a cylinder into a bark-like texture. plication of a bulge elimination method 17 would result in a more realistic leaf-stem combination. Figure 6 shows that two bark textures will join
c The Eurographics Association 1995
John C. Hart / Implicit Representations of Rough Surfaces
Figure 4: Blend of leaf and stem (left) and blowup of leaf-stem blend (right).
Figure 5: Smooth branching ramiform (left) and rough version (right).
c The Eurographics Association 1995
7
8
John C. Hart / Implicit Representations of Rough Surfaces
Figure 6: A r branch blended into a trunk, with no bark (ul), one octave of the sinusoid bark texture (ur), two octaves (ll) and three octaves (lr).
c The Eurographics Association 1995
John C. Hart / Implicit Representations of Rough Surfaces
when their grain is nearly co-planar. In the noncoplanar case, however, the bark textures interfere, forming a cross-hatched pattern. The bark at branching points in observed trees similarly blends in the coplanar case, but in the interference case, the branch's bark does not blend into the trunk's, and the trunk's bark bends around the branch.
6. Conclusion
As computer hardware becomes more powerful and graphics algorithms become more ecient, the demand for more detailed geometric models will rise. This paper was an initial step toward creating tools for processing geometric roughness using an implicit representation. The central problems for future research is exploring and expanding the superelliptic blend to create better control over its eect on rough surfaces. A secondary problem is the development of ecient rendering algorithms for rough implicit surfaces so as to aid through visualization the investigation of roughsurface modeling and processing algorithms.
6.1. Future Work
The introduction of blending to rough surface modeling creates many new directions for further research. Elimination of the bulge in Figure 4 would be an immediate improvement. Development of a new blending basis for tree branches that blends in the co-planar case, and bends in the interference case would result in a more realistic branching ramiform. In general, new blending functions need to be developed, suited for the speci c needs of rough surfaces. This work is an early step in the control of rough surfaces. The typical paradigm for fractal modeling is experimental. This results in canonical models that resemble natural objects in general. Our long term future work focuses on the development of new techniques for fractal-based design: the ability to take a given rough shape, and produce a fractal model that resembles that speci c shape. The application of blending operations to rough surfaces gives us a little more control over a model powerful enough to describe much of natural geometry. Much more control is needed before fractal models can become a signi cant geometric design tool.
6.2. Acknowledgements
The author's work in implicit surfaces is supported in part by the NSF Research Initiation Award
c The Eurographics Association 1995
9
CCR-9309210, whereas his work in fractal modeling is supported in part by a grant from Intel. This work was performed in the Imaging Research Laboratory, which is supported in part by the NSF under grant CDA-9121675. The section on escape time bene ted from collaboration with Daryl Hepting. This work was inspired by the SIGGRAPH courses on implicit surfaces organized by Brian Wyvill and Jules Bloomenthal, and originally presented in the Implicit Surfaces '95 Eurographics Workshop co-chaired by Brian Wyvill and Marie-Paule Gascuel.
References
1. B. B. Mandelbrot, The Fractal Geometry of Nature. San Francisco: W.H. Freeman, (1982). 2. A. P. Rockwood and J. C. Owen, \Blending surfaces in solid modeling", in Geometric Modelling (G. Farin, ed.), pp. 367{383, SIAM, (1987). 3. Y. Fisher, \Exploring the Mandelbrot set", in The Science of Fractal Images (H. Peitgen and D. Saupe, eds.), pp. 287{296, New York: Springer-Verlag, (1988). 4. J. C. Hart, D. J. Sandin, and L. H. Kauman, \Ray tracing deterministic 3-D fractals", Computer Graphics, 23(3), pp. 289{296 (1989). 5. R. F. Williams, \Composition of contractions", Bol. Soc. Brasil Mat., 2, pp. 55{59 (1971). 6. J. Hutchinson, \Fractals and self-similarity", Indiana University Mathematics Journal, 30(5), pp. 713{747 (1981). 7. M. F. Barnsley and S. G. Demko, \Iterated function schemes and the global construction of fractals", Proceedings of the Royal Society A, 399, pp. 243{275 (1985). 8. M. F. Barnsley, J. H. Elton, and D. P. Hardin, \Recurrent iterated function systems", Constructive Approximation, 5, pp. 3{31 (1989). 9. D. Hepting, P. Prusinkiewicz, and D. Saupe, \Rendering methods for iterated function systems", in Proc. of Fractals '90, IFIP, (1990). 10. P. Prusinkiewicz and M. S. Hammel, \Escapetime visualization method for languagerestricted iterated function systems", in Proc. of Graphics Interface, pp. 213{223, Morgan Kaufmann, (1992).
10
John C. Hart / Implicit Representations of Rough Surfaces
11. P. Prusinkiewicz and G. Sandness, \Koch curves as attractors and repellers", IEEE Computer Graphics and Applications, 8(6), pp. 26{40 (1988). 12. K. Perlin, \An image synthesizer", Computer Graphics, 19(3), pp. 287{296 (1985). 13. K. Perlin and E. M. Hoert, \Hypertexture", Computer Graphics, 23(3), pp. 253{262 (1989). 14. J. C. Hart and T. A. DeFanti, \Ecient antialiased rendering of 3-D linear fractals", Computer Graphics, 25(3), (1991). 15. J. C. Hart, \Sphere tracing: Simple robust antialiased rendering of distance-based implicit surfaces", Tech. Rep. EECS-93-15, School of EECS, Washington State University, (Jan. 1993). Appears in SIGGRAPH '93 Course Notes #25 \Modeling, Visualizing and Animating Implicit Surfaces," J. Bloomenthal and B. Wyvill (eds.). 16. D. Kalra and A. H. Barr, \Guaranteed ray intersections with implicit surfaces", Computer Graphics, 23(3), pp. 297{306 (1989). 17. J. Bloomenthal, \Bulge elimination in implicit surface blends", in Proc. of Implicit Surfaces '95 (Eurographics Workshop), pp. 7{20, (April 1995). 18. J. Bloomenthal, \Techniques for implicit modeling", Tech. Rep. P89-00106, Xerox PARC, (1989). Appears in SIGGRAPH '93 Course Notes #25 \Design, Visualization and Animation of Implicit Surfaces".
c The Eurographics Association 1995