查看: 2220|回复: 0
打印 上一主题 下一主题

[Unity 组件参考手册]iOS:透明着色器系列之顶点光照透明

[复制链接]
.    

3797

主题

11

听众

5万

积分

首席设计师

Rank: 8Rank: 8

纳金币
32328
精华
41

活跃会员 优秀版主 荣誉管理 论坛元老

跳转到指定楼层
楼主
发表于 2013-2-21 17:01:04 |只看该作者 |倒序浏览
Transparent Properties 透明属性This shader can make mesh geometry partially or fully transparent by reading the alpha channel of the main texture. In the alpha, 0 (black) is completely transparent while 255 (white) is completely opaque. If your main texture does not have an alpha channel, the object will appear completely opaque.这个着色器可以通过读取基础纹理贴图的Alpha通道控制对象全部或部分透明。在Alpha表达中,0(纯黑)是完全的透明而255(纯白)是完全的不透明。如果您的基础纹理贴图不含有Alpha通道,对象会完全不透明显示。Using transparent objects in your game can be tricky, as there are traditional graphical programming problems that can present sorting issues in your game. For example, if you see odd results when looking through two windows at once, you're experiencing the classical problem with using transparency. The general&nbsp***le is to be aware that there are some cases in which one transparent object may be drawn in front of another in an unusual way, especially if the objects are intersecting, enclose each other or are of very different sizes. For this reason, you should use transparent objects if you need them, and try not to let them become excessive. You should also make your designer(s) aware that such sorting problems can occur, and have them prepare to change some design to work around these issues.在游戏中使用透明对象可能会比较棘手,因为传统图形编程中的一些问题会在你的游戏中出现。例如,如果你在透过两个窗子观察看到奇怪的结果时,你在体验使用透明的的经典问题。一般的规则是要知道有些情况下在一个透明对象前面绘制另外一个透明对象的时候会出现不正常的现象,特别是在透明对象相交、互为包含或者尺寸上有着很大的差异。因此,如果你需要使用透明对象,要注意不要让它们过大。你也需要告诉美工师这些问题让他们在设计上做出适当的修改。
Vertex-Lit Properties 顶点光照属性This shader is Vertex-Lit, which is one of the simplest shaders. All lights shining on it are rendered in a single pass and calculated at vertices only.这个着色器Vertex-Lit(顶点光照) 是一个最简单的着色器,所有的光影效果都是在结点上经过一次计算渲染成的。Because it is vertex-lit, it won't display any pixel-based rendering effects, such as light cookies, normal mapping, or shadows. This shader is also much more sensitive to tesselation of the models. If you put a point light very close to a cube using this shader, the light will only be calculated at the corners. Pixel-lit shaders are much more effective at creating a nice round highlight, independent of tesselation. If that's an effect you want, you may consider using a pixel-lit shader or increase tesselation of the objects instead.以为是顶点光照,这个着色器不能显示任何以像素为基础的渲染效果,例如特殊光效(light cookies,应该是一种基于能量传递形成的光效---译者注)、法线贴图或者阴影。这个着色器也对模型的网格分布很敏感。如果你在使用这个着色器的立方体很近的地方放置一个点光源,会仅仅计算角点上的光效。像素光照(Pixel-lit)算法的着色器在生成一个漂亮的圆形高光方面更加高效,而且与模型网格分布无关。如果你需要这样的效果,你可以考虑使用像素光照(Pixel-lit)类型的着色器或者提高对象的网格数量。
Performance 性能Generally, this shader is very cheap to render. For more details, please view the Shader Peformance page.通常来讲这个着色器非常廉价(应该是指系统资源耗费上---译者注)。如果希望获取更多的细节信息,可以参考着色器表现章节(Shader Peformance page)。
【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2024-11-16 00:39 , Processed in 0.482367 second(s), 32 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部