Прикрытие рассеянного света

From Valve Developer Community
< Ru
Jump to navigation Jump to search
English (en)Русский (ru)Translate (Translate)
Пример обычного предварительно рассчитанного прикрытия рассеянного света в Blender 3D. SSAO пытается имитировать это в реальном времени.

Прикрытие рассеянного света (Ambient Occlusion) (сокращённо AO) - это метод отображения, используемый для расчёта степени освещённости каждой точки трёхмерной виртуальной сцены рассеянным светом. Он имитирует мягкие местные тени в углублениях, углах и точках соприкосновения поверхностей, исключая восприятие искусственности объектов и придавая реалистичное ощущение объёма.

В отличие от общего освещения или прямых динамичных теней, прикрытие рассеянного света - это приближение, учитывающее свет как равномерно поступающий со всех сторон. Метод определяет, сколько света *блокируется* (перекрывается) близлежащей геометрией.

Прикрытие рассеянного света реализовано для Source и Source 2 с помощью различных методов: полноэкранной обработки в реальном времени, современной аппаратной трассировки лучей или рассчитанное в текстуры при компиляции карты (VRAD(en)).

Note.pngПримечание: Не следует путать с предварительно рассчитанным прикрытием рассеянного света на моделях!

SSAO

Полноэкранное прикрытие рассеянного света (Screen Space Ambient Occlusion) (сокращённо SSAO) анализирует пиксели на экране и сравнивает их положение в буфере глубины(en) с соседними пикселями. Пиксели, расположенные рядом, но не в одной плоскости (на одной грани), затеняются для имитации мягких теней. Для поддержания приемлемой частоты кадров невозможно выполнять выборку по каждому пикселю в каждом кадре, поэтому используется случайная выборка, что неизбежно приводит к появлению шума/зернистости, которые более заметны при движении. Для устранения зернистости после расчёта 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(en) aswell as Source Filmmaker(en), are the only official Source games that support SSAO. SSAO is also used in Titanfall engine branch(en) engine branch.

Игры, использующие SSAO
Source Filmmaker Source Filmmaker
Dota 2 Dota 2
Tactical Intervention Tactical Intervention
Counter-Strike Online 2 Counter-Strike Online 2
Double Action: Boogaloo Double Action: Boogaloo
Consortium(en) (delisted)
Vindictus Vindictus

Source Filmmaker

См. также: SFM/Ambient Occlusion(en)

Source Filmmaker(en) includes an SSAO option (labelled "Ambient Occlusion"), accessible by right-clicking on the viewport. The default setting is very grainy.

Нужно сделать: Adjust number of samples?

Добавление SSAO на платформе Source

You can implement Basic SSAO Shader on Source SDK Base 2013 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(en) 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).

Note.pngПримечание: For baked Ambient Occlusion maps per model within the Source Engine, see $ambientocclusion(en).
Note.pngПримечание: A post process SSAO shader currently ships with the Source Shader Editor(en).

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
Estranged: Act I Estranged: Act I
Insurgency Insurgency
Blade Symphony Blade Symphony
Day of Infamy Day of Infamy
Horizon-Based Ambient Occlusion (HBAO)
Titanfall Titanfall
Titanfall 2 Titanfall 2
Horizon-Based Ambient Occlusion Plus (HBAO+)

Forcing HBAO/HBAO+ on unsupported games

Нужно сделать: HBAO can be forced through GPU driver control panel (or NVIDIA Profile Inspector) for other Source games that only support other AO techniques or never had native support for AO at all. Document how to do it. HBAO Compatibility flags can be found here.

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(en) 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(en) 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
Apex Legends Apex Legends GTAO
Strata Source Strata Source XeGTAO

Другие методы AO

Игры Метод прикрытия рассееянного света
Military Conflict: Vietnam Military Conflict: Vietnam Scalable Ambient Obscurance (SAO)
Portal with RTX Portal with RTX
Half-Life 2 RTX Half-Life 2 RTX
RTX Remix RTX Remix
Ray-traced AO (RTAO)

Внешние ссылки