When we're using three-dimensional graphics for data visualization, often we don't want something that looks like a photograph. We want something that looks more like an illustration. In this case, we want to use something called non-photorealistic rendering. If we can photograph or render with computer graphics everything, then why do we need things like illustrations? And the answer is is that illustrations can more clearly depict a three-dimensional configuration than a photograph can. And so then the question is how can we use three-dimensional computer graphics to render an illustration? So, a good example of this form of non-photorealistic rendering is Gray's Anatomy. And here's an illustration of the human heart from Gray's Anatomy, and it's not a photograph. A photograph would be gory and covered with blood, and it would be hard to see all of these configurations. But with an illustration, the artist has much more control over the lighting, and the texturing, and the cutaways in order to more clearly denote the structures of the heart. What we'd like to do is be able to do the same thing with data visualization. So, for example, if I have a simple model of a pig, I could render it using photorealistic illumination and occlusion and fills to get this shape here. But I could also use non-photorealistic techniques to get a more cartoony version of this pig that conveys much the same information. And you'll notice that this pig has outline strokes and it has fills. And so the outline strokes are created from contours. And from a three-dimensional scene, the way we get those contours is by tracing them. They create things like silhouette curves, the border between the shape and the background. And sometimes this boundary will cover itself, and other contours of the shading. And so sometimes these contours will trace behind other surfaces, and so we still need to respect occlusion. So we have to trim away portions of the contour that are hidden by other regions. But that leaves us with a set of outlines and a set of regions that we can then render using some of our vector graphics techniques instead of some of our three-dimensional photorealistic techniques. So, when we fill in the surfaces we may not want to use photorealistic lighting. So, this top line shows a bunch of spheres rendered with photorealistic lighting. And you can see that, in each case, we have a diffuse color illumination and then a white specular highlight. So we're getting diffuse illumination and specular illumination. The light source is to the up and right of the object. And yet we don't see any information in the dark side of the moon here, the dark side of the sphere. That's because this is shadowed because of photorealistic lighting. You're not going to see any information in the shadows. You can still see the color of the object because there's enough ambient light bouncing around to get the color. But you don't see any orientation information, this very well could be a disk instead of a sphere. We know it's a sphere because of the illuminated side. And so we can create better depictions, better illumination of the sphere using non-photorealistic illumination. In this case, replacing the diffuse illumination here with a non-photorealistic diffuse illumination that we get by taking the color map. In this case, going from red to black, and then mixing it with a cool-to-warm, in this case, blue to yellow color map. And that creates a gradation that goes from a cool form of red, kind of a bluer shade of red, all the way to a warmer shade of red, kind of an orange. So, we're going from a violet to an orange. And then we can apply that to the entire sphere based on the orientation of the surface and the light source. And then we get more information on the shadowed side of the object in addition to the illuminated side of the object. And these shapes look even more spherical than they do in the physical case. So when we're displaying three-dimensional shapes, in this case, skeletal shapes. With photorealistic illumination you're not seeing anything in the dark sides of these objects because of the nature of shadows and illumination. But when we apply non-photorealistic illumination, we can see these contours. These divots in the bone that are revealed by this non-photorealistic shading that are also hidden in photorealistic shading. In both cases, we've also added the contour to better indicate the outlines of these shapes. Here's another example. This is a photorealistic rendering of a part, and this is a non-photorealistic rendering of a part. You're missing all of the shape information of the orientation of the surface on the shadowed side. And we gain that with our non-photorealistic shading. And also the contours help us see the configuration and the definite occlusion of the individual pieces. So whereas photorealistic rendering focuses on the physics of light, non-photorealistic rendering focuses on the psychology of perception. It emphasizes other parts of the image, for example, the outlines, the visual contours of the object. And it uses non-photorealistic shading to better communicate shape that would otherwise take very complex lighting. [MUSIC]