# Spatial Filter

## Radius

Defines the width of the spatial filter. Higher values lead to stronger noise reduction at the cost of small details and performance.

*Performance impact: moderate, don't increase above the necessary level*

{% tabs %}
{% tab title="Radius = 0" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FWOGdNjkaUivfPWPgEzpr%2FImage%20Sequence_083_0000.jpg?alt=media&#x26;token=56e5b526-e325-4f21-812d-f0ff0ddad2df" alt=""><figcaption><p>Spatial Occlusion ReSTIR Validation ON</p></figcaption></figure>
{% endtab %}

{% tab title="Radius = 0.5" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FYyLqCHxWvVSe6YdSLZbC%2FImage%20Sequence_084_0000.jpg?alt=media&#x26;token=3fcc3c93-b801-46d3-aeb9-897440729cdf" alt=""><figcaption><p>Spatial Occlusion ReSTIR Validation ON</p></figcaption></figure>
{% endtab %}

{% tab title="Radius = 1.0" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FXNwu1dvVSTwHLPhbVpWP%2FImage%20Sequence_085_0000.jpg?alt=media&#x26;token=5b9d8645-0eb2-4981-8d27-bd3e3e251909" alt=""><figcaption><p>Spatial Occlusion ReSTIR Validation ON</p></figcaption></figure>
{% endtab %}
{% endtabs %}

[Spatial Occlusion ReSTIR Validation](https://ipgames.gitbook.io/htrace-ssgi/settings-and-properties/restir-validation#spatial-occlusion-validation) plays a very important role in preserving details during spatial filtering. Without it, over-blurring of small features (especially indirect shadows) becomes much more noticeable.

\
The comparison below demonstrates the same **Radius** values, with [Spatial Occlusion ReSTIR Validation ](https://ipgames.gitbook.io/htrace-ssgi/settings-and-properties/restir-validation#spatial-occlusion-validation)turned off:

{% tabs %}
{% tab title="Radius = 0" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FEs4b0xLZQEef5zMcCIWN%2FImage%20Sequence_086_0000.jpg?alt=media&#x26;token=bf1e70e7-3dcd-4f16-928d-8953e86f735c" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Radius = 0.5" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FvYMgFRagRUToCXKEo7Sq%2FImage%20Sequence_087_0000.jpg?alt=media&#x26;token=087eba3f-1a3d-4a12-856b-ee98b1c6dae3" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Radius = 1.0" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FxQV2ZkN4Q74I9q5y6nd5%2FImage%20Sequence_088_0000.jpg?alt=media&#x26;token=16a2450b-7196-415b-8140-ec5abb56ff57" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Adaptivity

Defines the adaptive behavior of the spatial filter. Higher values allow the filter radius to shrink more in corners and crevices (where small-scale indirect shadowing and light bounce are expected), better preserving details at the cost of filtering strength.

*Performance impact: small*

{% tabs %}
{% tab title="Adaptivity = 0" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FO1Kfa3jm3Yx9StkAm58B%2FImage%20Sequence_089_0000.jpg?alt=media&#x26;token=9d35b713-5059-44f3-b269-ffc5c60c291b" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Adaptivity = 1" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FzubhlKQGP2XvjGz2lKKn%2FImage%20Sequence_090_0000.jpg?alt=media&#x26;token=7cbe3472-de84-42b2-8ae4-9669a7cb188a" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

Adaptivity, while efficient at preserving small-scale details, cannot replace [Spatial Occlusion ReSTIR Validation](https://ipgames.gitbook.io/htrace-ssgi/settings-and-properties/restir-validation#spatial-occlusion-validation). The best results are achieved when the two are used together:

{% tabs %}
{% tab title="0, OFF" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FmIyZB8OjjKUTMbM6b2du%2FImage%20Sequence_091_0000.jpg?alt=media&#x26;token=7b80e369-5724-46d6-ba78-18dfa25f740e" alt=""><figcaption><p>Adaptivity = 0, <a href="../restir-validation#spatial-occlusion-validation">ReSTIR Spatial Occlusion Validation</a> OFF</p></figcaption></figure>
{% endtab %}

{% tab title="1, OFF" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FkFAnpGL8hjnP6YDC3ZRC%2FImage%20Sequence_092_0000.jpg?alt=media&#x26;token=782feb2f-0f85-475b-98dc-5b428edf9000" alt=""><figcaption><p>Adaptivity = 1, <a href="../restir-validation#spatial-occlusion-validation">ReSTIR Spatial Occlusion Validation</a> OFF</p></figcaption></figure>
{% endtab %}

{% tab title="1, ON" %}

<figure><img src="https://1925284358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9GTrs62pFTw6Syf4M0nT%2Fuploads%2FJ1RueYfTc6IItVDZpPbH%2FImage%20Sequence_093_0000.jpg?alt=media&#x26;token=e9963b0c-e6b9-4f6e-962f-9bd76408ede1" alt=""><figcaption><p>Adaptivity = 1, <a href="../restir-validation#spatial-occlusion-validation">ReSTIR Spatial Occlusion Validation</a> ON</p></figcaption></figure>
{% endtab %}
{% endtabs %}

## Recurrent Blur

Enables an algorithm that combines spatial and temporal denoising stages in a way that achieves stronger spatial blurring without a large performance impact. This comes at the cost of losing some details and slightly reducing temporal responsiveness.

*Performance impact: small*

## Firefly Suppression

Enables a filter that removes bright outliers ("fireflies") from the tracing result before the denoiser runs. This reduces boiling artifacts and improves temporal stability, at the cost of some image darkening.

*Performance impact: small*
