Re: [Algorithms] approximation to pow(n,x)?
Brought to you by:
vexxed72
From: Nathaniel H. <na...@io...> - 2009-11-04 15:37:21
|
> What are you using this for? If it's lighting or shading, there's no > real reason to use a power function on the cosine term to get tighter > specular highlights. It's just a shaping function that people use > because it's easy to control and AFAICT it has no physical basis in > defining a BRDF from the micropolygon point of view. > > - Robin Green. It's true that there is no reason to _exactly_ match a cosine power, and I agree with Robin that for this purpose, any curve which vaguely resembles cosine power will do. As a side note, I just wanted to say a few words in the defense of the lowly cosine power - it's not completely physically meaningless. If you are using Blinn-Phong (N dot H, which is much to be preferred over original Phong - R dot L), then using a cosine power is equivalent to assuming that the microfacet normal distribution follows a cosine power curve. Now, there is no physical reason to assume that microfacet distributions necessarily follow a cosine power curve, but (except for very low powers) this curve very closely matches one that _does_ have a physical basis - the Beckmann distribution (the one used in the Cook-Torrance BRDF). The match is amazingly close considering that Bui-Tong Phong just eyeballed the function; he didn't do any curve fitting. BTW, Beckmann's behavior for very low powers is interesting - it stops behaving like a Gaussianish blob and starts turning inside-out (which makes sense when you look at the definition of the "m" parameter). Beckmann isn't the last word on microfacet distributions; the EGSR 2007 paper "Microfacet Models for Refraction through Rough Surfaces" (which is a great paper overall and well worth reading for anyone interested in microfacet BRDFs) makes a good case for a different curve, with a more gradual falloff. Which again supports Robin's original point. Naty Hoffman |