浏览代码

Merge pull request #22456 from WestLangley/dev_physical_sheen

MeshPhysicalMaterial: Use roughness-squared in sheen BRDF
WestLangley 3 年之前
父节点
当前提交
2a741efea7
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/renderers/shaders/ShaderChunk/bsdfs.glsl.js

+ 3 - 1
src/renderers/shaders/ShaderChunk/bsdfs.glsl.js

@@ -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