Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Making View Cone that Follows Terrain Height

Discussion in 'Shaders' started by Bradster15, Jul 24, 2019.

  1. Bradster15


    Feb 15, 2019
    HI I am trying to make a view cone, similar to the one found the the Commandos and Shadow Tactics Game.

    I have tried using projectors, however they don't get effected by world objects, and I have also tried spot lights.
    Would anyone advise if it would be possible to use a shader to do this. All I want is for the texture to follow to ground height and no go through objects. Thanks

    Attached Files:

  2. mouurusai


    Dec 2, 2011
    Yes it is possible. You need render depth map from your object place and use it for masking. Basically it's how shadow maps works.
    It's little too much for me to try do it myself, here some random article about shadow mapping for give some taste what I mean:

    Also you can use one from "2d lighting" assets, from asset store if your ground if pretty much flat.
    Last edited: Jul 28, 2019