Unity3D圖像後處理特效——Color Correction image effect

Color Correction allows you apply arbitrary color correction to your scene as a postprocessing effect (just like the Curves tool in Photoshop or Gimp). This page explains how to setup color correction in Photoshop and then apply exactly the same color correction at runtime in Unity.

顏色校正作爲一種後處理特效允許您將任意的校正顏色應用於你的場景(就像 Photoshop Gimp 中的曲線工具)。本頁說明如何在 Photoshop 中設置顏色校正,然後在Unity中如何在程序運行時應用完全相同顏色校正。

 

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

和其他圖像特效一樣,該特效只能在Unity Pro上進行使用,並且在使用之前必須安裝Pro Standard Assets

Color correction applied to the scene. Color ramp used (magnified) is shown at the right.

應用於場景的顏色校正特效。所用的顏色漸變圖可見右方。


Color ramp used for the image above.

上面圖片所用的顏色漸變圖。

 

Getting color correction from Photoshop into Unity                PhotoShop中得到顏色漸變圖並應用於Unity

 

1.      Take a screenshot of a typical scene in your game

         在遊戲中取一張典型場景的截圖

2.      Open it in Photoshop and color correct using the Image->Adjustments->Curves

         在PhotoShop中打開它,並使用Image->Adjustments->Curves進行顏色校正

3.      Save the .acv file file from the dialog using Save...

         使用Save...保存.acv文件

4.      Open Pro Standard Assets->Image Based->color correction ramp.png in Photoshop

         在Photoshop中打開Pro Standard Assets->Image Based->color correction ramp.png

5.      Now apply color correction to the ramp image: open Image->Adjustments->Curves again and load your saved .acv file

         現在在漸變圖像中進行顏色漸變處理:再次打開Image->Adjustments->Curves,並導入你保存的.acv文件

6.      Select your camera in Unity and select Component->Image Effects->Color Correction to add color correction effect. Select your modified color ramp.

         在Unity中選擇你的照相機,選擇選項Component->Image Effects->Color Correction來加入顏色校正特效。選擇你修改過的漸變顏色。

7.      Hit Play to see the effect in action!

         點擊Play來看效果。

 

Details                細節

Color correction works by remapping the original image colors through the color ramp image (sized 256x1):

顏色校正特效是將顏色漸變圖像映射到原始圖像上所得到的效果:

1.      result.red = pixel's red value in ramp image at (original.red + RampOffsetR) index

result.red =漸變圖像上索引爲(original.red + RampOffsetR)的像素紅色通道值

2.      result.green = pixel's green value in ramp image at (original.green + RampOffsetG) index

result.green =漸變圖像上索引爲(original. green + RampOffsetG)的像素綠色通道值

3.      result.blue = pixel's blue value in ramp image at (original.blue + RampOffsetB) index

result.blue =漸變圖像上索引爲(original. blue + RampOffsetB)的像素藍色通道值

So 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).

例如,要反相圖像中的顏色你只需要水平地翻轉顏色漸變曲線(以便它從白色變爲黑色而不是從黑色到白色)。

A simpler version of color remapping that only remaps based on luminance can be achieved with Grayscale image effect.

一個只基於亮度的顏色重映射的簡單版本通過結合灰度圖像特效結果來達到。

 

Tips:

提示:

        The color correction ramp image should not have mip-maps. Turn them off in Import Settings. It should also be set to Clamp mode.

      顏色校正漸變圖像不應該擁有mip-map。在Import Settings中將其關閉,同時它應該是Clamp模式。

 

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.

這個特效需要顯卡擁有像素着色器(3.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 run on end-users graphics card.  

所有圖像特效如果無法在用戶顯卡上運行時將會自動被關閉。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章