# RTAO Quality

## **Resolution**

Determines the resolution at which the effect is rendered. This parameter has the greatest impact on performance and visual output.

* **Full:** 100% of pixels are rendered. Achieves maximum quality.
* **Half:** 50% of pixels are rendered in a checkerboarded (non-temporal) pattern. A good balance between performance and quality.
* **Quarter:** 25% of pixels are rendered. The most performant of the three modes.
* **Adaptive:** Splits the screen into 2×2-pixel tiles and checks whether the geometry within each tile is uniform enough, by comparing the depth, normals and velocity of the pixels and occlusion values inside it. Tiles are then categorized into three groups, rendered at 100%, 50%, or 25% resolution. This can be previewed via the **Shading Rate Visualization** [Debug Mode](/htrace-ao/settings-and-properties/shared-settings.md#debug-mode).

*Performance impact: most severe, consider carefully*

{% tabs %}
{% tab title="Full" %}

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

{% tab title="Half" %}

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

{% tab title="Quarter" %}

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

{% tab title="Adaptive" %}

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

## Tracing Mode <mark style="color:$info;">\[HDRP, Unity 2023.2+]</mark> <a href="#alpha-cutout-hdrp-unity-2023.2" id="alpha-cutout-hdrp-unity-2023.2"></a>

Defines how the **Alpha Cutout** property of materials will be handled:

* **Native Ray Tracing**: Materials will accurately evaluate alpha cutout on hit. This matches Unity's native RTAO behavior, providing accurate alpha rendering at the cost of performance. If selected, HTrace will use Unity's Ray Tracing Acceleration Structure.
* **Inline Ray Tracing**: Alpha cutout will be evaluated in screen space against the depth buffer. Objects with alpha cutout that are obscured from the main view (e.g., offscreen or behind other objects) will behave as fully opaque. This option can improve tracing performance by up to 50%. If selected, HTrace will build its own Ray Tracing Acceleration Structure and expose its [Culling Settings](/htrace-ao/settings-and-properties/rtao-settings/rtao-culling.md).

This selection is available only for **HDRP** and Unity 2023.2 and above. URP pipeline will default to **Inline Ray Tracing,** while HDRP on older Unity versions will default to **Native Ray Tracing**.

*Performance impact: severe, use Inline Ray Tracing whenever possible.*

{% hint style="warning" %}
Switching to **Native Ray Tracing** also exposes the [Specular Occlusion](/htrace-ao/settings-and-properties/rtao-settings/rtao-visuals.md#specular-occlusion-hdrp) slider. Another additional benefit of the Native Ray Tracing mode is more accurate velocity detection for moving objects, used by the [Static](/htrace-ao/settings-and-properties/rtao-settings/rtao-denoising/temporal-denoising.md#rejection-static) / [Dynamic](/htrace-ao/settings-and-properties/rtao-settings/rtao-denoising/temporal-denoising.md#rejection-dynamic) Rejection features in temporal denoising.
{% endhint %}

## Ray Count

Specifies the number of rays launched into the scene to evaluate occlusion. This parameter represents the primary tradeoff between noise level and performance for this mode.

*Performance impact: severe, use as few as possible*

{% tabs %}
{% tab title="Ray Count 1" %}

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

{% tab title="Ray Count 2" %}

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

{% tab title="Ray Count 3" %}

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

## Sample Rebalancing <mark style="color:$info;">\[</mark><mark style="color:$info;">**Adaptive Resolution]**</mark>

Since **Adaptive Resolution** depends on frame content and motion, a large portion of the frame may occasionally require full (100%) resolution due to temporal disocclusion or high geometric complexity. In such cases, Sample Rebalancing stochastically reduces the ray count on random pixels to keep the total number of rays per frame as constant as possible, avoiding sudden performance spikes. Enabling this option may degrade overall AO quality in some cases, but provides a smoother framerate.

*Performance impact: beneficial*

## Screen Space Pretrace

Activates screen-space ray marching that precedes hardware ray tracing. Its primary goal is to hide the mismatch between the rasterized scene and its ray tracing counterpart (RTAS), by providing screen-space occlusion for objects that are not visible to hardware ray tracing for any reason. It can also save some performance if enough screen-space rays find their intersections in screen space.

In the example below, the Scooter mesh was intentionally excluded from RTAS, so it can only receive AO and cannot cast it (neither onto its surroundings nor onto itself). With Pretrace enabled, the occlusion cast by this mesh is restored using screen-space rays.

*Performance impact: none*

{% tabs %}
{% tab title="Pretrace OFF" %}

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

{% tab title="Pretrace ON" %}

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

{% tab title="Hardware Ray Tracing Scene Debug" %}

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

## Mask <mark style="color:$info;">\[Screen Space Pretrace]</mark>

Excludes objects from casting screen-space AO on a per-layer basis via the **Rendering Layer Mask** during **Screen Space Pretrace**. Most useful when you know which objects are certainly not visible to hardware ray tracing and can mark them through this mask, so screen-space rays target only those objects, leaving the rest to regular ray tracing. Furthermore, when the mask is used, the screen-space rays are allowed to pass behind objects, which helps them to capture more occlusion. If the mask is not used, a more conservative tracing is applied and rays are rejected as soon as they go behind objects, to prevent view-dependent artifacts.

In the example below, when no specific object is marked (the mask is set to “Everything”), screen-space occlusion is traced for every pixel, even though most of them don't need it. Furthermore, since screen-space rays don’t know the true thickness of objects, this leads to overestimation on thin geometry (e.g., chair legs) and underestimation on more complex surfaces, such as the Scooter mesh itself. As a result, the hardware ray-tracing result gets spoiled while still not providing the best AO for the missing Scooter mesh. On the other hand, when only the Scooter is marked with the mask, the Pretrace can be more “confident”, knowing that this object is not present in RTAS anyway and is isolated for screen-space rays. This makes the occlusion gathered for it more robust, while all other pixels remain unchanged, preserving the already valid ray-tracing result.

*Performance impact: none*

{% tabs %}
{% tab title="Mask: Everything" %}

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

{% tab title="Mask: Scooter object only" %}

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

## Samples <mark style="color:$info;">\[Screen Space Pretrace]</mark>

Defines how many steps the screen-space ray marching algorithm is allowed to take across the depth buffer to find an intersection. The higher this value, the more defined the occlusion gathered by **Pretrace**, at the cost of performance.

*Performance impact: moderate*

## Distance <mark style="color:$info;">\[Screen Space Pretrace]</mark>

Controls the maximum distance in meters that can be ray-marched in screen space. Samples are distributed along this distance, so the greater the distance, the more [Samples](#samples-screen-space-pretrace) may be needed. If the [Mask](/htrace-ao/settings-and-properties/rtao-settings/rtao-quality.md#mask-screen-space-pretrace) is not used, it is recommended to keep this value low to avoid marching long rays in screen space for all pixels, which can cause view-dependent artifacts.

*Performance impact: small*

{% tabs %}
{% tab title="Distance 0.1" %}

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

{% tab title="Distance 1" %}

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

## Thickness <mark style="color:$info;">\[Screen Space Pretrace]</mark>

Controls the virtual thickness of objects. Since a screen-space algorithm uses the depth buffer to find intersections, it has no way of knowing the true thickness of objects. Instead, an arbitrary parameter is used, the higher this value, the stronger the occlusion.

*Performance impact: none*

{% tabs %}
{% tab title="Thickness 0.15" %}

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

{% tab title="Thickness 1" %}

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ipgames.gitbook.io/htrace-ao/settings-and-properties/rtao-settings/rtao-quality.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
