> For the complete documentation index, see [llms.txt](https://ipgames.gitbook.io/htrace-ao/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ipgames.gitbook.io/htrace-ao/comparisons-with-unitys-ao/htrace-gtao-vs.-hdrp-gtao.md).

# HTrace GTAO vs. HDRP GTAO

{% hint style="warning" %}
The following comparison is performed in the HDRP Demo Scene on a laptop RTX 3060 6GB, 1920 x 1080 native.
{% endhint %}

## Overall Quality

HDRP's screen-space ambient occlusion features a GTAO (Ground Truth Ambient Occlusion) algorithm similar to the one used by HTrace. However, it's based on the [original](https://research.activision.com/publications/archives/practical-real-time-strategies-for-accurate-indirect-occlusion) implementation rather than the more [recent](https://github.com/GameTechDev/XeGTAO) versions and doesn't include major updates to the technology, such as [Visibility Bitmasks](/htrace-ao/settings-and-properties/gtao-settings/gtao-quality.md#tracing-mode).

{% hint style="warning" %}
For the following 2 screenshots, both algorithms were tuned to match in total sample count:

* **HDRP GTAO** uses 1 slice x 2 directions x 32 steps = **64 samples** in total.
* **HTrace GTAO** uses 2 slices x 2 directions x 16 steps = **64 samples** in total.
  {% endhint %}

{% tabs %}
{% tab title="HDRP GTAO (\~1.75ms)" %}

<figure><img src="/files/ayLTADkOaGK2ZhVGiZwD" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HTrace GTAO (\~1.6ms)" %}

<figure><img src="/files/vKD2n839LEbRtYC5gJQe" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HDRP Settings" %}

<figure><img src="/files/FG3wxeCUIYSPHZpbuXoM" alt="" width="401"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HTrace settings" %}

<figure><img src="/files/7pOrTzXKfpJARegdrqqO" alt="" width="470"><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Peak Quality

**HDRP GTAO** doesn't scale well in terms of tracing and denoising quality. As a result, even when performance or resolution are not limiting factors and higher quality is desired, it isn't always achievable with HDRP's occlusion. **HTrace GTAO** offers higher scalability, providing much better visual results.

{% hint style="warning" %}
**HDRP GTAO** is set to the "High" preset here, while **HTrace GTAO** uses its medium to high settings.
{% endhint %}

{% tabs %}
{% tab title="HDRP GTAO" %}

<figure><img src="/files/CC4j8twIzQSK7IpZpbQg" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HTrace GTAO" %}

<figure><img src="/files/2aEVAOus58osPfH8p689" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Thickness Heuristic

As with most screen-space algorithms, GTAO is not aware of object thickness and treats the depth buffer as infinitely thick by default. Therefore, different thickness heuristics have been proposed to overcome the issue of thin objects' overocclusion. More about this problem can be read [here](https://github.com/GameTechDev/XeGTAO?tab=readme-ov-file#thin-occluder-conundrum). One of the most influential contributions to this field was made by [visibility bitmasks research,](https://arxiv.org/abs/2301.11376) which allowed horizon-based algorithms (such as HBAO and GTAO) to evaluate visibility with much better accuracy, significantly bridging the gap with RTAO. This approach [was adopted](/htrace-ao/settings-and-properties/gtao-settings/gtao-quality.md#thickness-mode-visibility-bitmasks) by **HTrace GTAO**.

Unfortunately, **HDRP GTAO** hasn't been augmented with any thickness heuristic at all. This results in very poor evaluation of thin objects (e.g., fences, bars), which degrades even further as the effect's radius grows.

{% tabs %}
{% tab title="HDRP GTAO Radius 5" %}

<figure><img src="/files/7Zoa9iQcSmuy1CrjzeTM" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HTrace GTAO Radius 5" %}

<figure><img src="/files/B8CMHNaOLpJjEDzUQzjt" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HDRP GTAO Radius 2" %}

<figure><img src="/files/3Ao6gBy1rNCotwrQHVeV" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HTrace GTAO Radius 2" %}

<figure><img src="/files/pPonZryMQNexwoWSO6Sq" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Small Details and Denoising

In the following screenshots, pay attention to small details: round curtains, alpha-cutout vegetation, and normal maps. As you can see, **HDRP GTAO** detail takes a particularly hard hit as its radius increases. Indeed, the official [documentation](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@17.0/manual/reference-ambient-occlusion.html#:~:text=direct%20diffuse%20lighting.-,Radius,-Use%20the%20slider) warns that "Be aware that a higher distance (radius) value often produces a lower quality result." **HTrace GTAO** is much less susceptible to this issue and retains small details even with a large radius.

The quality gap is further widened by the difference in spatial denoising approach. **HTrace GTAO** provides [explicit controls](/htrace-ao/settings-and-properties/gtao-settings/gtao-denoising/spatial-denoising.md) over the filter to balance detail preservation with noise reduction, while **HDRP GTAO** uses a simpler approach with less attention to detail and more visual artifacts.

{% tabs %}
{% tab title="HDRP GTAO Radius 1" %}

<figure><img src="/files/LRLzDg1DfqN5jpbRYuUu" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HTrace GTAO Radius 1" %}

<figure><img src="/files/WG21ktdsEOAwrurbBFkH" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HDRP GTAO Radius 5" %}

<figure><img src="/files/dGj7kmA5hAAGXwhezMC4" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HTrace GTAO Radius 5" %}

<figure><img src="/files/L2WgaBYoX5sY2CEw3D8s" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Resolution Scaling and Upscaling

Unlike **HDRP GTAO**, which offers only a **Full Resolution** enable/disable [option](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@17.0/manual/reference-ambient-occlusion.html), **HTrace GTAO** features 3 different [resolution modes](/htrace-ao/settings-and-properties/gtao-settings/gtao-quality.md#resolution): **Full**, **Half**, and **Quarter**, for more fine-grained performance control. On top of that, it provides a sharp and optimized upscaler for interpolating from any of these resolutions to the final target. This makes it more viable to render the effect at a lower resolution and then upscale it, retaining as much detail as possible.

{% tabs %}
{% tab title="HDRP GTAO Full Resolution Disabled" %}

<figure><img src="/files/9zvDdtG34RCUEDOPQm3Z" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="HTrace GTAO Quarter Resolution  " %}

<figure><img src="/files/t31hzL6XssgwziMPYKbj" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Additional Features <a href="#additional-features" id="additional-features"></a>

Here is the list of most notable features HTrace GTAO offers **that are not present** in HDRP's GTAO implementation:

* [Fadeout](https://ipgames.gitbook.io/htrace-ao/v2/settings-and-properties/shared-settings/visuals#fadeout)
* [Exclude Receiving](https://ipgames.gitbook.io/htrace-ao/v2/settings-and-properties/shared-settings/visuals#exclude-receiving)
* [Exclude Casting](/htrace-ao/settings-and-properties/gtao-settings/gtao-visuals.md#exclude-casting)
* [Max Screen Space Radius](/htrace-ao/settings-and-properties/gtao-settings/gtao-visuals.md#screen-space-radius)
* [Adaptive | Half | Quarter Resolution](/htrace-ao/settings-and-properties/gtao-settings/gtao-quality.md#resolution)
* [Visibility Bitmasks](/htrace-ao/settings-and-properties/gtao-settings/gtao-quality.md#tracing-mode)
* [Thickness Control](/htrace-ao/settings-and-properties/gtao-settings/gtao-quality.md#thickness-mode-visibility-bitmasks)
* [Separate Denoising Modes](/htrace-ao/settings-and-properties/gtao-settings/gtao-denoising.md#denoising-mode)
* [Output Dithering](/htrace-ao/settings-and-properties/gtao-settings/gtao-denoising.md#output-dithering-hdrp)
* [Temporal Rejection](/htrace-ao/settings-and-properties/gtao-settings/gtao-denoising/temporal-denoising.md#rejection-threshold)
* [Sharp Temporal Reprojection](/htrace-ao/settings-and-properties/gtao-settings/gtao-denoising/temporal-denoising.md#reprojection-filter)
* [Spatial Filter Selection](/htrace-ao/settings-and-properties/gtao-settings/gtao-denoising/spatial-denoising.md#filter-type)

{% embed url="<https://www.patreon.com/c/htrace>" %}
