Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

[RELEASED] GPU Line of Sight / Field of View

Discussion in 'Assets and Asset Store' started by Tycho, Jul 16, 2014.

  1. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    180
    So you would like to make an explosion reveal a part of the Line of Sight mask? Or does it need to also do the actual line of sight calculations?

    In case you just want to reveal a part of the mask, you could try adding a mesh (that covers the area you want to reveal) which is either transparent (or even better uses a shader that doesn't write to the color buffer) and attach a LOS Stencil Renderer component. This will exclude the area the mesh covers from the Line of Sight mask, without the mesh being visible.
     
  2. Ripityom

    Ripityom

    Joined:
    Jan 9, 2016
    Posts:
    22
    Brilliant, thank you! Can i do fading distance with the stencil renderer? Maybe with a texture with alpha channel?
     
  3. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    180
    No, the Stencil Renderer does not allow fading since the Stencil Buffer uses binary operations.

    If you need fading, you could try rendering the (reveal) mesh directly to the LOS mask, but that would require quite a few changes to the scripts.
     
  4. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    663
  5. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    180
  6. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    6,338
    Are there any plans for HDRP/URP support in the future? My current project handles it just fine since it's on default, but I have an upcoming URP project I'd like to use it for.
     
    Ripityom likes this.
  7. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    180
    No, I currently don't have plans to support any of the scriptable render pipelines :oops:
     
  8. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    6,338
    Ah, oh well. I can probably hack something together in the next 10 months, it's all still prototype so there's no rush. Thanks for getting back to me!