朱峰社區(qū)首頁 朱峰社區(qū)

搜索資源 注冊|登陸

等待

返回 展開菜單
按功能 按軟件

Unity3D游戲制作教程

Unity3D游戲制作教程

包含5節(jié)視頻教程

本系列包含Unity3D介紹、Unity3D導(dǎo)出人物、Unity3D導(dǎo)出場景、Unity3D導(dǎo)出動作、游戲測試最終完成一個簡單的游戲。是一套非常完整的Unity3D游戲制作教程。

關(guān)閉

Unity組件:Grayscale image effect 灰度圖像特效

關(guān)注:1270 留言:0 樓主:kim201201 發(fā)帖時間:15年11月16日

kim201201

普通會員

kim201201

社區(qū)新人:1級

關(guān)注1748人

  • 積分

    1

  • 登陸

    1

  • 發(fā)帖

    2

間隔線

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.

灰度圖像特效是一種將原始顏色轉(zhuǎn)變成灰度的圖像特效。它可以使用一個Texture Ramp紋理來將亮度值重新映射到任意的顏色。

Like all image effects, Grayscale is available in Unity Pro only. Make sure to have the Pro Standard Assets installed.

和其他圖像特效一樣,該特效只能在Unity Pro上進(jìn)行使用,并且在使用之前必須安裝Pro Standard Assets。


Grayscale image effect applied to the scene
應(yīng)用于場景的灰度圖像特效

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.

灰度圖像特效是顏色校正特效的一個簡單版本,即,將灰度圖像映射到任意的顏色。這可以用來模擬熱源顯示效應(yīng)。

The process of color remapping is very similar to ColorCorrection effect:

顏色沖映射操作與顏色校正特效非常相似:

  1. Take a screenshot of a typical scene in your game.
    在您的游戲中對于場景進(jìn)行截屏
  2. Open it in Photoshop and convert to grayscale.
    在Photoshop中打開它,并將其轉(zhuǎn)變?yōu)榛叶葓D
  3. Color correct it using the Image->Adjustments->Curves.
    使用Image->Adjustments->Curves來進(jìn)行顏色校正
  4. Save the .acv file file from the dialog using Save...
    使用Save...來將其保存成.acv文件
  5. Open Pro Standard Assets->Image Based->color correction ramp.png in Photoshop
    在Photoshop中打開Pro Standard Assets->Image Based->color correction ramp.png
  6. Now apply color correction to the ramp image: open Image->Adjustments->Curves again and load your saved .acv file
    將顏色校正操作應(yīng)用于漸變圖像上:再次打開Image->Adjustments->Curves,并導(dǎo)入您保存的.acv文件
  7. Select your camera in Unity and select Component->Image Effects->Grayscale to add the effect. Select your modified color ramp.
    在Unity中選擇您的相機(jī),并添加灰度圖像特效Component->Image Effects->Grayscale,同時選擇您的顏色漸變圖像。
  8. Hit Play to see the effect in action!
    運(yùn)行并查看效果
Details 細(xì)節(jié)

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):
    結(jié)果顏色=漸變圖像上索引為(OriginalLuminance + RampOffset)的像素顏色。比如,要翻轉(zhuǎn)圖片上的顏色,您只需水平翻轉(zhuǎn)原始的漸變圖像即可(這樣它才能從白色到從黑色到白色而不是黑色)。


Grayscale applied to the scene with color ramp that goes from white to black.
應(yīng)用于場景的灰度圖像特效效果,顏色漸變圖像是從白到黑

A more complex version of color remapping that does arbitrary color correction can be achieved with ColorCorrection image effect.

關(guān)于顏色重映射的更加復(fù)雜的版本可見顏色校正圖像特效。

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。臺式機(jī):2003年以后的NVIDIA顯卡(GeForce FX),2004年以后的AMD顯卡(Radeon 9500),2005年以后的Intel卡(GMA 900);移動設(shè)備:OpenGL ES 2.0;控制臺: Xbox 360、 PS3。

All image effects automatically disable themselves when they can not run on end-users graphics card.

所有圖像特效如果無法在用戶顯卡上運(yùn)行時將會自動被關(guān)閉。

贊0 踩0

未知用戶

2005-2025 朱峰社區(qū) 版權(quán)所有 遼ICP備2021001865號-1
2005-2025 ZhuFeng Community All Rights Reserved

VIP

朱峰社區(qū)微信公眾號

回頂部

1.復(fù)制文本發(fā)給您的QQ好友或群、微信等;好友點(diǎn)擊鏈接以后,轉(zhuǎn)發(fā)就成功了。 2.如朋友點(diǎn)擊您的鏈接,您需要需刷新一下才行;同一個好友僅能點(diǎn)擊一次。
購買VIP,觀看所有收費(fèi)教程。