Browse Source

changed vViewPosition to camera space for normal map shader

evan 14 years ago
parent
commit
19e0f0ac7c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/extras/ShaderUtils.js

+ 1 - 1
src/extras/ShaderUtils.js

@@ -304,9 +304,9 @@ THREE.ShaderUtils = {
 				"void main() {",
 
 					"vec4 mPosition = objectMatrix * vec4( position, 1.0 );",
-					"vViewPosition = cameraPosition - mPosition.xyz;",
 
 					"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
+					"vViewPosition = -mvPosition.xyz;",
 					"vNormal = normalize( normalMatrix * normal );",
 
 					// tangent and binormal vectors