# Asset Setup

Since the Asset uses some URP render pipeline features you will need to make sure everything is set up properly before you use the asset.&#x20;

Please follow these step by step instructions.

### **(1) Terrain Scanner tag**

First we need a Tag for the TerrainScanner. If it is not already added automatically, add a new tag named “TerrainScanner”. Locate the TerrainScanner Prefab in the prefabs folder and assign the newly created tag to the prefab.&#x20;

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXffgFBDKpJbs-jnJ5e_N3SZSAN0BFSaydI-0j9GTp1GLBA6zpL3IIMn5-2tycyP5kLr0RlBhjC2OC8gxXqFkhJIVVQcLral792dMYk--KV0riYUJPmwgR7sTVBBLTEj1DtZL1Pf0AMPhgsaYbNBgc50j4QD?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

### **(2) LootObject Layer**

Go to the layer option and check if the LootObject layer exists. It not add a new layer named LootObject

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfTJ8y6HZfF7OwqlYScfvBUDa-ITa_i08ttRQeDbWrd1qBciaNsnO6DHp51iTNImiZ11k6j3eB_NfXMFZL8qLDSMXrBBE47mZeCl4yagc-GStDK_Sb2Y4eWSFoZXo0uTgCj__o3oEQXrJH28VJcL5Ut-Jz-?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Not adding this layer to your project will result into a Runtime Error:

_<mark style="color:red;">“A game object can only be in one layer. The layer needs to be in the range \[0...31]”</mark>_
{% endhint %}



If you want to use your own existing layers for the hidden layer just go to the LayerSwitcher.cs script and insert your layers in the Start method

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfny2bCBnzSj3py_CEsIbP8sDm6fWKRlyrA8IGefPMV0mCtlYsF2RWhqEV-J4MCrofDQZxieJPHdT0lMdIiwBxN-wWXZFwCS5Go3oByICrY3zVTaaWzhSZfsJs3zSt8aUXoKk9WVLZDVmp4FbLBEs5m-NsK?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you use your own layers please keep in mind to use your layer in the LayerMask of the Render Objects in step (5) and not the “LootObject” layer.
{% endhint %}

### **(3) Locate the used RenderPipeline**

Go to Edit → Project Settings → Quality.\
Under Rendering double click on the Render Pipeline Asset.\
This will open the render pipeline in the inspector and lead you to the correct setting in your project folder.\


<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf-1395BwYpSPAY7vIcTQzUebWcgHFpoz48pa0Tj-OC8TsZn-GDO-irgBvzTJ-J6DvWT1Rl7jys1_KsRK-ur67HX9iv4kOSi4zYhuTmlRHU6wOw8Kn9QhrdzVDnQ36tcOVwh2EQJV-Mrib3Pqr2ifh9sWjY?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

### **(4)  Enabling Depth and Opaque Texture**

After selecting your used render pipeline, in the Inspector and make sure the Depth Texture and Opaque Texture settings are enabled

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcV8ov3rjoBfTFAx1xbMumo9qJ9or-GX3BETYoe34sHPgGgyhWQepufjexbr4v4ACD2mPqlm04YKhW5cVzvqc28BOn_znpF5ES82sAxy9Lolppq1MEAr3Jg-wLXKHx4BHEUFBi5-Q?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

Double click on the Renderer Element of the Renderer list, this will open the inspector for this renderer.

### **(5) Adding Render Objects**

On the bottom click Add Render Feature and add a new Render Object with the settings that you see in the following image:&#x20;

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdkbl1dWQYhBzfv0stpEbvggyRTNuFEd2gcUm8s69yfX9CG8qoxl4r86BGFnnmdBcsUiwGIf6FmZAC8t4TQ1y91yt9rbwqqKwKSCRhsgnttDAdxMZq1pjmsVqH-7WsQh9_y-UF-CQ?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

The HiddenLoot material has the glow shader attached which will make the scanned objects appear to be glowing

\
Now your setup is finished and should work properly.

### **Camera settings**

Some side note about the camera settings:\
The camera has MSAA turned off to avoid some artifacts from the intersection shader

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeJm1IXtY4nVBh6uM-gKZBPsr0kjz4fiLpjV4esrqdX5Q0L58Ozu2jGmOyo2Nvkqa6TP0X_rMsVuMul1h-0JrraAlX9TrIUtRKAPkZs1QnFURNNd9w3aT8HTZWGEAiECb-iGEfP0w?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

With MSAA turned on you are seeing some outlines, even if the scanner is already behind the terrain and should not be visible to the camera (see the right part of the image)

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdsnBikH_detuj9rtzgCNLTiFoeBesOKEgaUUyCYxkEKq_rEs2tj2u_fIRwn5OdmgBQA4dS3npYMBp_ulzTCl4PO8A6lwGCed-ExmGJKGrAcpZ_mV9d5HMeiCo5ITxD6rloebd5?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

Turning MSAA off will remove those lines:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdUXLOwz5MqFAGw3doSuiF9lFdOZbEVcV-1E5tfSNtOmlYd9GoW3AbzjB4xySmMKPiJGT990oS2itvAjK9a_XWt_R1QMvUpsJMndldoCNap-z3uN-6OrUBXw_Ww0eXuUXeuTSBh1g?key=647kYnNU_pMtzI-3LSMfyA" alt=""><figcaption></figcaption></figure>

Depending on which behavior you want, feel free to turn this setting on again.

\
\
