
Image Based Rendering of Iterated Function Systems J.J. van Wijk a;∗, D. Saupe b aTechnische Universiteit Eindhoven, Dept. of Mathematics and Computer Science, P.O. Box 513, 5600 MB Eindhoven, The Netherlands bUniversit¨at Konstanz, Dept. of Computer Science, Box D697, D-78457 Konstanz, Germany Abstract A fast method to generate fractal imagery is presented. Iterated Function Systems (IFS) are based on repeatedly copying transformed images. We show that this can be directly translated into standard graphics operations: Each image is generated by texture mapping and blending copies of the previous image. Animations of dy- namic IFS codes are generated at fifty frames per second on a notebook PC, using commodity graphics hardware. Various extensions and variations are presented. Key words: Fractal imagery, iterated function systems, hardware acceleration ∗ Corresponding author. Email addresses: [email protected] (J.J. van Wijk), [email protected] (D. Saupe). Preprint submitted to Computer & Graphics 9 March 2004 1 Introduction Fractal imagery is one of the most fascinating topics in computer graphics. With only a few lines of code, highly intricate images with details on all scales can be generated. We consider one class of these images: The well-known deterministic fractals produced by two-dimensional Iterated Function Systems (IFS's). One example is the Black Spleenwort Fern image, devised by Michael Barnsley, which is defined by only a few numbers and a compact algorithm. In the next section we give a very short overview of IFS's and algorithms to generate imagery; a very readable introduction can be found in [1], in [2] an in-depth treatment can be found. In section 3 we present a new technique to generate images of IFS's using graphics hardware acceleration. We show that the definition of the attractor can be translated almost directly into graphics operations. Several extensions and variations, i.e., the use of colour, dynamic IFS's, and the visualization of the space surrounding of the attractor, are presented. The performance of the method is discussed in section 4 and compared to results with a standard algorithm. Thanks to the acceleration by graphics hardware a frame rate of 50 frames per second can be achieved for animations of dynamic IFS's. Finally, conclusions are drawn. 2 Background An Iterated Function System (IFS) code with probabilities consists of a set of transformations fw1; w2; · · · ; wN g and associated positive probabilities fp1; p2; · · · ; pN g N with pi = 1 . We consider affine and contractive two-dimensional trans- Pi=1 2 2 2 formations wi : R ! R , defined by 0 1 0 1 0 1 0 1 x ai bi x ei B C B C B C B C w B C = B C B C + B C : i B C B C B C B C B C B C B C B C B C B C B C B C B y C B ci di C B y C B fi C @ A @ A @ A @ A Given an IFS code, there exists a unique associated geometrical object, de- 2 noted by A, a compact subset of R , called the attractor of the IFS. The attractor is defined as the set of points for which N A = [ wi(A): i=1 Informally, the attractor can be understood as a result of an iteration as follows. Suppose that initially a sufficiently large domain (e.g., a square Q with wi(Q) ⊂ Q for i = 1; : : : ; N) is covered with an (infinitely fine) powder, such that the amount of mass that covers each point is the same. In one iteration each transformation wi moves a portion pi of mass around as specified by the corresponding affine mapping. Now, points that remain covered with mass in the long run belong to the attractor. The set A is controlled by the affine maps wi and does not depend on the choice of the probabilities. Furthermore, an IFS code has an associated measure denoted by µ, which is governed by the probabilities pi. Intuitively, some areas will be covered with more mass than other areas. The measure of a subset B of A can be defined (informally) as the weight of the mass which lies upon B. Various algorithms have been developed to produce images of A. The deter- ministic algorithm follows almost directly from the definition of A. Choose a 3 2 compact set A0 ⊂ R . Next, generate a sequence Ak; k = 1; 2; · · · according to N Ak+1 = [ wi(Ak): i=1 This sequence will converge to A. The algorithm can be implemented in a straightforward way to generate a sequence of binary images Fk that approach an image F of A. For simplicity, we assume that the domain of the image is the unit square (2), we adopt the convention that a value of 0 denotes black (background) and a value of 1 denotes white (A), and we assume that the image is discretized in square pixels. Obviously, images are bounded, outside a fixed rectangle the image is assumed to be 0. In each iteration of Barnsley's implementation of the deterministic algorithm the new image is set to zero first, next all pixels are scanned. For pixels (u; v) that are white in the old image, the coordinates wi(u; v) are calculated and the corresponding pixels are set to white. The most well-known algorithm is the random iteration algorithm. It relies on the generation of a sequence of points xn; n = 0; 1; · · ·. Starting from an arbi- trary point x0, each next point is picked from the set fw1(xn 1); w2(xn 1); · · · ; wN (xn 1)g, − − − where the propability of the event xn = wi(xn 1) is pi. The first, say ten, points − are discarded, plotting the remaining points gives an image that approaches A again. A variation of this algorithm is to count how many points fall inside each pixel. In the limit this count, suitably weighted, gives an image of the measure µ of each pixel. Another algorithm is the escape time algorithm. For each point of the im- age pre-images are calculated recursively. If all pre-images remain within a bounded area, the initial point is in A; if not, the maximal number of itera- 4 tions until all preimages of the point leave an a priori defined bounding box of the attractor provides a measure for the distance to A (larger counts cor- respond to smaller distances). Mapped to a colour scale an intriguing image of the attractor and its environment results. The deterministic algorithm is a brute force algorithm, the random iteration algorithm requires sometimes millions of points to be evaluated before pixels are covered with enough points to obtain a detailed and stable image of µ, the escape time algorithm also involves a lot of computation. Several other algo- rithms have been developed [3,5,4,9,10] that are more efficient. For example, it is possible to limit the number of calculated points that fall into any given pixel. We present an alternative approach to improve the efficiency: We exploit graphics hardware, as can be found in todays commodity consumer PCs. 3 Method How can we use graphics hardware to render images of IFS codes? Instead of point based calculations as used, e.g., in the random iteration algorithm, we propose an image based approach that lends itself for an implementation with graphics primitives supported by graphics hardware. Consider the following sequence of images: F0 = 1; N Fk = min(1; i=1 siwi(Fk 1)); k = 1; 2; : : : : P − 5 Here w(F ) denotes the image F , warped by transformation w. The minimum is taken pointwise, and 1 is here the image with uniform maximal intensity 1.0. Furthermore, si denotes a weight factor for the transformed image wi(Fk 1). − As described later on, different values for these weights can be used to select either rendering of the attractor or of the measure. Each image Fk is generated via operations on complete images, each next image is defined as the sum of intensity scaled and geometrically transformed copies of the previous image. The intensity of the image is clamped to 1, to account for the limited dynamic range of images. An example is shown in figure 1. The transformations are defined as the mapping from a base frame (yellow) to sub frames (white). The figure shows the result after 1 to 5 steps and the final result. For the intermediate steps here a low value for the weight factors si was used to show the separate images of the original square more clearly. The process converges k quickly. Image Fk contains N copies of the original image. The largest copy k has size (maxi=1;:::;N Di) , where Di is the area of a unit square transformed by wi, i.e., Di = jaidi − bicij. Hence, if we render an M × M size image, after − log M= log(maxi=1;:::;N Di) iterations the copies are smaller than a pixel in area. Likewise the diameters of the copies shrink and converge to zero. Various settings for the weight factors si can be used. If all si = 1, the result will be an image of the attractor, assuming that all wi are non-singular, i.e., all Di > 0. If we use si = pi=Di (and omit the clamping to the maximal intensity 1.0) an image of the measure µ will result. The division by Di denotes the contraction of mass as a result of the transformation. It is necessary to include this here because warping in the graphics sense does not preserve measure in the mathematical sense.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages17 Page
-
File Size-