Is this spec method any faster than using pow()?

The line below uses a different approach to specular falloff. Essentially it would take the spec falloff gradient

 and apply "black crushing" (a la photoshop levels) to simulate glossiness[g]. Then, it multiplies the end result to simulate spec power[s].

(1-((1-c)/(1-g)))*s


c=input color, g=glossiness, s=spec strength


The problem is, I don't know if this is any faster than pow()! Does anyone have some better insight into the math behind this?

Thanks!

-Dan

1 Answer

1

Well you don’t take it to the power of s, you multiply it by s.

So is it faster: yes, probably
is it the same as pow: no, certainly not :wink:

pow takes the first argument to the power of the second