Ambient Occlusion

From ActiveWiki
Jump to: navigation, search
Ambient Occlusion
Build

1317

Version

6.0

SSAO result01.jpg
The result of a frame's z-buffer post-processed with ambient occlusion, represented as black/white image, to be blended with the color buffer for final presentation.

Introduction

Ambient Occlusion is a modern rendering technique added in version 6.0. It improves scene depth appearance by adding shades on a per pixel base.

Ambient Occlusion is rendered dynamically for every frame for the current camera view, better known as Scene Space Ambient Occlusion or in short SSAO.

Sh3d2 01 without SSAO.jpg Sh3d2 01 with SSAO.jpg
Without and with rendered post processing (shown models and textures are courtesy of Starheart).

How it is done

The current scene's depth buffer (z-buffer) is used to determine each pixel's and its neighbor pixels depth. If neighbor pixels vary in scene depth, it draws a shade which is blended into the color buffer (front buffer) in a later process before presenting the rendered result.

thump thump
The left screenshot is without SSAO enabled, and the screenshot to the right shows the same view with SSAO enabled. Look at the shades around the column and the signs in particular. These example screenshots have been taken in AWGate world. Click on the image to zoom in.

Pro and Contra

Advantages

  • Very fast processing.
  • Independent of scene complexity.
  • Suitable for all modern realtime rendering engines.
  • No additional rendering step required.
  • No CPU usage needed, all is processed by GPU.
  • No additional system memory required (but video memory).

Disadvantages to other AO methods

  • Requires NVIDIA hardware and a DirectX render engine.
  • Render engine has only a few options to control details or modify the result.
  • Only takes the visible view into account.
  • The result is camera perspective dependent and may vary while walking through the environment.

Options

Ambient Occlusion settings offer 3 choices in the browser's graphic settings dialog: Performance, Quality and High Quality. These are the only options the NVIDIA driver accepts by the DirectX engine.
The selections are disabled in the browser, if the feature is not available by the graphic card/driver.

Performance
By scaling the z-buffer down to 1/4th of its original size the amount of texels is reduced for fastest z-buffer analyses. The result is scaled up to the initial size with a loss in accuracy and shades may flicker while walking through the environment.

Quality
By scaling the z-buffer down to half of its original size the amount of texels is reduced for fast z-buffer analyses. The result is scaled up to the initial size still with a loss in accuracy and shades might flicker slightly while walking through the environment, yet certainly suitable for still image presentations / screenshots.

High Quality
No scaling of the z-buffer is applied for best accuracy of the resulting shades. This is the recommended option to choose, if the hardware is fast enough to process the 3D window's full size within acceptable time.


Requirements

Testing

  • Ambient Occlusion will remain an option, disabled by default.
  • To test AO press Alt+F10 to toggle to render SSAO term only. A greyscale image will be rendered showing the shaded areas.

Committed Test results

Success

GeForce GTX 650excellent quality and fast performance
GeForce GTX 560 Tiexcellent quality and fast performance
GeForce GTX 550 Tiexcellent quality, slight drop in performance
GeForce 320Mgood quality, noticeable drop in performance
GeForce 9800 GTgood quality, drop in performance
GeForce 9600 GTgood quality, drop in performance

No effect

GeForce 8500enabling AO makes no differnce


Step by Step Troubleshooting

If it reads in your aworld.log :

Error: NVAPI_INVALID_USER_PRIVILEGE (0xffffff77) Set AO_COMPATIBILITY_ID (0x00000016)
Description:

As the NVIDIA's driver interface (NVAPI) modifies 'hidden driver settings' to set certain application specific compatibility bits, it requires a privileged Windows user account to modify these settings.

If you run into this issue, follow the steps below (links point to detail instructions on Microsoft's help pages and NVIDIA pages respectively):


1) Ensure all Windows Updates are installed, including optional updates. Reboot the computer when it asks for it.

2) Ensure the latest NVIDIA driver is installed.

3) Set the current Windows User type to Administrator to allow the application changing 'hidden NVIDIA driver settings' through NVAPI.

4) Set the User Account Control to the lowest level, to avoid Windows asking for credentials every time the NVIDIA driver settings get modified by the application. Reboot Windows when it asks for.

--- The options for selecting Ambient Occlusion will be enabled within the AW browser now.


References

SSAO on Wikipedia
SSAO on an animated avatar inworld

Examples

thump
AWMix07 dance floor on a Monday morning, courtesy of Class3 and Veger.

thump thump
Without and with SSAO, building courtesy of Startheart.