Browse Source

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 năm trước cách đây
mục cha
commit
7355c2b68b

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
build/Three.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
build/custom/ThreeExtras.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 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"),
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác