Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Mar 9, 2015
1 parent 8cb82c8 commit 47b7f88
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions examples/js/ShaderSkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ THREE.ShaderSkin = {

"#endif",

"outgoingLight.xyz += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse ) + totalSpecularLight;",
"outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse ) + totalSpecularLight;",

THREE.ShaderChunk[ "shadowmap_fragment" ],
THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
Expand Down Expand Up @@ -526,11 +526,11 @@ THREE.ShaderSkin = {

"#ifdef VERSION1",

"vec3 nonblurColor = sqrt(outgoingLight.xyz );",
"vec3 nonblurColor = sqrt(outgoingLight );",

"#else",

"vec3 nonblurColor = outgoingLight.xyz;",
"vec3 nonblurColor = outgoingLight;",

"#endif",

Expand Down
6 changes: 3 additions & 3 deletions examples/js/shaders/NormalDisplacementShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,11 @@ THREE.NormalDisplacementShader = {

" #ifdef METAL",

" outgoingLight.xyz += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse + totalSpecularLight );",
" outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse + totalSpecularLight );",

" #else",

" outgoingLight.xyz += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse ) + totalSpecularLight;",
" outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse ) + totalSpecularLight;",

" #endif",

Expand All @@ -417,7 +417,7 @@ THREE.NormalDisplacementShader = {

" #endif",

" outgoingLight.xyz = mix( outgoingLight.xyz, cubeColor.xyz, specularTex.r * reflectivity );",
" outgoingLight = mix( outgoingLight.xyz, cubeColor.xyz, specularTex.r * reflectivity );",

" }",

Expand Down
8 changes: 4 additions & 4 deletions src/renderers/shaders/ShaderChunk/envmap_fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );
sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;
vec4 envColor = texture2D( envMap, sampleUV );

#elif defined( ENVMAP_TYPE_SPHERE )
vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));
vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );
Expand All @@ -47,15 +47,15 @@

#ifdef ENVMAP_BLENDING_MULTIPLY

outgoingLight.xyz = mix( outgoingLight.xyz, outgoingLight.xyz * envColor.xyz, specularStrength * reflectivity );
outgoingLight = mix( outgoingLight, outgoingLight. * envColor.xyz, specularStrength * reflectivity );

#elif defined( ENVMAP_BLENDING_MIX )

outgoingLight.xyz = mix( outgoingLight.xyz, envColor.xyz, specularStrength * reflectivity );
outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );

#elif defined( ENVMAP_BLENDING_ADD )

outgoingLight.xyz += envColor.xyz * specularStrength * reflectivity;
outgoingLight += envColor.xyz * specularStrength * reflectivity;

#endif

Expand Down

0 comments on commit 47b7f88

Please sign in to comment.