# Motion Vectors Setup

Motion Vectors necessary for the some rendering effects like TAA. Unfortunately Unity Supports custom motion vectors after version 6 and after. Even then a small change in shaders reqired to\
have motion vectors.

Motion Vectors basically difference between current and previous frame position of the vertices.\
Ica Skinner store previous frame positions on uv3 xyz part. There is included subgraph to generate motion vectors, all you need to do is import it in the your shader graph and connect to motion vectors input:\
\
\
Step 1: Open Your Shader Graph and enable "Add Custom Velocity" option on graph settings. It will activate a new input on vertex  block.

<figure><img src="https://2638760822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHm5sOVyC7v2O6iEXkqQ%2Fuploads%2Fb7HMaTUAqjjQ03yxa0jJ%2F1.png?alt=media&#x26;token=d81356e8-54ac-40bd-ae4d-f307c0b1bb69" alt=""><figcaption><p>Step 1</p></figcaption></figure>

\
Step 2: Import the "Fetch Motion Vectors" subgraph that comes with the asset.

<figure><img src="https://2638760822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHm5sOVyC7v2O6iEXkqQ%2Fuploads%2Fc1gEpqIRcA9l1OW51Lvi%2F2.png?alt=media&#x26;token=1f9fca03-f70d-45e4-8e3c-c4e4f6990c1d" alt=""><figcaption><p>Step 2</p></figcaption></figure>

Step 3: Conect it to Motion Vectors Input. Ans save the shader.

<figure><img src="https://2638760822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHm5sOVyC7v2O6iEXkqQ%2Fuploads%2FFXx4cXIr5LhGxrVJhW07%2F3.png?alt=media&#x26;token=8eb823e1-d22d-411f-9efb-b67950c3bd39" alt=""><figcaption><p>Step 3</p></figcaption></figure>

\
Step 4: Go inspector to material that use that shader, and enable the "Motion Vectors for Vertex Animation" option.

<figure><img src="https://2638760822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHm5sOVyC7v2O6iEXkqQ%2Fuploads%2FZmhZdnA5N7uiuwYWsY4U%2F4.png?alt=media&#x26;token=fe6fc674-04c9-443a-838b-3d68043a3fc6" alt=""><figcaption><p>Step 4</p></figcaption></figure>

<br>


---

# Agent Instructions: 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://ica.gitbook.io/ica-skinned-mesh-docs/motion-vectors-setup.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.
