浏览代码

Changed ambient term to influence also texture in Phong / normal map materials.

This feels more intuitive, otherwise ambiently lit textured surfaces look weird.
alteredq 14 年之前
父节点
当前提交
7355c2b68b
共有 5 个文件被更改,包括 2 次插入2 次删除
  1. 0 0
      build/Three.js
  2. 0 0
      build/custom/ThreeExtras.js
  3. 0 0
      build/custom/ThreeWebGL.js
  4. 1 1
      src/extras/ShaderUtils.js
  5. 1 1
      src/renderers/WebGLShaders.js

文件差异内容过多而无法显示
+ 0 - 0
build/Three.js


文件差异内容过多而无法显示
+ 0 - 0
build/custom/ThreeExtras.js


文件差异内容过多而无法显示
+ 0 - 0
build/custom/ThreeWebGL.js


+ 1 - 1
src/extras/ShaderUtils.js

@@ -280,7 +280,7 @@ THREE.ShaderUtils = {
 
 					"#endif",
 
-					"gl_FragColor.xyz = gl_FragColor.xyz * totalDiffuse + totalSpecular + ambientLightColor * uAmbientColor;",
+					"gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * uAmbientColor) + totalSpecular;",
 
 					"if ( enableReflection ) {",
 

+ 1 - 1
src/renderers/WebGLShaders.js

@@ -439,7 +439,7 @@ THREE.ShaderChunk = {
 
 		"#endif",
 
-		"gl_FragColor.xyz = gl_FragColor.xyz * totalDiffuse + totalSpecular + ambientLightColor * ambient;"
+		"gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;"
 
 	].join("\n"),
 

部分文件因为文件数量过多而无法显示