Unity3D圖像後處理特效——Contrast Stretch image effect

Contrast Stretch dynamically adjusts the contrast of the image according to the range of brightness levels it contains. The adjustment takes place gradually over a period of time, so the player can be briefly dazzled by bright outdoor light when emerging from a dark tunnel, say. Equally, when moving from a bright scene to a dark one, the "eye" takes some time to adapt.

對比度拉伸特效根據亮度級別的範圍來動態地調整圖像的對比度。調整是逐漸變化的,並且會持續一段時間,就好像是當玩家黑暗的隧道出來時,會對明亮的室外光線產生目眩的感覺。同樣,當從明亮的畫面進入到黑暗的一面,"眼睛"也要花一些時間來適應。

 

As with the other image effects, this effect is only available in Unity Pro and you must have the Pro Standard Assets installed before it becomes available.

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

 

Understanding Contrast Stretch     對比度拉伸特效的理解

The clarity of detail in an image is largely determined by the range of different brightness values it contains. It is difficult for the eye to distinguish between two brightness levels that differ by less than about 2% and above that, the greater the difference, the stronger the detail. The overall separation between the lightest and darkest values in an image is referred to as the contrast of that image.

圖像中的細節的清晰度很大程度上取決於它所包含的不同亮度值的範圍。我們很難區分差異小於2%的兩個亮度級別,亮度差異越大,所表現的細節也就越明顯。在圖像中最亮和最暗的值之間的整體分離程度被稱爲該圖像的對比度。

 

It is common for an image to use less than the full range of available brightness values. One way to increase the contrast is to redistribute the pixels' values so as to make better use of the range. The darkest level in the original image is remapped to a even darker level, the brightest to a brighter level and all the levels in between are moved farther apart in proportion. The distribution of levels is then "stretched" out farther across the available range and thus this effect is known as contrast stretch.

一般來說,一張普通的圖像的亮度範圍僅爲可用亮度範圍的一部分,所以增加對比度的一種方法是對像素的亮度值進行重新分配,以更好地利用可用的亮度範圍。原始圖像中的最暗的級別會重新映射到一個更黑暗的水平,而最亮的級別則被映射到更亮的級別上,兩者之間各級的間距也成正比地拉伸。這樣,亮度級別的分佈就相當於在可用範圍內進行了拉伸,我們將此效果稱爲對比度拉伸。

 

Contrast stretching is evocative of the way the eye adapts to different light conditions. When walking from an outdoor area to a dimly lit building, the view will briefly appear indistinct until the contrast is stretched to reveal the detail. When emerging from the building, the contrast stretch will have the effect of making the outdoor scene appear dazzling bright until the "eye" of the player adjusts.

對比度拉伸特效可以體現眼睛在適應不同光照條件下的調節情況。當從室外走進昏暗的建築後,視圖將明顯地變得模糊,直到對比度被拉伸後才能看清細節信息。同樣當從大樓出來時,對比度拉伸會讓戶外場景更加明亮,造成目眩的效果,這種效果一直持續到玩家的"眼睛"適應了爲止。

 

No Contrast Stretch applied.

沒有應用對比度拉伸特效。

Contrast stretch applied with a dark skybox. Note that buildings get brighter.

在一個較暗的天空盒中使用對比度拉伸特效。注意建築物變得更加明亮。

Contrast stretch applied with a very bright skybox. Note that buildings get darker.

在一個非常明亮的天空盒中使用對比度拉伸特效。注意建築物變得更加灰暗。

 

Properties           屬性

Adaptation Speed

適應速度

The speed of the transition. The lower this number, the slower the transition

變換速度,該值越低,變換的越慢

Limit Minimum

受限最小值

The darkest level in the image after adjustment

調整過後圖像的最暗亮度級別.

Limit Maximum

受限最大值

The brightest level in the image after adjustment.

調整過後圖像的最亮亮度級別.

Tips:

提示:

      Since Constrast Stretch is applied over a period of time, the full effect is only visible in Play mode.

      因爲對比度拉伸特效需要持續一段時間,所以該效果只能在運行模式下可見。

 

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 run on end-users graphics card.

所有圖像特效如果無法在用戶顯卡上運行時將會自動被關閉。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章