To render the BRDF from MERL i need to index into the BRDF data. For that purpose I need to calculate local theta_IN, phi_IN and local theta_VIEW, phi_VIEW at each point on the sphere.
Although the MERL data is isotropic but still I want to have all the above four angles calculated.
Ok, so are you're just talking about converting the incoming light direction L and the view vector V into spherical coordinates?
I did a quick google and found this primer on BRDFs which describes a quick conversion between cartesian and spherical coordinates, but I presume you've already seen this?
http://www.cs.princeton.edu/courses/archive/fall06/cos526/tmp/wynn.pdf
x = cos(phi) * sin(theta)
y = sin(phi) * sin(theta)
z = cos(theta)
phi = atan (x/y)
theta = atan( sqrt(x^2 + y^2) / z^2)
Hope that helps!
Cheers, Paul.