Browse Source

Replacing indentation spaces with tabs

Michael Bond 10 years ago
parent
commit
5e9ad40b35

+ 7 - 10
src/renderers/shaders/ShaderChunk/envmap_fragment.glsl

@@ -37,17 +37,14 @@
 		vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
 
 	#elif defined( ENVMAP_TYPE_EQUIREC )
-		// #ifdef DOUBLE_SIDED
-
-		// 	float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );
 		vec2 sampleUV;
-    sampleUV.y = clamp( flipNormal * reflectVec.y * 0.5 + 0.5, 0.0, 1.0);
-   	sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * 0.15915494309189533576888376337251 + 0.5; // reciprocal( 2 PI ) + 0.5
-   	vec4 envColor = texture2D( envMap, sampleUV );
-  #elif defined( ENVMAP_TYPE_SPHERE )
-
-  	vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));
-   	vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );
+		sampleUV.y = clamp( flipNormal * reflectVec.y * 0.5 + 0.5, 0.0, 1.0);
+		sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * 0.15915494309189533576888376337251 + 0.5; // reciprocal( 2 PI ) + 0.5
+		vec4 envColor = texture2D( envMap, sampleUV );
+		
+	#elif defined( ENVMAP_TYPE_SPHERE )
+		vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));
+		vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );
 	#endif
 
 	#ifdef GAMMA_INPUT

+ 3 - 3
src/renderers/shaders/ShaderLib.js

@@ -1296,9 +1296,9 @@ THREE.ShaderLib = {
 				// "	gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",
 				"vec3 direction = normalize( vWorldPosition );",
 				"vec2 sampleUV;",
-		    "sampleUV.y = clamp( tFlip * direction.y * -0.5 + 0.5, 0.0, 1.0);",
-		   	"sampleUV.x = atan( direction.z, direction.x ) * 0.15915494309189533576888376337251 + 0.5;", // reciprocal( 2 PI ) + 0.5
-		   	"gl_FragColor = texture2D( tEquirect, sampleUV );",
+				"sampleUV.y = clamp( tFlip * direction.y * -0.5 + 0.5, 0.0, 1.0);",
+				"sampleUV.x = atan( direction.z, direction.x ) * 0.15915494309189533576888376337251 + 0.5;", // reciprocal( 2 PI ) + 0.5
+				"gl_FragColor = texture2D( tEquirect, sampleUV );",
 
 				THREE.ShaderChunk[ "logdepthbuf_fragment" ],