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

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

[复制链接]
.    

3797

主题

11

听众

5万

积分

首席设计师

Rank: 8Rank: 8

纳金币
32328
精华
41

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

跳转到指定楼层
楼主
发表于 2013-2-21 17:01:43 |只看该作者 |倒序浏览
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.在游戏中使用透明对象可能会比较棘手,因为传统图形编程中的一些问题会在你的游戏中出现。例如,如果你在透过两个窗子观察看到奇怪的结果时,你在体验使用透明的的经典问题。一般的规则是要知道有些情况下在一个透明对象前面绘制另外一个透明对象的时候会出现不正常的现象,特别是在透明对象相交、互为包含或者尺寸上有着很大的差异。因此,如果你需要使用透明对象,要注意不要让它们过大。你也需要告诉美工师这些问题让他们在设计上做出适当的修改。
Specular Properties 高光属性Specular computes the same simple (Lambertian) lighting as Diffuse, plus a viewer dependent specular highlight. This is called the Blinn-Phong lighting model. It has a specular highlight that is dependent on surface angle, light angle, and viewing angle. The highlight is actually just a realtime-suitable way to simulate blurred reflection of the light source. The level of blur for the highlight is controlled with the Shininess slider in the Inspector.高光同漫反射一样进行简单的(兰伯特)照明计算的同时,附加显示一个高光点。这个称为Blinn-Phong光照模型。它有一个依靠曲面角度、入射光角度及观察角度而产生的高光点。这个高光点其实是一个实时表现光源模糊反射的方式,高光的模糊层次由Inspector面板中的Shininess(反光)滑标参数控制。Additionally, the alpha channel of the main texture acts as a Specular Map (sometimes called "gloss map"), defining which areas of the object are more reflective than others. Black areas of the alpha will be zero specular reflection, while white areas will be full specular reflection. This is very useful when you want different areas of your object to reflect different levels of specularity. For example, something like&nbsp***sty metal would use low specularity, while polished metal would use high specularity. Lipstick has higher specularity than skin, and skin has higher specularity than cotton clothes. A well-made Specular Map can make a huge difference in impressing the player.另外,基础纹理贴图的alpha通道作为高光贴图(有时称为“光泽贴图”),定义了对象上的某个地方比其它地方更反光。Alpha通道黑色区域是0高光反射区域,而白色区域是全反射区域。这在你需要游戏对象具有不同的高光反射层次时很有用。例如,腐蚀的金属用低高光,而抛光金属应用强高光。唇膏应该比皮肤有更强的高光,而皮肤应该比纯棉衣服更反光。一个精致的高光贴图可以给玩家一个截然不同的印象。
Performance 性能表现Generally, this shader is moderately expensive to render. For more details, please view the Shader Peformance page.通常来讲这个着色器系统资源耗费一般。如果希望获取更多的细节信息,可以参考着色器性能章节。
【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

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

关闭

站长推荐上一条 /1 下一条

手机版|纳金网 ( 闽ICP备08008928号

GMT+8, 2024-5-2 18:40 , Processed in 0.086574 second(s), 33 queries .

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

© 2008-2019 Narkii Inc.

回顶部