您的位置:首页 > 移动开发 > Unity3D

Unity3D中CG/GLSL shader与iPhone shader的区别

2012-10-11 22:46 375 查看
最重要的区别即CG/GLSL shader在Unity iphone中是不支持的。更多信息见:

file:///Applications/Unity%20iPhone/Unity%20iPhone.app/Contents/Documentation/Documentation/Manual/iphone-unsupported.html

据我所知,并不是ShaderLab Reference所有功能都能在iPhone中运行良好,不支持的功能列表如下:

1、Cubemaps

2、SeparateSpecular command

3、Three-argument texture combiner functions (except Lerp)

4、GrabPass

之所以Unity中的每个shader都能在iPhone上运行良好,是因为Unity中的Fallbacks预设机制。如果想要编写自己的shader,最好依据iPhone standard assets中的shader, 因为其中的shader做了简化与优化,运行更高效。

深入阅读:
http://www.unifycommunity.com/wiki/index.php?title=Shader_Archive#iPhone
补充学习:

Unity provides a language called "ShaderLab" which is similar to Nvidia's CgFX. You can use this to write custom shaders including vertex & fragment programs.

Read more about it in the Unity reference manual here: http://unity3d.com/support/documentation/Components/SL-Reference.html

A good way to start off is to have a look at the source code for Unity's built-in shaders, which you can download here:http://unity3d.com/download_unity/builtin_shaders.zip

Or check out the custom shaders that people have put up on the Unity Wiki, here:http://www.unifycommunity.com/wiki/index.php?title=Shaders
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: