PDF derivation in UE4

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

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 on other sites

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 on other sites

Wonderful, this is exactly what I was looking for. Thanks!

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• Forum Statistics

• Total Topics
633679
• Total Posts
3013294
×