Search Unity

FX/Flare Shader on unity cube makes it visible through colliders

Discussion in 'Shaders' started by reiterm, Mar 27, 2017.

  1. reiterm

    reiterm

    Joined:
    Mar 27, 2017
    Posts:
    1
    Does anybody have a solution to this? I'm really loving the visual effect of what I have set up with the FX/Flare shader on a cube, but it doesn't seem to play by the same rules as flares on lights in that it makes the cube visible through all my other objects, right through colliders.

    Thanks!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    Flares on lights are doing raytraces on the CPU side against colliders and adjusting the opacity of the flare mesh rendered by the GPU. The flare shader itself has no logic for hiding itself, it just renders on top of everything no matter what.