Skip to content

Commit

Permalink
fix (1.0, mtoon): fix use of artistic PI factor
Browse files Browse the repository at this point in the history
  • Loading branch information
0b5vr committed Oct 20, 2021
1 parent cb86020 commit 1d0c2e2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/three-vrm-materials-mtoon/src/shaders/mtoon.frag
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ vec3 getDiffuse(
return vec3( BRDF_Lambert( shading * lightColor ) );
#endif

#ifndef PHYSICALLY_CORRECT_LIGHTS
lightColor *= PI;
#if THREE_VRM_THREE_REVISION < 132
#ifndef PHYSICALLY_CORRECT_LIGHTS
lightColor *= PI;
#endif
#endif

return lightColor * BRDF_Lambert( mix( material.shadeColor, material.diffuseColor, shading ) );
Expand All @@ -154,8 +156,10 @@ void RE_Direct_MToon( const in IncidentLight directLight, const in GeometricCont
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;

#ifndef PHYSICALLY_CORRECT_LIGHTS
irradiance *= PI;
#if THREE_VRM_THREE_REVISION < 132
#ifndef PHYSICALLY_CORRECT_LIGHTS
irradiance *= PI;
#endif
#endif

float shading = getShading( dotNL, shadow, material.shadingShift );
Expand Down

0 comments on commit 1d0c2e2

Please sign in to comment.