Computer Graphics & Geometry

Non-photorealistic Rendering of Functionally Defined Volumetric Objects

M. Mizota (1), A. Pasko (2)


(1)   Graduate School of Computer and Information Sciences
Hosei University, Tokyo, Japan
(2)   National Centre for Computer Animation,
Bournemouth University, United Kingdom

E-mail: pasko@acm.org


Contents


Abstract: We propose two approaches to artistic (non - photorealistic) rendering of functionally defined volumetric objects. The overall object shape is modeled as a group of implicit primitives. The internal density of object is defined with special Noise or Turbulence functions. For rendering purposes, the object defined by real functions is converted into volume data. An artistic image is generated by using the density value obtained from the volume data. The proposed method makes it possible to create cartoon images and animations of steam or smoke, which are volumetric objects without clear boundaries.

1. Introduction

In this paper, we propose a method for creating an artistic (non-photorealistic) rendering and animation of functionally defined volumetric objects. Typical examples of volumetric objects are clinical diagnosis image (CT, MRI, and PET, etc.) and fluid analysis data (CFD). More general examples are fire, fog, steam, and clouds. In this paper, we select steam and smoke as typical gaseous objects for the experiments.

Recently, Non-photorealistic Rendering (NPR) or artistic rendering has received much research attention. However, there are few works on volumetric objects without clear boundaries like clouds or smoke. Furthermore, in the existing research on artistic rendering of clouds and smokes, usually particles are allocated in volume, and they are supplemented with some primitive shape (e.g., a sphere). The proposed techniques are applied only to the outer surface without taking into consideration the peculiar density distribution of gaseous objects.

In the method we proposed, the value of density is calculated from the functionally defined volume object model, and we create an artistic image by using the values of density. Steam and thin smoke can be rendered by using our method that puts the distribution of density into consideration.

For implementation, we use HyperFun that is a programming language designed for modeling the function representation (FRep) objects defined by real continuous functions of point coordinates as f (x)≥0 [5], and use POV-Ray, a free ray tracing software for rendering.

2. Related Work

Selle et al. [1] describe a technique for generating cartoon style animations of smoke. In their method, the dynamics of the smoke is generated with a standard liquid simulator with output in the form of particles. These particles are then rendered as texture mapped two-dimensional stencils, and silhouette edges are added using a depth difference technique to emphasize shape and depth. Hoshino et al. [2] proposed a method for creating cartoon-images and animation of smoke. They set particles from the volume data given by the simulation. Clouds or smoke are represented by allocating a sphere shape to each particle. Cartoon images are expressed by the cel-shading and the outline. Selle and Hoshino treat smoke simply as a surface without considering the internal distribution of density that is the main feature of a volumetric object.

Ebert [4] proposed a volumetric modeling and animation technique that combines real continuous functions with turbulence-based procedural techniques. This technique can produce a realistic cloud image. A cumulus cloud is created by positioning some implicit spheres with varying radii and blending amounts to define the overall shape of the cloud. Rheingans and Ebert [3] introduced a volume illustration approach, combining the familiarity of a physics-based illumination model with the ability to enhance important features using non-photorealistic rendering techniques.

3. Approaches to artistic rendering

We propose a technique for generating cartoon images of steam and smoke. As we deal with volumetric objects, it is not enough only to render some surface. We select several volume density values and thus several isosurfaces inside the volume. These isosurfaces are rendered with parameters depending on the density value to simulate the visual effect of the semi-transparent media. For the given object, we select several threshold intervals Tn (n=1, 2, 3...) of the density value to be used for changing rendering parameters.

Our gaseous object rendering system consists of three main components: defining an object model by using the function representation; conversion of the object model into a volume data set; and a rendering system for making artistic images. We have two rendering methods, namely a density threshold colors method and a stroke method.

3.1. Gaseous object model

Let us describe a functional definition of a gaseous object. In the functional model, the outward shape of the object is defined by a function f(x), and the inner density is defined by s(x). We define the outward shape by using blobby objects and convolution surfaces, because ordinarily, a hand drawn cartoon image of smoke or cloud is seen like a set of blended spheres. However, it is possible to use any primitive for defining the outward shape. The inside is defined by using the function of turbulence for representing density [6].

3.1.1. Attributes in function representation. 

In FRep, physical and abstract objects and phenomena are modeled as point sets. Object properties are modeled as attributes: photometric (opacity, color and reflectance), material, density, temperature as

Volume model = {3D point set, point attributes}.

Each point: {(x, y, z), (s1, s2,..., sn)}.

3.1.2. Turbulence.

Turbulence is a random noise. The inner part of a gaseous object can be filled by turbulence making randomly scattered volume density.

In our method, we use the Perlin's turbulence method [6] with the function hfA_Turbulence(x, freq), where x is a point coordinates array, and freq is frequency of the turbulence. Output is a value in [0, 1].

3.2. Conversion to a volume data set

The defined functional model is converted into the volume data set (voxel array). The size of the volume is assumed to be nx*ny*nz, and the density is recorded in each voxel. First, the model is converted into the slice grayscale images similar to CT data. Next, the density data is acquired by reading the intensity values of the 2D image slices and using them as 3D volume data in the form acceptable for the renderer. The point coordinates and the density value are converted to a voxel stored in the volume data set. Moreover, the shape and density changes of the object according to the passage of time are followed by continuously updating the volume data according to the time series.

3.3. Artistic rendering using density threshold colors

In the process of ray tracing, the density value at each point is calculated from the volume data set. For example, the density distribution obtained for a simple cylinder is shown in Fig. 1.

Fig. 1. Example of cylinder and its density graph.

The ray-isosurface intersection in each threshold interval Tn (n=1,2,3...) is calculated for the density data as shown in Fig. 2. The left is a cylinder function and the right is a cylinder function with added turbulence.

Fig. 2. Finding density levels by threshold intervals

Color is assigned to the respective threshold levels Tn, and the color of the pixel for the ray-isosurface intersection is taken as the color of the corresponding Tn. Color close to white level is assigned to the threshold with high density, and color close to black is assigned to the low one. Thus, ray tracing produces the image with the cartoon style discrete grey levels. Fig. 3 shows ray-traced images of a cylinder with the smooth and turbulent density attributes.

    

Fig. 3. Artistic rendering of cylinder.

 

3.4. Artistic rendering using density values and strokes

We propose the technique for rendering gaseous objects in a hand drawn style by generating strokes using density values. To make strokes, points are selected on the isosurface contour for the given density threshold value. We select points with maximum and minimum values of X-coordinates with constant Y coordinates on the contour (Fig. 4). The minimum value is stored in the array of Left_Line, and the maximum value is stored in the array of Right_Line.

Fig. 4. Finding points for strokes.

Strokes are generated between detected points of the contour using the arrays Left_Line and Right_Line. Fig. 5 (b) shows straight line strokes for one isosurface contour. Because general hand drawn steam is usually by curves, we supplement detected points with the curved strokes. Left_Line  strokes are defined to bend to the left, and Right_Line is defined oppositely. Moreover, the first points of each array are connected by the curve too. Fig. 5(c). shows a contour rendered with curved strokes.

To simulate steam appearance, the following conditions are put for each density isosurface contour:

The color and the thickness of strokes are changed according to the density value.

The number of the strokes is decreased with random variation while the isosurface becoming deeper internal, because outside outline is clarified and the inside part will be rendered as indistinct fuzzy media.

       (a)                       (b)                        (c)

Fig. 5. Points and strokes for steam rendering.

4. Implementation and Experiments

4.1 Artistic images of steam

  The implementation includes steps of the model definition, generation of volume data, and the modification of POV-Ray for artistic rendering.

  We implement the steam model as follows:

                   f(x) = 1;

                   s(x) = hfConvCurve(x,vect,S,T) & hfA_Turbulence(x,freq );

  hfConvCurve is a convolution primitive with a curve skeleton (set of connected skeleton line segments). Normally, the attributes are defined in the array S(x) when f(x) > threshold (ex.-0.01) in HyperFun. However with f(x)=1 we can consider distribution of the density attribute in the entire space. For the test model, we add the following expression to simulate diffusion of steam going up and thinning of the density.

                   s[x] = s[x] * (1 - (y + α) * 0.1);

  For making volume data, the steam model is converted into 200 bitmap images of 200x200 pixels by using the HFSlicer software. Fig. 6 is one of slice image. The density value in each voxel is calculated from the color obtained by reading the bitmap image, and the density is stored as df3 file, which is a file format for volume data. As a result, we can get the volume data of 200x200x200 size.

Fig. 6. Slice image of steam.

The generated volume data is read to POV-Ray. The volume is called by using the Media object supported by POV-Ray as an interior of a box. The interval and sample of necessary parameters are set to a little larger than 20. These parameters define intervals advanced by a ray during tracing. The modification part of the existing POV-Ray source code is the following. We changed the media.cpp module to calculate the density value, and to detect the intersection with the threshold isosurface. The module render.cpp is changed for the points generation and rendering of strokes. Fig. 7 (a) is a realistic image of smoke. Fig. 7(b) shows artistic


     (a)                                                     (b)                                                       (c)

Fig. 7. Realistic (a) and artistic (b, c) images of steam


rendering with density threshold colors (see 3.3). In this image, there are five given threshold intervals. Fig. 7(c) is an artistic image obtained using the density values and strokes (see 3.4).

4.2 Thin smoke

Fig. 8. is artistic image of thin smoke by using the density threshold colors method. This model is a convolution primitive with a curve skeleton. With NPR applied only to the surface, this thin smoke object is not expressible and would be seen only as a bent cylinder, because there is no ruggedness on the surface.

Fig. 8. Artistic image of thin smoke.

5. Conclusion and Future Work

In this paper, we proposed a new artistic rendering method for functionally defined volumetric objects. The technique using the density threshold colors is able to produce cartoon-like images that express gaseous objects with long lines of peculiar strength. In addition to steam rendering, it was possible to express thin smoke. The method of stroke style rendering is able to express hand-drawn steam.

The method with strokes style involves only simple curved strokes now. Our future work is to render various stroke types such as brush strokes, and we consider it is possible to calculate color of smoke from the density and color attributes of the background objects. In addition, we propose an approach to convert a functional model into a voxel array. This approach can help us develop direct volume rendering of functional models.

References

[1] A. Selle, A. Mohr, S. Chenney , "Cartoon Rendering of Smoke Animations", NPAR04, 2004, pp 57-60.

.[2] T. Hoshino, Y. Dobashi, T. Yamamoto, "Cartoon Rendering of Smoke", IPSJ SIG Technical Report, 2004.

[3] P. Rheingans, D. Ebert, "Volume Illustration: Nonphotorealistic Rendering of Volume Models." IEEE Transactions on Visualization and Computer Graphics, vol. 7, no 3, 2001, pp. 253-264.

[4] D. Ebert, "Volumetric Procedural Implicit Functions: A Cloud is Born," ACM SIGGRAPH 97 Technical Sketches Program, August 1997.

[5] V. Adzhiev, R. Cartwright, E. Fausett, A. Ossipov, A. Pasko, V. Savchenko, "HyperFun project: a framework for collaborative multidimensional F-rep modeling", Implicit Surfaces '99 Workshop, 1999, pp. 59-69.

[6] K. Perlin, "An image synthesizer", SIGGRAPH 1985, pp. 287-296.