A Procedural Approach to Style for NPR Line Drawing from 3D Models
Total Page:16
File Type:pdf, Size:1020Kb
INSTITUT NATIONAL DE RECHERCHE EN INFORMATIQUE ET EN AUTOMATIQUE A Procedural Approach to Style for NPR Line Drawing from 3D models Stéphane Grabli — Frédo Durand — Emmanuel Turquin — François Sillion N° 4724 Février 2003 THÈME 3 apport de recherche ISSN 0249-6399 A Procedural Approach to Style for NPR Line Drawing from 3D models Stéphane Grabli £ , Frédo Durand†, Emmanuel Turquin‡ , François Sillion§ Thème 3 — Interaction homme-machine, images, données, connaissances Projets ARTIS et MIT Graphics Group Rapport de recherche n° 4724 — Février 2003 — 25 pages Abstract: This paper introduces a procedural approach to non-photorealistic line drawing from 3D models. The approach is inspired both by procedural shaders in classical rendering and by the power of procedural modeling. We propose a new image creation model where all operations are controlled procedurally. A view map describing all relevant support lines in the drawing is first created from the 3d model; a number of style modules operate on this map, by procedurally selecting and chaining lines before creating strokes and assigning drawing attributes. Two different levels of user control are provided, ranging from a low-level programming API to a parameterized building-block assembly mechanism. The resulting drawing system allows very flexible control of all elements of drawing style: first, different style modules can be applied to different types of lines in a view; second, stroke attributes are assigned procedurally and can be correlated at will with various scene or view properties. We illustrate the components of our system and show results of its application. Key-words: Non-Photorealistic Rendering, Procedural Rendering, style, line drawing £ ARTIS † MIT Graphics Group ‡ ARTIS § ARTIS Unité de recherche INRIA Rhône-Alpes 655, avenue de l’Europe, 38330 Montbonnot-St-Martin (France) Téléphone : +33 4 76 61 52 00 — Télécopie +33 4 76 61 52 52 Modélisation et application procédurale de styles pour le rendu expressif Résumé : Ce document introduit une approche procédurale pour le rendu de dessins au trait à partir de modèles 3D. Cette approche s’inspire à la fois des shaders procéduraux utilisés en rendu tradi- tionnel et de la modélisation procédurale. Nous proposons un nouveau modèle de création d’images dans lequel toutes les opérations sont contrôlées de manière procédurale. Dans un premier temps, un graphe de vue décrivant tous les supports des lignes pertinentes du dessin est créé à partir du modèle 3D. Des modules de style s’appuient alors sur ce graphe pour sélectionner et chaîner les lignes de manière procédurale, avant de créer les traits et de leur affecter des attributs de dessin. Deux niveaux de contrôle différents sont fournis à l’utilisateur, allant de l’interface de programmation bas-niveau à un mécanisme d’assemblage de composants paramétrés. Le système résultant permet un contrôle très souple de tous les éléments constitutifs du style de dessin: premièrement, différents modules de style peuvent s’appliquer à différents types de lignes; deuxièmement, les attributs des traits sont af- fectés de manière procédurale et peuvent dépendre à volonté des différentes propriétés de la scène ou de la vue. Nous illustrons les composants de ce système et montrons les résultats de son application. Mots-clés : Rendu non photoréaliste, rendu procédural, style, dessin A Procedural Approach to Style... 3 Figure 1: Two line drawings generated from a 3D model using our system. 1 Introduction The field of Non-Photorealistic Rendering [GG01, SS02, Dur02] has proposed a variety of tech- niques to create compelling line drawings from 3D models. Unfortunately, these methods are gen- erally hard-coded in monolithic software and lack a flexible and formal specification framework. In contrast, the shading languages available in photorealistic renderers such as Pixar Renderman [Coo84, HL90, Ups89, AG99] permit the design of an infinite variety of rich and complex appear- ances. In this paper, we introduce a flexible procedural approach to NPR line drawing. We focus on pure line drawing and leave hatching and tonal modeling as future work. Style can be specified by implementing procedures that describe how the silhouettes and other feature lines from the 3D model should be turned into strokes. This allows for a great variety of styles, including local stylistic variations within the drawing. The appeal of line drawing lies in its expressiveness and abstraction. It is widely used in con- texts as different as technical and scientific illustration, appliance manuals, maps, signs, and art. In addition to its pleasing aesthetic qualities, line drawing can prevent clutter, focus the attention on relevant part and omit superfluous details. Despite its simplicity, line drawing permits a broad vari- ety of styles. Style can be varied by changing the medium (e.g. chalk, pencil, pen and ink), but also by varying the attributes of the strokes. This includes thickness, tone, transparency, or texture. The art and craft of drawing carefully chooses these attributes to reveal shape, texture, ambiance, or to place emphasis. Equally important, the omission of strokes such as parts of the silhouettes allows the artist to prevent clutter, to choose focal point, and to call to the imagination of the beholder in order to produce a more lively drawing. It is therefore crucial to provide a fine control and the possibility to vary style across the picture. RR n° 4724 4 Grabli & Durand & Turquin & Sillion In this paper, we present an approach to style in line drawing inspired by photorealistic produc- tion rendering software such as Renderman [Coo84, HL90, Ups89, AG99]. Quoting Upstill: “The key idea in the RenderMan Shading Language is to control shading, not only by adjusting parame- ters, but by telling the shader what you want it to do directly in the form of a procedure” [Ups89] p. 275. Similarly, the style of a line drawing can be specified in our approach by implementing procedures that describe how the silhouettes and other feature lines from the 3D model should be turned into strokes. Historically, the development of shading languages has dramatically facilitated the exploration and development of realistic shading, and it has contributed to a dramatic improve- ment in the quality of production rendering. We hope that NPR can similarly benefit from a flexible procedural approach. We see two major application domains for our approach. First, the approach is ideally suited for situations where drawings have to be produced automatically in a given style, such as repair or assembly manuals, CAD-CAM, etc., where different features need to be rendered in different styles, or where some parts need to be emphasized, e.g. [SF91]. For example, the new field of feature modeling encodes semantic and high-level geometric information about parts of objects. At rendering time, these features needs to be visualized in a different style [BBN02]. Our approach is ideally suited for this, since it can use this high-level information and render objects in a flexible variety of styles. Which leads to our second application domain. The flexibility of our approach greatly facilitates the exploration of style and depiction issues for line drawing. A new effect can be implemented very easily and interactively explored, encouraging creativity. Figure 2: System architecture. 1.1 Related work Non-photorealistic rendering has proposed a wealth of techniques to generate line drawings from · · 3D models, e.g. [MKT · 97, HZ00, RC99, BS00, Elb98, SB99, GSG 99, KMM 02]. We build upon these techniques and extend them to propose a flexible procedural control of the drawing’s appearance. Style has received much attention in Non-Photorealistic Rendering and computer vision. Ma- chine learning is the most popular approach, e.g. [TF97, FTP99, BH00, HJO · 01, JEGPO02, KMM · 02]. However, these work focus on the low-level and statistical aspects of styles. Most Non-photorealistic techniques offer a control of style through a set of parameters, e.g. [Her98], or INRIA A Procedural Approach to Style... 5 through direct user interaction, e.g. [Hae90, Sch96, KMM · 02]. Hamel and Strothotte [HS99] cap- ture and re-use style using templates that control the parameters of a line renderer. In addition, the subtle variation of style within an image has been shown to be crucial to make the image more lively and focus attention, e.g. [WS94, DOM · 01, Her01, SD02, DS02]. The work closest to ours is the OpenNPAR system [HSS02, Ope02]. They developed an API for the development of real-time NPR software. They provide an impressive graphical user interface for the exploration of simple styles. Our approach focuses on line drawing and on more complex style development. We believe that ideally, a line drawing style could be explored first in our system before porting a more optimized real-time implementation in OpenNPAR. We also borrow from procedural modeling, which is a great technique to augment the complexity · of graphics models [EMP · 94, LDG01, CDM 02]. Similarly, in our system, the richness of a style can be generated by procedures specified by the developer. Our approach is also inspired by the style sheets present in word processing systems such as LATEX. They separate style from content, and the writer needs only provide some high-level semantic information such as what is a section header. The developer of a style writes a set of procedures that describe the appearance of the document, based on the structure information provided by the writer. The structure of 3D scenes and pictures is not as simple to specify, and we will rely more on geometry and semantic information provided by the user such as the importance of objects. Production software has recently been augmented with toon shaders, and non-photorealistic styles can be obtained with Pixar Renderman, e.g. [AG99], p330 and p477. Impressive results can be obtained, but the styles are usually limited to plain or wiggly lines, because no real one-dimensional stroke data structure is available.