What I try to achieve is a fog of war system for 3d top-down stealth game. I have searched the Internet and it seems that behavior I want to achieve can be done by using secondary camera that is rendering its output to a render texture. Then render texture is applied to a plane which sits above a map with a masking shader. I was following this video: https://www.youtube.com/watch?v=PNAvNeOTnSE however my project is using URP in Unity and the Clear Flags on camera settings is missing. So basically after each rendering loop render texture gets cleared and drawn again which makes impossible to "save" areas that already have been revealed by the player.

Maybe this can be done using another technique? I would like to have fog of war that covers entire rooms with black opaque plane and reveals them upon entering them but remains cleared once visited. However visited areas should be gray once left and enemies should be hidden from the player when not in line of sight. Something like in this video: https://youtu.be/jrK_Uvwwk9I?t=1247

I would really appreciate if someone pointed my in right direction.

  • \$\begingroup\$ URP doesn't support camera stacking until Unity v2020.1. Clear Flags is the first option in camera component, checked in 2019.4.1f1. I will be researching this topic myself as I need it for development, it might take a few months until it's ready to use, but you can follow my progress at github.com/PixelLifetime/unity-pixli-fog-of-war-system , it's going to be open source till some point in time, but you can watch repo for changes. \$\endgroup\$ Jul 28, 2020 at 6:43

1 Answer 1


Until recently, camera stacking used to be unavailable in the URP. But with the newest release 2020.1 (released just yesterday), it's available again. Although with two limitations: It's unavailable when using the 2D Renderer or when using the VR Multi Pass mode. But there is a promise that this will change "soon™".

From the documentation linked above:

  1. Create a Camera in your Scene. Its Render Type defaults to Base, making it a Base Camera.
  2. Create another Camera in your Scene, and select it.
  3. In the Camera Inspector, change the Camera’s Render Type to Overlay.
  4. Select the Base Camera again. In the Camera Inspector, scroll to the Stack section, click the plus (+) button, and click the name of the Overlay Camera.

The Overlay Camera is now part of the Base Camera's Camera Stack. Unity renders the Overlay Camera's output on top of the Base Camera's output.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .