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

Merge pull request #17378 from WestLangley/dev_pbr_indirect_specular

Physical Shader: properly group indirect diffuse and indirect specular terms
......@@ -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.
先完成此消息的编辑!
想要评论请 注册