瀏覽代碼

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",
 					"#endif",
 
 
-					"gl_FragColor.xyz = gl_FragColor.xyz * totalDiffuse + totalSpecular + ambientLightColor * uAmbientColor;",
+					"gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * uAmbientColor) + totalSpecular;",
 
 
 					"if ( enableReflection ) {",
 					"if ( enableReflection ) {",
 
 

+ 1 - 1
src/renderers/WebGLShaders.js

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

部分文件因文件數量過多而無法顯示