摘要 |
Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for generating shadows. In one aspect, a method includes identifying a two-dimensional image representing an icon and a two-dimensional image representing a light source, applying an affine transformation to a transparency channel of the image representing the icon, the affine transformation projecting pixels of the transparency channel into three-dimensional space, and generating a field of pixels representing a shadow cast by the icon by computing a portion of the light source that is visible to pixels of the field by subtracting rows of a matrix that represents the affine transformation from rows of a matrix that represents the transparency channel of the light source image, and computing brightness of each of the generated pixels of the field based at least partly on the computed portion of the visible light source. |