Scene model data, including a scene geometry model and a plurality of pixel data describing objects arranged in a scene, is received. A first pixel data of the plurality of pixel data is selected. A primary
pixel color and a primary
ray are generated based on the first pixel data. If the primary
ray intersects an object in the scene, an intersection point, P is determined. A surface normal, N, is determined based on the object intersected and the intersection point, P. A primary hit color is determined based on the intersection point, P. The primary
pixel color is modified based on the primary hit color. A plurality of
ambient occlusion (AO) rays are generated based on the intersection point, P and the surface normal, N, with each AO
ray having a direction, D. For each AO ray, the AO ray direction is reversed, D, the AO ray origin, O, is set to a point outside the scene. Each AO ray is marched from the AO ray origin into the scene to the intersection point, P. If an AO ray intersects an object before reaching point P, that AO ray is excluded from
ambient occlusion calculations. If an AO ray does not intersect an object before reaching point P, that ray is included in
ambient occlusion calculations.
Ambient occlusion is estimated based on included AO rays. The primary
pixel color is shaded based on the ambient
occlusion and the primary hit color and an image is generated based on the primary pixel color for the pixel data.