Volumetric Ambient Occlusion (VAO) is our Screen Space Ambient Occlusion for Unity 5 (5.3.0 or higher)
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.
VAO effect behaviour is controlled by a couple of easy to use parameters.
Radius sets the distance of how far the algorithm reaches to calculate occlusion. Higher radius means longer shadows caused by objects further away.
Power variable controls the hardness of the shadow, lower value causes softer shadows.
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.
Number of samples used to calculate VAO. Choose lower settings if you need faster performance.
Adaptive sampling means lower number of samples is used on more distant areas of the image. Ideally causes no loss of detail.
Speeds up the calculation by downsampling the parts without occlusion. Results in performance boost, especially for higher resolutions.
New in v1.7
These settings control how VAO effect looks depending on surface’s distance from the camera.
Maximum radius given as a percentage of area considered for occlusion to the whole screen (e.g 0.33 means the sampled area will never exceed third of the screen). Use this to avoid performance drops when object passes the view close to the camera.
This gradually decreases occlusion effect after a certain distance. For example you want to make objects close to camera even more pronounced or don’t want occlusion on your background objects.
Insert effect via command buffer (BeforeImageEffectsOpaque event)
Take depth&normals from GBuffer of deferred rendering path, use this for better precision. Note that this feature will cause some performance drop.
Intermediate Texture Format
New in v1.7
This lets you specify texture format for mixing VAO command buffer with scene. Auto is recommended (handles switching between HDR by default).
Far Plane Source
New in v1.7
Source of Far Clipping Plane values. Some effects (notably Postprocessing Stack’s Temporal Anti-aliasing) alter the _ProjectionParams variable which may cause flickering. If you are planning on using TAA or similar effect enable the Camera option to fix this.
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.
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.
Color Bleed has its own set of parameters.
Similar to the AO Power setting - controls the intensity of the color bleed part.
Presence makes the colorbleed more pronounced towards the crease.
Same Color Hue Attenuation
New in v1.7
Provides a set of options to control color contribution based on color of source and target surfaces.
Sets the size of the sample set used for the color bleed (relative to AO samples). Options are ‘Normal’, ‘Half’ and ‘Quarter’.
Limits casting color on itself.
Makes surfaces cast color only in front of them - unlike shadows, that are cast both to the front and to the back.
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.
Simple uniform 3x3 blur
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|
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.
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.
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.
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.
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.
In case of questions or further issues, please contact us at email@example.com