Browse Source

Added support for metal flag to normal map shader.

alteredq 13 năm trước cách đây
mục cha
commit
aa5918fbb8
3 tập tin đã thay đổi với 9 bổ sung1 xóa
  1. 0 0
      build/Three.js
  2. 0 0
      build/custom/ThreeExtras.js
  3. 9 1
      src/extras/ShaderUtils.js

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


+ 9 - 1
src/extras/ShaderUtils.js

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

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