Browse Source

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

Mr.doob 14 years ago
parent
commit
fbbfb3b683

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


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


File diff suppressed because it is too large
+ 0 - 0
build/custom/ThreeWebGL.js


+ 2 - 2
src/extras/ShaderUtils.js

@@ -223,7 +223,7 @@ THREE.ShaderUtils = {
 							"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );",
 							"float pointDistance = vPointLight[ i ].w;",
 
-							"float pointDotNormalHalf = dot( normal, pointHalfVector );",
+							"float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );",
 							"float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );",
 
 							"float pointSpecularWeight = specularTex.r * pow( pointDotNormalHalf, uShininess );",
@@ -249,7 +249,7 @@ THREE.ShaderUtils = {
 							"vec3 dirVector = normalize( lDirection.xyz );",
 							"vec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );",
 
-							"float dirDotNormalHalf = dot( normal, dirHalfVector );",
+							"float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );",
 							"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );",
 
 							"float dirSpecularWeight = specularTex.r * pow( dirDotNormalHalf, uShininess );",

+ 2 - 3
src/renderers/WebGLShaders.js

@@ -385,7 +385,7 @@ THREE.ShaderChunk = {
 				"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );",
 				"float pointDistance = vPointLight[ i ].w;",
 
-				"float pointDotNormalHalf = dot( normal, pointHalfVector );",
+				"float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );",
 				"float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );",
 
 				"float pointSpecularWeight = pow( pointDotNormalHalf, shininess );",
@@ -409,8 +409,7 @@ THREE.ShaderChunk = {
 				"vec3 dirVector = normalize( lDirection.xyz );",
 				"vec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );",
 
-				"float dirDotNormalHalf = dot( normal, dirHalfVector );",
-
+				"float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );",
 				"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );",
 
 				"float dirSpecularWeight = pow( dirDotNormalHalf, shininess );",

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