Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Create fog around map (Shader Graph / URP)

Discussion in 'Shader Graph' started by Yheeky, Aug 25, 2020.

  1. Yheeky

    Yheeky

    Joined:
    Nov 16, 2017
    Posts:
    3
    Hey,

    I´m just ran in the following problem. I´ve a map - let´s assume it´s an island - and now I would like to change the visuals a bit. So far it´s a map with water around but I would like to make the water be faded out in the shape of the island. For example:

    Currently I have a map with a plane which represents the water:
    Island_Default.png

    Now I would like to create kind of a "Fog of war", so I´m only able to see the map and a specific radius of the water (related to the map shape). the rest should be black. Like this:

    Island_Transition.png

    Moreover I´m able to pan the camera so I should be able to see mountains as a silhouette.
    What´s the most effective/performant way to do that? What I already tried to realize is rendering the map to a render texture with a second camera (with the same position/rotation) and work with UV and the distance to create something similar but this only effects the plane the water is on.

    The game Bad North is a great looking example what I am trying to realize as well:
    Switch_BadNorth_06.jpg

    Would be great if someone could give me some advice! Thanks a lot in advance!