Unity3D图像后处理特效——Screen Space Ambient Occlusion (SSAO) image effect

Screen Space Ambient Occlusion (SSAO) approximates Ambient Occlusion in realtime, as an image post-processing effect. It darkens creases, holes and surfaces that are close to each other. In real life, such areas tend to block out or occlude ambient light, hence they appear darker.

屏幕空间环境遮挡技术(SSAO)作为一种图像的后处理特效来实时模拟场景的环境遮挡效果。

 

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

 

Unity3D图像后处理特效——Screen Space Ambient Occlusion (SSAO) image effect_第1张图片
SSAO applied to the scene.

应用于场景中的SSAO效果。

Unity3D图像后处理特效——Screen Space Ambient Occlusion (SSAO) image effect_第2张图片
The same scene without SSAO for comparison. Note the differences at the corners where structures or grass meet the ground.

同样的场景,但没有进行SSAO操作。注意两幅图在建筑物的角落里或草和地面的交接处的差异。

 

Properties    属性

Radius

半径

The maximum "radius" of a gap that will introduce ambient occlusion.

环境遮挡所需的最大半径值

Sample Count

采样点数量

Number of ambient occlusion samples. A higher count will give better quality but with a higher processing overhead.

环境遮挡效果所需采样点的个数。较高的采样点数量可以达到更高的质量,但也会造成更高的处理开销

Occlusion Intensity

遮挡强度

The degree of darkness added by ambient occlusion.

环境遮挡所加的黑暗程度

Blur

模糊度

Amount of blur to apply to the darkening. No blur (0) is much faster but the darkened areas will be noisy.

应用到黑暗区域的模糊程度。不使用模糊(0)时,处理效果很快,但黑暗区域会有需要噪点。

Downsampling

下采样

The resolution at which calculations should be performed (for example, a downsampling value of 2 will work at half the screen resolution). Downsampling increases rendering speed at the cost of quality.

决定在何种计算下所采用的分辨率(比如,四分之一的下采样将应用在一半屏幕分辨率的情况下)。下采样可以增加渲染速度。

Occlusion Attenuation

遮挡衰减

How fast occlusion should attenuate with distance.

遮挡效果随距离变化的衰减程度

Min Z

Z最小值

Try increasing this value if there are artifacts.

如果出现误差,可尝试增加该值

 

Details         细节原理

SSAO approximates ambient occlusion using an image processing effect. Its cost depends purely on screen resolution and SSAO parameters and does not depend on scene complexity as true AO would. However, the approximation tends to introduce artifacts. For example, objects that are outside of the screen do not contribute to occlusion and the amount of occlusion is dependent on viewing angle and camera position.

SSAO技术使用图像处理特效来模拟环境遮挡的效果。它的计算开销完全取决于屏幕分辨率和SSAO的系数,而与场景复杂度和真实的环境遮挡无关。但是,这种模拟也会引入一些瑕疵。比如,屏幕之外的物体将对遮挡效果没有影响,并且遮挡程度取决于视角和照相机的位置。

 

Note that SSAO is quite expensive in terms of processing time and generally should only be used on high-end graphics cards. Using SSAO will cause Unity to render the depth+normals texture of the camera which increases the number of draw calls and has a CPU processing overhead. However, the depth+normals texture then can be used for other effects as well (eg, Depth of Field). Once the texture is generated, the remainder of the SSAO effect is performed on the graphics card.

注意SSAO技术在处理时间上来说是非常耗时的,一般应该用于高端显卡上。使用SSAO技术会让Unity渲染照相机上的深度+法线纹理,这样会增加一定数量的绘制调用和一定的CPU开销。但是,深度+法线纹理同样也可以用于其他特效(比如,景深特效)。一旦纹理生成了,接下来的特效处理就在显卡上进行了。

 

Hardware support     硬件支持

SSAO works on graphics cards with Shader Model 3.0 support (eg, GeForce 6 and later, Radeon X1300 and later). All image effects automatically disable themselves when they can not run on a particular graphics card. Due to the complexity of the effect, SSAO is not supported on mobile devices.

SSAO特效需要显卡支持Shader Model 3.0(即GeForce 6、Radeon X1300以后的显卡)。所有图像特效如果无法在用户显卡上运行时将会自动被关闭。由于该特效的复杂性,SSAO目前不支持移动设备。

你可能感兴趣的:(Unity3D,脚本)