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

[Unity 组件参考手册]组件:图像特效脚本之灰度图像特效

[复制链接]
.    

3797

主题

11

听众

5万

积分

首席设计师

Rank: 8Rank: 8

纳金币
32328
精华
41

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

跳转到指定楼层
楼主
发表于 2013-1-31 21:49:22 |只看该作者 |倒序浏览
Grayscale is a simple image effect that changes colors to grayscale by default. It can also use a Texture Ramp texture to remap luminance to arbitrary colors. 灰度图像特效是一种将原始颜色转变成灰度的图像特效。它可以使用一个Texture Ramp纹理来将亮度值重新映射到任意的颜色。Like all image effects, Grayscale is available in Unity Pro only. Make sure to have the Pro Standard Assets installed. 和其他图像特效一样,该特效只能在Unity Pro上进行使用,并且在使用之前必须安装Pro Standard Assets。
Grayscale image effect applied to the scene
应用于场景的灰度图像特效 Remapping colors 重新映射颜色
Grayscale can do a simple version of color correction, i.e. remap grayscale image into arbitrary colors. This can be used for effects like heat vision. 灰度图像特效是颜色校正特效的一个简单版本,即,将灰度图像映射到任意的颜色。这可以用来模拟热源显示效应。The process of color remapping is very similar to ColorCorrection effect: 颜色冲映射操作与颜色校正特效非常相似:Take a screenshot of a typical scene in your game.
在您的游戏中对于场景进行截屏 Open it in photoshop and convert to grayscale.
在Photoshop中打开它,并将其转变为灰度图 Color correct it using the Image->Adjustments->Curves.
使用Image->Adjustments->Curves来进行颜色校正 Save the .acv file file from the dialog using Save...
使用Save...来将其保存成.acv文件 Open Pro Standard Assets->Image Based->color correction ramp.png in Photoshop
在Photoshop中打开Pro Standard Assets->Image Based->color correction ramp.png Now apply color correction to the ramp image: open Image->Adjustments->Curves again and load your saved .acv file
将颜色校正操作应用于渐变图像上:再次打开Image->Adjustments->Curves,并导入您保存的.acv文件 Select your camera in Unity and select Component->Image Effects->Grayscale to add the effect. Select your modified color ramp.
在Unity中选择您的相机,并添加灰度图像特效Component->Image Effects->Grayscale,同时选择您的颜色渐变图像。 Hit Play to see the effect in action!
运行并查看效果  [Details 细节]
Color remapping works by remapping the original image luminance through the color ramp image (sized 256x1): 颜色重映射操作是通过将原始图像亮度映射到颜色渐变图像(256x1)上:result color = pixel's color in the ramp image at (OriginalLuminance + RampOffset) index. For example, to invert the colors in the image you only need to flip the original color ramp horizontally (so that it goes from white to black instead of from black to white):
结果颜色=渐变图像上索引为(OriginalLuminance + RampOffset)的像素颜色。比如,要翻转图片上的颜色,您只需水平翻转原始的渐变图像即可(这样它才能从白色到从黑色到白色而不是黑色)。
Grayscale applied to the scene with color ramp that goes from white to black.
应用于场景的灰度图像特效效果,颜色渐变图像是从白到黑A more complex version of color remapping that does arbitrary color correction can be achieved with ColorCorrection image effect. 关于颜色重映射的更加复杂的版本可见颜色校正图像特效。 [Hardware support]
This effect requires a graphics card with pixel shaders (2.0) or OpenGL ES 2.0. PC: NVIDIA cards since 2003 (GeForce FX), AMD cards since 2004 (Radeon 9500), Intel cards since 2005 (GMA 900); Mobile: OpenGL ES 2.0; Consoles: Xbox 360, ps3. 这个特效需要显卡拥有像素着色器(2.0)或者OpenGL ES 2.0。台式机:2003年以后的NVIDIA显卡(GeForce FX),2004年以后的AMD显卡(Radeon 9500),2005年以后的Intel卡(GMA 900);移动设备:OpenGL ES 2.0;控制台: Xbox 360、 PS3。All image effects automatically disable themselves when they can not&nbsp***n on end-users graphics card. 所有图像特效如果无法在用户显卡上运行时将会自动被关闭。
【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

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

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

GMT+8, 2024-11-11 18:52 , Processed in 0.100590 second(s), 33 queries .

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

© 2008-2019 Narkii Inc.

回顶部