Volumetric Ambient Occlusion Unity Plugin User Guide

Contents

Introduction

Volumetric Ambient Occlusion (VAO) is our Screen Space Ambient Occlusion for Unity 5 (5.3.0 or higher)

You can download free demo or buy VAO at Unity Asset Store.

Please rate our plugin on Asset Store to support its development.

VAO provides additional level of visual quality by simulating soft ambient light shadows. It accentuates local geometric detail and produces shadows by nearby occluding surfaces (in the corners, cracks, holes, rough surfaces etc.). Resulting scenes have more depth and appear more realistic.

Combining classic screen-space ambient occlusion (SSAO) algorithm with a more physically based approach lets us achieve better visual quality and performance compared to classic SSAO.

Effect is compatible with normal&bump mapping, so there is no need for complex 3D geometry to create shadows.

VAO is implemented as an image effect that gets attached to the camera. It features only a couple of user controlled variables, which makes it easy to control to produce the desired visual appearance - no magic variables (such as Bias).

Plugin is compatible with all Unity rendering paths (Forward, Deferred and Legacy) and anti-aliasing.

See forum for discussion and contact us at projectwilberforce@gmail.com for additional support.

Requirements

Installation

  1. Import from Asset Store.
  2. Select your camera component.
  3. From Component menu select Image Effects -> Rendering -> Volumetric Ambient Occlusion.
  4. VAO effect should now be visible in the Inspector window.
  5. If property VAO shader is not set to “Hidden/Wilberforce/VAOShader” see Troubleshooting section below on how to fix it.

How to Use

Parameters

VAO effect behaviour is controlled by a couple of easy to use parameters.

Radius

Radius sets the distance of how far the algorithm reaches to calculate occlusion. Higher radius means longer shadows caused by objects further away.

Power

Power variable controls the hardness of the shadow, lower value causes softer shadows.

Presence

Presence makes the effect more pronounced towards the crease.

Presence turned off is closer to “physically-based” solution, however, adjust this to suit your scene and desired appearance.

You can also try increasing presence rather than radius to make effect more visible and save performance.

Quality

Number of samples used to calculate VAO. Choose lower settings if you need faster performance.

Adaptive Sampling

Adaptive sampling means lower number of samples is used on more distant areas of the image. Ideally causes no loss of detail.

Downsampled Pre-pass

Speeds up the calculation by downsampling the parts without occlusion. Results in performance boost, especially for higher resolutions.

Command Buffer

Insert effect via command buffer (BeforeImageEffectsOpaque event)

GBuffer Depth&Normal

Take depth&normals from GBuffer of deferred rendering path, use this for better precision. Note that this feature will cause some performance drop.

Downsampling

Reduces resolution of output, use this to gain performance at the cost of quality. Try lowering quality parameter first as this reduces quality dramatically. Having high quality setting with downsampling enabled serves no purpose. Alternatively, use this option if you have some sort of supersampling enabled - as high pixel density would have adverse effect on performance without much visual impact.

Luminance Sensitivity

Reduces occlusion on bright surfaces - either light sources or strongly lit areas. We recommend enabling this in combination with downsampling to reduce the most visible artifact caused by reducing of the occlusion texture. Also use this to prevent occlusion on lamps, windows, screens etc.

Try moving the sliders to see the difference:

Effect Mode

Color Bleed

Color Bleed has its own set of parameters.

Blur Mode

In case you are applying your own blur after VAO effect, you can try turning this off to save performance. Blur implementations included in VAO are fast and a part of its visual appearance, so you might consider keeping it on all the time.

Basic

Simple uniform 3x3 blur

Enhanced

If you need extra control over how is the occlusion blurred - with controls size and sharpness. Sizes of 3 or 5 can be faster than basic blur, but higher values will be slower. Sharpness does not affect performance.

Output AO only

Use for development to display only ambient occlusion component.

  low radius high radius
low power
high power

Performance and other tips

Performance tips

Unwanted interaction with other camera effects

You should place VAO Effect before any effects that change colors of the image such as tone mapping, vignetting, blur, chromatic aberration etc. As a rule of thumb, place VAO so that it is applied as soon as possible.

Disabling Ambient Occlusion for specific objects

If you don’t want some object to cast or receive occlusion - set Rendering Mode of its material to Fade or Transparent. Or use plugin’s Luminance Sensitivity option where possible.

Troubleshooting

Near/Far plane

When near and far clipping planes of the camera are too far apart, banding artifacts as seen on the picture occur. Should this happen, set the clipping planes to tightly envelop the visible scene - i.e. bring far plane as close as possible.

Note that range of possible settings is determined by precision of depth buffer.

incorrect far plane
Example of banding artifacts caused by incorrectly set far plane
correct far plane
Adjusting far plane fixes the issue

Attaching shader

When VAO effect is attached to the camera, its corresponding VAOShader.shader file is automatically located and bound to VAOShader property. If this does not happen, make sure that VAOShader.shader file can be found in the Project window under Assets/Shaders folder. Then bind this shader manually by drag&dropping it to VAOShader property in Inspector window.

no shader attached
Inspector shows no attached shader
shader attached
Should instead look like this

Radius is too low

Because VAO is screen-space based effect, there is a limited range of values that work correctly for radius setting. If radius is set too low, artifacts as seen on the picture will occur due to self-intersections. Thanks to its design this algorithm is not very susceptible to self-intersection problems, however when radius gets extremely low, no reasonable occlusions can be found.

To solve the issue, increase radius slowly until dark banded areas disappear and only correct occlusions are visible.

low radius example
Radius is too low to produce reasonable results
low radius fixed
Scene in question after correction

Radius is too large

Because VAO is screen-space based effect, there is a limited range of values that work correctly for radius setting. When radius is too large, large dark areas will appear with no reasonable occlusions visible.

To solve the issue, lower radius setting until correct occlusions appear in the corners, cracks etc.

large radius example
Setting large radius breaks the effect
large radius fixed
Expected result

Contact Information

In case of questions or further issues, please contact us at projectwilberforce@gmail.com