Unity Post processing(Unity 后期处理 ) 官方手册笔记系列之Ambient Occlusion(环境光遮蔽)

Ambient Occlusion(环境光遮蔽)


The effect descriptions on this page refer to the default effects found within the post-processing stack.

The Ambient Occlusion post-processing effect approximates Ambient Occlusion in real time as a full-screen post-processing effect. It darkens creases, holes, intersections 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.

Note that the Ambient Occlusion effect is quite expensive in terms of processing time and generally should only be used on desktop or console hardware. Its cost depends purely on screen resolution and the effects parameters and does not depend on scene complexity as true Ambient Occlusion would.
Scene with Ambient Occlusion. 拥有环境光遮蔽的场景
Scene without Ambient Occlusion. Note the differences at geometry intersections.
UI for Ambient Occlusion 环境光遮蔽的UI


IntensityDegree of darkness produced by the effect(黑暗强度)
RadiusRadius of sample points, which affects extent of darkened areas. (采样点的半径,影响黑暗区域的范围)
Sample CountNumber of sample points, which affects quality and performance. (采样点的数量,影响效果质量和性能)
DownsamplingHalves the resolution of the effect to increase performance at the cost of visual quality. (将效果的分辨率减半,以提高性能成本)
Force Forward CompatibilityForces compatibility with Forward rendered objects when working with the Deferred rendering path. (在处理延迟渲染时,强制兼容前向渲染对象)
High Precision (Forward)Toggles the use of a higher precision depth texture with the forward rendering path (may impact performances). Has no effect with the deferred rendering path. (是否使用前向渲染(可能影响性能)高精度深度纹理。对延迟呈现路径没有影响)
Ambient OnlyEnables the ambient-only mode in that the effect only affects ambient lighting. This mode is only available with the Deferred rendering path and HDR rendering. (是否只影响环境光照。这种模式只能在延迟渲染和HDR渲染中有效)


  • Reduce Radius size 减少半径
  • Reduce Radius size 减少采样点
  • Enable Downsampling 开启降采样
  • If using deferred rendering, disable Force Forward Compatibility (will cause forward rendered object to not be used when calculating Ambient Occlusion) 如果使用延迟渲染,禁用前向兼容性(将导致在计算环境光遮挡时前向渲染对象不会被使用)
  • If using forward rendering, disable High Precision (will cause the effect to use a lower precision depth texture, impacting visual quality) 如果使用前向渲染,禁用高精确度(将导致效果使用较低的精度深度纹理,影响视觉质量)

Beware that this effect can be quite expensive, especially when viewed very close to the camera. For that reason it is recommended to always enable Downsampling and favor a low radius setting. With a low radius the Ambient Occlusion effect will only sample pixels that are close, in clip space, to the source pixel, which is good for performance as they can be cached efficiently. With higher radiuses, the generated samples will be further away from the source pixel and won’t benefit from caching thus slowing down the effect. Because of the camera’s perspective, objects near the front plane will use larger radiuses than those far away, so computing the Ambient Occlusion pass for an object close to the camera will be slower than for an object further away that only occupies a few pixels on screen.

When working with the Deferred rendering path, you have the possibility to render the ambient occlusion straight to the ambient G-Buffer so that it’s taken into account by Unity during the lighting pass. Note that this setting requires the camera to have HDR enabled.

When working with the Forward rendering path you may experience some quality issues in regards to depth precision. You can overcome these issues by toggling High Precision but only do it if you actually need it as it will lower performances.


  • Depth & Normals texture 深度和法线贴图
  • Shader model 3 着色模型3 以上
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页