Selaa lähdekoodia

Fix OutlineEffect broken by #11271

Takahiro 8 vuotta sitten
vanhempi
commit
11e45b81e1
1 muutettua tiedostoa jossa 5 lisäystä ja 8 poistoa
  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>"