Browse Source

Updated builds.

Mr.doob 11 years ago
parent
commit
545a6e1011
2 changed files with 17 additions and 115 deletions
  1. 15 113
      build/three.js
  2. 2 2
      build/three.min.js

+ 15 - 113
build/three.js

@@ -13980,7 +13980,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
 	this.shininess = 30;
 	this.shininess = 30;
 
 
 	this.metal = false;
 	this.metal = false;
-	this.perPixel = true;
 
 
 	this.wrapAround = false;
 	this.wrapAround = false;
 	this.wrapRGB = new THREE.Vector3( 1, 1, 1 );
 	this.wrapRGB = new THREE.Vector3( 1, 1, 1 );
@@ -17432,28 +17431,6 @@ THREE.ShaderChunk = {
 
 
 	lights_phong_pars_vertex: [
 	lights_phong_pars_vertex: [
 
 
-		"#ifndef PHONG_PER_PIXEL",
-
-		"#if MAX_POINT_LIGHTS > 0",
-
-			"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];",
-			"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];",
-
-			"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];",
-
-		"#endif",
-
-		"#if MAX_SPOT_LIGHTS > 0",
-
-			"uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];",
-			"uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];",
-
-			"varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];",
-
-		"#endif",
-
-		"#endif",
-
 		"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )",
 		"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )",
 
 
 			"varying vec3 vWorldPosition;",
 			"varying vec3 vWorldPosition;",
@@ -17465,44 +17442,6 @@ THREE.ShaderChunk = {
 
 
 	lights_phong_vertex: [
 	lights_phong_vertex: [
 
 
-		"#ifndef PHONG_PER_PIXEL",
-
-		"#if MAX_POINT_LIGHTS > 0",
-
-			"for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
-
-				"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );",
-				"vec3 lVector = lPosition.xyz - mvPosition.xyz;",
-
-				"float lDistance = 1.0;",
-				"if ( pointLightDistance[ i ] > 0.0 )",
-					"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );",
-
-				"vPointLight[ i ] = vec4( lVector, lDistance );",
-
-			"}",
-
-		"#endif",
-
-		"#if MAX_SPOT_LIGHTS > 0",
-
-			"for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {",
-
-				"vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );",
-				"vec3 lVector = lPosition.xyz - mvPosition.xyz;",
-
-				"float lDistance = 1.0;",
-				"if ( spotLightDistance[ i ] > 0.0 )",
-					"lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );",
-
-				"vSpotLight[ i ] = vec4( lVector, lDistance );",
-
-			"}",
-
-		"#endif",
-
-		"#endif",
-
 		"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )",
 		"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )",
 
 
 			"vWorldPosition = worldPosition.xyz;",
 			"vWorldPosition = worldPosition.xyz;",
@@ -17534,16 +17473,8 @@ THREE.ShaderChunk = {
 
 
 			"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];",
 			"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];",
 
 
-			"#ifdef PHONG_PER_PIXEL",
-
-				"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];",
-				"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];",
-
-			"#else",
-
-				"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];",
-
-			"#endif",
+			"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];",
+			"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];",
 
 
 		"#endif",
 		"#endif",
 
 
@@ -17555,15 +17486,7 @@ THREE.ShaderChunk = {
 			"uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];",
 			"uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];",
 			"uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];",
 			"uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];",
 
 
-			"#ifdef PHONG_PER_PIXEL",
-
-				"uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];",
-
-			"#else",
-
-				"varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];",
-
-			"#endif",
+			"uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];",
 
 
 		"#endif",
 		"#endif",
 
 
@@ -17612,23 +17535,14 @@ THREE.ShaderChunk = {
 
 
 			"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
 			"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
 
 
-				"#ifdef PHONG_PER_PIXEL",
-
-					"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );",
-					"vec3 lVector = lPosition.xyz + vViewPosition.xyz;",
-
-					"float lDistance = 1.0;",
-					"if ( pointLightDistance[ i ] > 0.0 )",
-						"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );",
-
-					"lVector = normalize( lVector );",
-
-				"#else",
+				"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );",
+				"vec3 lVector = lPosition.xyz + vViewPosition.xyz;",
 
 
-					"vec3 lVector = normalize( vPointLight[ i ].xyz );",
-					"float lDistance = vPointLight[ i ].w;",
+				"float lDistance = 1.0;",
+				"if ( pointLightDistance[ i ] > 0.0 )",
+					"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );",
 
 
-				"#endif",
+				"lVector = normalize( lVector );",
 
 
 				// diffuse
 				// diffuse
 
 
@@ -17673,23 +17587,14 @@ THREE.ShaderChunk = {
 
 
 			"for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {",
 			"for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {",
 
 
-				"#ifdef PHONG_PER_PIXEL",
-
-					"vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );",
-					"vec3 lVector = lPosition.xyz + vViewPosition.xyz;",
-
-					"float lDistance = 1.0;",
-					"if ( spotLightDistance[ i ] > 0.0 )",
-						"lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );",
-
-					"lVector = normalize( lVector );",
-
-				"#else",
+				"vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );",
+				"vec3 lVector = lPosition.xyz + vViewPosition.xyz;",
 
 
-					"vec3 lVector = normalize( vSpotLight[ i ].xyz );",
-					"float lDistance = vSpotLight[ i ].w;",
+				"float lDistance = 1.0;",
+				"if ( spotLightDistance[ i ] > 0.0 )",
+					"lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );",
 
 
-				"#endif",
+				"lVector = normalize( lVector );",
 
 
 				"float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );",
 				"float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );",
 
 
@@ -24106,7 +24011,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 			alphaTest: material.alphaTest,
 			alphaTest: material.alphaTest,
 			metal: material.metal,
 			metal: material.metal,
-			perPixel: material.perPixel,
 			wrapAround: material.wrapAround,
 			wrapAround: material.wrapAround,
 			doubleSided: material.side === THREE.DoubleSide,
 			doubleSided: material.side === THREE.DoubleSide,
 			flipSided: material.side === THREE.BackSide
 			flipSided: material.side === THREE.BackSide
@@ -25473,7 +25377,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 			parameters.morphTargets ? "#define USE_MORPHTARGETS" : "",
 			parameters.morphTargets ? "#define USE_MORPHTARGETS" : "",
 			parameters.morphNormals ? "#define USE_MORPHNORMALS" : "",
 			parameters.morphNormals ? "#define USE_MORPHNORMALS" : "",
-			parameters.perPixel ? "#define PHONG_PER_PIXEL" : "",
 			parameters.wrapAround ? "#define WRAP_AROUND" : "",
 			parameters.wrapAround ? "#define WRAP_AROUND" : "",
 			parameters.doubleSided ? "#define DOUBLE_SIDED" : "",
 			parameters.doubleSided ? "#define DOUBLE_SIDED" : "",
 			parameters.flipSided ? "#define FLIP_SIDED" : "",
 			parameters.flipSided ? "#define FLIP_SIDED" : "",
@@ -25572,7 +25475,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 			parameters.vertexColors ? "#define USE_COLOR" : "",
 			parameters.vertexColors ? "#define USE_COLOR" : "",
 
 
 			parameters.metal ? "#define METAL" : "",
 			parameters.metal ? "#define METAL" : "",
-			parameters.perPixel ? "#define PHONG_PER_PIXEL" : "",
 			parameters.wrapAround ? "#define WRAP_AROUND" : "",
 			parameters.wrapAround ? "#define WRAP_AROUND" : "",
 			parameters.doubleSided ? "#define DOUBLE_SIDED" : "",
 			parameters.doubleSided ? "#define DOUBLE_SIDED" : "",
 			parameters.flipSided ? "#define FLIP_SIDED" : "",
 			parameters.flipSided ? "#define FLIP_SIDED" : "",

File diff suppressed because it is too large
+ 2 - 2
build/three.min.js


Some files were not shown because too many files changed in this diff