Browse Source

Merge remote-tracking branch 'alteredq/dev' into dev

Mr.doob 14 years ago
parent
commit
0651e7d9fa
3 changed files with 10 additions and 4 deletions
  1. 1 1
      build/Three.js
  2. 1 1
      build/custom/ThreeExtras.js
  3. 8 2
      src/extras/ShaderUtils.js

File diff suppressed because it is too large
+ 1 - 1
build/Three.js


File diff suppressed because it is too large
+ 1 - 1
build/custom/ThreeExtras.js


+ 8 - 2
src/extras/ShaderUtils.js

@@ -127,7 +127,10 @@ THREE.ShaderUtils = {
 				"uSpecularColor": { type: "c", value: new THREE.Color( 0x111111 ) },
 				"uAmbientColor": { type: "c", value: new THREE.Color( 0x050505 ) },
 				"uShininess": { type: "f", value: 30 },
-				"uOpacity": { type: "f", value: 1 }
+				"uOpacity": { type: "f", value: 1 },
+
+				"uOffset" : { type: "v2", value: new THREE.Vector2( 0, 0 ) },
+				"uRepeat" : { type: "v2", value: new THREE.Vector2( 1, 1 ) }
 
 				}
 
@@ -286,6 +289,9 @@ THREE.ShaderUtils = {
 
 				"attribute vec4 tangent;",
 
+				"uniform vec2 uOffset;",
+				"uniform vec2 uRepeat;",
+
 				"#ifdef VERTEX_TEXTURES",
 
 					"uniform sampler2D tDisplacement;",
@@ -329,7 +335,7 @@ THREE.ShaderUtils = {
 					"vBinormal = cross( vNormal, vTangent ) * tangent.w;",
 					"vBinormal = normalize( vBinormal );",
 
-					"vUv = uv;",
+					"vUv = uv * uRepeat + uOffset;",
 
 					// point lights
 

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