Path: utzoo!utgpu!watmath!watcgl!awpaeth
From: awpaeth@watcgl.waterloo.edu (Alan Wm Paeth)
Newsgroups: comp.graphics
Subject: Re: raytracing in || (supersampling speedup)
Keywords: 4 rays per pixel
Message-ID: <7034@watcgl.waterloo.edu>
Date: 29 Nov 88 22:23:38 GMT
References: <9700001@datacube> <3148@uoregon.uoregon.edu> <1351@umbc3.UMD.EDU> <5263@cbmvax.UUCP> <5548@thorin.cs.unc.edu>
Reply-To: awpaeth@watcgl.waterloo.edu (Alan Wm Paeth)
Organization: U. of Waterloo, Ontario
Lines: 30

In article <5548@thorin.cs.unc.edu> brown@tyler.UUCP (Lurch) writes:
>
>From what I understand, the way to achieve 4 rays per pixel is to sample at
>vertical resolution +1, horizontal resolution +1, and treat each ray as a
>'corner' of each pixel, and average those values.  This is super cheap compared
>to sampling at twice vertical and horizontal.

This reuses rays, but since the number of parent rays and number of output
pixels match, this has to be the same as low-pass filtering the output
produced by a raytracer which casts the same number of rays (one per pixel).

The technique used by Sweeney in 1984 (while here at Waterloo) compares the four
pixel-corner rays and if they are not in close agreement subdivides the pixel.
The recursion terminates either when the rays from the subpixel's corners are
in close agreement or when some max depth is reached. The subpixel values are
averaged to form the parent pixel intensity (though a more general convolution
could be used in gathering up the subpieces).

This approach means that the subpixel averaging takes place adaptively in
regions of pixel complexity, as opposed to globally filtering the entire
output raster (which the poster's approach does implicitly).

The addition can be quite useful. For instance, a scene of flat shaded polygons
renders in virtually the same time as a "one ray per pixel" implementation,
with some slight overhead well spent in properly anti-aliasing the polygon
edges -- no time is wasted on the solid areas.

   /Alan Paeth
   Computer Graphics Laboratory
   University of Waterloo