Jump to content
  • Advertisement
Sign in to follow this  
brkho

PDF derivation in UE4

This topic is 659 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 all,

 

In Karis's 2013 course notes for PBR in Unreal Engine 4, he states the PDF used in importance sampling in shader code:

// Incident light = SampleColor * NoL
// Microfacet specular = D*G*F / (4*NoL*NoV)
// pdf = D * NoH / (4 * VoH)
SpecularLighting += SampleColor * F * G * VoH / (NoH * NoV);

Given the specular lobe of the microfacet BRDF being used (Smith GGX), I'm having a bit of trouble arriving at the stated PDF. In particular, I'm working through the derivation described in the GPU Gems chapter on importance sampling, and I don't fully understand how to get the material function in terms of spherical coordinates (like in equation 4 of the GPU gems chapter).

 

Maybe it's just that my knowledge of calculus and coordinate systems has gotten increasingly rusty over the years, but could anyone walk me through the derivation or point me in the right direction? Thanks!

Edited by brkho

Share this post


Link to post
Share on other sites
Advertisement

You'll want to read Walter's original paper where he (re-)introduced GGX, and derived the formula for sampling the distribution (see section 5.3). If I recall correctly, you'll need to also read the referenced paper if you want to understand how they arrive at the final weighting function.

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.

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!