Jump to content
  • Advertisement
Sign in to follow this  
maxest

Deriving L_o for directional light

This topic is 1010 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

I've been reading some ray-tracing book and stumbled upon something that really intrugued me. The author derives the simple dot(N, L) equation for an ideal directional light (assume white light (1,1,1)).

But let's start from the top. The direct illumination formula is this:

http://www.HostMath.com/Show.aspx?Code=L_o(p%2C%20%5Comega_o)%20%3D%20%5Cint_%7B2%5CPi%5E%2B%7D%5E%7B%7D%20f_r(p%2C%20%5Comega_i%2C%20%5Comega_o)%20L_i(p%2C%20%5Comega_i)%20%5Ccos(%5Ctheta_i)%20d%5Comega_i

 

The final formula for L_o is:

http://www.HostMath.com/Show.aspx?Code=L_o(p%2C%20%5Comega_o)%20%3D%20f_r(p%2C%20l%2C%20%5Comega_o)%20%5Ccos(%5Ctheta_l)

(where l is light'd direction)

 

The author states that in order for the equation to end up like this, L_i must be:

http://www.HostMath.com/Show.aspx?Code=L_i(p%2C%20%5Comega_i)%20%3D%20%5Cdelta(%5Ccos%5Ctheta_i-cos%5Ctheta_l)%20%5Cdelta(%5Cphi_i-%5Cphi_l)

 

I was curious enough to verify it and indeed:
http://www.wolframalpha.com/input/?i=integrate%28+integrate+%28+delta%28cos%28theta%29-A%29*delta%28phi-B%29*cos%28theta%29*sin%28theta%29+dtheta+%29+from+0+to+Pi%2F2+%29+dphi+from+0+to+2*Pi

A is cos(theta_l), B is phi_l. Note that I skipped BRDF f function.

 

Now my simple question is: why is L_i the way it is? How was it derived?

Edited by maxest

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!