Two primitives, Illuminazione Diffusa and Illuminazione Speculare, are included to simulate light shining on objects. They represent two of the three parts of the Phong reflection model for modeling light in computer graphics. The three parts of the model are:
The Phong model does not take into account shadows that would be caused by one area of an object on another, i.e., it does not do ray tracing.
The contour of an object in the z (out of the drawing) direction is described by a mappa bump that is defined by the Alpha channel of an object. The values of the pixel and the neighboring pixels in the mappa bump define the normal to the surface for the pixel.
The two lighting filters share in common most of their attributes such as the type of light source, its color, and its position; thus we'll discuss them together.
When applying a lighting filter with a large Surface Scale, the limited resolution of the mappa bump may create artifacts. These can be removed by applying a small amount of Gaussian blur to the image.
This light source simulates a light at a large (infinite) distance from the illuminated object. The required attributes are:
This light source simulates a point light source near an illuminated object. One triple set of numbers (x, y, z) is required to set the Location of the light. The units are in the coordinate system of the lit object. Note: z represents the distance out of the plane (toward the viewer of the SVG drawing) if x or y are not inverted.
This light source simulates a point light source near an illuminated object but with a limited cone of light. One triple set of numbers (x, y, z) is required to set the Location of the light and another to set the direction the center of the cone points (Points At). See above for the definition of the coordinate system. The Specular Exponent sets how well focused is the light; the higher the value, the more sharply focused the light. The Cone Angle (degrees) defines the maximum angle for the light. The lights are directed at each other.
© 2005-2008 Tavmjong Bah. | Get the book. |