Skip to content

Commit

Permalink
Merge pull request #13716 from WestLangley/dev-perturb_normal
Browse files Browse the repository at this point in the history
Fix perturbNormal2Arb() bug
  • Loading branch information
mrdoob authored Mar 28, 2018
2 parents 93d8326 + fd359bf commit 7f0bcc4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
vec2 st0 = dFdx( vUv.st );
vec2 st1 = dFdy( vUv.st );

vec3 S = normalize( q0 * st1.t - q1 * st0.t );
vec3 T = normalize( -q0 * st1.s + q1 * st0.s );
float scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude
vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );
vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );
vec3 N = normalize( surf_norm );

vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
Expand Down

0 comments on commit 7f0bcc4

Please sign in to comment.