Fix for specular component of Phong and normal map materials. Hope so.

Thanks to @fazeaction for spotting this.
This commit is contained in:
alteredq
2011-07-12 02:57:05 +02:00
parent 23e315cb33
commit 256f9a671a
6 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -202,7 +202,7 @@ THREE.ShaderUtils = {
"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
"vec3 pointVector = normalize( vPointLight[ i ].xyz );",
"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + vViewPosition );",
"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );",
"float pointDistance = vPointLight[ i ].w;",
"float pointDotNormalHalf = dot( normal, pointHalfVector );",
@@ -229,7 +229,7 @@ THREE.ShaderUtils = {
"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );",
"vec3 dirVector = normalize( lDirection.xyz );",
"vec3 dirHalfVector = normalize( lDirection.xyz + vViewPosition );",
"vec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );",
"float dirDotNormalHalf = dot( normal, dirHalfVector );",
"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );",
+2 -2
View File
@@ -336,7 +336,7 @@ THREE.ShaderChunk = {
"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
"vec3 pointVector = normalize( vPointLight[ i ].xyz );",
"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + vViewPosition );",
"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );",
"float pointDistance = vPointLight[ i ].w;",
"float pointDotNormalHalf = dot( normal, pointHalfVector );",
@@ -364,7 +364,7 @@ THREE.ShaderChunk = {
"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );",
"vec3 dirVector = normalize( lDirection.xyz );",
"vec3 dirHalfVector = normalize( lDirection.xyz + vViewPosition );",
"vec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );",
"float dirDotNormalHalf = dot( normal, dirHalfVector );",