Apendix 1 - Apply Scanner only on Terrain

Since this was already asked by a customer, maybe it can also help others if they are struggling with the same issue.

The shader itself has no detailed info about other objects in the scene, so we can not achieve this by modifying the shader. But what we can do is change the order in which things are rendered.

  • First render the Terrain

  • Then render the TerrainScanner

  • And afterwards render all the other objects in the scene

That's at least the method I came up with. If someone has an even better solution, and wants to share it, feel free to contact me. So to achieve this we need to create a new Layer named “Terrain” and attach it to the terrain:

Then we go to the Render Pipeline where you have already added the HiddenLoot RenderObject. This is described in “Setting up the asset”.

Apply following configuration:

  • Change Hidden Loot Render to BeforeRenderingPostProcessing

  • Create new render object with Event “AfterRenderingTransparents”

  • Select all Layers that you want to be rendered after the Scanner (In our case every object is either Default or LootObject)

With this order you will make sure that the terrain layer is Rendered in the beginning. Then the scanner is applied. Since scanner is of type “transparent” it will be rendered before all the other objects. Then we apply “AfterRenderingTransparents” for all other layers. And in the end we render the specific HiddenLoot material with “BeforeRenderingPostProcessing” to ensure the object detection is still working.

Last updated