未验证 提交 b0d76dab 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #18042 from elalish/anti-alias

Geometric anti-aliasing
export default /* glsl */`
PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );
vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.specularRoughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.
material.specularRoughness += geometryRoughness;
material.specularRoughness = min( material.specularRoughness, 1.0 );
#ifdef REFLECTIVITY
......@@ -16,7 +22,9 @@ material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );
#ifdef CLEARCOAT
material.clearcoat = saturate( clearcoat ); // Burley clearcoat model
material.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );
material.clearcoatRoughness = max( roughnessFactor, 0.0525 );
material.clearcoatRoughness += geometryRoughness;
material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_SHEEN
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册