This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Normal distribution function (Trowbridge-Reitz GGX) | |
float DistributionGGX(float NdotH, float alpha2) | |
{ | |
float f = (NdotH * alpha2 - NdotH) * NdotH + 1.0f; | |
return alpha2 / (f * f * PI); | |
} | |
//Height-correlated Smith-GGX visibility function | |
float VisibilitySmithGGX(float NdotL, float NdotV, float alpha2) | |
{ |