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

本文详细介绍了在 Unity iPhone 中使用 ShaderLab 的限制,包括不支持的特性如 Cubemaps、SeparateSpecular command 等,并提供了优化建议。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最重要的区别即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

                                                      
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值