At present, it’s not easy at all to create high quality, fast shadows with shadow mapping and shadow volumes techniques. Therefore, I propose a new simple way, inspired by the Reconstructable Geometry Shadow Maps [Dai et al. 2008], for creating fast, pixel-accurate shadows with support from graphics APIs and GPUs.
The new way is much simpler, much faster than shadow mapping and shadow volume techniques. When rendering the final image, each pixel in the image will be checked with the entire collection of triangles in the scene (or collection of frontfacing triangles), with respect to a light source. If there is at least one triangle occluding the pixel, then the pixel is in shadow, otherwise the pixel is lit. Here the GPU can help us: if the pixel can be checked in parallels with all triangles in the collection, the checking overhead is insignificant, and we can easily create high quality shadows in realtime.
The pixel and the collection of triangles should be transformed into normalized device coordinates (NDC) of each light source before doing the checking. By default, pixels that are not in the unit cube are in shadow.
The shadow created is pixel-accurate. If we want smooth shadow edges while using relatively low-polygon objects, each triangle in the collection can be sub-divided into smaller triangles, using a geometry shader of direct support from the GPU.
When graphics APIs and GPUs have direct support for the above features, creating ambient occlusion will also become easier.