|
@@ -229,9 +229,7 @@ THREE.ShaderSkin = {
|
|
|
|
|
|
"for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {",
|
|
|
|
|
|
- "vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );",
|
|
|
-
|
|
|
- "vec3 dirVector = normalize( lDirection.xyz );",
|
|
|
+ "vec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );",
|
|
|
|
|
|
"float dirDiffuseWeightFull = max( dot( normal, dirVector ), 0.0 );",
|
|
|
"float dirDiffuseWeightHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );",
|
|
@@ -254,8 +252,7 @@ THREE.ShaderSkin = {
|
|
|
|
|
|
"for ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {",
|
|
|
|
|
|
- "vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );",
|
|
|
- "vec3 lVector = normalize( lDirection.xyz );",
|
|
|
+ "vec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );",
|
|
|
|
|
|
"float dotProduct = dot( normal, lVector );",
|
|
|
"float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;",
|
|
@@ -527,9 +524,7 @@ THREE.ShaderSkin = {
|
|
|
|
|
|
"for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {",
|
|
|
|
|
|
- "vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );",
|
|
|
-
|
|
|
- "vec3 dirVector = normalize( lDirection.xyz );",
|
|
|
+ "vec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );",
|
|
|
|
|
|
"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );",
|
|
|
|