Concealment-shading

The concealment-shading (literally “shade of celluloid”), also named toon-shading is a model of lighting not photorealist used in synthesis of image. It makes it possible to generate images with the aspect “Cartoon”.

Graphically, returned is characterized by marked contours and a reduced palette, as in the traditional cartoons, from where the reference to the celluloïdes. One also often employs the term “cartoon” to indicate this technique. Mimicry of the characters is generally exaggerated to accompany the style drawing-animated as in The Legend off Zelda: The Wind Waker , but that is not an obligation.

In the case of the play XIII , one allots the use of the concealment-shading to returned “cartoon” or “drawing-animated”.

The commercial revelation of this technique returns to Sega, with the play Jet-set Radio left in 2000. Some would give the invention of this technique to the play Super Mario World 2: Yoshi' S Island , of Nintendo. More recent, Crackdown of Real Time Worlds brings a crossing between reality and cartoon.

Techniques of concealment-shading for the 3D real-time

There exist various methods making it possible to obtain one returned concealment-shading in 3D Real-time. Some of these methods use the functions of bases present on all the graphics cards, while others call upon extensions available only on the recent charts, like the pixels shaders. All these methods in common have the addition of two effects: the layout of contours of the model 3D and thresholding of the shades (i.e. the replacement of the shades in degraded by a succession of levels of gray). This mode of returned, although decreasing realism, is thus more expensive in resources (as well CPU as GPU) as a basic posting because the objects must be returned in several stages.

Example of returned concealment-shading in 3 stages: contours, basic texture, then thresholding of the shades.

Layout of contours

Two methods make it possible to trace contours of an object 3D. The first consists in posting only contours of the back faces of the object in the form of thick black features. The posting of the back faces is managed by the graphics card, by reversing simply the Back-face culling (function of optimization allowing to draw only the faces fronts of an object in one made 3D normal). When this stage is finished, the object must then be réaffiché normally so that the back faces previously posted arise like contours. This method with the advantage of being simple to implement, but its major disadvantage is to give the illusion that contours grow bigger when the object moves away. Actually, it is the thickness of the lines which remains constant.

The layout of contours can also be carried out by using two almost identical objects 3D: the object itself and its envelope (which cannot be generated by a simple enlarging of the first). Contours are obtained then by posting the back faces of the envelope, in black, then by posting of the object. As the envelope is slightly larger than the object, it is visible on its edges. This method, used in the play XIII, generates contours more precise than the preceding one, without enlargement with the distance, but she asks more memory to store the object and her envelope.

Thresholding of the shades

At the time of this stage, the faces fronts of the object are posted without being subjected to lighting, what removes the shades and gives to the texture of the object a maximum Luminosité. This texture must have two layers: the first contains the texture of the object; the second contains the levels of gray allowing the thresholding of the shades. This second layer is semi-transparent, it is thus superimposed on the original texture of the object. The coordinates of texture of the first layer are fixed, while the coordinates of the second layer are recomputed with each image. For each top of the object, the coordinate of the second texture depends on the angle formed by the normal vector at the top and the vector of the light. If the angle is worth 180°, then the top is lit by a ray coming from face, therefore one will place the coordinate of texture for this top on a level of maximum gray: white (thus transparent). If the angle is worth 90° then the Lumière is “shaving”, without effect on the object, one will thus place the coordinate of texture on black. Between these two extremes the various levels of gray generating appear then the effect of seuillée shade.

Example of texture used to generate the shades.

This method uses a texture on several levels, which supposes the presence on the Graphics card of an adapted extension (like GL_ARB_multitexture in OpenGL). It is possible to circumvent this extension by posting the object in two stages: initially the object with its texture, then the same object but only with the texture of the levels of gray (semi-transparent). The disadvantage is that division on the two ways increases the computing time.

Use of the pixels shaders

On the recent and sufficiently powerful graphics cards, the pixels shaders can be used for returned in concealment-shading. If their use releases CPU certain calculations (see preceding methods), it is however greedy in resource GPU. Indeed, the thresholding and the layout of contours require calculations for each pixel of the image, whereas the methods without shaders work only on the tops of the object, much fewer. The thresholding of the shades is carried out by a fragment shader. The luminosity of each fragment (pixel) depends on the angle between the light and the normal at the point considered.

Characteristic plays

External bonds

  • concealment-shading in details (in English)
  • Tutoriel on the concealment-shading

Random links:List land borders by country | Mompantero | Marguerite Moreau | Me bour | Heinke van der Merwe | Prix_Tony