Browse Source

OutlineEffect: Fixed breakage due to normals defaultnormal_vertex.glsl changes. See #11271.

Mr.doob 8 years ago
parent
commit
3c4b4b8183
1 changed files with 3 additions and 7 deletions
  1. 3 7
      examples/js/effects/OutlineEffect.js

+ 3 - 7
examples/js/effects/OutlineEffect.js

@@ -95,10 +95,10 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 		"#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined( PHYSICAL )",
 
 		"	#ifndef USE_ENVMAP",
-		"		vec3 objectNormal = normalize( normal );",
+		"		vec3 transformedNormal = normalize( normal );",
 
 		"		#ifdef FLIP_SIDED",
-		"			objectNormal = -objectNormal;",
+		"			transformedNormal = -transformedNormal;",
 		"		#endif",
 
 		"	#endif",
@@ -109,11 +109,7 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 		"	vec3 transformed = vec3( position );",
 		"#endif",
 
-		"#ifdef USE_SKINNING",
-		"	gl_Position = calculateOutline( gl_Position, objectNormal, skinned );",
-		"#else",
-		"	gl_Position = calculateOutline( gl_Position, objectNormal, vec4( transformed, 1.0 ) );",
-		"#endif",
+		"gl_Position = calculateOutline( gl_Position, transformedNormal, vec4( transformed, 1.0 ) );",
 
 		"#include <fog_vertex>"