Browse Source

Merge branch 'master' into dev

Mr.doob 8 years ago
parent
commit
9c44f624cd
1 changed files with 5 additions and 8 deletions
  1. 5 8
      examples/js/effects/OutlineEffect.js

+ 5 - 8
examples/js/effects/OutlineEffect.js

@@ -93,23 +93,20 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 	var vertexShaderChunk2 = [
 	var vertexShaderChunk2 = [
 
 
 		"#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined( PHYSICAL )",
 		"#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined( PHYSICAL )",
-
 		"	#ifndef USE_ENVMAP",
 		"	#ifndef USE_ENVMAP",
-		"		vec3 transformedNormal = normalize( normal );",
-
-		"		#ifdef FLIP_SIDED",
-		"			transformedNormal = -transformedNormal;",
-		"		#endif",
-
+		"		vec3 objectNormal = normalize( normal );",
 		"	#endif",
 		"	#endif",
+		"#endif",
 
 
+		"#ifdef FLIP_SIDED",
+		"	objectNormal = -objectNormal;",
 		"#endif",
 		"#endif",
 
 
 		"#ifdef DECLARE_TRANSFORMED",
 		"#ifdef DECLARE_TRANSFORMED",
 		"	vec3 transformed = vec3( position );",
 		"	vec3 transformed = vec3( position );",
 		"#endif",
 		"#endif",
 
 
-		"gl_Position = calculateOutline( gl_Position, transformedNormal, vec4( transformed, 1.0 ) );",
+		"gl_Position = calculateOutline( gl_Position, objectNormal, vec4( transformed, 1.0 ) );",
 
 
 		"#include <fog_vertex>"
 		"#include <fog_vertex>"