The last step is critical for algorithm speed. For each point of triangle we can use algorithms described in chapter 2 based on barycentric coordinates or it is possible to extend scan line algorithm for polygon (triangle) filling ([FoDa91], [RuFe95]) to get barycentric coordinates faster. Barycentric coordinates of each pixel of scan line could be obtained by the linear interpolation of barycentric coordinates of first and last pixel of scan line. We can obtain barycentric coordinates of each scan line point by two additions of deltas, because we need only two barycentric coordinates. It's possible to show that the properties of map transforming barycentric coordinates to texture coordinates allow to use just two addition deltas again to get texture coordinates of each pixel of scan line.
Only texture mapping can not generate shadow effects, but there are several possibilities to simulate shadows (analogous problem is opacity simulation)
Shadows levels obtained from mask
There is possibility to adjust brightness/darkness of each pixels using mask - special bitmap which can be created by image processing algorithms from e.g. scanned sample. For example bitmap of depth 8 can contain values from range (-127, 127). Each value affects particular pixel in result image according one of many optional criterions. This approach decreases flexibility of vector objects slightly, because objectís position should be frozen above such mask.