Skip to content

Commit

Permalink
Merge pull request #22456 from WestLangley/dev_physical_sheen
Browse files Browse the repository at this point in the history
MeshPhysicalMaterial: Use roughness-squared in sheen BRDF
  • Loading branch information
WestLangley committed Aug 30, 2021
2 parents a3190d0 + a8ebd6d commit 2a741ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderers/shaders/ShaderChunk/bsdfs.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,10 @@ vec3 BRDF_BlinnPhong( const in IncidentLight incidentLight, const in GeometricCo
// https://github.com/google/filament/blob/master/shaders/src/brdf.fs
float D_Charlie( float roughness, float dotNH ) {
float alpha = pow2( roughness );
// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"
float invAlpha = 1.0 / roughness;
float invAlpha = 1.0 / alpha;
float cos2h = dotNH * dotNH;
float sin2h = max( 1.0 - cos2h, 0.0078125 ); // 2^(-14/2), so sin2h^2 > 0 in fp16
Expand Down

0 comments on commit 2a741ef

Please sign in to comment.