Ink-painting Animation by Geometry Buffer Based Real-time 3 D Rendering

We propose a technique using geometry buffers for real-time rendering of 3D ink-wash paintings. According to the characteristics of hand-drawn ink-wash paintings, contour lines and coloring area in the ink paintings are stylized by rendering 3D models to 2D texture images. Contour lines are drawn according to curvature of object surfaces. Coloring areas are rendered by alpha blending with stroke textures. Stroke textures are blended at sparsely sampled points for saving computation. Finally, integration of contour lines and colored area yields an ink-wash painting image. Entire rendering computation is implemented with a GPU for enabling its real-time processing on commercially available computers.


Introduction
Ink-wash painting is a non-photorealistic rendering technique currently focused attention.This technique is expected by media artists to be used in virtual reality systems.For its use in the virtual reality, generation of 3D CG is required instead of the conventional method transforming 2D images to a ink-painting style.Additionally, user interaction in the virtual reality demands high efficient real-time rendering of scenes.
Lee et al. (1) and Park et al. (2) presented GPU-based real-time 3D NPR of ink-paintings.Their drawing of surfaces, however, seems only limited to primitive 3D models.Li et al. (3) simulated the diffusion process of Indian inks, however, their computation is not real-time.Way et al. (4) stylized procedural stroke textures, however, their method is specialized to trees.The footprint particles by Xu et al. (5) are applicable to broad scenes, while rendering of ink surfaces is insufficient and diffusion effect is weak.
We propose, in this paper, a technique for real-time rendering of ink-paintings of 3D scenes on the basis of geometry buffers.In our method, all of geometry information are firstly rendered into 2D texture images.Next, contour-line strokes drawn with inks and naturally diffused object surfaces are generated from the geometry buffers.Finally, they are fused into the frames in animation movies.This approach has the advantage over the conventional NPR methods as it can deal with various type of objects and scenes not limited to specific objects.

Characteristics of Ink-paintings
Ink paintings are pictures representing shades of objects by black ink drawing on a white paper.Various traditional drawing techniques have been developed in Asian regions.

Qualitative Characteristics
Fine reality is not pursued in ink paintings, instead objects are drawn with abstracted lines and surfaces.Some rules are followed as contour lines are attached on the edge of hard objects such as stones while soft materials are painted with blurred surfaces.The thickness of lines is also adjusted according to fine or rough materials.

Drawing Techniques in Ink Painting
Techniques used in the ink painting are generally categorized into three groups: contouring, coloring and texturing.Each group contains two techniques.The contouring includes drawing outlines and sketching contours, the coloring is composed of stippling and dyeing painting, the texturing contains techniques of drawing the shades and textures of rocks and mountains.Among these techniques, popularly used are the contouring and the coloring, that is, ink paintings are mainly composed of contour lines and colored surface areas.

Rendering Technique of Ink-paintings
We propose a rendering technique of ink-paintings focusing on the contouring and the coloring.The flow of the rendering procedure is illustrated in Fig. 1.
As is shown in Fig. 1, our method renders an inputted 3D model into a geometry buffer composed of four texture data: depth map, normal map, diffuse map and grayscale map.From these maps, the edge map is constructed and using it the contouring lines are rendered.In parallel, the coloring area is calculated and the contour lines and the coloring area are integrated to generate ink-painting frames.
Inputted 3D models are rendered into the above four textures and whole geometry information is written in a 2D image, and all of computation are executed on a pixel level.
From the geometry buffers, the color, size and orientation of stroke textures are computed and pasted at every pixel in the screen space, resulted in an output frame of our method.

Basic Data Structure
We represent the geometry information and surface texture by 2D images for their calculation on the pixel level.We call that set of 2D images the geometry buffer which is composed of four images: depth map, normal map, diffuse map and grayscale map.The depth map contains the geometry information, the normal map includes the information of surface normal vectors, the quality of the materials is preserved in the diffuse map in which the thickness of contour lines is saved in its R-channel, G and B channel denote the darkness of coloring area and the index of materials is saved in the alpha-channel.This grayscale map contains the following data: ( ) where N is the normal direction at the pixel and pos V is a unit vector from the viewpoint to the pixel.We set 0.35

 
. The grayscale map is used for rendering coloring areas.

Drawing of Contour Lines
In the NPR, contour lines are drawn not only at object boundaries but also at the interior in objects at high curvature surface.We, therefore, extract contour lines using the curvature of surfaces.Firstly, the curvature is calculated from the data of normal vectors in the normal map.Variations in the angle of normal vectors along the four nearest neighbors , , , Next, we apply the Laplacian filter to the depth map to get ij L .We decide the pixel where ij L is lower than -0.
for edge pixels.For pixels where ij L is greater than 0.4, we set these four weights to 0. For remaining pixels, we set these four weights to 1.We set 0.
where  is a parameter controlling the size of stroke textures and the alpha blending with contour A .

Drawing of Coloring Areas
Coloring areas are regions where the surface of 3D  Rendering of all of stroke textures is computational intensive even if we use GPU.Hence, stroke textures are rendered by skipping some pixels as is shown in Fig. 4(a).However, if stroke textures are rendered with fixed spacing as in Fig. 4(a), aliasing occurs around contours as is seen in Fig. 4(b).In order to prevent such jaggies, strokes are pasted with variable spacing as in Fig. 4(c).This interval is adjusted by the value in the grayscale map.If the grayscale map is small, then such pixels are near contours and their spacing should be small.This adaptive spacing resolves the aliasing as is shown in Fig. 4(d).

Integration
Integration of contour lines and colored area yields an ink-wash painting image.
The first step in the integration is blending of Gaussian-blurred black regions with coloring area.This is secondarily alpha-blended with a paper texture.This is finally alpha-blended with contour lines (7) .
In order to preserve temporal coherency in the animation of rendered frames, each frame is smoothed using a temporal Gaussian filter.Thus temporally smoothed movie is an output of our method.

Results
The above method was implemented using C++ and HLSL running on the platform of Intel Core i7 and GeForce GTX 970M.An example of results is shown in Fig. 5 where (a) is a 3D model of deer, (b) is its surface texture and (c) is a rendered result.
Other examples are illustrated in Fig. 6.The horse, rabbit, chicken, bird and goat in Fig. 6(a)～(e) use grayscale maps.These are rendering of only one object, while multiple objects are rendered in Fig. 6(f)～(h).In Fig. 7, a rendering result of 3D scene composed of several objects is shown.Finally, two frames in an animation are shown in    Our method renders 3D scenes on a screen space, hence its performance varies with the resolution of the screen as is shown in table 1.The value of FPS larger than 25 is sufficient for real-time processing.All cases in table 1 satisfy this condition.

Conclusions
We have presented a method for real-time ink-painting rendering of 3D scenes focusing on contour lines and coloring areas.Resulted animations well preserve temporal coherency.Improvement in natural expression of ink-painting strokes and computational efficiency is under study.

.
shown in Fig.3.The darkness of ink strokes is set to 0, and the transparency color A Resulted stroke textures are rendered with the alpha blending.

Table 1 .
Rendering speed at various resolution.