Skip to content

Instantly share code, notes, and snippets.

View FeodorVolguine's full-sized avatar

Feodor Volguine FeodorVolguine

  • Canada
View GitHub Profile
@FeodorVolguine
FeodorVolguine / pbr.glsl
Last active March 25, 2024 14:30
Physically Based Shading
//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)
{