Shading

From Wikipedia, the free encyclopedia
  (Redirected from Flat shading)
Jump to: navigation, search

Shading refers to depicting depth perception in 3D models or illustrations by varying levels of darkness.

Contents

[edit] Drawing

Example of shading.

Shading is a process used in drawing for depicting levels of darkness on paper by applying media more densely or with a darker shade for darker areas, and less densely or with a lighter shade for lighter areas. There are various techniques of shading including cross hatching where perpendicular lines of varying closeness are drawn in a grid pattern to shade an area. The closer the lines are together, the darker the area appears. Likewise, the farther apart the lines are, the lighter the area appears.

Light patterns, such as objects having light and shaded areas, help when creating the illusion of depth on paper.

Simple tutorials and lessons are available at numerous locations online to help learn the tips and tricks of shading to improve sketches[1].


[edit] References

[edit] Computer graphics

In computer graphics, Shading refers to the process of altering a color based on its angle to lights and its distance from lights to create a photorealistic effect. Shading is performed during the rendering process.

[edit] Angle to light source

Shading alters the colors of faces in a 3D model based on the angle of the surface to a light source or light sources.

The very first image below has the faces of the box rendered, but all in the same color. Edge lines have been rendered here as well which makes the image easier to see.

The second image is the same model rendered without edge lines. It is difficult to tell where one face of the box ends and the next begins.

The third image has shading enabled, which makes the image more realistic and makes it easier to see which face is which.

Rendered image of a box. This image has no shading on its faces, but uses edge lines to separate the faces.
This is the same image with the edge lines removed.
This is the same image rendered with shading of the faces to alter the colors of the 3 faces based on their angle to the light sources.

[edit] Light sources

Shading effects from floodlight.

There are many types of lights:

Shading is interpolated based on how the angle of these light sources reach the objects within a scene. Of course, these light sources can be and often are combined in a scene. The renderer then interpolates how these lights must be combined, and produces a 2d image to be displayed on the screen accordingly.

[edit] Distance falloff

Theoretically, two surfaces which are parallel, are illuminated the same amount from a distant light source, such as the sun. Even though one surface is further away, your eye sees more of it in the same space, so the illumination appears the same.

Notice in the first image that the color on the front faces of the two boxes is exactly the same. It appears that there is a slight difference where the two faces meet, but this is an optical illusion because of the vertical edge below where the two faces meet.

Notice in the second image that the surfaces on the boxes are bright on the front box and darker on the back box. Also the floor goes from light to dark as it gets farther away.

This distance falloff effect produces images which appear more realistic without having to add additional lights to achieve the same effect.

Two boxes rendered with an OpenGL renderer. Note that the colors of the two front faces are the same even though one box is further away.
The same model rendered using ARRIS CAD which implements "Distance Falloff" to make surfaces which are closer to the eye appear brighter.

Distance falloff can be calculated in a number of ways:

Flat shading interpolation example

[edit] Flat vs smooth shading

Flat shading is a lighting technique used in 3D computer graphics. It shades each polygon of an object based on the angle between the polygon's surface normal and the direction of the light source, their respective colors and the intensity of the light source. It was used for high speed rendering where more advanced shading techniques were too computationally expensive. But by the end of the 20th century affordable graphics cards were offering smooth shading that were also very fast, making flat shading for speed reasons unnecessary.

The disadvantage of flat shading is that it gives low-polygon models a faceted look. Sometimes this look can be advantageous though, such as in modeling boxy objects; flat shading is only inappropriate when the object must appear with smoother curves than actually modeled. Artists sometimes use flat shading to look at the polygons of a solid model they are creating. More advanced and realistic lighting and shading techniques include Gouraud shading and Phong shading.

[edit] See also

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages