Papervision 3D provides several different methods for shading a 3D scene.
So far we've used a basic FlatShadeMaterial, which shows all of the polygons that make up a shape.
Some of the other types of shaded materials available are as follows:
CellMaterial - creates a cartoon style shading effect.
GouraudMaterial - creates a very smooth shading effect.
PhongMaterial - creates a very smooth shading effect with additional control over the lighting effect. It can also be used with a 'bump map' which allows additional textured lighting on a shape.
Each of these different shading methods has increasing computational demands, so you may find that animations with more complex shading will render more slowly and any motion may be jerky.
This is what each type of shading looks like.

Let's look at the CellMaterial first.
To use a CellMaterial in the previous example simply replace the line that creates the material with the following:
var sphereMaterial:MaterialObject3D=new CellMaterial(light, 0xFF0000, 0x330000, 5);
The additional parameter specifies the number of steps of shading between the highlight and shadow colours.
GouraudMaterial uses a similar syntax to the FlatShadeMaterial.
var sphereMaterial:MaterialObject3D=new GouraudMaterial(light, 0xFF0000, 0x330000);
Finally, PhongMaterial has an additional parameter to adjust the highlight area. The higher the number, the smaller the highlight (and larger the shadow area).
var sphereMaterial:MaterialObject3D=new PhongMaterial(light, 0xFF0000, 0x330000, 50);
End of tutorial.
