OpenImageIO/oiio — pull request #417 by lgritz (2012-08-03 17:34:40+00:00)
Title: Review: Anisotropic texture blur fixes

Anisotropic texturing overhaul and fixes to address some artifacts we'd noticed.

(a) Proper computation of the major axis on which to place the samples;
previously, it was assuming the major axis was the same as the larger
derivative. That's true if the derivs are orthogonal in texture st
space, but not for arbitrary angles. Solving this fixes a number of
artifacts, that tended to be only visible with added "blur", but were
pretty ugly with blur discontinuities.
(b) Adjusted the strategy we were using for "conservative" dealing with
extreme anisotropy to get a better visual result.
(c) Eliminate a 2x error where we were not distributing the samples far
enough along the line.
(d) Apply Gaussian weights to the samples.

Along the way, I added some new tests and testtex options to help with the debugging. You may notice some code (that doesn't run by default) at the end of texturesys.cpp that generates sets of derivatives randomly, then makes graphs plotting the derivatives, the ellipse that is fit to them, and the sample positions and weights. This was really important to my debugging this and convincing myself that I finally have it right.