Прикрытие рассеянного света
Прикрытие рассеянного света (Ambient Occlusion) (сокращённо AO) - это метод отображения, используемый для расчёта степени освещённости каждой точки трёхмерной виртуальной сцены рассеянным светом. Он имитирует мягкие местные тени в углублениях, углах и точках соприкосновения поверхностей, исключая восприятие искусственности объектов и придавая реалистичное ощущение объёма.
В отличие от общего освещения или прямых динамичных теней, прикрытие рассеянного света - это приближение, учитывающее свет как равномерно поступающий со всех сторон. Метод определяет, сколько света *блокируется* (перекрывается) близлежащей геометрией.
Прикрытие рассеянного света реализовано для Source и Source 2 с помощью различных методов: полноэкранной обработки в реальном времени, современной аппаратной трассировки лучей или рассчитанное в текстуры при компиляции карты (VRAD).
SSAO
Полноэкранное прикрытие рассеянного света (Screen Space Ambient Occlusion) (сокращённо SSAO) анализирует пиксели на экране и сравнивает их положение в буфере глубины с соседними пикселями. Пиксели, расположенные рядом, но не в одной плоскости (на одной грани), затеняются для имитации мягких теней. Для поддержания приемлемой частоты кадров невозможно выполнять выборку по каждому пикселю в каждом кадре, поэтому используется случайная выборка, что неизбежно приводит к появлению шума/зернистости, которые более заметны при движении. Для устранения зернистости после расчёта SSAO зачастую применяется размытие.
As with traditional AO, SSAO is completely independent of the normal lighting system. This means that both the performance and appearance of the shader are unaffected by the lights used in a level.
The depth buffer is measured from the camera, and so SSAO is view-dependent - the size and locations of the "shadows" created by SSAO may change as the player moves the camera around. Additionally, the shading may look different along the edges of the screen - this can be combated by rendering additional information outside of the current camera's bounds.
SSAO на платформе Source
The original release of Dota 2 aswell as Source Filmmaker, are the only official Source games that support SSAO. SSAO is also used in Titanfall engine branch engine branch.
| Игры, использующие SSAO |
|---|
| Consortium (delisted) |
Source Filmmaker
Source Filmmaker includes an SSAO option (labelled "Ambient Occlusion"), accessible by right-clicking on the viewport. The default setting is very grainy.
Добавление SSAO на платформе Source
You can implement Basic SSAO Shader on
Source SDK Base 2013, using
tutorial by DmitRex. However, as SSAO is a post-processing effect, you can use third-party software (ReShade), or Source Shader Editor to add SSAO. Alternatively, it is possible to use the superior HBAO ambient occlusion, which can be forced through GPU driver control panel (or by using NVIDIA Profile Inspector).
HBAO и HBAO+
Горизонтное прикрытие рассеянного света (Horizon-Based Ambient Occlusion) was developed by NVIDIA to significantly evolve standard SSAO. Unlike previous SSAO variants, HBAO uses a physically based algorithm that approximates an integral with depth buffer sampling. This enables HBAO to generate higher-quality SSAO, increasing the number of samples per pixel and the definition, quality, and visibility of AO.
But for performance reasons, HBAO is typically rendered at half-resolution, reducing the number of AO pixels by three-quarters. Unfortunately, rendering HBAO at reduced resolutions causes flickering that’s challenging to hide in all situations.
To overcome these issues, NVIDIA has completely redeveloped and revamped SSAO to create HBAO+, a paradigm shift in the field of SSAO rendering. In comparison to HBAO, HBAO+ doubles the detail level of AO and runs three times faster.
| Игры | Типы HBAO |
|---|---|
| Horizon-Based Ambient Occlusion (HBAO) | |
| Horizon-Based Ambient Occlusion Plus (HBAO+) |
Forcing HBAO/HBAO+ on unsupported games
GTAO
(Ground Truth Ambient Occlusion) is able to match a ground truth reference in half a millisecond on current console hardware. This is done by using an alternative formulation of the ambient occlusion equation, and an efficient implementation which distributes computation using spatio-temporal filtering.
Apex Legends replaced the primary AO implementation from HBAO+ to GTAO, but HBAO and HBAO+ were not removed. They remain available in the game. Also Apex Legends features a custom implementation of its own SSSO technology, which runs as a second pass on top of the ambient occlusion. It is presumed to stand for Screen Space Specular Occlusion. It produces cone-based specular effects. Based on Horizon-Based techniques with some code snippets from GTAO, it is a hybrid technology.
| Игры | Типы GTAO |
|---|---|
| GTAO | |
| XeGTAO |
Другие методы AO
| Игры | Метод прикрытия рассееянного света |
|---|---|
| Scalable Ambient Obscurance (SAO) | |
| Ray-traced AO (RTAO) |