ALTA
alpha

In this tutorial, we will see how to fit a rational BRDF model to the goldmetallicpaint
dataset from the MERL library (please click on the picture to change the horizontal position of the vertical cut):
goldmetallicpaint 
The first step is download and convert the dataset into ALTA internal format. This will ease the manipulation of data afterwards:
$ wget http://people.csail.mit.edu/wojciech/BRDFDatabase/brdfs/goldmetallicpaint.binary
will download the dataset and
$ data2data input goldmetallicpaint.binary indata data_merl output goldmetallicpaint.exr outdata data_brdf_slice param RUSIN_TH_TD
this conversion requires to use the data_merl and data_brdf_slice plugins to load MERL binary files and convert them into and HDR image slice. This allows us to slice the 3D data contained in the MERL binary file to a 2D data format.
However, the rational fitter only works with vertical_segment objects. We need to convert the 2D data into ALTA's internal format. This is done by:
$ data2data input goldmetallicpaint.exr indata data_brdf_slice output goldmetallicpaint.alta
We use the least square rational fitter: rational_fitter_leastsquare. This fitter alternatively fit the numerator and the denominator of the rational function. We also use a Chebychev polynomial as the basis for the rational function by selecting the rational_function_chebychev plugin using 100 coefficients at the numerator and 50 at the denominator:
$ data2brdf input goldmetallicpaint.alta output goldmetallicpaint.func func rational_function_chebychev fitter rational_fitter_leastsquare np 100 nq 50
Here we provide the resulting BRDF file and the associated Python and XML scripts: