Browse Source

replicate previous phong metal look -- it still isn't correct but at least it roughly matches previous look.

Ben Houston 10 years ago
parent
commit
f15ae3a87b

+ 4 - 4
examples/webgl_materials2.html

@@ -69,10 +69,10 @@
 
 
 				shininess = 15;
 				shininess = 15;
 
 
-				materials.push( new THREE.MeshPhongMaterial( { map: imgTexture2, bumpMap: imgTexture2, bumpScale: bumpScale, color: 0x666666, ambient: 0x000000, specular: 0xffaa00, shininess: shininess, metal: true, shading: shading } ) );
-				materials.push( new THREE.MeshPhongMaterial( { map: imgTexture2, bumpMap: imgTexture2, bumpScale: bumpScale, color: 0x666666, ambient: 0x000000, specular: 0xaaff00, shininess: shininess, metal: true, shading: shading } ) );
-				materials.push( new THREE.MeshPhongMaterial( { map: imgTexture2, bumpMap: imgTexture2, bumpScale: bumpScale, color: 0x666666, ambient: 0x000000, specular: 0x00ffaa, shininess: shininess, metal: true, shading: shading } ) );
-				materials.push( new THREE.MeshPhongMaterial( { map: imgTexture2, bumpMap: imgTexture2, bumpScale: bumpScale, color: 0x666666, ambient: 0x000000, specular: 0x00aaff, shininess: shininess, metal: true, shading: shading } ) );
+				materials.push( new THREE.MeshPhongMaterial( { map: imgTexture2, bumpMap: imgTexture2, bumpScale: bumpScale, color: 0x000000, ambient: 0x000000, specular: 0xffaa00, shininess: shininess, metal: true, shading: shading } ) );
+				materials.push( new THREE.MeshPhongMaterial( { map: imgTexture2, bumpMap: imgTexture2, bumpScale: bumpScale, color: 0x000000, ambient: 0x000000, specular: 0xaaff00, shininess: shininess, metal: true, shading: shading } ) );
+				materials.push( new THREE.MeshPhongMaterial( { map: imgTexture2, bumpMap: imgTexture2, bumpScale: bumpScale, color: 0x000000, ambient: 0x000000, specular: 0x00ffaa, shininess: shininess, metal: true, shading: shading } ) );
+				materials.push( new THREE.MeshPhongMaterial( { map: imgTexture2, bumpMap: imgTexture2, bumpScale: bumpScale, color: 0x000000, ambient: 0x000000, specular: 0x00aaff, shininess: shininess, metal: true, shading: shading } ) );
 
 
 				// Spheres geometry
 				// Spheres geometry
 
 

+ 1 - 1
src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl

@@ -229,7 +229,7 @@ vec3 totalSpecularLight = vec3( 0.0 );
 
 
 #ifdef METAL
 #ifdef METAL
 
 
-	outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor * ambient + totalSpecularLight ) + emissive;
+	outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor * ambient ) * specular + totalSpecularLight + emissive;
 
 
 #else
 #else