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.
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.
(2) LootObject Layer
Go to the layer option and check if the LootObject layer exists. It not add a new layer named LootObject
Not adding this layer to your project will result into a Runtime Error:
“A game object can only be in one layer. The layer needs to be in the range [0...31]”
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
(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.
(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
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:
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
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)
Turning MSAA off will remove those lines:
Depending on which behavior you want, feel free to turn this setting on again.
Last updated