提交 c3113b7b 编写于 作者: W WestLangley

Properly group indirect diffuse and indirect specular terms

上级 7e0a78be
......@@ -140,8 +140,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
float clearcoatInv = 1.0 - clearcoatDHR;
// Both indirect specular and diffuse light accumulate here
// if energy preservation enabled, and PMREM provided.
// Both indirect specular and indirect diffuse light accumulate here
vec3 singleScattering = vec3( 0.0 );
vec3 multiScattering = vec3( 0.0 );
......@@ -152,7 +151,8 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );
reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;
reflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;
reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册