Shadows are important in enhancing both the realism and the intelligibility of synthetic 2D images of 3D scenes. In order to determine which part of a scene is in shadow, numerous algorithms have been developed. The Z-buffer shadow algorithm and its descendants have proved to be both efficient and easy to implement. However, in casting shadows, the aliasing introduced by the Z-buffer point sampling is notorious. Therefore a new method that is based on a modification of the Z-buffer has been developed. This method deals with the aliasing problem but preserves the strengths of the Z-buffer algorithm. Moreover, as a side effect, the information stored in the modified Z-buffer allows accurate antialiasing of the resulting image.