UberGame Articles : Hi! and Realtime Cartoon Rendering!

Well, I figured I better just dive into it and start putting up articles, instead of the classic, "Hi my name is joe and I will write some stuff..." So here's at least one article to start me off... If you want to send me email get it from my bio(by clicking my name in the bar above this). Here's the rest of the article:

What is it( Definition )?

Various Non-Photorealistic Rendering(NPR) techniques have been developed over the last few years by a large body of researchers. These are techniques that do not attempt to re-create the true look of reality, "photorealism", but instead re-create the artistic expression of reality. NPR attempts to emulate the techniques used by artists and illustrators to communicate visual information. Cartoon rendering(also known as cell rendering) is one branch of NPR.

Why use it( Motivation )?

NPR can increase the expressive power of 3D games by communicating information or emotions more effectively than photorealism. Traditional animators have for a long time known that the best way to convey emotion and meaning is through simplification and exhaggeration. This idea has unfortunately not transfered very well to computer animation and games where there is constant market pressure for more and more realistic imagery. This is unfortunate because realism(in the form of complex models, textures, and lighting) can often interfere with the goal of getting the idea or emotion across to the user. It frequently distracts, overloads, and forces the user to have to sort out meaning from all the extranious details while NPR does not. An artisistic expression, cartoon or otherwise, of a scene conveys much of the same information that a photorealistic verison does, but in a much more palletable form. Also, because it is a "drawing" it engages the viewer in a completely different fashion - missing details are filled in by the viewer's mind, and not seen as "mistakes". There are several advantage to using NPR techniques in a game: - Make your game stand out with a new a very differnt 3D look. - Reduce the rendering time of complex scenes(by drawing only the important details).

How do you do it( Technique )?

Common Methods

Most NPR techniques techniques are based on finding object silhouettes and important features and drawing them in various styles. The vast majority of documented NPR techniques do this by using 2D image processing techniques after a photorealistic rendering of the scene has already been rendered. Many of these techniques require additional information beyond the original image, such as depth, normal, or material buffers to be created during the rendering. These techniques tend to use gradations and discontinuities in the various buffers and image to determine which areas are edges and features. Some simply draw these areas black while others do things as exotic as placing ink trailing particles along the discontinuities and then using the gradations to affect the particles physically based motion. Obviously none of these techniques are good candidates for real time applications. Besides, why throw away the 3D information you already have during the rendering process only to later extract it from various buffers.

Other Methods

Here's a summary of various hardware friendly techniques I've found for those that may be interested:

Pascal Martineau wrote, "You could try using an env. map with a circle drawn in it (filled circle like in paintbrush) to highlight the edges... fast but you might have to tweak the mesh to make it look good." This seems nice and fast(since no lines are drawn),but could be quite slow - based on demos I've seen of env. mapped objects running on PCs, but maybe not so bad with some of the newer 3D hardware...I also wonder about the visual quality. I can imagine a viewing a cube from one side with the whole side drawn black, or the opposite effect with it drawn normally, but no cartoon edges at all...

Colin Doncaster wrote, "A lot of the "toon" rendering shaders compare the normal of the surface to the location of the camera, if the surface is facing, say, 88 degrees or more away from the camera then make it the outline colour, so drastically changing topology (edges) will become the lines of the object. Then just fill the rest of the surface with a solid colour or some method to create toon line shadows (some ratio based on the shadow value maybe?)."

I do like both of these techniques and also had a third suggested given to me by Matthew MacLaurin, "Based on the normals of the surface "bloat" the object by some amount. Render the 'bloated' object in black. Render the original object over the "bloated" version." Of course this technique would have several problems when in a full scene, but none of them seem totally intractable...

Overview of Our Method

The real-time cartoon renderer I describe will deliberately trade accuracy and detail for speed. It makes comprehensible but simple pictures of complicated objects by using an overall reduction of visual detail together with an enhancement of the most important details- like sharp edges and silhouette outlines. We will use a sloppy but fast technique to avoid re-analizing the scene every frame to determine the silhouette edges. Even though there will be errors in the silhouette outlines such errors will usually visually mesh with the overall rendering style. An overview of the technique we will use is:

More?

My next entry will contain some code, an example .exe, the overall results, ideas for the future, and any acknowledgements or references...

All Entries (year.month.day) by Meico.