您的位置:首页 > 移动开发 > Unity3D

Unity3D图像后处理特效——Contrast Stretch image effect

2012-07-15 21:13 627 查看
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.

所有图像特效如果无法在用户显卡上运行时将会自动被关闭。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: