September 2018
Intermediate to advanced
472 pages
15h 36m
English
We'll define a function for each of the three terms in the specular BRDF. Use the following steps:
vec3 schlickFresnel( float lDotH ) { vec3 f0 = vec3(0.04); // Dielectrics if( Material.Metal ) { f0 = Material.Color; } return f0 + (1 - f0) * pow(1.0 - lDotH, 5);}
float geomSmith( float dotProd ) { float k = (Material.Rough + 1.0) * (Material.Rough + 1.0) / 8.0; float denom = dotProd * (1 - k) + k; return 1.0 / denom;}
float ggxDistribution( float nDotH ) { float alpha2 = Material.Rough * Material.Rough * Material.Rough * Material.Rough; ...Read now
Unlock full access