浏览代码

Added support for metal flag to normal map shader.

alteredq 13 年之前
父节点
当前提交
aa5918fbb8
共有 3 个文件被更改,包括 9 次插入1 次删除
  1. 0 0
      build/Three.js
  2. 0 0
      build/custom/ThreeExtras.js
  3. 9 1
      src/extras/ShaderUtils.js

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


文件差异内容过多而无法显示
+ 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 ) {",
 

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