diff --git a/examples/js/ShaderSkin.js b/examples/js/ShaderSkin.js index 72a3dc0767dddb..668fbf40aca3b2 100644 --- a/examples/js/ShaderSkin.js +++ b/examples/js/ShaderSkin.js @@ -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" ], @@ -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", diff --git a/examples/js/shaders/NormalDisplacementShader.js b/examples/js/shaders/NormalDisplacementShader.js index 1537d0d84ce2e2..b30a941a9833b1 100644 --- a/examples/js/shaders/NormalDisplacementShader.js +++ b/examples/js/shaders/NormalDisplacementShader.js @@ -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", @@ -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 );", " }", diff --git a/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl b/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl index 09407c1fb1d8c1..7c930647da0e6c 100644 --- a/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl +++ b/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl @@ -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 ); @@ -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