Jump to content
  • Advertisement
Sign in to follow this  

specular energy normalization

This topic is 4130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've found a modification (?) of the original Blinn/Phong specular model looking this way: I was wondering about that - the cosine part which shininess n is clear. rho_s is named a "scaling coefficient" which seems to me would be controlled by a specular map, wouldn't it? But the (n+2)/(2Pi) is named "energy normalization": "so that the cosine lobe always integrates to one" - which I don't understand. Does anyone knows what this could mean, it is used in offline rendering and I was wondering if one could somehow benefit from this in realtime rendering? thank you very much!

Share this post


Link to post
Share on other sites
Advertisement
I'm in a bit of a hurry, so I'll have to be quick. You probably want to read up on Bidirectional Reflectance Distribution Functions (BRDF's) - a lot of lighting models (such as Phong and Blinn's modification) sacrifice validity to the two laws of a BRDF (bidirectionality and conservation of energy) in favour of simplicity/speed. Several more theoretical models will include normalization functions so that they are more physically plausible w.r.t. these laws.

Pretty sure that should give you something to get started with [smile]

hth
Jack

Share this post


Link to post
Share on other sites
d is constrained to the range [-p/2, p/2] so that cos(d) is zero at the extremities and unity at d = 0. The resulting curve looks like a hill; one half of a sine wave. Since the image is bound between 0 and 1, any power of it will also be. So here, n acts as a specular power: the higher n is, the narrower the peak at d = 0.
However, because cos < 1, raising the function to a positive power will decrease the area under the graph. Physically, this means that the amount of light being reflected (in all directions) is less than that incident upon the material. This is undesirable. So, to maintain energy conservation, we scale the entire function up so that the enclosed area is independent of n.

Mathematically, the total reflected intensity is the area under the graph, determined by integrating the function over its domain:

I = ∫-p/2p/2 (n+2)/2p . cosn(d) . dd

This value should always be the same, regardless of the value of n.

As for rs, I presume you're right about it being a specular texture value. Maybe somebody who knows more can confirm that.

Edit: On closer inspection, I suspect something is wrong with that formula. Either the rho-factor is rather different to what I thought or I have the whole situation rather wrong. That simple linear factor (n+2)/2p doesn't have a hope in hell of tackling the complexity of a power of cosine under an integral. After a little poking around, I found that the 'correct' scaling factor for even values of n is:

b = p-12n/(n!/((n - n/2)!(n/2)!)

That factorial mess at the end is the binomial coefficient (n, n/2).
For odd n, the situation is slightly different: we lose the factor of pi and introduce some different factorials. I'm not compelled to work it out.

So... any guesses?

Admiral

Share this post


Link to post
Share on other sites
Thank you very much!

I suspected the rho_s to be some sort of specular map factor, but - when thinking about it - would such a factor not rule out any chance of safely integrating this to 1?

The terms is from this paper section 5.3 if it clears some thing up
http://graphics.ucsd.edu/~henrik/papers/skin-analysis/skin-analysis.pdf

thanks alot!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!